:root {
  --bg: #fefefe;
  --blue: #2326a5;
  --ink: #161616;
  --muted: #8b8b8b;
  --soft: #b9b9b9;
  --pill: #efefef;
  --pill-hover: #e3e3e3;
  --line: #ececec;
  --accent: #e8643a;   /* her Readymag orange */
  --accent-2: #37c2f0; /* cyan from the Chorinho tears */
  --gutter: clamp(16px, 5.8vw, 116px);
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --wide: "Archivo", "Instrument Sans", sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--pill);
  font-size: 14px; font-weight: 500; letter-spacing: .01em; text-transform: uppercase;
  white-space: nowrap;
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.pill:hover { background: var(--pill-hover); }
.pill.muted { color: var(--soft); background: #f3f3f3; }
.pill.muted:hover { color: var(--ink); }
.pill.dark { background: var(--ink); color: #fff; }
.pill.dark:hover { background: #333; }
.pill.icon { width: 36px; padding: 0; }
.wordmark {
  font-family: var(--wide); font-weight: 800; font-stretch: 125%;
  text-transform: lowercase; font-size: 14px; letter-spacing: -.01em;
  background: #f3f3f3;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-left, .nav-right { display: flex; gap: 6px; align-items: center; }
.nav-extra { display: flex; gap: 6px; overflow: hidden; max-width: 0; opacity: 0; transition: max-width .5s var(--ease), opacity .3s; }
.nav-extra.open { max-width: 400px; opacity: 1; }
.plus { position: relative; width: 14px; height: 14px; }
.plus::before, .plus::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 1.5px; background: currentColor;
  transition: transform .35s var(--ease);
}
.plus::after { transform: rotate(90deg); }
#navToggle[aria-expanded="true"] .plus::after { transform: rotate(0deg); }

/* ---------- Hero: the floor → organized ---------- */
.hero {
  position: relative;
  min-height: max(100svh, 640px);
  background: #000;
  color: #fff;
  overflow: hidden;
  transition: background-color 1s var(--ease);
}
.hero::before { /* film grain over the black floor */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  transition: opacity 1s;
}
body.organized .hero, body.organizing .hero { background: var(--blue); }
body.organized .hero::before, body.organizing .hero::before { opacity: 0; }

.mess-note {
  position: absolute; z-index: 60; left: 16px; bottom: 20px; margin: 0;
  font-size: 15px; line-height: 1.35; color: rgba(255,255,255,.85); pointer-events: none;
  transition: opacity .4s;
}
.mess-note span { color: rgba(255,255,255,.45); }
body.organizing .mess-note, body.organized .mess-note { opacity: 0; }

.floor { position: absolute; inset: 0; z-index: 1; }
.thumb {
  position: absolute; margin: 0; left: 0; top: 0;
  padding: var(--frame, 5px); background: #f4f2ee;
  box-shadow: 0 calc(var(--d, .5) * 30px) calc(var(--d, .5) * 50px) rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.4);
  cursor: grab; touch-action: none; user-select: none;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.thumb.in { opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; background: #ddd; transition: filter 1s; }
.thumb.far img { filter: brightness(.7) blur(.6px); }
.thumb.dragging { cursor: grabbing; transition: none; }
.thumb figcaption {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px;
  font-size: 11px; line-height: 1.2; color: rgba(255,255,255,.9);
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
body.organizing .thumb, body.organized .thumb { --frame: 0px; box-shadow: 0 12px 24px -16px rgba(0,0,0,.55); }
body.organizing .thumb.far img, body.organized .thumb.far img { filter: none; }
body.organized .thumb { cursor: pointer; transition: translate .3s var(--ease); }
body.organized .thumb:hover { translate: 0 -4px; }
body.organized .thumb:hover figcaption, body.organized .thumb:focus-visible figcaption { opacity: 1; }
body.organizing .thumb {
  transition: left 1.1s var(--ease), top 1.1s var(--ease), width 1.1s var(--ease), height 1.1s var(--ease),
              transform 1.1s var(--ease), padding .6s, box-shadow 1s, opacity .6s;
  transition-delay: var(--delay, 0s);
}

.organize-btn {
  position: absolute; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%);
  height: 52px; padding: 0 30px; border-radius: 999px;
  background: #fff; color: #121212; font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.6);
  transition: transform .3s var(--ease), opacity .4s;
}
.organize-btn:hover { transform: translateX(-50%) scale(1.05); }
body.organized .organize-btn, body.organizing .organize-btn { opacity: 0; pointer-events: none; }

.org-layout {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 5vw; align-items: center;
  min-height: max(100svh, 640px);
  padding: 96px var(--gutter) 72px;
}
.org-text > * { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
body.organizing .org-text > *, body.organized .org-text > * { opacity: 1; transform: none; }
.org-text > :nth-child(1) { transition-delay: .9s; }
.org-text > :nth-child(2) { transition-delay: .3s; }
.org-text > :nth-child(3) { transition-delay: 1.1s; }
.org-text > :nth-child(4) { transition-delay: 1.3s; }
.org-text > :nth-child(5) { transition-delay: 1.5s; }
.org-text .eyebrow { color: rgba(255,255,255,.6); }
.org-title { margin: 0 0 28px; font-size: clamp(48px, 6.4vw, 116px); line-height: .95; font-weight: 500; letter-spacing: -.045em; }
.org-lead { margin: 0 0 18px; max-width: 560px; font-size: clamp(19px, 1.5vw, 24px); line-height: 1.38; color: rgba(255,255,255,.72); }
.org-lead b { color: #fff; font-weight: 500; }
.org-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill.light { background: #fff; color: var(--blue); }
.pill.light:hover { background: #e9eaff; }
.pill.ghost { background: rgba(255,255,255,.14); color: #fff; }
.pill.ghost:hover { background: rgba(255,255,255,.24); }

.org-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.org-grid .cell { aspect-ratio: 3 / 4; }

/* Everything below stays hidden until the floor is organized */
body.messy { overflow: hidden; }
body.messy .rest, body.messy .bottom-bar { display: none; }

/* Nav: translucent pills, white-on-dark while over the hero */
.nav .pill { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(239,239,239,.88); }
body.on-hero .nav .pill { background: rgba(255,255,255,.13); color: #fff; }
body.on-hero .nav .pill:hover { background: rgba(255,255,255,.24); }
body.on-hero .nav .pill.muted { color: rgba(255,255,255,.55); }

/* ---------- Featured ---------- */
.featured { padding: 40px 0 0; }
.feature-frame {
  position: relative; margin: 0 var(--gutter);
  aspect-ratio: 16 / 8.5; border-radius: 4px; overflow: hidden;
  display: grid; place-items: center;
  background: #cfd3d8;
}
.feature-bg {
  position: absolute; inset: -12%;
  background-size: cover; background-position: center;
  filter: blur(46px) saturate(1.2) brightness(1.05);
  transform: scale(1.15) rotate(-8deg);
}
.feature-bg::after { /* motion streaks like a long exposure */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.18) 0 2%, rgba(0,0,0,.05) 2% 5%, rgba(255,255,255,0) 5% 9%);
  filter: blur(18px);
  animation: drift 18s linear infinite alternate;
}
@keyframes drift { to { transform: translateX(6%); } }
.feature-player {
  position: relative; z-index: 1; width: 63%; aspect-ratio: 16/9;
  border-radius: 10px; overflow: hidden; background: #111;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.45);
}

/* ---------- Media (shared by feature + rows) ---------- */
.media-video { position: relative; width: 100%; height: 100%; background: #111; overflow: hidden; }
.media-video > img, .media-video > video, .media-video > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0;
}
.media-video > img { transition: transform 8s linear, opacity .5s; }
.media-video.in-view > img { transform: scale(1.08); }
.media-video iframe { opacity: 0; transition: opacity .6s; }
.media-video iframe.ready { opacity: 1; }
.media-caption {
  position: absolute; left: 8%; bottom: 14%; z-index: 2; margin: 0;
  color: #fff; font-size: clamp(22px, 2.6vw, 44px); font-weight: 500; letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgba(0,0,0,.35); pointer-events: none;
  transition: opacity .6s;
}
.play-btn {
  position: absolute; right: 16px; bottom: 16px; z-index: 3;
  display: inline-flex; gap: 8px; align-items: center;
  height: 36px; padding: 0 16px 0 12px; border-radius: 999px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  transition: transform .25s var(--ease), background .25s;
}
.play-btn:hover { background: #fff; transform: scale(1.04); }
.play-btn::before { content: ""; border-left: 9px solid currentColor; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; }
.media-video.playing .play-btn, .media-video.playing .media-caption { opacity: 0; pointer-events: none; }
.sound-btn {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: rgba(0,0,0,.45); color: #fff; font-size: 12px; text-transform: uppercase; backdrop-filter: blur(6px);
}

/* ---------- Split layout ---------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 64px var(--gutter) 0;
}
.split-right { max-width: 780px; }
.eyebrow { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 500; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: #fff1ea; color: var(--accent); font-size: 13px; font-weight: 500;
}
.badge::before { content: "✺"; }
.big { margin: 0 0 20px; font-size: clamp(22px, 1.75vw, 30px); line-height: 1.32; letter-spacing: -.012em; }
.big em { font-style: normal; color: var(--accent); }
.muted-text { color: var(--muted); }
.muted-text b { color: var(--ink); font-weight: 500; }
.credits { margin: 0 0 24px; color: var(--muted); font-size: 15px; }
.body { margin: 0 0 32px; color: var(--muted); font-size: 18px; line-height: 1.55; max-width: 640px; }

.about { padding-top: 140px; }
.section-title { margin: 0; font-size: clamp(34px, 2.6vw, 44px); font-weight: 400; letter-spacing: -.02em; }
.portrait { margin: 32px 0 0; width: min(300px, 70%); }
.portrait img { width: 100%; filter: grayscale(.15); }

.facts { margin: 0 0 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; border-top: 1px solid var(--line); }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 15px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #2fc26a; box-shadow: 0 0 0 4px #e3f7ea; vertical-align: 1px; }

.awards ul { list-style: none; margin: 0; padding: 0; }
.awards li { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.awards .yr { color: var(--muted); }
.awards .proj { color: var(--muted); font-size: 14px; }

/* ---------- Work list ---------- */
.work { padding: 180px 0 40px; }
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 0 var(--gutter) 40px; flex-wrap: wrap; }
.work-head .chip.active { background: var(--ink); color: #fff; }
.row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 50px var(--gutter) 90px;
  transition: opacity .5s var(--ease);
}
.row[hidden] { display: none; }
.row-title { margin: 0; font-size: clamp(30px, 2.3vw, 42px); font-weight: 400; letter-spacing: -.02em; line-height: 1.1; }
.row-meta { margin-top: 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.row-award { margin-top: 14px; }
.row-left { position: sticky; top: 70px; align-self: start; }
.row-media { width: 100%; }
.row-media .media-video { aspect-ratio: 16/9; border-radius: 3px; }
.row-text { margin: 32px 0 26px; color: var(--muted); font-size: 20px; line-height: 1.6; letter-spacing: -.005em; }
.row-links { display: flex; gap: 8px; flex-wrap: wrap; }

.trio { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 20px; align-items: center; }
.trio img { width: 100%; aspect-ratio: 3/5.2; object-fit: cover; }
.trio img:nth-child(2) { aspect-ratio: 3/4.3; }
.single img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Contact ---------- */
.contact { padding: 120px var(--gutter) 160px; border-top: 1px solid var(--line); margin-top: 40px; }
.contact-title { margin: 0 0 32px; max-width: 18ch; font-size: clamp(38px, 5vw, 88px); font-weight: 500; line-height: 1; letter-spacing: -.035em; }
.contact-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Bottom bar ---------- */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 4px; pointer-events: none;
}
.bottom-bar > * { pointer-events: auto; }
.now-playing {
  display: flex; align-items: center; gap: 8px; width: 230px; height: 32px; padding: 0 12px 0 10px;
  border-radius: 999px; background: rgba(243,243,243,.92); backdrop-filter: blur(8px); overflow: hidden;
}
.np-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .5; } }
.marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee span { display: inline-block; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--muted); animation: marquee 22s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.socials { display: flex; gap: 4px; }
.socials a {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(243,243,243,.92); backdrop-filter: blur(8px); font-size: 13px; font-weight: 600;
  transition: background .25s;
}
.socials a:hover { background: var(--pill-hover); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav-right .pill:not(.icon):not(.nav-extra .pill) { padding: 0 11px; font-size: 12px; height: 32px; }
  .nav-left .pill.muted { display: none; }
  .nav-extra.open { max-width: 100vw; }
  #navToggle { display: none; }
  .pill { height: 32px; font-size: 12px; padding: 0 12px; }

  .org-layout { grid-template-columns: 1fr; gap: 40px; padding: 88px 16px 56px; align-items: start; }
  .org-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .org-title { font-size: 52px; }
  .mess-note { display: none; }

  .featured { padding-top: 64px; }
  .feature-frame { margin: 0 16px; aspect-ratio: 4/5; }
  .feature-player { width: 86%; }
  .split, .row { grid-template-columns: 1fr; gap: 20px; padding-left: 16px; padding-right: 16px; }
  .row-left { position: static; }
  .row { padding-top: 32px; padding-bottom: 56px; }
  .row-text { font-size: 17px; margin-top: 20px; }
  .about { padding-top: 96px; }
  .facts { grid-template-columns: 1fr; }
  .awards li { grid-template-columns: 48px 1fr; }
  .awards .proj { grid-column: 2; }
  .work { padding-top: 110px; }
  .work-head { padding: 0 16px 16px; }
  .trio { gap: 8px; }
  .contact { padding: 80px 16px 120px; }
  .now-playing { width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .thumb { opacity: 1; transform: none; }
}

/* Floor thumbs: drop-in, and the text layer never blocks the pictures */
.thumb { transition: opacity .5s var(--ease), transform .7s cubic-bezier(.3, 1.3, .5, 1); }
.org-layout { pointer-events: none; }
body.organized .org-actions a { pointer-events: auto; }

/* While messy, the hero is exactly one screen so the Organize button is always visible */
body.messy .hero { height: max(100svh, 560px); min-height: 0; }
body.messy .org-layout { visibility: hidden; }

@media (max-width: 820px) {
  .nav-right a[href="#reel"] { display: none; }
  .nav .pill { padding: 0 11px; }
  .organize-btn { bottom: max(24px, env(safe-area-inset-bottom)); }
}

/* Language switch */
.lang {
  display: inline-flex; gap: 2px; padding: 3px; height: 36px; border-radius: 999px;
  background: rgba(239,239,239,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lang button {
  height: 30px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--soft); transition: background .25s, color .25s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
body.on-hero .lang { background: rgba(255,255,255,.13); }
body.on-hero .lang button { color: rgba(255,255,255,.55); }
body.on-hero .lang button:hover { color: #fff; }
body.on-hero .lang button[aria-pressed="true"] { background: #fff; color: #000; }
body.organized.on-hero .lang button[aria-pressed="true"] { color: var(--blue); }

.about { padding-bottom: 40px; }

@media (max-width: 820px) {
  .nav-about { display: none; }
  .lang { height: 32px; }
  .lang button { height: 26px; padding: 0 8px; font-size: 12px; }
}

/* About: portrait + experience */
.portrait { width: 100%; max-width: 520px; margin-top: 32px; }
.portrait img { width: 100%; aspect-ratio: 1734 / 1546; object-fit: cover; filter: none; border-radius: 3px; }
.experience { margin-bottom: 40px; }
.experience ul { list-style: none; margin: 0; padding: 0; }
.experience li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.experience li:first-child { border-top: 1px solid var(--line); }
.experience .yr { color: var(--muted); font-variant-numeric: tabular-nums; }
.experience b { font-weight: 500; }
.experience .org { color: var(--muted); font-size: 14px; }
@media (max-width: 820px) {
  .experience li { grid-template-columns: 1fr; gap: 2px; }
}
