/* Project pages: the home page's theme (navy, cream, burnt orange; Newsreader over Hanken Grotesk). */
:root {
  --bg: #f6f1e9;
  --surface: #eee7db;
  --ink: #18202f;
  --muted: #5a5f6a;
  --accent: #142238;
  --accent-ink: #f6f1e9;
  --accent-deep: #0f1a2c;
  --orange: #a94d1a;
  --orange-hi: #e2834b;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;

  --font: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem);
  --step-head: clamp(2.25rem, 1.2rem + 4.4vw, 5.5rem);
  --step-display: clamp(3.25rem, 11vw, 11.5rem);

  --gutter: clamp(16px, 2.2vw, 32px);
  --section-gap: clamp(56px, 6.5vw, 104px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--step-body);
  line-height: 1.45; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap {
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.head { font-size: var(--step-head); font-weight: 500; line-height: 0.95; letter-spacing: -0.045em; text-wrap: balance; }
.lead { font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.015em; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* Bar */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 14px; background: var(--bg);
}
.bar .start { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 20px); }
.bar .home {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font-size: var(--step-small); font-weight: 500; line-height: 1;
  border: 1px solid currentColor; border-radius: 999px; padding: 7px 14px 7px 11px;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.bar .home svg { width: 14px; height: 14px; }
.bar .home:hover, .bar .home:focus-visible { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bar .mark { font-weight: 500; font-size: var(--step-lead); letter-spacing: -0.03em; text-decoration: none; }
.bar nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 32px); }
.bar nav a { text-decoration: none; position: relative; }
.bar nav a.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease);
}
.bar nav a.link:hover::after, .bar nav a.link[aria-current="page"]::after { transform: scaleX(1); }
.bar nav a.link[aria-current="page"] { color: var(--accent-deep); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 0;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  transition: transform 160ms var(--ease), background-color 200ms var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--accent-deep); }
.btn:active { transform: translateY(1px); }

/* Opening */
.open { padding-block: clamp(32px, 4.5vw, 72px) clamp(32px, 4vw, 56px); }
.open h1 {
  font-size: var(--step-display); font-weight: 500; line-height: 0.88; letter-spacing: -0.055em;
  max-width: 11ch; text-wrap: balance; animation: rise 800ms var(--ease) both;
}
.open .sub { margin-top: 24px; max-width: 36ch; animation: rise 800ms 120ms var(--ease) both; }
.facts {
  margin-top: clamp(28px, 3.5vw, 48px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  animation: rise 800ms 220ms var(--ease) both;
}
.facts dt { font-size: var(--step-small); color: var(--muted); }
.facts dd { font-weight: 500; margin-top: 4px; }
@keyframes rise { from { opacity: .4; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* Picture */
.photo { position: relative; overflow: hidden; background: var(--ink); }
.photo img {
  width: 100%; height: clamp(200px, 36svh, 420px); object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  animation: drift 24s ease-in-out infinite alternate;
}
.photo figcaption {
  position: absolute; left: 0; bottom: 0; background: var(--ink); color: var(--bg);
  padding: 12px max(var(--gutter), env(safe-area-inset-left, 0px)); font-size: var(--step-small);
}
@keyframes drift { from { transform: scale(1.03); } to { transform: scale(1.1) translateX(-2%); } }

/* Two-column text section */
.split { padding-block: var(--section-gap) 0; display: grid; grid-template-columns: 34% 1fr; gap: 24px; }
.split .body { display: grid; gap: 24px; max-width: 44ch; }
.split .body p:not(.lead) { max-width: 60ch; }

/* Proposal list */
.moves { padding-block: var(--section-gap) var(--section-gap); }
.moves h2 { margin-bottom: clamp(24px, 3vw, 44px); max-width: 14ch; }
.moves ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px var(--gutter); }
.moves li h3 { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 10px; }
.moves li p { max-width: 46ch; }

/* Figures on an ink field */
.figs { background: var(--ink); color: var(--bg); padding-block: clamp(48px, 5.5vw, 88px); }
.figs h2 { max-width: 16ch; margin-bottom: clamp(32px, 4vw, 64px); }
.figs .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.fig { font-size: clamp(3rem, 6.5vw, 6.5rem); font-weight: 500; line-height: 0.85; letter-spacing: -0.06em; white-space: nowrap; }
.fig small { font-size: 0.4em; letter-spacing: -0.03em; margin-left: 0.05em; }
.figs .cap { margin-top: 20px; max-width: 30ch; }

/* Set piece shared parts */
.piece { padding-block: var(--section-gap) 0; }
.piece > h2 { margin-bottom: 16px; }
.piece > .lead { max-width: 40ch; margin-bottom: clamp(24px, 3vw, 44px); }
.bars { display: grid; gap: 14px; }
.bars .b { display: grid; grid-template-columns: minmax(0, 32%) 1fr; gap: 20px; align-items: center; }
.bars .b .label { font-weight: 500; }
.bars .b .label span { display: block; font-weight: 400; color: var(--muted); font-size: var(--step-small); }
.bars .track { position: relative; height: 38px; background: var(--surface); }
.bars .fill {
  position: absolute; inset: 0 auto 0 0; background: var(--ink);
  transform-origin: left; transition: width 500ms var(--ease);
}
.bars .fill.alt { background: var(--accent); }
.bars .val { position: absolute; left: calc(var(--w) + 12px); top: 50%; transform: translateY(-50%); font-weight: 500; white-space: nowrap; }
.bars .val.inside { left: auto; right: calc(100% - var(--w) + 12px); color: var(--bg); }

/* My part */
.mine { margin-top: var(--section-gap); background: var(--accent); color: var(--accent-ink); padding-block: clamp(44px, 5vw, 76px); }
.mine .inner { display: grid; grid-template-columns: 34% 1fr; gap: 24px; }
.mine ul { display: grid; gap: 14px; max-width: 52ch; }
.mine li { padding-left: 1.2em; position: relative; }
.mine li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.5em; height: 0.5em; background: var(--accent-ink); }

/* Next project + footer */
.next { padding-block: var(--section-gap) clamp(40px, 5vw, 72px); display: grid; gap: 20px; }
.next p { color: var(--muted); }
.next a.go {
  font-size: var(--step-head); font-weight: 500; line-height: 0.95; letter-spacing: -0.045em;
  text-decoration: none; display: inline-flex; gap: 0.3em; align-items: baseline; width: fit-content;
  transition: color 200ms var(--ease);
}
.next a.go span { transition: transform 240ms var(--ease); display: inline-block; }
.next a.go:hover { color: var(--accent-deep); }
.next a.go:hover span { transform: translateX(10px); }
.foot { background: var(--surface); padding-block: 28px; display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 24px; font-size: var(--step-small); }
.foot > :last-child { text-align: right; }
.foot a { text-underline-offset: 3px; }

/* Entrances tied to scroll; content is complete without them */
@supports (animation-timeline: view()) {
  .in { animation: enter linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  .in.d1 { animation-range: entry 10% entry 80%; }
  .in.d2 { animation-range: entry 20% entry 90%; }
}
@keyframes enter { from { transform: translateY(44px); } to { transform: none; } }

@media (max-width: 760px) {
  .bar nav a.link { display: none; }
  .bar .start .mark { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .split, .mine .inner { grid-template-columns: 1fr; }
  .moves ul { grid-template-columns: 1fr; gap: 24px; }
  .figs .row { grid-template-columns: 1fr; gap: 32px; }
  .fig { font-size: 16vw; }
  .bars .b { grid-template-columns: 1fr; gap: 8px; }
  .foot { grid-template-columns: 1fr; }
  .foot > :last-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Theme: navy bar, serif display, orange accents ---------- */
h1, h2, h3, .fig, .next a.go { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
.open h1 { font-weight: 500; letter-spacing: -0.03em; line-height: 0.95; }
::selection { background: var(--orange); color: #fff; }
:focus-visible { outline-color: var(--orange); }
.bar { background: var(--accent); color: var(--accent-ink); }
.bar .mark { font-family: var(--serif); font-size: 1.75rem; letter-spacing: -0.02em; }
.bar .mark .dot { color: var(--orange-hi); }
.bar nav a.link[aria-current="page"] { color: var(--orange-hi); }
.bar .home:hover, .bar .home:focus-visible { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.bar .btn { background: transparent; color: var(--orange-hi); box-shadow: inset 0 0 0 1.5px var(--orange-hi); }
.bar .btn:hover { background: var(--orange-hi); color: var(--accent); transform: none; }
.btn:hover { background: var(--orange); }
.facts dt { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.photo img { filter: none; }
.figs { background: var(--accent); }
.fig { color: var(--orange-hi); }
.mine li::before { background: var(--orange-hi); }
.next a.go:hover { color: var(--orange); }
.foot { background: var(--accent); color: var(--accent-ink); }
