/* Serif: Poliphilus Pro Regular (MyFonts web license, loaded from
   assets/fonts/MyWebfontsKit.css). The kit has no italic, so browsers are
   told not to fake one: emphasis comes from the purple color instead. */
/* Zoë Waechter — portfolio
   Colors and type match the Figma "Home (final)" frame. */
:root {
  --bg: #ffffff;
  --surface: #f3f2ef;
  --ink: #141413;
  --muted: #7a7770;
  --rule: #e3e1dc;
  --accent: #6b4fd8;
  --serif: "PoliphilusProRegular", "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 3.4vw, 48px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-synthesis: none; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.label, .list-head, .details dt, .facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 50; }

/* Header */
.site-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-block: 28px; }
.logo img { width: 44px; height: auto; }
nav { display: flex; gap: 28px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
nav a { text-decoration: none; }
nav a:hover { color: var(--accent); }
.status { justify-self: end; display: flex; gap: 18px; align-items: center; font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 96px) 24px; }
.hero-stage { position: relative; padding-bottom: clamp(60px, 9vw, 140px); }
.intro { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.2vw, 76px); line-height: 1.04; letter-spacing: -.02em; margin: 0; max-width: 16.5em; min-height: 2.1em; }
.intro em { font-style: italic; color: var(--accent); }
.caret { display: inline-block; width: .06em; height: .9em; background: var(--ink); margin-left: .04em; vertical-align: -.08em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.disciplines { margin: 28px 0 0; }
.drops { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.hero-stage.liquid { cursor: crosshair; touch-action: none; }
.hero-stage.liquid .drops { opacity: 1; }
.hero-stage.liquid .intro, .hero-stage.liquid .intro em, .hero-stage.liquid .disciplines { color: transparent; }
.hero-stage.liquid .intro ::selection { color: var(--ink); }
.hero-stage.over-drop { cursor: grab; }
.hero-stage.dragging { cursor: grabbing; }
.hero-hint { margin: 0; font-size: 12px; }

/* Index */
.index { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; padding-block: 24px 140px; }
.list-col { position: sticky; top: 24px; }
.list-head { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.projects { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding-block: 20px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.row .year { color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .7em; }
.row .title { font-family: var(--serif); font-size: clamp(24px, 2.3vw, 32px); line-height: 1.12; display: block; transition: color .2s ease; text-wrap: balance; }
.row .disc { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.row .note { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease, opacity .3s ease; opacity: 0; }
.row .note > span { overflow: hidden; max-width: 52ch; padding-top: 0; }
.row:hover .title, .row:focus-visible .title, .row[aria-current="true"] .title { color: var(--accent); }
.row:hover .note, .row:focus-visible .note, .row[aria-current="true"] .note { grid-template-rows: 1fr; opacity: 1; }
.row:hover .note > span, .row[aria-current="true"] .note > span { padding-top: 6px; }

.detail-col { min-width: 0; }
.preview { margin: 0; position: sticky; top: 24px; }
.preview-media { background: var(--surface); aspect-ratio: 616 / 648; overflow: hidden; }
.preview-media img, .preview-media video { width: 100%; height: 100%; object-fit: cover; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; } }
.preview figcaption { margin-top: 10px; font-size: 11px; min-height: 1.5em; }

/* Case study */
.case-bar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--ink); font-size: 12px; position: sticky; top: 0; background: var(--bg); z-index: 2; padding-top: 24px; margin-top: -24px; }
.case-bar .pager { display: flex; gap: 24px; }
.case-bar button:hover, .case-next:hover .next-title { color: var(--accent); }
.case-lead { margin: 16px 0 0; background: var(--surface); }
.case-lead img, .case-lead video { width: 100%; height: auto; }
.case-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 3.4vw, 48px); line-height: 1.05; letter-spacing: -.01em; margin: 40px 0 16px; text-wrap: balance; }
.case-summary { white-space: pre-line; font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.35; margin: 0; max-width: 34em; }
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; margin: 56px 0 0; padding-top: 20px; border-top: 1px solid var(--rule); }
.details dd { margin: 6px 0 0; }
.case-section { margin-top: 56px; }
.case-section h3 { font: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 14px; font-weight: 400; }
.case-section p { white-space: pre-line; font-family: var(--serif); font-size: 19px; line-height: 1.45; margin: 0; max-width: 36em; }
.case-media { margin: 56px 0 0; display: grid; gap: 12px; }
.case-media.pair { grid-template-columns: 1fr 1fr; align-items: start; }
.case-media img, .case-media video { width: 100%; height: auto; background: var(--surface); }
.case-next { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 80px 0 0; padding-top: 20px; border-top: 1px solid var(--ink); text-align: left; width: 100%; }
.case-next .next-title { font-family: var(--serif); font-size: 32px; transition: color .2s ease; }

/* Play */
.play { padding-block: 0 140px; }
.play-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; margin-bottom: 28px; }
.play h2 { font-family: var(--serif); font-weight: 400; font-size: 40px; margin: 0; }
.play-controls { display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.arrow { font-size: 15px; padding: 2px 4px; }
.arrow:hover { color: var(--accent); }
.play-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 4px; }
.play-track::-webkit-scrollbar { display: none; }
.tile { flex: none; scroll-snap-align: start; margin: 0; }
.tile-media { position: relative; height: clamp(240px, 26vw, 360px); background: var(--surface); overflow: hidden; }
.tile-media img, .tile-media video { height: 100%; width: 100%; object-fit: cover; }
.tile-media video { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.tile.playing .tile-media video, .tile-media video.always { opacity: 1; }
.tile figcaption { margin-top: 8px; font-size: 12px; display: flex; gap: 10px; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 24px; padding-block: 28px 160px; border-top: 1px solid var(--rule); }
.about-left { display: flex; flex-direction: column; gap: 40px; }
.portrait { margin: 0; max-width: 300px; }
.portrait img { width: 100%; height: auto; filter: grayscale(1); }
.song { width: calc((100% - 48px) / 3); min-width: 260px; margin: 56px 0 0 auto; }   /* lines up under the last fact column, on the right */
.song iframe { width: 100%; height: 152px; border: 0; border-radius: 12px; }
.bio { font-family: var(--serif); font-size: clamp(22px, 2vw, 28px); line-height: 1.3; margin: 0; max-width: 34em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 40px 0 0; }
.facts dd { margin: 8px 0 0; }

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; padding-block: 20px 40px; border-top: 1px solid var(--rule); }
.hello { font-family: var(--serif); font-style: italic; font-size: 40px; text-decoration: none; }
.hello:hover { color: var(--accent); }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 32px; font-size: 12px; color: var(--muted); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* Sheet (mobile case study) */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-inner { padding: calc(env(safe-area-inset-top, 0px) + 8px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 48px); }
.sheet .case-bar { margin-top: 0; padding-top: 16px; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: auto 1fr; }
  nav { grid-column: 1 / -1; grid-row: 2; gap: 20px; }
  .index { grid-template-columns: 1fr; padding-bottom: 96px; }
  .list-col { position: static; }
  .detail-col { display: none; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .song { width: 100%; max-width: 360px; margin: 40px 0 0; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-media.pair { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .status .clock { display: none; }
  .row, .list-head { grid-template-columns: 52px 1fr; gap: 14px; }
  .hello { font-size: 32px; }
  .facts { grid-template-columns: 1fr; }
}

/* Liquid glass layer over images (drawn by js/liquid.js) */
.liquid-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }
body.sheet-open .liquid-layer { z-index: 45; }
.case-lead > *, .case-media > *, .preview-media > *, .tile-media { cursor: crosshair; }

/* Puddles in blank space (js/puddles.js) */
.puddle-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 20; }
body.sheet-open .puddle-layer { display: none; }
