/* sozokin.com — shared styles
   Every line-height is a multiple of 24px. Text is nudged with `top` so its
   baseline sits on the grid: calc(line-height / 2 - 0.36em) for Instrument Sans,
   calc(line-height / 2 - 0.355em) for Geist Mono. Rules use box-shadow so they
   add no height. Mobile layout starts at 860px and below. */

:root {
  --bg: #F6F6F3;
  --ink: #0F0F0F;
  --grey: #5F5F5B;
  --muted: #8A8A85;
  --body: #3A3A37;
  --rule: #D9D9D4;
  --panel: #EBEBE6;
  --accent: #E2462A;
  --sans: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--grey); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; padding: 8px 12px; background: var(--ink); color: var(--bg); font: 500 13px/24px var(--mono); z-index: 10; }
.skip:focus { left: 8px; color: var(--bg); }

/* Paper: 24px grid plus a fine cream grain */
.grain {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(15,15,15,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,15,15,0.045) 1px, transparent 1px),
    url(../img/grain.webp);
  background-size: 24px 24px, 24px 24px, 256px 256px;
  background-repeat: repeat;
}
.grid-bg { background-position: calc(50% + 12px) 0, calc(50% + 12px) 0, 0 0; }
@media (max-width: 1199px) { .grid-bg { background-position: 0 0, 0 0, 0 0; } }

/* Strips of images that scroll sideways on phones */
.strip { scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }

/* Status markers */
.dot { display: inline-block; vertical-align: middle; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cross { display: inline-block; vertical-align: middle; }

/* ---------- Home ---------- */
.home { max-width: 1200px; margin: 0 auto; padding: 0 48px 72px; display: flex; flex-direction: column; }

.mono { font-family: var(--mono); }
.b24 { position: relative; top: calc(12px - 0.36em); line-height: 24px; }
.m24 { position: relative; top: calc(12px - 0.355em); line-height: 24px; font-family: var(--mono); }
.grey { color: var(--grey); }
.m-only { display: none; }

.site-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0 48px; padding: 24px 0; }
.handle { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.site-head .m24 { font-size: 12px; }
.status .dot { width: 7px; height: 7px; margin-right: 8px; }

.intro { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 48px; padding: 120px 0 96px; box-shadow: inset 0 1px 0 var(--ink); }
.intro-text { flex: 8 1 528px; min-width: 0; display: flex; flex-direction: column; gap: 48px; }
.intro h1 { margin: 0; display: flex; flex-direction: column; gap: 24px; font-weight: 500; }
.intro .title { position: relative; top: calc(36px - 0.36em); font-size: 72px; line-height: 72px; letter-spacing: -0.04em; text-wrap: balance; }
.intro .sub { position: relative; top: calc(24px - 0.36em); font-size: 36px; line-height: 48px; letter-spacing: -0.02em; color: var(--muted); }
.intro .lede { margin: 0; max-width: 552px; font-size: 18px; color: var(--body); text-wrap: pretty; }
.intro .lede a { text-decoration: underline 1px; text-underline-offset: 3px; }
.eyebrow { font-size: 11px; color: var(--grey); }
.portrait { flex: 0 0 288px; width: 288px; height: 384px; object-fit: cover; object-position: center 30%; border-radius: 2px; display: block; }

.label { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; }
/* Accent band under section headings: a little past both ends, with a small gap below the letters.
   The right padding drops the trailing letter space so the band overhangs evenly. */
.label { width: fit-content; padding: 0 calc(3px - 0.15em) 0 3px; margin-left: -3px; background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 0 19.5px; background-size: 100% 4px; }
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; padding-bottom: 24px; }
.legend { display: flex; gap: 24px; font-size: 12px; color: var(--grey); }
.legend .dot { margin-right: 8px; }

.work-list { display: flex; flex-direction: column; box-shadow: 0 1px 0 var(--ink); }
.work-row {
  display: grid; gap: 0 24px; align-items: start; padding: 24px 0;
  grid-template-columns: 48px 264px minmax(0,1fr) 192px 144px;
  grid-template-areas: "num title desc meta link";
  box-shadow: inset 0 1px 0 var(--rule);
}
.work-row:first-child { box-shadow: inset 0 1px 0 var(--ink); }
.work-row .num { grid-area: num; font-size: 13px; color: var(--grey); }
.work-row h3 { grid-area: title; margin: 0; font-size: 32px; font-weight: 500; letter-spacing: -0.025em; white-space: nowrap; }
.work-row h3 .dot, .work-row h3 .cross { margin-right: 12px; }
.work-row .desc { grid-area: desc; min-width: 0; display: flex; flex-direction: column; }
.work-row .desc p { margin: 0; }
.work-row .summary { font-size: 18px; text-wrap: pretty; }
.work-row .note { font-size: 12px; color: var(--grey); }
.work-row .meta { grid-area: meta; display: flex; flex-direction: column; font-size: 12px; color: var(--grey); }
.work-row .links { grid-area: link; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.work-row .links .visit { color: var(--grey); }

.experience { display: flex; flex-direction: column; padding: 96px 0; }
.experience .label { margin-bottom: 24px; }
.exp-list { display: flex; flex-direction: column; box-shadow: 0 1px 0 var(--rule); }
.exp-row {
  display: grid; gap: 0 24px; align-items: start; padding: 24px 0;
  grid-template-columns: 312px minmax(0,1fr) auto;
  grid-template-areas: "org role dates";
  box-shadow: inset 0 1px 0 var(--rule);
}
.exp-row:first-child { box-shadow: inset 0 1px 0 var(--ink); }
.exp-row .org { grid-area: org; font-size: 18px; font-weight: 500; }
.exp-row .role { grid-area: role; font-size: 16px; color: var(--grey); }
.exp-row .dates { grid-area: dates; font-size: 12px; color: var(--grey); }

.site-foot { display: flex; flex-direction: column; padding-top: 48px; }
.site-foot .email { position: relative; top: calc(36px - 0.36em); margin-top: 24px; align-self: flex-start; font-size: 64px; line-height: 72px; font-weight: 500; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.foot-row { margin-top: 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 48px; }
.elsewhere { display: flex; flex-wrap: wrap; gap: 0 24px; font-size: 13px; }
.colophon { font-size: 12px; color: var(--grey); }

@media (max-width: 860px) {
  .home { max-width: 576px; margin: 0; padding: 0 24px 72px; }
  .m-only { display: initial; }
  .d-only { display: none; }

  .site-head { flex-wrap: nowrap; gap: 0 24px; }
  .site-head .m24 { font-size: 11px; }

  .intro { display: block; position: relative; padding: 48px 0 72px; }
  .intro-text { display: block; }
  .intro h1 { gap: 24px; margin-top: 24px; }
  .intro .lede { display: block; }
  .intro .title { top: calc(24px - 0.36em); font-size: clamp(34px, 11vw, 42px); line-height: 48px; }
  .intro .sub { top: calc(12px - 0.36em); font-size: 20px; line-height: 24px; letter-spacing: -0.02em; color: #6E6E69; padding-right: 114px; }
  .intro .lede { margin-top: 24px; font-size: 16px; }
  .portrait { position: absolute; right: 0; top: 236px; width: 90px; height: 120px; }

  .label, .legend { font-size: 11px; }
  .work-head { flex-direction: column; }
  .legend { gap: 16px; }

  .work-row {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "title num" "desc desc" "meta meta" "link link";
    gap: 0 12px;
  }
  .work-row .num { font-size: 12px; justify-self: end; }
  .work-row h3 { font-size: 26px; }
  .work-row h3 .dot, .work-row h3 .cross { margin-right: 10px; }
  .work-row .desc { margin-top: 24px; }
  .work-row .summary { font-size: 16px; }
  .work-row .note { font-size: 11px; }
  .work-row .meta { display: block; }
  .work-row .meta span + span::before { content: " · "; }
  .work-row .links { justify-self: start; flex-direction: row; gap: 24px; white-space: nowrap; font-size: 12px; }
  .work-row .links a { padding: 10px 0; margin: -10px 0; }

  .experience { padding: 72px 0; }
  .exp-row { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "org dates" "role role"; gap: 0 12px; }
  .exp-row .role { font-size: 15px; }
  .exp-row .dates { font-size: 11px; }

  .site-foot .email { top: calc(24px - 0.36em); font-size: 28px; line-height: 48px; letter-spacing: -0.035em; }
  .foot-row { margin-top: 24px; flex-direction: column; }
  .elsewhere { flex-direction: column; font-size: 14px; top: 0; }
  .elsewhere a { padding: 12px 0; box-shadow: inset 0 1px 0 var(--rule); }
  .elsewhere a:last-child { box-shadow: inset 0 1px 0 var(--rule), 0 1px 0 var(--rule); }
  .elsewhere a span { position: relative; top: calc(12px - 0.355em); }
  .colophon { margin-top: 24px; font-size: 11px; }
}

/* Résumé download in the intro */
.intro .cta { margin: -24px 0 0; font-size: 13px; }
/* Plain inline (not flex) so the underline stays on the words and skips the arrow */
.intro .cta a { text-decoration: underline 1px; text-underline-offset: 4px; }
.intro .cta a span { display: inline-block; margin-left: 0.5em; transition: transform 200ms ease; }
.intro .cta a:hover span { transform: translateY(3px); }
@media (max-width: 860px) {
  .intro .cta { display: block; margin-top: 24px; }
  .intro .cta a { padding: 10px 0; margin: -10px 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .intro .cta { animation: rise 800ms cubic-bezier(.2,.7,.2,1) 320ms both; }
}

/* Header navigation (replaces the availability note, which now sits by the contact details) */
.top-nav { display: flex; gap: 24px; font-size: 12px; }
.top-nav a { color: var(--ink); }
.top-nav a:hover { color: var(--grey); }
.foot-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; padding-bottom: 24px; box-shadow: inset 0 -1px 0 var(--ink); }
.foot-head .status { font-size: 12px; color: var(--grey); }
#work { scroll-margin-top: 24px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (max-width: 860px) {
  .top-nav { gap: 16px; font-size: 11px; }
  .top-nav a { padding: 10px 0; margin: -10px 0; }
  .foot-head .status { font-size: 11px; }
}

/* Email arrow is an SVG: iOS Safari swaps the ↗ character for an emoji at large sizes */
.site-foot .email .arrow { display: inline-block; width: 0.8em; height: 0.8em; vertical-align: -0.06em; overflow: visible; }

/* ---------- Plotter: cells around the cursor fill in, then fade (assets/js/site.js) ---------- */
.plotter { position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; }
.grain > :not(.plotter) { position: relative; z-index: 1; }
/* When the canvas draws the grid (mouse devices, motion allowed), the CSS grid steps aside and only the grain stays */
.fx-grid .grain { background-image: url(../img/grain.webp); background-size: 256px 256px; background-position: 0 0; }

/* ---------- Custom cursor (added by assets/js/site.js on mouse devices) ---------- */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor {
  position: fixed; left: 0; top: 0; z-index: 9999;
  width: 0; height: 0; pointer-events: none;
  opacity: 0; transition: opacity 150ms ease;
}
.cursor.is-visible { opacity: 1; }
/* On touch screens it shows up at each tap and fades out more slowly */
.cursor.is-touch { transition: opacity 400ms ease; }
.cursor::before {
  content: ""; position: absolute; left: -6px; top: -6px;
  width: 12px; height: 12px; background: var(--accent);
  transition: transform 220ms cubic-bezier(.3,.7,.4,1.4), background-color 150ms ease, box-shadow 150ms ease;
}
/* Over a link: the square turns into a larger diamond, drawn as a see-through outline */
.cursor.is-link::before { transform: rotate(45deg) scale(2.6); background-color: transparent; box-shadow: inset 0 0 0 0.6px rgba(158, 40, 18, 0.5); }
.cursor.is-down::before { transform: scale(0.7); }
.cursor.is-link.is-down::before { transform: rotate(45deg) scale(2.1); }
.cursor-label {
  position: absolute; left: 16px; top: -12px; padding: 0 8px; white-space: nowrap;
  background: var(--accent); color: #FFF; font: 500 12px/24px var(--mono);
  opacity: 0; transform: translateX(-4px); transition: opacity 150ms ease, transform 150ms ease;
}
.cursor.is-copied .cursor-label { opacity: 1; transform: none; }

/* ---------- Project preview that follows the cursor on the home page ---------- */
.preview {
  position: fixed; left: 0; top: 0; z-index: 9000; pointer-events: none;
  opacity: 0; transition: opacity 200ms ease;
}
.preview.is-on { opacity: 1; }
.preview img {
  display: block; max-width: 384px; max-height: 240px; width: auto; height: auto;
  border-radius: 2px; box-shadow: 0 0 0 1px rgba(15,15,15,0.08), 0 24px 48px -24px rgba(15,15,15,0.35);
  transform: scale(0.94); transition: transform 260ms cubic-bezier(.2,.7,.2,1);
}
.preview.is-on img { transform: none; }

/* The whole project row is clickable (assets/js/site.js); keyboard users use the real links */
.work-row { position: relative; }
.work-row .links a:first-child { transition: transform 200ms ease, background-size 320ms cubic-bezier(.2,.7,.2,1), color 200ms ease; }
.work-row:hover .links a:first-child { transform: translateX(4px); }
.work-row:hover h3 a { color: var(--ink); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 9500; padding: 12px 16px;
  background: var(--ink); color: var(--bg); font: 500 13px/24px var(--mono);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }

/* ---------- Motion: load, scroll reveals and page transitions ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .js .intro .title,
  .js .intro .sub,
  .js .intro .lede,
  .js .intro .portrait { animation: rise 800ms cubic-bezier(.2,.7,.2,1) both; }
  .js .intro .sub { animation-delay: 120ms; }
  .js .intro .lede { animation-delay: 240ms; }
  .js .intro .portrait { animation-delay: 180ms; }

  /* Hidden from the first paint (html.js is set by an inline script in <head>), so nothing
     flashes before site.js runs. site.js adds .is-in as each block scrolls into view.
     If site.js never loads, the inline script adds .reveal-off after 2.5s and shows everything. */
  html.js:not(.reveal-off) :is(.work-head, .work-row, .experience .label, .exp-row, .site-foot, .cs-row, section[aria-labelledby="cs-title"] > :not(h1), .grain figure) { opacity: 0; transform: translateY(16px); }
  html.js :is(.work-head, .work-row, .experience .label, .exp-row, .site-foot, .cs-row, section[aria-labelledby="cs-title"] > :not(h1), .grain figure).is-in {
    opacity: 1; transform: none;
    transition: opacity 700ms ease var(--d, 0ms), transform 700ms cubic-bezier(.2,.7,.2,1) var(--d, 0ms);
  }

  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .cursor::before, .cursor-label, .preview, .preview img, .toast, .work-row .links a:first-child { transition: none; }
}

/* ---------- Links: an accent highlight wipes in from the left (mouse and trackpad) ---------- */
@media (hover: hover) and (pointer: fine) {
  .grain a:not(.work-row h3 a) {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat; background-position: left center; background-size: 0% 100%;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
    /* Room around the text and below the underline, with no shift in layout */
    padding: 0.08em 0.3em 0.26em; margin: 0 -0.3em;
    transition: background-size 320ms cubic-bezier(.2,.7,.2,1), color 200ms ease;
  }
  .grain a:not(.work-row h3 a):hover { background-size: 100% 100%; color: var(--bg) !important; }
}
.grain a:not(.work-row h3 a):focus-visible { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 100% 100%; color: var(--bg) !important; }

/* Arrows in links nudge the way they point */
.arr { display: inline-block; transition: transform 260ms cubic-bezier(.3,.7,.4,1.4); }
a:is(:hover, :focus-visible) .arr-ne { transform: translate(0.14em, -0.14em); }
a:is(:hover, :focus-visible) .arr-e { transform: translateX(0.22em); }
a:is(:hover, :focus-visible) .arr-s { transform: translateY(0.16em); }
a:is(:hover, :focus-visible) .arr-w { transform: translateX(-0.22em); }

@media (prefers-reduced-motion: reduce) {
  .grain a, .arr { transition: none !important; }
}
