/* The basics: colours and fonts, the page's scroll steps, the fixed stage the sections sit in, the top
   bar and buttons. Each section has its own stylesheet; phone layouts are at the end of each file. */

:root {
  --bg: #efe3d7;               /* the hero */
  --bg-deep: #e2cfbf;
  --cream: #f4ece3;
  --card: #fffaf4;
  --sand: #eadccb;
  --blush: #f3e3e5;
  --ink: #1f2433;
  --ink-soft: #4a4f5e;
  --muted: #6b6560;
  --accent: #c2553f;           /* the hero cards' headings */
  --mauve: #9e5462;            /* the main accent */
  --night: #1b1624;
  --black: #0e0b0b;
  --red: #b3141c;
  --gold: #dcb872;
  --ease: cubic-bezier(.22, .8, .3, 1);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html, body { background: var(--bg); overscroll-behavior-y: none; }
body { color: var(--ink); font-family: var(--sans); overflow-x: hidden; }
:focus-visible { outline: 2px solid var(--mauve); outline-offset: 3px; }

/* the scroll steps: one invisible full-height section per step (scroll-steps.js); scrolling stops at
   every one, except while scrolling back up */
html { scroll-snap-type: y mandatory; }
html.scroll-free { scroll-snap-type: none; }
.track > div { height: 100vh; scroll-snap-align: start; scroll-snap-stop: always; }
/* on a touch screen a step is half a screen of swiping, so a short swipe moves on too (the padding lets
   the last step be scrolled to) */
@media (pointer: coarse) {
  .track > div { height: 50vh; }
  .track { padding-bottom: 50vh; }
}

/* the stage: one fixed screen, with a full-screen scene for each section on it */
.stage { position: fixed; inset: 0; overflow: clip; background: radial-gradient(120% 90% at 50% 40%, var(--bg) 0%, var(--bg-deep) 100%); }
.chapters { position: absolute; inset: 0; }
.chapter {
  position: absolute; inset: 0; overflow: clip;           /* (clip: never scrolled sideways by a focus) */
  opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s;
}
.chapter.is-active { opacity: 1; visibility: visible; transition: opacity .8s ease; }
.kicker { font: 600 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--mauve); }
.title { font-family: var(--serif); font-style: italic; font-weight: 400; line-height: .92; letter-spacing: -.02em; }

/* shared motion: a line drawing itself downward (under "keep scrolling" cues), and a gentle bob (prompts) */
@keyframes hint-line {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@keyframes prompt { 50% { transform: translate(-50%, -4px); } }

/* a fine paper grain over everything */
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------- the top bar */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 clamp(16px, 3vw, 40px);
  color: var(--ink); transition: color .6s ease;
}
html[data-tone="dark"] .bar { color: var(--cream); }
.bar-name { font-family: var(--serif); font-style: italic; font-size: 40px; line-height: 1; text-decoration: none; color: inherit; }
.bar-nav { display: flex; gap: 2px; margin: 0 auto; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, currentColor 7%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bar-nav button {
  font: 500 13px/1 var(--sans); color: inherit; background: none; border: 0; cursor: pointer;
  padding: 9px 14px; border-radius: 999px; opacity: .6; transition: opacity .3s, background .3s;
}
.bar-nav button:hover { opacity: 1; }
.bar-nav button[aria-current="true"] { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.bar-cta { display: flex; gap: 8px; margin-left: 0; }
.bar .bar-menu { display: none; }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 31; background: var(--mauve);
  transform-origin: 0 50%; transform: scaleX(0); transition: transform .6s var(--ease); }

.btn {
  display: inline-block; font: 500 14px/1 var(--sans); color: inherit; text-decoration: none; cursor: pointer;
  padding: 11px 18px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: none; transition: background .3s, color .3s, border-color .3s;
}
.btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.btn-solid { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-solid:hover { background: var(--mauve); border-color: var(--mauve); }
html[data-tone="dark"] .bar .btn-solid { background: var(--cream); color: var(--ink); border-color: var(--cream); }

/* ---------------------------------------------------------------- phones and tablets */
@media (max-width: 900px) {
  .bar { gap: 12px; }
  .bar-nav { display: none; }
  .bar-cta { margin-left: auto; }
  .bar-cta .btn[data-cv] { display: none; }
  .bar .bar-menu { display: inline-block; }
  html.menu-open .bar-nav {
    display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 60px; right: 16px; min-width: 180px;
    padding: 8px; border-radius: 18px; background: var(--cream); color: var(--ink); box-shadow: 0 18px 40px rgba(0, 0, 0, .2);
  }
  html.menu-open .bar-nav button { text-align: left; font-size: 15px; padding: 12px 14px; }
  .btn { padding: 10px 15px; }
}

/* less motion: everything simply appears */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01s !important; transition-delay: 0s !important;
    animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  }
}
