/* ==========================================================================
   Solen portfolio — public site
   "Gallery wall, pencil in hand" — see docs/DESIGN.md.
   Near-monochrome chrome, one signature (the pencil stroke), three faces:
   Young Serif (display) / Schibsted Grotesk (body) / Spline Sans Mono (meta).
   ========================================================================== */

/* ---------- tokens ---------- */

:root {
  color-scheme: light dark;

  --paper: #F6F4EF;
  --card: #FFFFFF;
  --ink: #1F2125;
  --ink-2: #5D6169;
  --ink-3: #979BA3;
  --line: #E4E1D8;
  --accent: #2E7DA6;
  --wash: #EBF2F6;
  --flag: #C77B3B;

  --font-display: 'Young Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --shadow-s: 0 1px 2px rgba(31, 33, 37, 0.04), 0 10px 24px -14px rgba(31, 33, 37, 0.18);
  --shadow-m: 0 2px 4px rgba(31, 33, 37, 0.05), 0 18px 34px -16px rgba(31, 33, 37, 0.26);
  --shadow-l: 0 34px 80px -30px rgba(31, 33, 37, 0.4), 0 10px 26px -14px rgba(31, 33, 37, 0.16);

  --scrim: rgba(17, 18, 19, 0.93);
  --video-well: #0B0C0D;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171819;
    --card: #1F2123;
    --ink: #EBE9E4;
    --ink-2: #A8ACB3;
    --ink-3: #74787F;
    --line: #2E3134;
    --accent: #7FC0DE;
    --wash: #22303A;
    --flag: #D89A63;

    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px -14px rgba(0, 0, 0, 0.55);
    --shadow-m: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 34px -16px rgba(0, 0, 0, 0.65);
    --shadow-l: 0 34px 80px -30px rgba(0, 0, 0, 0.75), 0 10px 26px -14px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
}

img,
svg,
video,
iframe {
  vertical-align: middle;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--wash);
  color: var(--ink);
}

.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.wrap-n {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

/* Mono small-caps label voice (11–12px, tracked out). */
.nav-link,
.chip,
.hero-anchor,
.hero-cats,
.tile-meta,
.chip-motion,
.crumb,
.work-meta,
.adj-label,
.side-label,
.media-label,
.grid-empty,
.btn-resume,
.lost-home {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  color: var(--ink-3);
}

.skip {
  position: absolute;
  left: 16px;
  top: -52px;
  z-index: 100;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
}

.skip:focus-visible {
  top: 0;
}

/* ---------- the pencil stroke ---------- */

.stroke {
  display: block;
  pointer-events: none;
}

.stroke path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}

/* Draw-in variant (nav links, filter chips): hidden until hover/active,
   revealed left-to-right like a pencil pass. (A clip reveal, not
   stroke-dashoffset: `vector-effect: non-scaling-stroke` makes browsers dash
   in screen space, which breaks pathLength math at arbitrary widths.)
   Negative vertical insets keep the round linecaps unclipped. */
.draw {
  clip-path: inset(-3px 100% -3px 0);
}

a:hover > .draw,
a:focus-visible > .draw,
[aria-current] > .draw {
  clip-path: inset(-3px 0 -3px 0);
}

/* Section headings carry a fully drawn stroke. */
.sec-h {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-bottom: 12px;
  font-size: 1.7rem;
  line-height: 1.2;
}

.sec-h .stroke {
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 8px;
  transform: rotate(-0.4deg);
}

/* ---------- header / nav ---------- */

.site-head {
  padding-top: 22px;
}

.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  position: relative;
  padding: 2px 0 8px;
  color: var(--ink-2);
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current] {
  color: var(--ink);
}

.nav-link .stroke {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
}

/* ---------- home: hero ---------- */

.hero {
  padding-top: clamp(28px, 6vh, 68px);
}

.hero-art a {
  display: block;
  border-radius: 2px;
}

.hero-art img {
  display: block;
  margin-inline: auto;
  width: auto;
  height: auto;
  max-width: min(100%, 940px);
  max-height: 72vh;
  border-radius: 2px;
  box-shadow: var(--shadow-l);
}

.hero-block {
  margin-top: clamp(36px, 6vh, 64px);
  max-width: 680px;
  padding-left: clamp(0px, 3vw, 56px);
}

.hero-name {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-bottom: 14px;
  font-size: clamp(2.4rem, 1.5rem + 4.2vw, 4.5rem);
  line-height: 1.05;
}

.name-stroke {
  position: absolute;
  left: 1%;
  bottom: 0;
  width: 94%;
  height: 10px;
  transform: rotate(-0.6deg);
}

.hero-tag {
  margin: 18px 0 0;
  font-size: 1.125rem;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: pretty;
}

.hero-cats {
  margin: 14px 0 0;
  color: var(--ink-3);
}

.hero-more {
  margin: 30px 0 0;
}

.hero-anchor {
  color: var(--accent);
  text-decoration: none;
}

.hero-anchor:hover,
.hero-anchor:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- home: work grid ---------- */

.work {
  margin-top: clamp(72px, 10vh, 128px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 26px 0 30px;
}

.chip {
  position: relative;
  padding: 4px 0 9px;
  color: var(--ink-2);
  text-decoration: none;
}

.chip:hover,
.chip:focus-visible {
  color: var(--ink);
}

.chip[aria-current] {
  color: var(--ink);
}

.chip .stroke {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 7px;
}

/* Masonry: continuous columns. Without JS the grid falls back to CSS
   multi-columns (order runs down each column); site.js upgrades it to flex
   columns filled shortest-first so the curation order reads left-to-right. */
.grid {
  columns: 3;
  column-gap: 20px;
}

.grid.m-on {
  display: flex;
  gap: 20px;
}

.m-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tile-wrap {
  break-inside: avoid;
  margin: 0 0 20px;
}

.m-on .tile-wrap {
  margin: 0;
}

@media (max-width: 959px) {
  .grid {
    columns: 2;
  }
}

@media (max-width: 619px) {
  .grid {
    columns: 1;
  }
}

.tile-wrap[hidden] {
  display: none;
}

.tile-wrap.is-out {
  opacity: 0;
}

.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-s);
}

.tile:hover,
.tile:focus-visible {
  box-shadow: var(--shadow-m);
}

.tile-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: var(--paper);
}

.tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.tile-video.is-playing {
  opacity: 1;
}

.chip-motion {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 4px 10px;
  font-size: 10px;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(3px);
}

.tile-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 13px 4px 2px;
}

.tile-meta {
  display: block;
  margin: 3px 4px 5px;
  font-size: 11px;
  color: var(--ink-3);
}

.grid-empty {
  color: var(--ink-3);
  padding: 44px 0;
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: clamp(80px, 12vh, 140px);
  border-top: 1px solid var(--line);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 26px;
  padding-block: 26px 44px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.foot-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.foot-link .ico-glyph {
  width: 14px;
  height: 14px;
}

.foot-link:hover,
.foot-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.foot-copy {
  color: var(--ink-3);
}

.admin-link {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11px;
  text-decoration: none;
}

.admin-link:hover,
.admin-link:focus-visible {
  color: var(--ink-2);
}

/* ---------- work detail ---------- */

.crumb-row {
  margin: 28px 0 0;
}

.crumb {
  color: var(--ink-2);
  text-decoration: none;
}

.crumb:hover,
.crumb:focus-visible {
  color: var(--accent);
}

.work-head {
  margin-top: 30px;
}

.work-title {
  margin: 0;
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem);
  line-height: 1.1;
}

.work-meta {
  margin: 12px 0 0;
  color: var(--ink-2);
}

.work-desc {
  margin: 22px 0 0;
  max-width: 65ch;
  font-size: 1.05rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.mat {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  box-shadow: var(--shadow-s);
}

a.mat {
  cursor: zoom-in;
}

.work-media {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.piece-img {
  margin: 0;
}

.piece-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.img-cap {
  margin: 10px 2px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.video-mat video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--video-well);
  border-radius: 2px;
}

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: var(--video-well);
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- process strip ---------- */

.process {
  margin-top: clamp(64px, 9vh, 104px);
}

.process-strip {
  list-style: none;
  margin: 26px 0 0;
  padding: 4px 4px 18px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(300px, 74vw);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.step {
  scroll-snap-align: start;
  min-width: 0;
}

.step img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.step-cap {
  margin: 10px 2px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.step-num {
  color: var(--accent);
  font-weight: 500;
  margin-right: 8px;
}

.timelapse {
  margin-top: 30px;
}

.media-label {
  margin: 0 0 10px;
  color: var(--ink-3);
}

/* ---------- prev / next ---------- */

.adjacent {
  margin-top: clamp(72px, 10vh, 110px);
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.adj {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.adj-prev {
  justify-self: start;
}

.adj-next {
  justify-self: end;
  flex-direction: row-reverse;
  text-align: right;
}

.adj-thumb {
  flex: none;
  width: 76px;
  height: 76px;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
}

.adj-text {
  min-width: 0;
}

.adj-label {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.adj-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
}

.adj:hover .adj-title,
.adj:focus-visible .adj-title {
  color: var(--accent);
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  margin-top: 34px;
}

.prose {
  margin-top: 26px;
  max-width: 68ch;
  font-size: 1.03rem;
  line-height: 1.7;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  margin: 1.6em 0 0.5em;
}

.prose h1 {
  font-size: 1.9rem;
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.18rem;
}

.prose p {
  margin: 0.85em 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 0.1em 0 0.1em 1.15em;
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
}

.prose img {
  max-width: 100%;
  height: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  box-shadow: var(--shadow-s);
  margin: 0.6em 0;
}

.prose ul,
.prose ol {
  margin: 0.85em 0;
  padding-left: 1.4em;
}

.prose iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 4px;
  background: var(--video-well);
}

/* Quill classes (admin editor whitelist). */
.prose .ql-align-center {
  text-align: center;
}

.prose .ql-align-right {
  text-align: right;
}

.prose .ql-align-justify {
  text-align: justify;
}

.prose .ql-size-small {
  font-size: 0.82em;
}

.prose .ql-size-large {
  font-size: 1.35em;
}

.prose .ql-size-huge {
  font-size: 1.75em;
}

.prose .ql-font-young {
  font-family: var(--font-display);
}

.prose .ql-font-schibsted {
  font-family: var(--font-body);
}

.prose .ql-font-mono {
  font-family: var(--font-mono);
}

.about-side > * + * {
  margin-top: 44px;
}

.side-label {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
}

/* Toolbox: only the app tiles are physically there; name + proficiency live
   in a popover that appears on hover, keyboard focus, and touch tap-focus.
   Screen readers get name + level from each tile's aria-label. */
.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: default;
}

.skill-ico {
  display: block;
  width: 100%;
  height: 100%;
}

.skill-ico .ico {
  display: block;
  width: 100%;
  height: 100%;
}

.skill-pop {
  position: absolute;
  bottom: calc(100% + 11px);
  left: 50%;
  transform: translateX(calc(-50% + var(--shift, 0px))) translateY(3px);
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 12px;
  box-shadow: var(--shadow-m);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}

/* Pointer arrow, centered on the tile even when the card is shifted. */
.skill-pop::after {
  content: '';
  position: absolute;
  bottom: -5.5px;
  left: calc(50% - var(--shift, 0px));
  width: 9px;
  height: 9px;
  background: var(--card);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}

.skill:hover .skill-pop,
.skill:focus .skill-pop,
.skill:focus-visible .skill-pop {
  opacity: 1;
  transform: translateX(calc(-50% + var(--shift, 0px))) translateY(0);
}

.pop-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink);
}

.pop-level {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.side-resume {
  display: flex;
  justify-content: center;
  margin: 0;
}

.btn-resume {
  display: inline-block;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 5px;
  padding: 12px 18px;
  text-decoration: none;
}

.btn-resume:hover,
.btn-resume:focus-visible {
  background: var(--wash);
}

.ico {
  flex: none;
}

.ico-glyph {
  width: 16px;
  height: 16px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.06rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.contact-email:hover,
.contact-email:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-socials {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-socials a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-decoration: none;
}

.contact-socials a:hover,
.contact-socials a:focus-visible {
  color: var(--accent);
}

/* ---------- 404 ---------- */

.lost {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 820px;
  padding-top: 8vh;
}

.lost-title {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-bottom: 14px;
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4rem);
  line-height: 1.1;
}

.lost-title .stroke {
  position: absolute;
  left: 1%;
  bottom: 0;
  width: 94%;
  height: 10px;
  transform: rotate(-0.7deg);
}

.lost-note {
  margin: 22px 0 8px;
  color: var(--ink-2);
  max-width: 48ch;
}

.lost-home {
  color: var(--accent);
  text-decoration: none;
}

.lost-home:hover,
.lost-home:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- lightbox (built by site.js) ---------- */

.lb {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 64px;
  opacity: 0;
}

.lb.is-open {
  opacity: 1;
}

.lb[hidden] {
  display: none;
}

.lb figure {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lb img {
  max-width: min(92vw, 1400px);
  max-height: 84vh;
  width: auto;
  height: auto;
  background: var(--card);
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.lb-cap {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #CFCDC7;
  text-align: center;
  max-width: 80ch;
}

.lb-btn {
  position: absolute;
  appearance: none;
  background: rgba(0, 0, 0, 0.3);
  border: 0;
  border-radius: 6px;
  color: #ECEAE5;
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1;
  padding: 14px;
  cursor: pointer;
}

.lb-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

.lb-btn:focus-visible {
  outline-color: #EBE9E4;
}

.lb-close {
  top: 14px;
  right: 16px;
  font-size: 28px;
}

.lb-prev {
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

body.lb-open {
  overflow: hidden;
}

/* ---------- responsive ---------- */

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: clamp(48px, 6vw, 88px);
    align-items: start;
  }

  /* Sticky only when a desktop-height viewport can show the whole sidebar —
     no overflow clipping, so the skill popovers can extend past its edges. */
  @media (min-height: 640px) {
    .about-side {
      position: sticky;
      top: 28px;
    }
  }
}

@media (max-width: 640px) {
  .brand {
    font-size: 1.1rem;
  }

  .nav-links {
    gap: 18px;
  }

  .nav-link {
    font-size: 11px;
  }

  .hero-block {
    padding-left: 0;
  }

  .adj-thumb {
    width: 60px;
    height: 60px;
  }

  .adj-title {
    font-size: 1rem;
  }

  .foot-row {
    gap: 8px 18px;
  }

  .lb {
    padding: 4vh 12px;
  }

  .lb-prev {
    left: 4px;
  }

  .lb-next {
    right: 4px;
  }
}

/* ---------- motion (all of it lives here) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .draw {
    transition: clip-path 220ms ease;
  }

  /* Scroll-triggered strokes (section headings, hero name, 404 title):
     hidden only when JS is present and motion is allowed; site.js starts the
     choreography after the page has loaded and settled, so the draw is seen
     (hero name first, other in-view strokes staggered, the rest on scroll).
     The shown state must be an explicit inset() — a transition between
     inset() and the default `none` cannot interpolate and snaps instead,
     which read as an "instant flash". This is the nav-hover reveal, verbatim. */
  .js .draw-io:not(.is-drawn) {
    clip-path: inset(-3px 100% -3px 0);
  }

  .draw-io {
    clip-path: inset(-3px 0 -3px 0);
    transition: clip-path 220ms ease;
  }

  .skill-pop {
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .tile {
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .tile:hover,
  .tile:focus-visible {
    transform: translateY(-3px);
  }

  .tile-wrap {
    transition: opacity 200ms ease;
  }

  .tile-video {
    transition: opacity 200ms ease;
  }

  .lb {
    transition: opacity 200ms ease;
  }

  .skip {
    transition: top 160ms ease;
  }

  /* Home hero load-in: art fades up, name/meta stagger after (once). */
  .js .fx {
    opacity: 0;
    animation: rise 600ms cubic-bezier(0.22, 0.61, 0.25, 1) forwards;
  }

  .js .fx-art {
    animation-delay: 0ms;
  }

  .js .fx-name {
    animation-delay: 80ms;
  }

  .js .fx-meta {
    animation-delay: 160ms;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}
