/* =========================================================================
   Amir Sabrin — portfolio
   Direction: SIGNAL. Dark instrument panel, hairline structure, card modules.
   ========================================================================= */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Permanent Marker";
  src: url("fonts/PermanentMarker-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0a0c0f;
  --surface: #101419;
  --surface-2: #151a20;
  --line: #212932;
  --line-soft: #192028;
  --ink: #e9eef4;
  --ink-2: #b3bec9;
  --muted: #8b97a6;
  --muted-2: #7c8794;
  --accent: #b6f24a;
  --accent-bright: #c6ff63;
  --accent-dim: rgba(182, 242, 74, 0.14);
  --line-hover: #38424e;
  --line-hover-soft: #39434f;
  --plate: #0d1116;
  --plate-drawn: #0c1014;
  /* controls that sit on an unknown plate: a screenshot can be dark or light,
     so these are the only colours on the page that do not follow the ground */
  --overlay: rgba(10, 12, 15, 0.62);
  --overlay-strong: rgba(10, 12, 15, 0.86);
  --on-plate: #ffffff;
  --line-on-plate: rgba(255, 255, 255, 0.18);
  /* the sticker wall: paper, the ink printed on paper, a grey chip, tape */
  --paper-ink: #47515b;
  --chip-slate: #cfd6dd;
  --tape: rgba(228, 219, 202, 0.9);

  --sans: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-mono: 0.75rem;
  --fs-mono-sm: 0.75rem;
  --gutter: clamp(20px, 4.4vw, 56px);
  --wrap: 1240px;
  --gap: clamp(14px, 1.6vw, 20px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius: 3px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

img { max-width: 100%; }

a { color: inherit; }

h1, h2, h3, p, dl, dd, dt, ul, li, figure, figcaption { margin: 0; }
ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  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 {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 16px; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 15px;
  padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  background: rgba(10, 12, 15, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.status {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.status-short { display: none; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  flex: none;
}

.topnav {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
}

.topnav a {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: transparent;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

/* ---------------------------------------------------------------- shared */

section {
  padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2));
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(24px, 3vw, 40px);
}

.sec-head h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sec-meta {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.lbl {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ---------------------------------------------------------------- hero
   A sticker wall pinned onto the console: the name is a printed plate, the
   portrait is a polaroid, the facts are a seven-segment readout. Every layer
   drifts at its own rate against the pointer (data-depth), and a lamp follows
   the cursor. All of it is decorative motion; nothing here carries meaning
   that the text does not already carry. */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  padding-top: clamp(48px, 6.5vw, 84px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: clamp(32px, 5vw, 76px);
  align-items: start;
}

/* the lamp: a pool of light that tracks the pointer. It is one big soft disc
   moved with translate rather than a repainted gradient, so following the
   cursor costs no layout or paint. */
.lamp {
  position: absolute;
  top: 22%;
  left: 64%;
  z-index: 0;
  width: min(1100px, 120vw);
  height: min(1100px, 120vw);
  margin: calc(min(1100px, 120vw) / -2) 0 0 calc(min(1100px, 120vw) / -2);
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(
    circle closest-side,
    rgba(182, 242, 74, 0.24),
    rgba(182, 242, 74, 0.07) 46%,
    transparent 70%
  );
  will-change: transform;
}

/* the loose stickers */
.scatter {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.slap {
  position: absolute;
  padding: 7px 12px;
  border: 2px solid var(--on-plate);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 14px 26px -14px rgba(0, 0, 0, 0.9);
}
.slap-a { top: 8%; left: 63%; rotate: 6deg; background: var(--accent); color: var(--bg); }
.slap-b { top: 50%; left: 82%; rotate: -5deg; background: var(--on-plate); color: var(--bg); }
.slap-c { top: 55%; left: 58%; rotate: 3.5deg; background: var(--chip-slate); color: var(--bg); }
.slap-d { top: 33%; left: 44%; rotate: -7deg; background: var(--accent); color: var(--bg); }

/* the name, printed on a lime plate */
.name-tag {
  display: inline-block;
  max-width: 100%;
  padding: 9px 26px 15px;
  border: 3px solid var(--on-plate);
  border-radius: 12px;
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 26px 50px -26px rgba(0, 0, 0, 0.95), 0 3px 0 rgba(0, 0, 0, 0.35);
  rotate: -2.5deg;
  transition: translate 0.5s var(--ease);
}

.tag-kicker {
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

.tag-body {
  margin-top: 3px;
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  line-height: 1;
}
.marker {
  display: flex;
  flex-direction: column;
  font-family: "Permanent Marker", "Space Grotesk", sans-serif;
  font-weight: 400;
  rotate: -1.2deg;
}
.marker span:last-child { padding-left: 0.12em; }

.lede {
  margin-top: clamp(26px, 3.4vw, 44px);
  font-size: clamp(1.5rem, 2.7vw, 2.2rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 500;
  max-width: 32ch;
  text-wrap: balance;
}

.sub {
  margin-top: 20px;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.62;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 3vw, 36px);
}

.btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn:hover { background: var(--accent-bright); border-color: var(--accent-bright); transform: translateY(-1px); }

.btn-ghost { color: var(--ink-2); background: transparent; }
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--line-hover-soft);
  transform: translateY(-1px);
}

.arr {
  display: inline-block;
  width: 0.56em;
  height: 0.56em;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  flex: none;
  translate: 0 -0.05em;
}
.arr--ne { rotate: 45deg; }
.arr--se { rotate: 135deg; }

/* the portrait as a polaroid: tape, tilt, caption in the margin */
.photo-sticker {
  position: relative;
  min-width: 0;
  padding: 12px 12px 0;
  background: var(--on-plate);
  border-radius: 10px;
  box-shadow: 0 34px 60px -28px rgba(0, 0, 0, 0.95), 0 3px 0 rgba(0, 0, 0, 0.35);
  rotate: 3deg;
  transition: translate 0.55s var(--ease);
}

.photo-sticker .media {
  border: 0;
  border-radius: 4px;
}

.photo-sticker figcaption {
  padding: 11px 4px 13px;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: var(--paper-ink);
}

.tape {
  position: absolute;
  top: 2px;
  left: 24px;
  z-index: 3;
  width: 92px;
  height: 22px;
  rotate: -9deg;
  background: var(--tape);
  box-shadow: 0 2px 5px -2px rgba(0, 0, 0, 0.55);
}

/* ------------------------------------------------- the tape under the hero
   The vocabulary of the work, running past the edge. Decorative: the same
   words are spelled out in Work and Projects, so it is hidden from the
   accessibility tree and stops entirely under reduced motion. */

.tape-band {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--plate);
  padding: 11px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.tape-track {
  display: flex;
  width: max-content;
  gap: 0;
  animation: tape-run 46s linear infinite;
}

.tape-band:hover .tape-track,
.tape-band:focus-within .tape-track {
  animation-play-state: paused;
}

.tape-track span {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-right: 26px;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.tape-track span::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

@keyframes tape-run {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------- media */

.media {
  position: relative;
  overflow: hidden;
  background-color: var(--plate);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 9px
  );
}

.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-4x5 { aspect-ratio: 4 / 5; }
.ratio-4x3 { aspect-ratio: 4 / 3; }

.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.media::after {
  content: attr(data-slot);
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.media:not([data-slot])::after { content: none; }
.media.is-filled::after { display: none; }

/* ---------------------------------------------------------------- cards */

.work,
.projects,
.edu-sec { padding-bottom: clamp(56px, 7vw, 100px); }

.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease),
    background 0.22s var(--ease);
}

.card:hover {
  border-color: var(--line-hover);
  transform: translateY(-2px);
  background: var(--surface-2);
}
.card:hover .media img { transform: scale(1.025); }

/* Work records run full width and carry no plate: identity on the left, what
   was done on the right. A 16:9 box holding text would be a placeholder
   pretending to be evidence. */
.card-row {
  grid-column: span 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.card .media { border-bottom: 1px solid var(--line); }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}

.card-body > :last-child {
  margin-top: auto;
  padding-top: 20px;
}

.idx {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.card h3 {
  font-size: clamp(1.3rem, 1.9vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.org {
  margin-top: 8px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.45;
}

.when {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.desc {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.chips li {
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 5px 9px;
}

/* module names are sentences, not four-letter tags: same chip, no shouting */
.chips--plain li {
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.card-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.card-note {
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.04em;
  color: var(--muted-2);
  line-height: 1.5;
}

.card-body.split {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 6px 48px;
  align-items: start;
  padding: 26px 32px 28px;
}
.card-body.split > :last-child { margin-top: 0; padding-top: 0; }

.split-r .desc { margin-top: 0; }
.split-r .card-link { margin-top: 20px; }
.split-r .card-note { margin-top: 18px; }

@media (max-width: 900px) {
  .card-body.split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .card-body.split > .split-r {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
  }
}

/* --------------------------------------------------------------- carousel
   Three screens on the same 16:9 plate, cross-faded in place. No autoplay:
   the reader drives it, and every control is a real button. */

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s var(--ease), visibility 0.32s var(--ease);
}
.slide.is-active { opacity: 1; visibility: visible; }

/* a horizontal drag is the reader paging, not the browser scrolling; a
   screenshot must not be draggable as an image */
.carousel .media { touch-action: pan-y; }
.slide img { -webkit-user-drag: none; user-select: none; }

/* The card's hover zoom would twitch the plate while the arrows are
   being aimed at, so the carousel plate stays put. */
.card:hover .carousel .media img { transform: none; }

.cbtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-on-plate);
  border-radius: 2px;
  background: var(--overlay);
  color: var(--on-plate);
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}
.cbtn--prev { left: 10px; }
.cbtn--next { right: 10px; }
.cbtn:hover,
.cbtn:focus-visible {
  background: var(--overlay-strong);
  border-color: var(--accent);
  color: var(--accent);
}
/* the page's lime ring is weak on a white screenshot, so the button carries
   its own ring: white line, dark halo, visible on either plate */
.cbtn:focus-visible {
  outline: 2px solid var(--on-plate);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--overlay-strong);
}
.cbtn:active { transform: translateY(-50%) scale(0.94); }

@media (hover: none) {
  .cbtn { width: 40px; height: 40px; }
}

.cbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.cbar[hidden] { display: none; }

.cname {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.cnum {
  flex: none;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.cnum b { font-weight: 500; color: var(--ink); }

/* The recording is the evidence for EsportsBN — no public repository exists —
   so it plays in place: 16:9, native controls, poster frame from the video. */
.card video {
  display: block;
  flex: none;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--plate-drawn);
  border-bottom: 1px solid var(--line);
  object-fit: cover;
}

/* ---------------------------------------------------------------- on site */

.onsite { padding-bottom: clamp(56px, 7vw, 100px); }

.onsite-copy,
.sec-copy {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.shot .media {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.shot figcaption {
  margin-top: 11px;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- education
   Five records as an index, not five more boxes: hairline rows that open in
   place. Native <details>, so it works with the keyboard and with no script. */

.edu {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.edu-item { border-bottom: 1px solid var(--line); }

.edu-item > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 6px 24px;
  padding: 22px 4px 22px 0;
  cursor: pointer;
  list-style: none;
}
.edu-item > summary::-webkit-details-marker { display: none; }

.edu-main { display: block; min-width: 0; }

.edu-kind {
  display: block;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}

.edu-title {
  display: block;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.18s var(--ease);
}

.edu-school {
  display: block;
  margin-top: 5px;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.edu-when {
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

/* one chevron, pointing down closed and up open */
.edu-item > summary::after {
  content: "";
  justify-self: end;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  rotate: 45deg;
  transition: rotate 0.2s var(--ease), border-color 0.18s var(--ease);
}
.edu-item[open] > summary::after { rotate: -135deg; }

.edu-item > summary:hover .edu-title,
.edu-item > summary:focus-visible .edu-title { color: var(--accent); }
.edu-item > summary:hover::after,
.edu-item > summary:focus-visible::after { border-color: var(--accent); }

.edu-body { max-width: 78ch; padding: 0 0 28px; }

.edu-grade {
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.edu-note {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.9688rem;
  line-height: 1.6;
}

.edu-lbl {
  margin: 22px 0 10px;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.edu-body .chips { margin-top: 0; }

.edu-list { display: grid; gap: 7px; }
.edu-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.edu-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 1px;
  background: var(--muted-2);
}

/* ---------------------------------------------------------------- skills
   A pile of stickers. Dragging is a toy, never a requirement: every name is
   already in the DOM in reading order, and "stick them again" puts them back.
   Below 900px the wall becomes a wrapped list and the drag is not offered. */

.skills { padding-bottom: clamp(56px, 7vw, 100px); }

.stick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.stick-hint {
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stick-reset {
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.stick-reset:hover { color: var(--ink); border-color: var(--line-hover-soft); }

.stick-wall {
  position: relative;
  height: clamp(300px, 29vw, 400px);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
}

.stick-list { position: absolute; inset: 0; }

.stick {
  position: absolute;
  top: var(--y);
  left: var(--x);
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 16px;
  border: 2px solid var(--on-plate);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  touch-action: none;
  rotate: var(--r, 0deg);
  translate: var(--dx, 0px) var(--dy, 0px);
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.9);
  transition: box-shadow 0.18s var(--ease);
}

.stick:hover { box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.95); }
.stick.is-dragging { cursor: grabbing; z-index: 5; }

.stick--lime { background: var(--accent); color: var(--bg); }
.stick--paper { background: var(--on-plate); color: var(--bg); }
.stick--dark {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-hover);
}
.stick--pill { border-radius: 999px; padding-left: 20px; padding-right: 20px; }

.stick-note {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  opacity: 0.6;
}

.lang-line {
  margin-top: 22px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}
.lang-line b {
  margin-right: 8px;
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- contact */

.contact {
  padding-top: clamp(40px, 6vw, 84px);
  padding-bottom: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--line);
}

.contact .status { margin-bottom: clamp(24px, 3vw, 36px); }

.mail {
  display: block;
  width: fit-content;
  max-width: 100%;
  font-size: clamp(1rem, 5.1vw, 4.7rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.14;
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.08em;
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.mail:hover { color: var(--accent); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 3.4vw, 40px);
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2vw, 28px);
  margin-top: clamp(30px, 4vw, 52px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.18s var(--ease);
}
.social a:hover { color: var(--ink); }
.social a:hover .arr { color: var(--accent); }

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

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 22px max(var(--gutter), calc((100% - var(--wrap)) / 2)) 30px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------------------------------------------------------------- motion */

/* Fade only. A transform here would outrank the card's own hover transform,
   because an animation beats a declared value while it is running. */
.pre {
  opacity: 0;
}
.is-in {
  opacity: 1;
  animation: fade-in 0.6s var(--ease) both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------------------------------------- rwd */

@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(210px, 290px); }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .scatter { display: none; }
  .photo-sticker { max-width: 320px; justify-self: start; }
  .stick-bar { display: none; }
  .stick-wall {
    height: auto;
    padding: 16px;
    border-style: solid;
  }
  .stick-list {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .stick {
    position: static;
    translate: none;
    cursor: default;
    box-shadow: none;
  }
  .card { grid-column: span 12; }
  .photos { grid-template-columns: repeat(2, 1fr); }
  .photos .shot:last-child { grid-column: 1 / -1; }
  .photos .shot:last-child .media { aspect-ratio: 2 / 1; }
}

@media (max-width: 720px) {
  .sec-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sec-meta { text-align: left; }
  .foot { flex-direction: column; }
}

@media (max-width: 620px) {
  .status-long { display: none; }
  .status-short { display: inline; }
  .topnav { gap: 12px; }
  .photo-sticker { max-width: 260px; }
}

@media (max-width: 560px) {
  .photos { grid-template-columns: 1fr; }
  .photos .shot:last-child .media { aspect-ratio: 4 / 3; }
  .btn, .btn-ghost { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 520px) {
  /* five nav links plus any sentence do not fit on one line: keep the dot */
  .status-short { display: none; }
}

@media (max-width: 400px) {
  .topnav { gap: 9px; }
  .topnav a {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .pre { opacity: 1; transform: none; }
}
