/* okkutsu: mono names things (the name, labels, keys, dates) and a grotesk says them (what you read). The intro is one size up. Hierarchy is ink vs soft and whole blank lines. */

/* Schibsted Grotesk, self-hosted under the SIL Open Font License (fonts/OFL.txt). One variable file, Latin only. */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --ink: #000000;       /* full black: content */
  --soft: #6B6B6B;      /* 5.3:1 on paper */
  --rule: #BDBDBD;      /* resting underline on links */
  --line: 1.7em;        /* one line of text; all vertical space is a multiple of it */
  --label: 13ch;        /* margin column: the cat, experience, skills, notes, contact */
  --key: 13ch;          /* key column inside a block: now, making, 2026-11-26 */
  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;   /* what you read */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.7 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
h1, h2, p, dl, dt, dd, ul { margin: 0; }
h1, h2 { font: inherit; }
ul { padding: 0; list-style: none; }
p { text-wrap: pretty; }
::selection { background: var(--ink); color: var(--paper); }

/* Weight 500 exists in SF Mono; faces without it fall back to 400. */
h1, .name { font-weight: 500; }
.soft, h2, dt, time, .t { color: var(--soft); }

/* Reading text is set in the grotesk. The font goes on the text itself, never on a grid or a list box, so every ch column still measures in mono. */
.prose, dd, .list li { font-family: var(--sans); }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* a heading for screen readers only */

a {
  color: inherit;
  text-decoration: underline 1px var(--rule);
  text-underline-offset: 3px;
}
a:hover, a:focus-visible { color: var(--ink); text-decoration-color: currentColor; }
a:active { text-decoration-thickness: 2px; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.name { text-decoration-color: transparent; }   /* the site name on a note page: a link home that reads as the name */

/* Page */
.page { padding: 32px 24px 64px; max-width: calc(84ch + 48px); overflow-wrap: break-word; }
section { margin-top: calc(var(--line) * 3); }

/* The intro stands alone: no margin label, one size up on the same 23.8px line as the rest, and more air before the rows. */
.prose { font-size: 16px; line-height: 1.4875; max-width: 27em; }
.prose p + p { margin-top: 1.4875em; }
.lead + section { margin-top: calc(var(--line) * 4); }

/* Two pictures by the intro, both the owner's own: the sitting cat, and the first old life poster, which opens its note. */
.pics { display: flex; gap: 12px; margin-top: calc(var(--line) * 2); --n: 4; }
.pics img { display: block; width: 112px; height: 140px; }
.pics a { display: block; padding: 0; text-decoration: none; }
.pics a:hover, .pics a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.pics a:active { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Under a pointer the cat shows its face: the owner's second drawing takes the tile, at once, with no fade. Touch screens keep the sitting cat. */
.cat-pic { position: relative; display: block; }
.cat-pic img + img { position: absolute; inset: 0; visibility: hidden; }
@media (hover: hover) { .cat-pic:hover img + img { visibility: visible; } }

/* Header: the cat, then the name and one line under it. The cat is two text lines tall. */
header { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center; }
.cat { display: block; width: 52px; height: 48px; }

/* Pairs: a soft key on the left, its value on the right. Dates and note titles use the same grid. The mono key and the grotesk value share a baseline. */
.pairs > div { display: grid; grid-template-columns: var(--key) minmax(0, 1fr); align-items: baseline; }
.loose > * + * { margin-top: var(--line); }
dd { text-wrap: balance; }   /* a wrapped list splits evenly, no one-word last line */
dd p { text-wrap: pretty; }
.t { display: block; }

/* A plain list (skills): no keys, one line each, on the same left edge as the values. */
.list { padding-left: var(--key); }

/* A soft pointer under a block, on the values' left edge: more on X. Mono, like the line under the name: both point off the site with the same arrow. */
.more { padding-left: var(--key); margin-top: var(--line); }

/* A note's own page */
.body { margin: var(--line) 0 calc(var(--line) * 2); max-width: 62ch; line-height: 1.8; }
.body p + p { margin-top: 1.8em; }

/* From 600px: label and key columns (26ch) sit left of the page's centre line and values start on it, once there is room for 44ch of values; until then the block sits 40px from the left. */
@media (min-width: 600px) {
  .page { padding: 48px 40px 96px max(40px, min(50% - 26ch, 100% - 70ch - 40px)); max-width: none; }
  header, section { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); column-gap: 0; max-width: 70ch; }
  .prose, .pics { grid-column: 1 / -1; }   /* the intro has no label, so it starts in the label column */
  .more { grid-column: 2; }
}

/* The name stays in view on the home page: its header sticks to the top on paper, and text fades as it slides under. Not on short or narrow screens, where it would cost too much of the view. */
@media (min-width: 600px) and (min-height: 600px) {
  .stay { position: sticky; top: 0; z-index: 1; margin-block: -12px; padding-block: 12px; background: var(--paper); }
  .stay::after { content: ""; position: absolute; inset: 100% 0 auto; height: var(--line); background: var(--paper); -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); pointer-events: none; }
  html:has(.stay) { scroll-padding-top: 100px; }   /* a jump or a Tab never lands under the header */
}

/* From 1100px there is room left of the block: the pictures move out there, level with the intro's first line. */
@media (min-width: 1100px) {
  .lead { position: relative; }
  .pics { position: absolute; top: 6px; right: calc(100% + clamp(48px, 30vw - 282px, 240px)); margin: 0; --n: 2; }
  .lead + section { margin-top: calc(var(--line) * 6); }
}

/* Narrow screens: the margin label sits on its own line above its block. */
@media (max-width: 599.98px) {
  .pairs, .list, .more { --key: 8ch; }   /* longest key is 6 characters; 8ch leaves room for a 29-character value line */
  .notes { --key: 13ch; }
}

/* Touch: every link gets a 44px target, and rows that hold one get room so targets never overlap. */
@media (max-width: 599.98px), (pointer: coarse) {
  a { padding-block: 14px; }
  /* A note page stacks two header links on neighbouring lines: each grows away from the other. The cat beside them is the 48px target home. */
  .name { padding-block: 14px 0; }
  header:has(.name) .soft { padding-block: 0 14px; }
  header > a { padding-block: 0; }
  .notes > div + div, footer .pairs > div + div { margin-top: var(--line); }
}

/* Load-in, once: lines print top to bottom. Lines are visible by default; only this block hides them. */
@media (prefers-reduced-motion: no-preference) {
  .ln { animation: print 1ms steps(1) backwards; animation-delay: calc(var(--n) * 45ms + 80ms); }
  @keyframes print { from { visibility: hidden; } }
}
