/* ==========================================================================
   Quraish Rahmatulloh - portfolio
   Aesthetic: retro digital notebook. Hand-built, no framework, no build step.
   Rules of the sheet:
     - corner radius: photos, cards and panels are sharp (2px).
       Buttons, tabs and chips are pills. That is the whole radius system.
     - colour has one job each: marker = highlight, ballpoint = action,
       leaf green = live status only, never text.
   ========================================================================== */

/* --- fonts (self-hosted, latin subset) ---------------------------------- */
@font-face {
  font-family: 'Pixelify Sans';
  src: url('fonts/pixelify-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gloria Hallelujah';
  src: url('fonts/gloria-hallelujah.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* --- tokens ------------------------------------------------------------- */
:root {
  /* The page is white on purpose. The one pure #FFFFFF in the palette is the
     card surface, which sits a hair brighter than the page so cards lift
     without needing a colour change. */
  --paper:        #FDFDFB;
  --paper-lift:   #FFFFFF;
  --ink:          #141414;
  --ink-soft:     #55524B;
  --rule:         #C9D6E8;
  --rule-strong:  #A9BBD6;
  --margin-red:   #E9A6A0;

  --marker:       #FDBA12;
  /* Ink that sits ON the highlighter yellow. The yellow does not change
     between themes, so neither can the type on it. Inheriting --ink put
     near-white text on a yellow band the moment NIGHT was switched on. */
  --on-marker:    #141414;
  --marker-soft:  rgba(253, 186, 18, .58);

  --ballpoint:      #3366FF;  /* fills, borders, decoration */
  --ballpoint-ink:  #1F3FC8;  /* text links, AA on paper */
  --ballpoint-deep: #1B36A8;

  --leaf:         #22C55E;    /* status dot only */
  --leaf-soft:    #E4F7EB;

  /* Sticky notes. Tinted paper, not saturated fills, so the handwriting on
     them still reads as ink rather than as a button label. */
  --sticky-a:     #FFF1BC;
  --sticky-b:     #DCE8FF;
  --sticky-c:     #FFDED7;

  --on-ballpoint: #FFFFFF;    /* label colour on blue fills, both themes */

  --shadow:       rgba(20, 20, 20, .10);
  --shadow-hard:  rgba(20, 20, 20, .14);

  --font-pixel: 'Pixelify Sans', 'Space Grotesk', system-ui, sans-serif;
  --font-hand:  'Gloria Hallelujah', 'Segoe Print', cursive;
  --font-body:  'Space Grotesk', system-ui, -apple-system, sans-serif;

  --nav-h: 68px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --bind: 92px;               /* space reserved for the spiral + margin rule */
  --shell: 1240px;
  --tilt: 0deg;
  --ry: 0px;
}

/* Night mode is opt-in through the toggle. The page deliberately does NOT
   follow prefers-color-scheme: a notebook that flips itself to black on a
   dark-mode laptop is not what this design is. */
:root[data-theme='dark'] {
  --paper:        #17161A;
  --paper-lift:   #201E24;
  --ink:          #EFEAE0;
  --ink-soft:     #A9A29A;
  --rule:         #2C3038;
  --rule-strong:  #3B414D;
  --margin-red:   #7A4A48;

  --marker:       #FDBA12;
  --on-marker:    #141414;
  --marker-soft:  rgba(253, 186, 18, .38);

  /* The blue is a fill that white text sits on, and white on a fill does not
     care which theme it is in. #3F6BFF measured 4.41:1 against white, under
     the 4.5:1 floor, so the fill keeps the light-mode value at night. Only
     the blue *text* colour lightens. */
  --ballpoint:      #3366FF;
  --ballpoint-ink:  #93AEFF;
  --ballpoint-deep: #2B4FE0;

  --leaf:         #4ADE80;
  --leaf-soft:    #1E3327;

  --sticky-a:     #3B3418;
  --sticky-b:     #1D2742;
  --sticky-c:     #3A2320;

  --shadow:       rgba(0, 0, 0, .45);
  --shadow-hard:  rgba(0, 0, 0, .55);
}

/* --- selection & focus -------------------------------------------------- */
::selection { background: var(--marker); color: var(--on-marker); }
:focus-visible {
  outline: 2.5px solid var(--ballpoint);
  outline-offset: 3px;
  border-radius: 2px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -.005em;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* A zero-height landmark for IntersectionObserver to watch. It is never seen
   and never affects layout, it just marks "the very top of the content". */
.sentinel { display: block; height: 1px; margin-bottom: -1px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, dt, figure { margin: 0; }
a { color: var(--ballpoint-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  border-radius: 999px;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 1rem; }

/* --- the sheet itself --------------------------------------------------- */
.paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.paper__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  opacity: .9;
}
.paper__spiral {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 44px;
  display: none;
  background-image: radial-gradient(circle at 50% 50%, var(--rule-strong) 5.5px, transparent 6.5px);
  background-size: 100% 44px;
  background-position: 0 26px;
  background-repeat: repeat-y;
  border-right: 1px solid var(--rule);
}
.paper__margin {
  position: absolute;
  left: calc(var(--bind) - 14px);
  top: 0;
  bottom: 0;
  width: 1.5px;
  display: none;
  background: var(--margin-red);
  opacity: .8;
}
@media (min-width: 900px) {
  .paper__spiral, .paper__margin { display: block; }
}

main, .nav, .contact { position: relative; z-index: 1; }

/* Mobile first: every band keeps the page gutter. The desktop rule at the
   bottom of this file pushes the left edge past the spiral binding. */
main > section { padding-inline: var(--gutter); }

/* Sticky nav would otherwise cover the top of whatever you jump to. */
:where(section, footer)[id] { scroll-margin-top: calc(var(--nav-h) + 14px); }

/* --- shared scraps: tape, photos, tilts --------------------------------- */
:where([data-reveal], .avatar, .statcard, .project, .skills__item, .skillcard, .shelfcard, .reads, .timeline__card, .tool, .case__shot, .case__specs) {
  transform: rotate(var(--tilt, 0deg)) translateY(var(--ry, 0px));
  transition:
    transform .55s cubic-bezier(.16, 1, .3, 1),
    opacity .45s ease,
    box-shadow .25s ease;
}
[data-reveal] { --ry: 22px; }
/* Only hide-and-reveal when JavaScript is around to reveal it again.
   --reveal-op is what the element should end up at: the faint doodles are
   deliberately drawn at 42 to 80% opacity, and without this the reveal
   flattened all of them to fully solid. */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in { opacity: var(--reveal-op, 1); --ry: 0px; }

.tape {
  position: absolute;
  width: 116px;
  height: 30px;
  background: linear-gradient(180deg, rgba(253, 186, 18, .88), rgba(238, 166, 12, .76));
  box-shadow: 0 2px 7px var(--shadow);
  clip-path: polygon(1% 8%, 13% 0, 34% 6%, 57% 1%, 78% 7%, 99% 2%, 100% 93%, 85% 100%, 62% 94%, 37% 100%, 13% 93%, 0 98%);
  pointer-events: none;
}
.tape--top { top: -15px; left: 50%; transform: translateX(-50%) rotate(-3.5deg); }
.tape--corner { top: -13px; right: -30px; width: 104px; transform: rotate(38deg); }
/* The corner tape is meant to hang past the card edge. Below ~800px the card is
   nearly as wide as the window, so that hang would poke out of the page. Pull it
   in and shrink it a little before that happens. */
@media (max-width: 800px) {
  .tape--corner { right: -10px; width: 88px; }
}

/* --- the round portrait -------------------------------------------------
   The artwork is a tall illustration on a flat green field, so a square frame
   had to crop either the cat on top or the face below it. The file is padded
   to a square with its own background green instead, so the circle only ever
   clips green. If the artwork is swapped, pad the new one the same way. */
.avatar {
  position: relative;
  width: min(100%, 280px);
  --tilt: -3.2deg;
  display: grid;
  justify-items: center;
  text-align: center;
}
.avatar img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  background: var(--paper-lift);
  border: 9px solid var(--paper-lift);
  box-shadow: 0 0 0 1px var(--rule), 5px 6px 0 var(--shadow-hard);
  transition: box-shadow .25s ease;
}
.avatar figcaption {
  font-family: var(--font-hand);
  font-size: .95rem;
  color: var(--ink-soft);
  padding: .6rem .2rem 0;
}

/* --- doodles, scrap notes, tape band ------------------------------------
   Every path in the sprite carries pathLength="1", so one dasharray of 1 is
   the whole stroke and a single inherited dashoffset draws it on. With no
   JS the marks just sit there already drawn. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.doodle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  color: var(--ballpoint);
  pointer-events: none;
  transition:
    transform .55s cubic-bezier(.16, 1, .3, 1),
    opacity .45s ease,
    stroke-dashoffset 1s cubic-bezier(.16, 1, .3, 1) .25s;
}
.js .doodle[data-reveal] { stroke-dashoffset: 1; }
.js .doodle[data-reveal].is-in { stroke-dashoffset: 0; }

/* a hand-drawn circle around the availability badge */
.badge-wrap { position: relative; display: inline-flex; }
.doodle--circle {
  position: absolute;
  /* width/height must be explicit: an absolutely positioned replaced element
     does not stretch to its inset box the way a div does. */
  left: -14px;
  top: -11px;
  width: calc(100% + 28px);
  height: calc(100% + 21px);
  stroke-width: 2.2;
  opacity: .8;
  --reveal-op: .8;
}

.doodle--spark {
  position: absolute;
  top: -17px;
  left: -19px;
  width: 34px;
  height: 34px;
  stroke-width: 2;
  color: var(--marker);
  --tilt: -8deg;
}
.doodle--spark-sm {
  position: absolute;
  right: -17px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  color: var(--ballpoint);
}
.doodle--arrow {
  width: 58px;
  height: 40px;
  margin-block: -.55rem;
  --tilt: 66deg;
}

/* Section marks. Anchored to the section box, never in the text flow, so they
   can never push copy around or widen the page. */
main > section { position: relative; }
.doodle--star {
  position: absolute;
  width: 26px;
  height: 26px;
  color: var(--marker);
  --tilt: 14deg;
}
.doodle--head-2 {
  position: absolute;
  width: 22px;
  height: 22px;
  color: var(--ballpoint);
  --tilt: -11deg;
}
.doodle--cross {
  position: absolute;
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
  color: var(--rule-strong);
  --tilt: 9deg;
}
.doodle--squiggle {
  display: block;
  width: 132px;
  height: 13px;
  margin: .5rem 0 1.4rem;
  color: var(--ballpoint);
  opacity: .75;
  --reveal-op: .75;
}
.doodle--down {
  position: absolute;
  width: 34px;
  height: 52px;
  color: var(--ballpoint);
  opacity: .7;
  --reveal-op: .7;
  --tilt: -12deg;
}
.doodle--loop {
  position: absolute;
  top: 2.3rem;
  right: clamp(1.35rem, 4vw, 3rem);
  width: 78px;
  height: 52px;
  color: var(--ballpoint);
  opacity: .5;
  --reveal-op: .5;
  --tilt: 9deg;
}
@media (max-width: 700px) { .doodle--loop { display: none; } }

/* per-section placement, mobile first, widened at 900px */
.about .doodle--cross { display: none; }
.experience .doodle--star { top: 1.9rem; right: var(--gutter); }
.education .doodle--star { top: 2.1rem; right: var(--gutter); }
.experience .scrap-note--rail,
.education .scrap-note--rail {
  display: none;
  max-width: 12.5rem;
  text-align: left;
}
.toolkit .doodle--down { display: none; }
.doodle--head { display: none; }

@media (min-width: 900px) {
  .about .doodle--cross {
    display: block;
    top: 5.6rem;
    right: calc(var(--gutter) + 3.5rem);
  }
  .experience .scrap-note--rail {
    display: block;
    position: absolute;
    top: 4.4rem;
    right: var(--gutter);
    --tilt: 2.4deg;
  }
  .education .scrap-note--rail {
    display: block;
    position: absolute;
    top: 4.4rem;
    right: var(--gutter);
    --tilt: -2deg;
  }
  .toolkit .doodle--down {
    display: block;
    top: 6.5rem;
    left: calc(var(--gutter) + .5rem);
  }
  .doodle--head { display: block; position: absolute; top: 3.1rem; }
  .doodle--head-2 { display: block; position: absolute; top: 5.2rem; right: calc(var(--gutter) + 2.6rem); }
  .work .doodle--head { left: calc(var(--gutter) + 13.5rem); }
  .writing .doodle--head { left: auto; right: var(--gutter); width: 110px; }
}

.scrap-note {
  font-family: var(--font-hand);
  font-size: .92rem;
  line-height: 1.35;
  text-align: center;
  color: var(--ink);
  background: var(--marker-soft);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: .55rem .85rem;
  max-width: 15rem;
  --tilt: -1.8deg;
  box-shadow: 3px 4px 0 var(--shadow-hard);
}

/* --- sticky notes ------------------------------------------------------- */
.sticky {
  position: relative;
  width: max-content;
  max-width: 13.5rem;
  margin-top: 1.4rem;
  padding: .7rem .95rem;
  font-family: var(--font-hand);
  font-size: .95rem;
  line-height: 1.4;
  color: var(--ink);
  background: var(--sticky-a);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 4px 5px 0 var(--shadow-hard);
  --tilt: -2.4deg;
}
/* the bottom-right corner peels up, the way a real note does */
.sticky::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 15px;
  height: 15px;
  background: linear-gradient(315deg, rgba(20, 20, 20, .16) 50%, transparent 50%);
}
.sticky--a { background: var(--sticky-a); --tilt: -2.4deg; }
.sticky--b { background: var(--sticky-b); --tilt: 2deg; }
.sticky--c { background: var(--sticky-c); --tilt: -1.6deg; }

/* --- rubber stamp on the certificate ------------------------------------ */
.stamp {
  position: absolute;
  /* Vertically centred on the right edge. The lines it sits beside there are
     the short ones (school, years, GPA), and it sits under them anyway. */
  top: 50%;
  right: -14px;
  width: 92px;
  height: 92px;
  color: var(--ballpoint-ink);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: .42;
  --reveal-op: .42;
  transform: translateY(-50%) rotate(-12deg);
  pointer-events: none;
  z-index: 0;
}
/* The stamp sits under the printed lines, the way a real seal sits under the
   writing. Nothing has to dodge it, so it works at every card width. */
.certificate > *:not(.stamp):not(.tape) { position: relative; z-index: 1; }
.stamp text {
  font-family: var(--font-pixel);
  font-size: 12.5px;
  font-weight: 700;
  fill: currentColor;
  stroke: none;
}
/* The stamp hangs past the card edge and is rotated, so its bounding box
   reaches about 23px beyond the card. Once the gutter drops below that (under
   roughly 620px) it would poke out of the page and, on a mobile layout
   viewport, widen the whole document. So it shrinks and pulls in first. */
@media (max-width: 640px) {
  .stamp { right: -10px; width: 74px; height: 74px; }
  .stamp text { font-size: 13.5px; }
}

/* a strip of washi tape with the vocabulary on it, running forever */
.marquee {
  overflow: hidden;
  margin-block: clamp(1.75rem, 4vh, 2.75rem);
  padding-block: .5rem;
  background: var(--marker);
  border-block: 1.5px solid var(--on-marker);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 46s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__run {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--on-marker);
  white-space: nowrap;
}
.marquee__run > span { display: inline-flex; align-items: center; }
.marquee__run > span::after {
  content: "";
  width: .34em;
  height: .34em;
  margin-inline: 1.05rem;
  background: var(--on-marker);
  transform: rotate(45deg);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* second pass, in ballpoint blue and running the other way */
.marquee--alt { background: var(--ballpoint); }
.marquee--alt .marquee__run { color: var(--on-ballpoint); }
.marquee--alt .marquee__run > span::after { background: var(--on-ballpoint); }
.marquee--alt .marquee__track {
  animation-direction: reverse;
  animation-duration: 54s;
}

/* --- nav ---------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--ink);
}
/* Reading progress. animation-timeline does all the work: no scroll listener,
   no JS. Browsers without it simply never show the bar. */
.nav__progress { display: none; }
@supports (animation-timeline: scroll()) {
  .nav__progress {
    display: block;
    position: absolute;
    inset: auto 0 -1.5px 0;
    height: 3px;
    background: var(--marker);
    transform-origin: 0 50%;
    animation: read-progress linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes read-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.nav__inner {
  max-width: var(--shell);
  margin-inline: auto;
  /* Below 900px the shared container rule does not apply, and without this the
     wordmark sat flush at x=0 while every section started at the gutter. */
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 1.6vw, 1.5rem);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}
.nav__star { color: var(--marker); font-size: 1.15rem; line-height: 1; }
.nav__brand-text {
  font-family: var(--font-pixel);
  /* The wordmark grew from "QURAISH" to "QURAISH PORTFOLIO" and stopped
     fitting beside the toggle on a phone. It scales with the viewport, and
     below 460px it wraps onto two lines at the space, which is narrower still
     than one line of the shorter word. */
  font-size: clamp(.78rem, 2.1vw, 1.15rem);
  letter-spacing: .06em;
  line-height: 1.1;
}
@media (max-width: 460px) {
  /* 6.2em is a hair over the width of PORTFOLIO at this size, so the break
     lands on the space and never mid-word. */
  .nav__brand-text { max-width: 6.2em; }
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(.55rem, 1.2vw, 1.25rem);
  margin-inline-start: auto;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 900px) {
  /* The strip scrolls sideways, so without a hint the last link just gets its
     tail cut off mid-word. The fade says "there is more this way" instead. */
  .nav__links {
    mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
  }
}
.nav__links::-webkit-scrollbar { display: none; }
.nav__link {
  position: relative;
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .1em;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  padding: .35rem .1rem;
  border-bottom: 2px solid transparent;
}
/* The underline draws itself from the left instead of just switching on. */
.nav__link::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px 0;
  height: 2px;
  background: var(--marker);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .32s cubic-bezier(.16, 1, .3, 1), background-color .2s ease;
}
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-current::after { transform: scaleX(1); background: var(--ballpoint); }

.theme-toggle {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink);
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: .42rem .8rem;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), background-color .18s ease;
}
.theme-toggle:hover { background: var(--marker); color: var(--on-marker); }
.theme-toggle:active { transform: translateY(1px) scale(.97); }

/* --- buttons, chips, badges -------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  white-space: nowrap;
  text-decoration: none;
  padding: .95rem 1.6rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), background-color .18s ease, box-shadow .18s ease;
}
.btn--primary {
  background: var(--ballpoint);
  border-color: var(--ballpoint-deep);
  color: var(--on-ballpoint);
  box-shadow: 3px 4px 0 var(--shadow-hard);
}
.btn--primary:hover { background: var(--ballpoint-deep); transform: translateY(-2px); box-shadow: 4px 6px 0 var(--shadow-hard); }
.btn--primary:active { transform: translateY(1px); box-shadow: 1px 2px 0 var(--shadow-hard); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--marker); color: var(--on-marker); transform: translateY(-2px); }
.btn--ghost:active { transform: translateY(1px); }

.chip {
  display: inline-flex;
  align-items: center;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .34rem .7rem;
  border-radius: 999px;
}
.chip--ink { background: var(--ink); color: var(--paper); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--leaf-soft);
  border: 1.5px dashed var(--leaf);
  border-radius: 999px;
  padding: .3rem .75rem;
}
.badge__dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--leaf);
  flex: 0 0 auto;
}

/* --- section titles ----------------------------------------------------- */
.pixel {
  font-family: var(--font-pixel);
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.02;
}
.section-title { font-size: clamp(1.7rem, 4.2vw, 2.8rem); }

/* Section numbers. A CSS counter, so nothing has to be renumbered by hand when
   a section is added or moved. Scoped to .home so the detail pages are left
   alone. The hero is skipped so "about" is 01, not 02. */
.home { counter-reset: sec; }
.home > section { counter-increment: sec; }
.home .hero { counter-increment: none; }
.home .section-title::before,
.home .hand-title::before,
.home .work__title::before {
  content: counter(sec, decimal-leading-zero);
  display: inline-block;
  margin-right: .6rem;
  padding: .1rem .5rem .16rem;
  font-family: var(--font-pixel);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--on-marker);
  background: var(--marker);
  border: 1.5px solid var(--on-marker);
  border-radius: 999px;
  vertical-align: .38em;
  transform: rotate(-3deg);
}

.hand-title {
  font-family: var(--font-hand);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 400;
  color: var(--ink);
  display: inline-block;
  transform: rotate(-1.2deg);
  /* The squiggle is a background image so it hugs the handwriting exactly,
     whatever the text length. It sweeps on the same way .hl does. */
  padding-bottom: .32em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 14' preserveAspectRatio='none'%3E%3Cpath d='M2 10 C14 2 26 12 38 5 C50 -1 62 12 74 5 C86 -1 98 12 110 5 C122 -1 134 12 146 5 C152 2 156 6 158 9' fill='none' stroke='%23FDBA12' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% .34em;
  transition:
    transform .55s cubic-bezier(.16, 1, .3, 1),
    opacity .45s ease,
    background-size .75s cubic-bezier(.16, 1, .3, 1) .3s;
}
.js .hand-title { background-size: 0% .34em; }
.js .hand-title.is-in { background-size: 100% .34em; }

/* --- hero --------------------------------------------------------------- */
.hero {
  display: grid;
  gap: clamp(2.25rem, 5vw, 3.5rem);
  padding-block: clamp(2.25rem, 5vh, 4.5rem) clamp(3rem, 7vh, 5.5rem);
}
@media (min-width: 980px) {
  .hero {
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    min-height: calc(100dvh - var(--nav-h));
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .hero__copy { padding-left: calc(var(--bind) - var(--gutter)); }
}

/* The header of the sheet. The hero is centred in a full viewport, which used
   to leave a dead 120px band above the name; this fills it with the facts a
   reader wants first. Labels look printed, values look hand-filled, and the
   rule underneath is the one the rest of the page is written on. */
.masthead {
  /* Three equal fields. Deliberately a grid rather than a wrapping flex row:
     the three labels plus their values come to about 600px and the column is
     581px, so flex wrapping dropped the third field onto a line of its own.
     Equal columns shrink and wrap the text inside instead, and a field is
     never orphaned. */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem 1.5rem;
  margin: 0 0 clamp(1.4rem, 3.5vh, 2.4rem);
  padding-bottom: .9rem;
  border-bottom: 1.5px solid var(--ink);
}
/* On a phone, and on a desktop between 980 and 1240px where the hero copy
   column is at its narrowest, three equal columns are too narrow to hold
   "IATF 16949, ISO 9001" on one line. Two fields then a full-width third. */
@media (max-width: 620px), (min-width: 980px) and (max-width: 1240px) {
  .masthead { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.2rem; }
  .masthead__cell:last-child { grid-column: 1 / -1; }
}
.masthead__k {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.masthead__v {
  display: block;
  margin: .2rem 0 0;
  font-family: var(--font-hand);
  font-size: .95rem;
  line-height: 1.25;
  color: var(--ink);
}

.hero__hand {
  font-family: var(--font-hand);
  font-size: clamp(1.15rem, 1.5vw, 1.45rem);
  color: var(--ink-soft);
  transform: rotate(-1.5deg);
  transform-origin: left center;
  margin-bottom: .35rem;
}
.hero__name {
  font-family: var(--font-pixel);
  font-weight: 700;
  /* Sized to the widest line, RAHMATULLOH: at 700 weight Pixelify runs ~6.875px
     per character, so the name is (chars x 6.875) x the font-size. The vw term
     keeps that a hair under the sheet (100vw minus the two gutters) at every
     phone width, which is what stops the second line breaking mid-word. */
  font-size: clamp(2.15rem, calc((100vw - 3rem) / 6.9), 5.2rem);
  line-height: .94;
  letter-spacing: .005em;
}
/* The two-column layout hands the name a narrow column (the collage owns the
   other one), so between 980 and 1240px the old cap outgrew the column and
   8.36vw - 14.5px is the solved fit: (column px - gutter) divided by the
   RAHMATULLOH width factor. Past 1240px the shell stops growing so the plain
   cap applies again. */
@media (min-width: 980px) and (max-width: 1240px) {
  .hero__name { font-size: min(5.2rem, calc(8.2vw - 14.5px)); }
}
.hero__name-l1, .hero__name-l2 {
  display: block;
  /* Shrink to the letters so the hover marker swipe stops where the word does
     instead of running the width of the column. */
  width: fit-content;
  background-image: linear-gradient(180deg, transparent 12%, var(--marker-soft) 12%, var(--marker-soft) 90%, transparent 90%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size .55s cubic-bezier(.16, 1, .3, 1);
}
.hero__name.is-split:hover .hero__name-l1 { background-size: 100% 100%; }
.hero__name.is-split:hover .hero__name-l2 { background-size: 100% 100%; transition-delay: .1s; }

/* Each letter gets its own box once the script has split the name. With no
   script the two spans are plain text and everything here is inert. */
.hero__name .ch { display: inline-block; }
.hero__name .ch__i { display: inline-block; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: 1.15rem;
}
.hero__place {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero__lede {
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.35;
  letter-spacing: -.015em;
  font-weight: 500;
  max-width: 34ch;
  margin-top: 1.4rem;
}
.hl {
  background-image: linear-gradient(180deg, transparent 12%, var(--marker-soft) 12%, var(--marker-soft) 92%, transparent 92%);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 100%;
  padding-inline: .12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  color: inherit;
  /* <mark> ships a solid yellow background in the UA stylesheet. The
     highlighter here is a translucent gradient painted over whatever is
     behind it, so that default has to go. Left in place it won in NIGHT mode,
     where near-white text landed on raw #FFFF00 at 1.12:1. */
  background-color: transparent;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.9rem;
}

.hero__collage {
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
  justify-items: center;
  max-width: 420px;
  margin-inline: auto;
}
.collage__photo { position: relative; }
.collage__stats { display: grid; gap: .9rem; justify-items: center; }
/* Narrower than the statcard below it: the artwork is 0.56 wide, so a square
   frame's width would make the collage twice as tall as it needs to be. */
.statcard {
  position: relative;
  width: min(100%, 300px);
  --tilt: 2.2deg;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.4rem 1.2rem 1.1rem;
  box-shadow: 6px 7px 0 var(--shadow-hard);
}
.statcard__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .45rem;
}
.statcard__row + .statcard__row { border-top: 1.5px dashed var(--rule-strong); }
.statcard dt {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.statcard dd {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* --- about -------------------------------------------------------------- */
.about {
  padding-block: clamp(3rem, 8vh, 6rem);
  border-top: 1.5px dashed var(--rule-strong);
}
.about .hand-title { margin-bottom: 1.5rem; }
.about__grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
}
@media (min-width: 940px) {
  .about__grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
.about__note {
  position: relative;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: clamp(1.35rem, 3vw, 2rem);
  box-shadow: 6px 7px 0 var(--shadow-hard);
}
.about__note p + p { margin-top: 1rem; }
.about__note p { max-width: 62ch; color: var(--ink); }
.about__lead { font-size: 1.1rem; font-weight: 500; }
.about__hand {
  font-family: var(--font-hand);
  font-size: .95rem;
  color: var(--ballpoint-ink);
  transform: rotate(-1deg);
}
.about__skills { display: grid; gap: 1.25rem; }
.skillcard {
  position: relative;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 5px 6px 0 var(--shadow-hard);
}
.skillcard--alt { --tilt: .8deg; background: var(--paper); }
.skillcard__title {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .02em;
  margin-bottom: .9rem;
}
.skills { display: flex; flex-wrap: wrap; gap: .45rem; }
.skills__item {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .05em;
  background: var(--marker);
  color: var(--on-marker);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: .34rem .72rem;
}
.skills__item:nth-child(even) { background: var(--paper-lift); color: var(--ink); }
.skills__item:hover { --tilt: 0deg; --ry: -3px; }

/* --- experience --------------------------------------------------------- */
.experience {
  padding-block: clamp(3rem, 8vh, 6rem);
  border-top: 1.5px dashed var(--rule-strong);
}
.experience .section-title { margin-bottom: 2.25rem; }
.timeline { display: grid; gap: clamp(1.5rem, 3.5vw, 2.25rem); }
@media (min-width: 820px) {
  .timeline__item {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 1.75rem;
    align-items: start;
  }
}
.timeline__when {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  padding-top: .55rem;
  margin-bottom: .5rem;
}
@media (min-width: 820px) {
  .timeline__when { margin-bottom: 0; text-align: right; }
}
.timeline__card {
  position: relative;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: 5px 6px 0 var(--shadow-hard);
}
.timeline__role {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  letter-spacing: .015em;
  line-height: 1.15;
}
.timeline__org {
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ballpoint-ink);
  margin-top: .3rem;
}
.bullets { margin-top: 1rem; display: grid; gap: .5rem; }
.bullets li {
  position: relative;
  padding-left: 1.35rem;
  font-size: .95rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: .1rem;
  top: .62em;
  width: .5rem;
  height: .5rem;
  background: var(--marker);
  border: 1px solid var(--on-marker);
}

/* --- projects ----------------------------------------------------------- */
.work {
  padding-block: clamp(3rem, 8vh, 6rem);
  border-top: 1.5px dashed var(--rule-strong);
}
.work__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.work__title {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  letter-spacing: .04em;
  line-height: 1;
}
.tabs, .shelfchips { display: flex; flex-wrap: wrap; gap: .5rem; }
.tab, .shelfchip {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink);
  background: transparent;
  border: 1.5px dashed var(--ink);
  border-radius: 999px;
  padding: .45rem .9rem;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s cubic-bezier(.16, 1, .3, 1), border-style .18s ease;
}
.tab:hover, .shelfchip:hover { background: var(--paper-lift); transform: translateY(-1px); }
.tab.is-active, .shelfchip.is-active { background: var(--marker); color: var(--on-marker); border-style: solid; transform: rotate(-1.5deg); }

.projects { display: grid; gap: clamp(1.5rem, 3vw, 2rem); }
@media (min-width: 700px)  { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .projects { grid-template-columns: repeat(3, 1fr); } }

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 6px 7px 0 var(--shadow-hard);
}
.project.is-hidden { display: none; }
/* The card number, so eight identical boxes read as a numbered index. Sits in
   the top-left corner, well clear of the tape strip centred above the card. */
.project__no {
  position: absolute;
  top: -.62rem;
  left: .9rem;
  padding: .1rem .42rem .14rem;
  font-family: var(--font-pixel);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--on-marker);
  background: var(--marker);
  border: 1.5px solid var(--on-marker);
  border-radius: 999px;
  transform: rotate(-4deg);
  pointer-events: none;
}
.project.is-in:hover { --tilt: 0deg; --ry: -7px; box-shadow: 9px 12px 0 var(--shadow-hard); }
.project:hover .tape { transform: translateX(-50%) rotate(-3.5deg) scaleX(1.07); }

.project__shot {
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
  background: var(--rule);
  margin-bottom: 1rem;
}
.project__shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}
.project__name {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  letter-spacing: .02em;
  line-height: 1.1;
}
.project__blurb { margin-top: .55rem; font-size: .93rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; }
.tags li {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: .2rem .55rem;
}
.project__links {
  margin-top: auto;
  padding-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.1rem;
}
.project__link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ballpoint-ink);
  text-decoration: none;
  border-bottom: 2px solid var(--marker);
  padding-bottom: .2rem;
}
.project__link--quiet { color: var(--ink-soft); border-bottom-style: dashed; border-bottom-color: var(--rule-strong); }
.project__link--quiet:hover { color: var(--ballpoint-ink); border-bottom-color: var(--ballpoint); }
.project__arrow { transition: transform .22s cubic-bezier(.16, 1, .3, 1); }
.project__link:hover .project__arrow { transform: translateX(5px); }

.work__empty {
  margin-top: 1.5rem;
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--ink-soft);
}

/* --- toolkit ------------------------------------------------------------ */
.toolkit {
  padding-block: clamp(3rem, 8vh, 6rem);
  border-top: 1.5px dashed var(--rule-strong);
}
.toolkit__lede { margin-top: .55rem; color: var(--ink-soft); max-width: 52ch; }

/* The tool list is the one section that used to float on the bare sheet. It now
   gets the same taped panel every other section has, so it reads as a page of
   the notebook rather than a leftover table. */
.kit {
  position: relative;
  margin-top: 2.25rem;
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  box-shadow: 7px 8px 0 var(--shadow-hard);
}
@media (min-width: 940px) {
  .kit { grid-template-columns: .8fr 1.2fr; align-items: start; }
}

.kit__label {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin-bottom: .9rem;
  padding-bottom: .55rem;
  border-bottom: 1.5px dashed var(--rule-strong);
}

.kit__list {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
}

/* Each tool is a small swatch card, sized to its own text. */
.tool {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: .7rem .85rem .75rem;
  box-shadow: 2px 3px 0 var(--shadow-hard);
}
.tool:nth-child(odd)  { --tilt: -.5deg; }
.tool:nth-child(even) { --tilt: .5deg; }
.tool:hover {
  --tilt: 0deg;
  --ry: -3px;
  box-shadow: 3px 6px 0 var(--shadow-hard);
}
.tool__name {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  line-height: 1.15;
}
.tool__use {
  font-size: .82rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.toolkit__hand {
  margin-top: 1.35rem;
  font-family: var(--font-hand);
  font-size: .95rem;
  color: var(--ballpoint-ink);
  transform: rotate(-1deg);
}

/* --- education ---------------------------------------------------------- */
.education {
  padding-block: clamp(3rem, 8vh, 6rem);
  border-top: 1.5px dashed var(--rule-strong);
}
.education .section-title { margin-bottom: 2.25rem; }
.education__grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 940px) {
  .education__grid { grid-template-columns: .9fr 1.1fr; align-items: start; }
}
.certificate {
  position: relative;
  --tilt: -.8deg;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 2rem 1.6rem 1.6rem;
  box-shadow: 6px 7px 0 var(--shadow-hard);
}
.certificate__label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.certificate__field {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.15;
  margin-top: .4rem;
}
.certificate__school {
  font-weight: 600;
  margin-top: .5rem;
}
.certificate__years {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin-top: .2rem;
}
.certificate__gpa {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1.5px dashed var(--rule-strong);
}
.certificate__gpa strong {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  letter-spacing: .02em;
  color: var(--ink);
}
.certificate__award {
  font-family: var(--font-hand);
  font-size: .92rem;
  color: var(--ballpoint-ink);
  margin-top: .9rem;
}
.certificate__award span { color: var(--marker); }

.awards__title {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .02em;
  margin-bottom: 1rem;
}
.awards__list, .case__list { display: grid; gap: .85rem; }
.awards__list li, .case__list li {
  position: relative;
  padding-left: 1.9rem;
  max-width: 62ch;
}
.awards__list li::before, .case__list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: .1em;
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--on-marker);
  background: var(--marker);
  border: 1.5px solid var(--on-marker);
  border-radius: 50%;
}

/* --- writing ------------------------------------------------------------ */
.writing {
  padding-block: clamp(3rem, 8vh, 6rem);
  border-top: 1.5px dashed var(--rule-strong);
}
.writing__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.writing__more {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ballpoint-ink);
  text-decoration: none;
  border-bottom: 2px solid var(--marker);
  padding-bottom: .15rem;
  white-space: nowrap;
}
.articles { display: grid; gap: 0; }
.article {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1.25rem;
  padding-block: 1.05rem;
  border-bottom: 1.5px dashed var(--rule-strong);
}
.article__date {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  flex: 0 0 6.5rem;
}
.article__title { font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 600; }
.article__title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(180deg, transparent 6%, var(--marker) 6%, var(--marker) 94%, transparent 94%);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0% 100%;
  transition: background-size .34s cubic-bezier(.16, 1, .3, 1), color .2s ease;
}
.article__title a:hover { background-size: 100% 100%; color: var(--on-marker); }

/* --- off the clock -------------------------------------------------------
   Lifted from the live site's /hobbies page, which this copy was missing
   entirely. Four shelf cards, then the books actually finished. */
.off__lede {
  margin-top: .6rem;
  font-family: var(--font-hand);
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.shelf {
  display: grid;
  /* Two up, then four across. auto-fit would fit three at laptop widths and
     leave the fourth card orphaned on a row of its own. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.6rem);
  margin-top: clamp(1.5rem, 3.5vw, 2.4rem);
}
@media (min-width: 1100px) {
  .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .shelf { grid-template-columns: minmax(0, 1fr); }
}
.shelfcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.5rem 1.15rem 1.1rem;
  box-shadow: 5px 6px 0 var(--shadow-hard);
}
.shelfcard__name {
  font-family: var(--font-pixel);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.shelfcard__sub {
  margin-top: .45rem;
  font-family: var(--font-hand);
  font-size: .9rem;
  line-height: 1.35;
  color: var(--ballpoint-ink);
}
.shelfcard__note {
  /* absorbs the leftover height so every card's tag sits on the same line */
  flex: 1 1 auto;
  margin-top: .6rem;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.shelfcard__freq {
  align-self: flex-start;
  margin-top: 1.1rem;
  padding: .22rem .6rem .26rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

/* On the 404 page the frequency chip is a link, so it has to read as one. */
.shelfcard__freq a {
  color: inherit;
  text-decoration: none;
}
.shelfcard__freq:hover { background: var(--marker); color: var(--on-marker); }
.shelfcard__freq a::after {
  content: " \2192";
  display: inline-block;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1);
}
.shelfcard__freq:hover a::after { transform: translateX(3px); }

.reads {
  position: relative;
  margin-top: clamp(1.75rem, 4vw, 2.6rem);
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.5rem 1.25rem 1.2rem;
  box-shadow: 5px 6px 0 var(--shadow-hard);
  --tilt: -.7deg;
}
.reads__title {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--ink);
}
.reads__list { margin-top: .8rem; }
.read {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .1rem;
  padding-block: .7rem;
  border-top: 1.5px dashed var(--rule-strong);
}
.read:first-child { border-top: 0; }
.read__book { font-weight: 600; }
.read__who {
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ballpoint-ink);
}
.read__why {
  font-family: var(--font-hand);
  font-size: .9rem;
  color: var(--ink-soft);
}
@media (min-width: 700px) {
  .read {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: .1rem 1.5rem;
    align-items: baseline;
  }
  .read__why { grid-column: 2; }
  .read__who { grid-column: 1; grid-row: 2; }
}

.off__more {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .7rem;
  margin-top: 1.6rem;
}
.off__link {
  display: inline-block;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: .42rem .85rem;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), background-color .18s ease;
}
.off__link:hover { background: var(--marker); color: var(--on-marker); transform: translateY(-2px); }
/* Dashed border and an outward arrow: these two leave the site, the shelf does
   not. The difference has to be visible before the click, not after. */
/* .off__link--out (dashed border for links that leave the site) was removed
   along with the Flap Break link; nothing in #off-clock points off-site now. */

/* --- footer / contact --------------------------------------------------- */
.contact {
  position: relative;
  /* Centred, with the width capped below, so the card never lands on the
     window edge and never clips its own 8px shadow. */
  margin: clamp(2rem, 6vh, 4rem) auto clamp(2rem, 5vh, 3.5rem);
  max-width: var(--shell);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.35rem, 4vw, 3rem);
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 7px 8px 0 var(--shadow-hard);
}
.contact .hand-title { margin-bottom: .8rem; }
.contact__lede { max-width: 46ch; color: var(--ink); }
.contact__mail { margin-top: 1.4rem; }
.contact__link {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: clamp(1.15rem, 3.2vw, 2.1rem);
  letter-spacing: .01em;
  color: var(--ballpoint-ink);
  text-decoration: none;
  border-bottom: 4px solid var(--marker);
  overflow-wrap: anywhere;
}
.contact__link:hover { background: var(--marker); color: var(--on-marker); }
/* The address is the one thing a visitor actually needs to take away, so it
   gets a one-click copy. Hidden until the script that wires it up runs. */
.contact__copy {
  margin-left: .7rem;
  padding: .34rem .7rem .38rem;
  font-family: var(--font-pixel);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  vertical-align: middle;
  transition: background-color .18s ease, transform .18s cubic-bezier(.16, 1, .3, 1);
}
.contact__copy:hover { background: var(--marker); color: var(--on-marker); transform: translateY(-2px); }
.contact__copy[data-done] { background: var(--marker); color: var(--on-marker); }
.contact__copied {
  display: inline-block;
  margin-left: .5rem;
  font-family: var(--font-hand);
  font-size: .95rem;
  color: var(--ballpoint-ink);
  vertical-align: middle;
}

/* --- back to top ---------------------------------------------------------
   The page runs about 7,000px. This is a plain anchor, so with JS off it is
   simply never shown rather than being a dead button. */
.totop {
  position: fixed;
  right: clamp(1rem, 3vw, 2.25rem);
  bottom: clamp(1rem, 3vw, 2.25rem);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  padding: .6rem .75rem .5rem;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 4px 5px 0 var(--shadow-hard);
  color: var(--ink);
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .28s ease, transform .28s cubic-bezier(.16, 1, .3, 1), visibility .28s;
}
.js .totop.is-shown { opacity: 1; visibility: visible; transform: translateY(0); }
.totop svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.totop__text {
  font-family: var(--font-pixel);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.totop:hover { background: var(--marker); color: var(--on-marker); transform: translateY(-2px); }
.totop:active { transform: translateY(1px); }

/* --- the tune -----------------------------------------------------------
   A cassette in the opposite corner to the back-to-top chip. The track is a
   file in this folder, not an embed: the label that owns the song blocks
   YouTube embedding. Browsers do not start audible media on their own, so it
   begins muted and the label asks for a tap; see tune.js for the whole of it. */
.tune {
  position: fixed;
  left: clamp(1rem, 3vw, 2.25rem);
  bottom: clamp(1rem, 3vw, 2.25rem);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: .55rem;
  max-width: calc(100vw - 2 * clamp(1rem, 3vw, 2.25rem));
  padding: .42rem .42rem .42rem .6rem;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 4px 5px 0 var(--shadow-hard);
}
/* Kept in the layout at a hair's size rather than hidden: a display:none
   media element is one a browser is free to stop decoding. */
.tune__player {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.tune__art {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  color: var(--ink);
}
.tune__art svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
/* transform-box is what lets a <g> spin about its own centre instead of the
   SVG's origin. */
.tune__hub { transform-box: fill-box; transform-origin: 50% 50%; }
.tune[data-state='live'] .tune__hub,
.tune[data-state='blocked'] .tune__hub { animation: spin 2.6s linear infinite; }
.tune__hub--b { animation-direction: reverse; }
.tune__meta { display: grid; gap: .1rem; min-width: 0; line-height: 1.1; }
.tune__k {
  font-family: var(--font-pixel);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .13em;
  color: var(--ink-soft);
}
.tune__t {
  overflow: hidden;
  font-family: var(--font-hand);
  font-size: .86rem;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tune__t em { font-style: normal; color: var(--ballpoint-ink); }
.tune__btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: var(--marker);
  color: var(--on-marker);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), background-color .18s ease;
}
.tune__btn:hover { transform: translateY(-2px); }
.tune__btn:active { transform: translateY(1px); }
.tune__btn:disabled { cursor: default; opacity: .5; }
.tune__btn svg {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tune__btn .tune__ico--play { fill: currentColor; stroke: none; }
.tune__ico { display: none; }
.tune[data-state='live'] .tune__ico--pause,
.tune[data-state='blocked'] .tune__ico--mute,
.tune[data-state='paused'] .tune__ico--play,
.tune[data-state='dead'] .tune__ico--out { display: block; }
/* Nothing to play: it stops being a player and becomes a way out to the song. */
.tune[data-state='dead'] .tune__btn { background: var(--paper-lift); color: var(--ink); }
.tune[data-state='dead'] .tune__k { color: var(--ballpoint-ink); }
/* A silent player that nobody notices is a silent player forever. The one
   state that needs a nudge is the one that gets one. */
.tune[data-state='blocked'] .tune__btn { animation: pulse 2.1s ease-in-out infinite; }

@media (max-width: 560px) {
  /* Two floating chips, one corner each. The label is the first thing to go. */
  .tune__meta { display: none; }
  .tune { padding: .4rem; }
}
.contact__cta { margin-top: 1.6rem; }
.contact__social {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.6rem;
}
.contact__social a {
  display: inline-block;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: .42rem .85rem;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), background-color .18s ease;
}
.contact__social a:hover { background: var(--marker); color: var(--on-marker); transform: translateY(-2px); }
.contact__fine {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1.5px dashed var(--rule-strong);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* --- motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__hand, .hero__name, .hero__meta, .hero__lede, .hero__cta, .masthead,
  .hero__collage .avatar, .hero__collage .statcard, .hero__collage .scrap-note {
    animation: settle .72s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 90ms);
  }
  .hero__lede .hl { animation: sweep .9s cubic-bezier(.16, 1, .3, 1) .55s backwards; }

  /* The name. Once the letters are separate boxes the heading stops settling as
     one block: two animations on the same element would fight over transform.
     The letters land one at a time instead, then ride a slow wave so the name is
     never quite still. The wave animates the inner span, the landing animates
     the outer one, so neither has to share a transform. */
  .hero__name.is-split { animation: none; }
  .hero__name.is-split .ch {
    animation: ch-in .6s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(var(--ci, 0) * 26ms + 130ms);
  }
  .hero__name.is-split .ch__i {
    animation: ch-ride 5.6s ease-in-out infinite;
    /* one whole ripple across the name, so the eye follows a single hump */
    animation-delay: calc(var(--ci, 0) * -0.3s);
  }

  /* The collage breathes, out of phase, so the hero is never completely still. */
  .collage__photo { animation: bob 7.5s ease-in-out infinite; }
  .collage__stats { animation: bob 9.5s ease-in-out -3s infinite; }
  .nav__star { animation: spin 16s linear infinite; }
  .badge__dot { animation: pulse 2.6s ease-in-out infinite; }

  /* The scraps drift on their own, out of phase, so the page is never fully
     still. This animates `translate`, not `transform`, so the tilt and the
     reveal transition on `transform` keep working untouched. */
  .kit, .certificate, .awards, .sticky, .scrap-note--rail, .shelfcard, .reads { animation: drift 10s ease-in-out infinite; }
  .kit              { animation-duration: 11.5s; animation-delay: -4s; }
  .certificate      { animation-duration: 9.5s;  animation-delay: -2s; }
  .awards           { animation-duration: 12.5s; animation-delay: -6s; }
  .sticky           { animation-duration: 8.5s;  animation-delay: -1s; }
  .scrap-note--rail { animation-duration: 13s;   animation-delay: -8s; }
  .shelfcard        { animation-duration: 10.5s; animation-delay: -3s; }
  .reads            { animation-duration: 12s;   animation-delay: -7s; }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: rotate(var(--tilt, 0deg)) translateY(20px) scale(.975);
  }
}
@keyframes ch-in {
  from { opacity: 0; transform: translateY(.55em) rotate(-7deg); }
}
@keyframes ch-ride {
  0%, 62%, 100% { transform: translateY(0) rotate(0deg); }
  31%           { transform: translateY(-.09em) rotate(-1.6deg); }
}
@keyframes sweep {
  from { background-size: 0% 100%; }
  to   { background-size: 100% 100%; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-7px) rotate(.7deg); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: .6; }
}
@keyframes drift {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -6px; }
}

/* --- hover: every scrap lifts and straightens --------------------------- */
@media (hover: hover) {
  .timeline__card:hover,
  .skillcard:hover,
  .certificate:hover,
  .case__shot:hover,
  .case__specs:hover,
  .scrap-note:hover,
  .sticky:hover,
  .shelfcard:hover,
  .reads:hover {
    --tilt: 0deg;
    --ry: -5px;
    box-shadow: 9px 12px 0 var(--shadow-hard);
  }
  .avatar:hover {
    --tilt: 0deg;
    --ry: -5px;
  }
  .avatar:hover img { box-shadow: 0 0 0 1px var(--rule), 8px 11px 0 var(--shadow-hard); }
  .avatar:hover .tape { transform: translateX(-50%) rotate(-3.5deg) scaleX(1.07); }
  .project:hover .project__shot img { transform: scale(1.05); }
  .writing__more:hover { transform: translateX(4px); }
}
.project__shot img { transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.writing__more { transition: transform .28s cubic-bezier(.16, 1, .3, 1), color .2s ease; }
.btn:active { transform: translateY(1px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal], .js [data-reveal] { opacity: var(--reveal-op, 1); --ry: 0px; }
  .marquee__track { animation: none; transform: none; }
  /* The button still has to appear and disappear, it just stops sliding. */
  .totop, .js .totop.is-shown { transform: none; }
  /* These carry the same selectors as the rules that start them: matching the
     specificity is what makes "none" win, a bare class name loses to
     .tune[data-state='live'] .tune__hub. */
  .tune__hub, .tune[data-state='live'] .tune__hub,
  .tune[data-state='blocked'] .tune__hub,
  .tune[data-state='blocked'] .tune__btn { animation: none; }
}

/* --- project detail page ------------------------------------------------ */
.case {
  padding-block: clamp(1.5rem, 4vh, 2.75rem) clamp(2rem, 5vh, 3.5rem);
}
.case__back { margin-bottom: 1.5rem; }
.case__back a {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}
.case__back a:hover { color: var(--ballpoint-ink); }

.case__hand {
  font-family: var(--font-hand);
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: var(--ink-soft);
  transform: rotate(-1.5deg);
  transform-origin: left center;
  margin-bottom: .3rem;
}
.case__title {
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: .02em;
}
.case__blurb {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.4;
  font-weight: 500;
  max-width: 52ch;
  margin-top: .9rem;
}
.case__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.75rem;
}

.case__grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  margin-top: clamp(2.25rem, 5vh, 3.5rem);
}
@media (min-width: 940px) {
  .case__grid { grid-template-columns: 1.35fr .65fr; align-items: start; }
}
.case__shot {
  position: relative;
  --tilt: -.6deg;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 12px;
  box-shadow: 6px 7px 0 var(--shadow-hard);
}
.case__shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: 1px;
  background: var(--rule);
}

.case__specs {
  position: relative;
  --tilt: .7deg;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 1.6rem 1.3rem 1.2rem;
  box-shadow: 6px 7px 0 var(--shadow-hard);
}
.case__row + .case__row {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1.5px dashed var(--rule-strong);
}
.case__specs dt {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
.case__specs dd { font-size: .95rem; font-weight: 500; }
.case__specs .tags { margin-top: 0; }
.case__specs a { overflow-wrap: anywhere; }

.case__notes { margin-top: clamp(2.5rem, 6vh, 4rem); }
.case__notes .hand-title { margin-bottom: 1.35rem; }

.case__next {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding-top: 1.75rem;
  border-top: 1.5px dashed var(--rule-strong);
}
.case__next-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.case__next-link {
  display: inline-flex;
  align-items: baseline;
  gap: .7rem;
  margin-top: .5rem;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.6vw, 2.2rem);
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 4px solid var(--marker);
}
.case__next-link:hover { background: var(--marker); color: var(--on-marker); }
.case__next-arrow { transition: transform .22s cubic-bezier(.16, 1, .3, 1); }
.case__next-link:hover .case__next-arrow { transform: translateX(6px); }
.case__next-blurb {
  margin-top: .7rem;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: .95rem;
}

.case__missing { max-width: 62ch; }
.case__missing .case__title { margin-bottom: .8rem; }
.case__index {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.75rem;
}
.case__index a {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: .45rem .9rem;
  transition: background-color .18s ease, transform .18s cubic-bezier(.16, 1, .3, 1);
}
.case__index a:hover { background: var(--marker); color: var(--on-marker); transform: translateY(-2px); }

@media (prefers-reduced-motion: no-preference) {
  #caseBody:not([hidden]) { animation: case-in .5s cubic-bezier(.16, 1, .3, 1) backwards; }
}
@keyframes case-in { from { opacity: 0; } }

/* --- the full shelf ------------------------------------------------------
   The live site keeps this on /hobbies at its own domain. This copy builds the
   same shelf locally instead, so nothing here depends on an external host. The
   data was taken from that page; the markup and the styling are ours. */
.shelf-page {
  padding-block: clamp(1.5rem, 4vh, 2.75rem) clamp(2.5rem, 6vh, 4rem);
}
.shelf-page__title { margin-top: .3rem; font-size: clamp(1.9rem, 5vw, 3.2rem); }
.shelf-page__lede {
  max-width: 62ch;
  margin-top: .9rem;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* The four categories keep the cover art the live site gives each shelf. */
.shelfcard--art { padding: 0 0 1.1rem; }
.shelfcard--art .shelfcard__art {
  display: block;
  margin-bottom: .95rem;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 1px 1px 0 0;
  overflow: hidden;
  background: var(--rule);
}
.shelfcard--art .shelfcard__art img { display: block; width: 100%; height: auto; }
.shelfcard--art .shelfcard__name,
.shelfcard--art .shelfcard__sub,
.shelfcard--art .shelfcard__note,
.shelfcard--art .shelfcard__freq { margin-inline: 1.15rem; }
.shelfcard__icon { margin-right: .34rem; }

/* Filter row: chips on the left, the search box on the right. */
.shelfbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1rem;
  margin-top: clamp(1.75rem, 4vw, 2.6rem);
  padding-top: clamp(1.1rem, 2.5vw, 1.5rem);
  border-top: 1.5px dashed var(--rule-strong);
}
.shelfsearch { flex: 1 1 15rem; max-width: 24rem; }
.shelfsearch input {
  width: 100%;
  font-family: var(--font-body);
  font-size: .86rem;
  color: var(--ink);
  background: var(--paper-lift);
  border: 1.5px dashed var(--ink);
  border-radius: 999px;
  padding: .45rem 1rem .5rem;
  transition: border-style .18s ease, box-shadow .18s ease;
}
.shelfsearch input::placeholder { color: var(--ink-soft); opacity: .8; }
.shelfsearch input:focus-visible {
  border-style: solid;
  outline: 2px solid var(--ballpoint);
  outline-offset: 2px;
}
.shelf-page__count {
  margin-top: 1.1rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.shelf-page__empty {
  margin-top: 1.4rem;
  font-family: var(--font-hand);
  font-size: 1.02rem;
  color: var(--ink-soft);
}

/* The wall itself. */
.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: clamp(.75rem, 1.7vw, 1.1rem);
  margin-top: 1rem;
}
.item { display: flex; }
.item.is-hidden { display: none; }
.item__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--paper-lift);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 4px 5px 0 var(--shadow-hard);
  overflow: hidden;
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), box-shadow .22s ease;
}
.item__link:hover { transform: translateY(-4px); box-shadow: 6px 9px 0 var(--shadow-hard); }
.item__art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-bottom: 1.5px solid var(--ink);
  overflow: hidden;
}
.item__art img {
  display: block;
  width: 100%;
  height: 100%;
  /* contain, not cover. The podcast stills are landscape, and cropping them
     into a poster shape would throw most of the picture away. The panel behind
     is the colour the live site picked for that item, so the letterboxing
     reads as a design choice rather than a mistake. */
  object-fit: contain;
}
.item__badge {
  position: absolute;
  top: .38rem;
  left: .38rem;
  padding: .08rem .38rem .12rem;
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-marker);
  background: var(--marker);
  border: 1.5px solid var(--on-marker);
  border-radius: 999px;
  pointer-events: none;
}
.item__body { display: block; padding: .55rem .6rem .7rem; }
.item__title { display: block; font-size: .82rem; font-weight: 600; line-height: 1.25; }
.item__sub {
  display: block;
  margin-top: .16rem;
  font-size: .7rem;
  line-height: 1.3;
  color: var(--ink-soft);
}
.item__cap {
  /* Three lines is enough to carry the voice without turning 66 posters into a
     wall of prose. The whole sentence is still on the card in the DOM. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: .34rem;
  font-family: var(--font-hand);
  font-size: .76rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

/* --- small screens ------------------------------------------------------ */
@media (max-width: 560px) {
  .work__head { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .article__date { flex-basis: 100%; }
}

/* --- touch: fingers are not cursors --------------------------------------
   The pills were sized for a mouse and came out 22 to 35px tall. WCAG's 24px
   floor is met, but a 24px chip is still a poor thing to hit with a thumb, so
   on a coarse pointer the standalone controls get a 44px box. Text links that
   draw their own underline are left alone: a taller box would peel the rule
   away from the words, and they clear the 24px floor already. */
@media (pointer: coarse) {
  .theme-toggle,
  .btn,
  .tab,
  .shelfchip,
  .off__link,
  .contact__social a,
  .contact__copy,
  .shelfcard__freq,
  .case__index a,
  .shelfsearch input {
    min-height: 44px;
  }
}

/* --- container: shared measure + clear the spiral binding ---------------- */
@media (min-width: 900px) {
  .nav__inner,
  main > section,
  .marquee,
  .contact {
    max-width: var(--shell);
    margin-inline: auto;
    padding-left: var(--bind);
    padding-right: var(--gutter);
  }
}

/* A band bleeds, a card does not. Between 900 and 1240px the shell is wider
   than the window, so the footer panel used to sit flush against both edges
   and lose the right half of its drop shadow. Capping it one gutter short of
   the window keeps its edge on the same line as everything else. */
.contact { max-width: min(var(--shell), calc(100% - 2 * var(--gutter))); }

/* --- print ---------------------------------------------------------------
   Someone will print this. Give them the content and drop the theatre:
   no sticky bar, no tape, no doodles, no drifting scraps, no shadows. */
@media print {
  .nav,
  .marquee,
  .totop,
  .tune,
  .tape,
  .doodle,
  .sprite,
  .stamp,
  .paper__spiral,
  .paper__margin,
  .contact__copy,
  .theme-toggle,
  .tabs,
  .shelfchips,
  .shelfsearch {
    display: none !important;
  }
  body { background: #fff; }
  .paper { display: none; }
  main > section,
  .contact {
    max-width: none;
    padding-inline: 0;
    break-inside: avoid;
  }
  [data-reveal] { opacity: var(--reveal-op, 1) !important; transform: none !important; }
  .project,
  .skillcard,
  .certificate,
  .awards,
  .kit,
  .item__link,
  .contact {
    box-shadow: none;
    border-color: #666;
  }
  .project__shot img { aspect-ratio: auto; }
  .projects { break-inside: auto; }
  /* 66 poster links would print 66 full IMDb and Goodreads URLs. The titles
     are the content; the addresses are noise on paper. */
  .item__link::after { content: none !important; }
  .item { break-inside: avoid; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .7em;
    word-break: break-all;
    color: #555;
  }
}
/* tombol ke versi 3D: ditumpuk DI ATAS widget musik (.tune), sejajar kirinya, supaya tidak saling menimpa */
.play3d {
  position: fixed; z-index: 60;
  left: clamp(1rem, 3vw, 2.25rem); bottom: calc(clamp(1rem, 3vw, 2.25rem) + 4.4rem);
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  font: 700 14px/1 'Space Grotesk', system-ui, sans-serif; color: #14161f; background: #ffd23f;
  border: 3px solid #14161f; border-radius: 12px; box-shadow: 3px 3px 0 #14161f; text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.play3d:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #14161f; }
.play3d:focus-visible { outline: 3px solid #2b4fe0; outline-offset: 3px; }
@media (max-width: 520px) { .play3d { padding: 9px 12px; font-size: 13px; bottom: calc(clamp(1rem, 3vw, 2.25rem) + 4.1rem); } }
