/* ==========================================================================
   Juno Reyes · portfolio
   Type: Anybody (display, variable wdth 50–150 / wght 100–900),
         Hanken Grotesk (text), Martian Mono (labels). All self-hosted, OFL.
   Colour: paper + ink, one vermilion accent (Jupiter's Great Red Spot).
   ========================================================================== */

@font-face {
  font-family: "Anybody";
  src: url("../fonts/anybody.woff2") format("woff2-variations"), url("../fonts/anybody.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk.woff2") format("woff2-variations"), url("../fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martian-mono.woff2") format("woff2-variations"), url("../fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --paper: #EEEAE1;
  --paper-2: #E2DDD2;
  --ink: #15130F;
  --ink-2: #211E19;
  --accent: #F0522A;
  --muted-paper: #5E584F;
  --muted-ink: #A39C90;

  --display: "Anybody", "Arial Black", system-ui, sans-serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 2.2vw, 32px);
  --gap: clamp(12px, 1.6vw, 24px);
  --bar: 34px;

  /* current section theme */
  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--muted-paper);
  --line: rgba(21, 19, 15, .18);
  --ph-bg: rgba(240, 82, 42, .13);
  --ph-rule: var(--accent);
}

.theme-paper { --bg: var(--paper); --fg: var(--ink); --muted: var(--muted-paper); --line: rgba(21,19,15,.18); }
.theme-ink   { --bg: var(--ink); --fg: var(--paper); --muted: var(--muted-ink); --line: rgba(238,234,225,.18); --ph-bg: rgba(240,82,42,.1); }
.theme-accent{ --bg: var(--accent); --fg: var(--ink); --muted: var(--ink); --line: rgba(21,19,15,.3); --ph-bg: rgba(21,19,15,.07); --ph-rule: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(16px, 1.05vw + 10px, 19px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
section, footer { background: var(--bg); color: var(--fg); }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
[id] { scroll-margin-top: calc(var(--bar) + 8px); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { padding-inline: var(--gutter); max-width: 1680px; margin-inline: auto; }
.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  font-stretch: 90%;
  letter-spacing: .02em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Placeholders: quiet highlight, removed once real info is in. */
.ph {
  background: var(--ph-bg);
  box-shadow: inset 0 -1.5px 0 var(--ph-rule);
  padding: 0 .12em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Draft bar ---------- */
.draft-bar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--paper-2);
  color: var(--ink);
  border-bottom: 1px solid rgba(21,19,15,.12);
  font-family: var(--mono); font-size: 12px; font-stretch: 90%;
  padding-inline: var(--gutter);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.draft-bar strong { font-weight: 600; }
.draft-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- Hero ---------- */
.hero {
  --seam: 100%;
  position: relative;
  min-height: calc(100svh - var(--bar));
  display: flex; flex-direction: column;
  color: var(--ink);
  background: linear-gradient(to bottom, var(--paper) var(--seam), var(--ink) var(--seam));
  isolation: isolate;
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap);
  padding-inline: var(--gutter);
}
.hero-grid i { border-left: 1px solid rgba(128, 118, 104, .16); }
.hero-grid i:last-child { border-right: 1px solid rgba(128, 118, 104, .16); }

.hero-top {
  width: 100%;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap);
  align-items: start;
  padding-top: 18px;
}
.mark {
  grid-column: 1 / span 3;
  font-family: var(--display); font-weight: 800; font-stretch: 112%;
  font-size: 17px; letter-spacing: -.01em; line-height: 1;
  min-height: 44px; display: inline-flex; align-items: center; align-self: start;
}
.role { grid-column: 4 / span 3; padding-top: 14px; color: var(--muted-paper); }
.nav { grid-column: 7 / -1; display: flex; justify-content: flex-end; gap: clamp(8px, 2vw, 32px); }
.nav a {
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 calc(100% - 10px);
  transition: background-size .25s ease;
}
.nav a:hover { background-size: 100% 1.5px; }
.nav .label { color: var(--muted-paper); }

.hero-mid {
  width: 100%;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap);
  margin-top: clamp(48px, 12vh, 140px);
}
.lede {
  grid-column: 7 / span 5;
  font-size: clamp(20px, 1.2vw + 12px, 30px);
  line-height: 1.25; font-weight: 500; letter-spacing: -.01em;
  max-width: 24ch;
}

.hero-foot { width: 100%; margin-top: auto; padding-top: 40px; }
.readout {
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--muted-paper);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(21,19,15,.18);
  margin-bottom: clamp(10px, 1.4vw, 22px);
}
.readout-val { font-variant-numeric: tabular-nums; color: var(--ink); }
.hint-touch { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-touch { display: inline; } }

/* Wordmark */
.wordmark {
  position: relative;
  font-family: var(--display);
  font-weight: 760; font-stretch: 112%;
  font-size: 14.6vw;              /* JS refits this to the exact column width */
  line-height: 1;
  letter-spacing: -.012em;
  text-transform: uppercase;
  touch-action: pan-y;
  cursor: default;
  user-select: none; -webkit-user-select: none;
}
.wm-layer { display: block; }
.wm-ink { color: var(--ink); }
.wm-paper { display: none; }
.js .wm-paper {
  display: block;
  position: absolute; inset: 0;
  color: var(--paper);
  clip-path: inset(var(--clip, 100%) 0 0 0);
  pointer-events: none;
}
.wm-row { display: inline-flex; gap: .2em; transform-origin: 0 100%; white-space: nowrap; }
.wm-fit { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; font-variation-settings: "wdth" 112, "wght" 760; }

.scroll-cue {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  margin: clamp(14px, 2vw, 28px) 0 clamp(10px, 1.5vw, 20px);
  color: var(--paper);
}
.scroll-cue:hover { color: var(--accent); }

/* Narrow: name on two lines, each fitted to the width */
@media (max-width: 719px) {
  .hero-top { grid-template-columns: 1fr auto; row-gap: 0; }
  .mark { grid-column: 1; grid-row: 1; }
  .nav { grid-column: 2; grid-row: 1; gap: 0; margin-right: -6px; }
  .nav a { padding-inline: 6px; font-size: 14px; }
  .nav .label { display: none; }
  .role { grid-column: 1 / -1; grid-row: 2; padding-top: 4px; }
  .hero { min-height: min(calc(100svh - var(--bar)), 700px); }
  .hero-mid { margin-top: clamp(32px, 7vh, 72px); }
  .lede { grid-column: 1 / -1; }
  .wordmark { font-size: 27vw; }
  .wm-row { display: flex; flex-direction: column; align-items: flex-start; gap: .04em; }
  .wm-fit:first-child { transform-origin: 0 100%; }
  .wm-fit:last-child { transform-origin: 0 0; }
  .hero-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-grid i:nth-child(n+5) { display: none; }
  .hero-grid i:nth-child(4) { border-right: 1px solid rgba(128, 118, 104, .16); }
}

/* ---------- Section scaffolding ---------- */
section { padding-block: clamp(72px, 10vw, 160px); }
.work { padding-top: clamp(32px, 5vw, 72px); }
.section-head {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap);
  align-items: end;
  padding-bottom: clamp(20px, 2.4vw, 36px);
  border-bottom: 1px solid var(--line);
}
.section-head > .label { grid-column: 1 / span 3; color: var(--muted); align-self: start; padding-top: .4em; }
.section-head > h2 { grid-column: 4 / -1; }

.display-cond {
  font-family: var(--display);
  font-weight: 800; font-stretch: 66%;
  font-size: clamp(52px, 9vw, 160px);
  line-height: .86; letter-spacing: -.01em;
  text-transform: uppercase;
}
.count { font-size: 12px; vertical-align: top; color: var(--muted); letter-spacing: .02em; }

/* ---------- Work ---------- */
.projects { counter-reset: p; }
.project {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap);
  padding-block: clamp(28px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.p-index { grid-column: 1 / span 2; display: flex; flex-direction: column; gap: 8px; }
.p-index .label:first-child { font-size: 13px; }
.tag { color: var(--muted); }
.p-text { grid-column: 3 / span 4; grid-row: 1; display: flex; flex-direction: column; gap: 16px; }
.p-media { grid-column: 7 / -1; grid-row: 1; }
.p-title {
  font-family: var(--display);
  font-weight: 700; font-stretch: 88%;
  font-size: clamp(28px, 2.7vw, 46px);
  line-height: 1.02; letter-spacing: -.02em;
  text-wrap: balance;
  transition: font-stretch .5s cubic-bezier(.2,.7,.2,1), font-variation-settings .5s;
}
.p-line { color: var(--muted); max-width: 34ch; }
.p-meta { display: flex; gap: 28px; }
.p-meta dt { color: var(--muted); margin-bottom: 2px; }
.p-link {
  align-self: start; min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
}
.p-link[aria-disabled="true"] { cursor: not-allowed; }

/* ---------- Stand-ins (code-built, replace with screenshots) ---------- */
.standin {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  isolation: isolate;
}
.standin-label {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  padding: 5px 8px; border-radius: 3px;
  background: rgba(21,19,15,.78); color: var(--paper);
  font-size: 12px; text-transform: none; letter-spacing: 0;
}

/* 01 specimen */
.s-specimen { background: var(--paper); color: var(--ink); }
.standin { container-type: inline-size; }
.spec-glyph {
  position: absolute; left: 7%; bottom: calc(17% - 4.05cqi); /* puts the baseline at 17% */
  font-family: var(--display);
  font-size: 36cqi;
  line-height: .78;
  font-variation-settings: "wdth" 150, "wght" 900;
  transition: font-variation-settings .8s cubic-bezier(.2,.7,.2,1);
}
.spec-line { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(21,19,15,.35); }
.spec-line .label { position: absolute; right: 12px; top: 4px; font-size: 12px; color: var(--muted-paper); text-transform: lowercase; }
.l-cap  { bottom: calc(17% + 24.3cqi); }
.l-cap .label { top: auto; bottom: 4px; }
.l-x    { bottom: calc(17% + 21.35cqi); border-top-style: dashed; }
.l-base { bottom: 17%; border-top: 2px solid var(--accent); }

/* 02 code */
.s-code { background: var(--ink-2); color: var(--paper); border: 1px solid rgba(238,234,225,.1); }
.code {
  position: absolute; left: 6%; right: 6%; top: 22%;
  margin: 0;
  font-family: var(--mono); font-stretch: 100%;
  font-size: clamp(12px, 2.9cqi, 22px);
  line-height: 1.75;
  white-space: pre; overflow: hidden;
}
.ln { display: inline-block; width: 2.2em; color: #6E675C; }
.tk-sel { color: var(--accent); }
.tk-prop { color: #D9D3C7; }
.tk-str { color: #F4A283; }
.tk-num { color: var(--paper); font-weight: 700; }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em; margin-left: 4px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 03 before/after */
.s-split { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); }
.split-before, .split-after { position: relative; padding: 18% 9% 8%; }
.split-before { background: #D8D3C8; display: flex; flex-direction: column; gap: 6%; }
.split-before .label, .split-after .label { position: absolute; left: 9%; bottom: 7%; color: var(--ink); }
.wire { display: block; height: 6%; background: #B9B2A5; border-radius: 2px; }
.w1 { width: 80%; height: 11%; } .w2 { width: 100%; } .w3 { width: 92%; } .w4 { width: 60%; } .w5 { width: 40%; height: 14%; margin-top: 4%; background: #A59E90; }
.split-after { background: var(--accent); color: var(--ink); overflow: hidden; }
.after-word {
  position: absolute; left: 7%; top: 18%;
  font-family: var(--display); font-size: 17cqi; line-height: .85;
  font-variation-settings: "wdth" 60, "wght" 900;
  transition: font-variation-settings .8s cubic-bezier(.2,.7,.2,1);
}
.split-handle {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-size: 18px;
}

/* 04 glyph grid */
.s-glyphs { background: var(--ink-2); color: var(--paper); border: 1px solid rgba(238,234,225,.1); }
.glyph-grid {
  position: absolute; inset: 18% 6% 8%;
  display: grid; grid-template-columns: repeat(6, 1fr); align-items: center; justify-items: center;
  font-family: var(--display); font-size: 12cqi; line-height: 1;
}
.glyph-grid span { font-variation-settings: "wdth" var(--w), "wght" var(--g); transition: font-variation-settings .6s cubic-bezier(.2,.7,.2,1); }
.glyph-grid span:nth-child(7n+4) { color: var(--accent); }

/* Hover: the type shifts axes (a small nod to the hero) */
@media (hover: hover) {
  .project:hover .p-title { font-stretch: 100%; }
  .project:hover .spec-glyph { font-variation-settings: "wdth" 60, "wght" 300; }
  .project:hover .after-word { font-variation-settings: "wdth" 150, "wght" 900; }
  .project:hover .glyph-grid span { font-variation-settings: "wdth" calc(200 - var(--w)), "wght" calc(1000 - var(--g)); }
}

/* ---------- About ---------- */
.about .section-head { border-bottom: 0; padding-bottom: 0; }
.about-body {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap);
  margin-top: 20px;
}
@media (min-width: 960px) { .about-body { margin-top: -1.6em; } }
.statement {
  grid-column: 4 / -1;
  font-family: var(--display);
  font-weight: 650; font-stretch: 96%;
  font-size: clamp(48px, 8.2vw, 150px);
  line-height: .9; letter-spacing: -.035em;
}
.about-copy {
  grid-column: 4 / span 5;
  margin-top: clamp(24px, 3vw, 48px);
  font-size: clamp(18px, .6vw + 14px, 22px);
  color: var(--muted); max-width: 40ch;
}
.caps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap);
  margin-top: clamp(56px, 8vw, 120px);
  border-top: 1px solid var(--line);
}
.caps li { padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.caps .label { color: var(--muted); }
.cap-title {
  font-family: var(--display); font-weight: 800; font-stretch: 66%;
  font-size: clamp(32px, 3vw, 48px); line-height: .95; text-transform: uppercase;
}
.caps p { color: var(--muted); max-width: 28ch; }

/* ---------- Contact ---------- */
.contact .section-head { border-bottom-color: var(--line); }
.contact-title { margin-top: clamp(28px, 4vw, 56px); }
.email {
  display: inline-block;
  margin-top: clamp(20px, 3vw, 40px);
  font-family: var(--display);
  font-weight: 800; font-stretch: 104%;
  font-size: clamp(26px, 5.3vw, 100px);
  line-height: 1.05; letter-spacing: -.03em;
  white-space: nowrap;
  transition: font-stretch .4s ease;
}
.email:hover { font-stretch: 90%; }
@media (max-width: 719px) { .email { white-space: normal; overflow-wrap: anywhere; font-size: 9vw; } }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: clamp(28px, 3vw, 44px); }
.btn {
  min-height: 48px; padding: 0 22px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; border: 1.5px solid var(--ink);
  font-weight: 600; font-size: 16px; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-quiet { background: transparent; }
.btn-quiet:hover { background: rgba(21,19,15,.1); }
.copy-status { min-height: 1.4em; }
.socials { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: clamp(40px, 6vw, 88px); padding-top: 18px; border-top: 1px solid var(--line); }
.socials a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------- Footer ---------- */
.footer { padding-block: 28px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--muted-ink); }
.footer-row .label { padding-block: 14px; }
.to-top { color: var(--paper); }

/* ---------- Tablet / phone layout ---------- */
@media (max-width: 959px) {
  .p-index { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
  .p-media { grid-column: 1 / -1; grid-row: auto; }
  .p-text { grid-column: 1 / -1; grid-row: auto; }
  .section-head > .label { grid-column: 1 / -1; }
  .section-head > h2 { grid-column: 1 / -1; margin-top: 12px; }
  .statement, .about-copy { grid-column: 1 / -1; }
  .caps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .caps { grid-template-columns: 1fr; }
  .caps li { border-top: 1px solid var(--line); padding-block: 16px 4px; }
  .caps { border-top: 0; }
  .draft-bar { justify-content: flex-start; font-stretch: 78%; }
  .footer-row { flex-direction: column; gap: 0; }
  .footer-row .label { padding-block: 8px; }
  .footer-row .to-top { padding-block: 14px; }
}

/* ---------- Reduced motion: no movement, everything still works ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* Small stand-in cards (phones): keep labels clear of the artwork */
@container (max-width: 520px) {
  .spec-glyph { font-size: 32cqi; bottom: calc(17% - 3.6cqi); }
  .l-cap { bottom: calc(17% + 21.6cqi); }
  .l-x { bottom: calc(17% + 18.98cqi); }
  .l-x .label { display: none; }
  .split-before { padding-top: 30%; }
  .after-word { top: 30%; font-size: 15cqi; }
  .glyph-grid { inset: 24% 4% 6%; }
}
