/* Colours and sizes. Change these to restyle the whole site. */
:root {
  --bg: #0c0a08;
  --surface: #181512;
  --surface-2: #221d18;
  --ink: #ffffff;
  --soft: #a59f97;
  --accent: #c9a45a;
  --accent-ink: #0c0a08;

  --step-small: clamp(0.875rem, 0.84rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  --step-lead: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --step-head: clamp(2.5rem, 1.4rem + 3.4vw, 4.25rem);
  --step-giant: clamp(2.75rem, 1rem + 6vw, 6.5rem);

  --m: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --tape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Crect width='56' height='56' fill='%230c0a08'/%3E%3Cpath d='M0 56 L28 0 L56 0 L28 56Z' fill='%23c9a45a'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "EB Garamond", Garamond, Georgia, serif;
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 9; }

/* ---------- Split stage ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--m);
  padding: var(--m);
}
.read { min-width: 0; }
.stage {
  position: sticky;
  top: var(--m);
  height: calc(100svh - 2 * var(--m));
  overflow: hidden;
  background: var(--surface);
}
.stage-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.2s var(--ease-out), transform 6s linear;
}
.stage-img.on { opacity: 1; transform: scale(1); }
.stage-cap {
  position: absolute; left: 0; bottom: 0;
  background: var(--bg);
  padding: 10px 16px;
  font-size: var(--step-small);
  font-style: italic;
}
.stage-cap:empty { display: none; }

/* ---------- Hero card ---------- */
.card {
  min-height: calc(100svh - 2 * var(--m));
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.tape { height: 56px; background: var(--tape) 0 0 / 56px 56px; animation: tape 6s linear infinite; }
.tape-thin { height: 16px; background-size: 16px 16px; }
@keyframes tape { to { background-position: 56px 0; } }
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 32px 32px;
  gap: 28px;
}
.wordmark { font-size: var(--step-lead); font-style: italic; color: var(--accent); }
.headline {
  font-weight: 400;
  font-size: var(--step-giant);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.headline .line { display: block; }
.tagline { max-width: 36ch; }
.card-nav { display: flex; gap: 28px; margin-top: auto; padding-top: 24px; font-size: var(--step-small); }
.card-nav a, .foot-menu a { text-decoration: none; transition: color .18s ease; }
.card-nav a:hover { color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-size: var(--step-small);
  font-weight: 500;
  padding: 14px 28px;
  transition: transform .14s var(--ease-out), background-color .18s ease;
}
.btn:hover { background: var(--ink); }
.btn:active { transform: scale(0.97); }

/* ---------- Intro ---------- */
.intro {
  max-width: 46ch;
  padding: 160px 0 160px 15%;
  display: grid;
  gap: 1.1em;
  color: var(--soft);
}
.intro p:first-child { color: var(--ink); font-weight: 500; font-size: var(--step-lead); line-height: 1.3; }

/* ---------- Work ledger ---------- */
.work { padding: 0 8% 180px 15%; }
.work h2 { font-size: var(--step-head); font-weight: 400; line-height: 1.05; letter-spacing: -0.02em; }
.work-note { color: var(--soft); font-size: var(--step-small); margin: 16px 0 40px; }
.ledger { list-style: none; padding: 0; }
.row-link {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto auto;
  column-gap: 20px;
  align-items: baseline;
  width: 100%;
  padding: 14px 0 18px;
  position: relative;
  transition: color .2s ease, transform .2s var(--ease-out);
}
.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.row-name { font-size: var(--step-lead); line-height: 1.2; }
.row-kind { color: var(--soft); font-size: var(--step-small); }
.row-year { font-variant-numeric: tabular-nums; font-size: var(--step-small); }
.meter { grid-column: 1 / -1; height: 6px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.meter-fill {
  display: block; height: 100%; background: var(--accent);
  transform-origin: left; transform: scaleX(0);
  transition: transform 1.1s var(--ease-out) .2s;
}
.row.in .meter-fill, html:not(.js) .meter-fill { transform: scaleX(var(--p)); }
.has-active .row:not(.active) .row-link { color: var(--soft); }
.row.active .row-link { transform: translateX(10px); }
.row-thumb { display: none; }

/* ---------- About letter ---------- */
.about {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 32px 200px;
}
.portrait { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: 28px; filter: grayscale(1); }
.letter { display: grid; gap: 1em; }
.sign { margin-top: 32px; display: grid; }
.sign em { font-size: var(--step-lead); }
.sign span { font-size: var(--step-small); color: var(--soft); }

/* ---------- Contact (full width, breaks the split) ---------- */
.contact { padding: 160px var(--m) 0; display: grid; }
.c-row {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-height: 150px;
  padding: 0 20px 24px;
  font-size: var(--step-giant);
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color .25s ease, color .2s ease;
}
.c-row:nth-child(odd) { background: var(--surface); }
.c-row:hover { color: var(--accent); }
.c-hello { background: var(--accent) !important; color: var(--accent-ink); }
.c-hello:hover { color: var(--accent-ink); }
.c-arrow {
  display: inline-grid; place-items: center;
  width: 1.5em; height: 1.5em; border-radius: 50%;
  background: var(--accent-ink); color: var(--accent);
  font-size: 0.6em; line-height: 1;
  transition: transform .25s var(--ease-out);
}
.c-hello:hover .c-arrow { transform: translateX(12px); }

/* ---------- Footer ---------- */
.foot { margin-top: 160px; }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 100svh; }
.foot-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.foot-menu { padding: 80px 8%; display: flex; flex-direction: column; gap: 28px; background: var(--surface); }
.foot-mark { font-style: italic; color: var(--accent); }
.foot-menu nav { display: grid; gap: 12px; }
.foot-menu nav a { font-size: var(--step-head); line-height: 1.05; width: fit-content; transition: transform .2s var(--ease-out), color .2s ease; }
.foot-menu nav:hover a { color: var(--soft); }
.foot-menu nav a:hover { color: var(--ink); transform: translateX(12px); }
.legal { margin-top: auto; font-size: var(--step-small); color: var(--soft); }

/* ---------- Entrances (only when the script has run) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }
.headline .line { animation: rise .9s var(--ease-out) both; animation-delay: calc(var(--i) * 90ms + 150ms); }
@keyframes rise { from { opacity: 0; transform: translateY(0.4em); } }

/* ---------- Phone ---------- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .stage { display: none; }
  .card { min-height: auto; }
  .card-body { padding: 40px 20px 28px; }
  .tape { height: 40px; background-size: 40px 40px; }
  .intro { padding: 96px 20px 96px; max-width: 34ch; }
  .work { padding: 0 8px 120px; }
  .row-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-top: 24px; }
  .row:nth-child(n+4) .row-thumb { display: none; }
  .row-link { grid-template-columns: 1fr auto; }
  .row-kind { grid-row: 2; grid-column: 1 / -1; }
  .row.active .row-link { transform: none; }
  .has-active .row:not(.active) .row-link { color: inherit; }
  .about { padding: 40px 20px 140px; }
  .contact { padding-top: 100px; }
  .c-row { min-height: 96px; padding: 0 16px 18px; font-size: clamp(1.75rem, 8vw, 3rem); }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-img { height: 50svh; }
  .foot-menu { padding: 48px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
