/* ==========================================================================
   Convexed · styles.css

   1. Tokens: colours, fonts, sizes, spacing, motion   <- edit colours here
   2. Font
   3. Base and browser surfaces
   4. Shared pieces: layout, headings, buttons, links
   5. Header and theme switch
   6. Hero
   7. Services
   8. Approach
   9. Contact
   10. Footer
   11. 404 page
   12. Motion (entrances; everything here respects reduced motion)
   ========================================================================== */


/* ==========================================================================
   1. Tokens
   Dark is the default. Light mode is data-theme="light" on <html> (script.js).
   The canvas reads --dots, --ink and --accent, so the bowl follows these too.
   If you change --accent, also update favicon.svg and assets/bowl.svg.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  --bg:          #15130f;  /* warm near-black page ground */
  --bg-raised:   #1f1c17;  /* one tone step up: alternate service bands, code */
  --ink:         #e8e6e2;  /* text, a touch warm but not cream (14.9:1 on --bg) */
  --ink-soft:    #aba59a;  /* secondary text, labels (7.6:1 on --bg) */
  --dots:        #9e978b;  /* the point clouds */

  --accent:       #ff7a3d; /* the one accent: signal orange */
  --accent-hover: #ff9361;
  --on-accent:    #170b05; /* text on accent-filled buttons */

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:          #f1f1ee;
  --bg-raised:   #e6e6e1;
  --ink:         #151513;
  --ink-soft:    #56544e;
  --dots:        #7d7a73;

  --accent:       #b33c0a; /* deeper burnt orange keeps 4.5:1 on the light ground */
  --accent-hover: #93300a;
  --on-accent:    #ffffff;

  color-scheme: light;
}

:root {
  /* Fonts: one self-hosted family; mono is only used inside real code samples. */
  --font-sans: "Epilogue", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace; /* taste-skill-ignore: real code samples only */

  /* Five type sizes, no more */
  --size-display: clamp(2.75rem, 1.15rem + 6.6vw, 6rem);
  --size-h2:      clamp(2rem, 1.3rem + 2.9vw, 3.75rem);
  --size-h3:      clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --size-body:    1.125rem;
  --size-small:   0.9375rem;

  /* Space */
  --gutter:  clamp(1.25rem, 0.6rem + 2.6vw, 3rem);
  --section: clamp(6.5rem, 3rem + 11vw, 13rem);
  --max:     88rem;

  /* Motion (custom curves; the built-in ones are too weak) */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press:   140ms;
  --dur-hover:   180ms;
}


/* ==========================================================================
   2. Font: Epilogue (variable 100–900), self-hosted, SIL OFL 1.1
   Source: @fontsource-variable/epilogue 5.3.0 (see fonts/OFL-Epilogue.txt)
   ========================================================================== */

@font-face {
  font-family: "Epilogue";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/epilogue-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ==========================================================================
   3. Base and browser surfaces
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--dots) var(--bg);
  accent-color: var(--accent);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.55;
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--accent);
  color: var(--on-accent);
}

h1, h2, h3 {
  margin: 0;
  font-weight: 620;
  line-height: 1.06;
  text-wrap: balance;
}

h3 {
  line-height: 1.18;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 0.07em;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

button {
  font: inherit;
  color: inherit;
}

/* `hidden` must win over the display rules below (JS reveals some controls). */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus-visible {
  transform: none;
}


/* ==========================================================================
   4. Shared pieces
   ========================================================================== */

.section {
  padding: var(--section) var(--gutter) 0;
  max-width: var(--max);
  margin-inline: auto;
}

.section-title {
  font-size: var(--size-h2);
  letter-spacing: -0.03em;
}

.section-intro {
  max-width: 40ch;
  font-size: var(--size-h3);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Buttons: fully round, one fill colour. Press feedback per Emil: scale 0.97. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 999px;
  font-size: var(--size-body);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out),
              background-color var(--dur-hover) ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background-color: var(--accent);
  color: var(--on-accent);
}

/* Text-style actions: on hover the underline draws back toward its start */
.text-btn,
.text-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--size-body);
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out);
}

.text-btn::after,
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.55rem;
  height: 0.09em;
  background-color: currentColor;
  transform-origin: left center;
  transition: transform 260ms var(--ease-out);
}

.text-btn:active,
.text-link:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    background-color: var(--accent-hover);
  }

  .text-btn:hover::after,
  .text-link:hover::after {
    transform: scaleX(0.35);
  }
}


/* ==========================================================================
   5. Header and theme switch
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin-inline: auto;
  padding: 1.25rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
}

.brand-dots {
  fill: var(--ink);
}

.brand-optimum {
  fill: var(--accent);
}

.brand-name {
  font-size: var(--size-body);
  font-weight: 640;
  letter-spacing: -0.015em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 0.3rem + 1.6vw, 2rem);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink-soft);
  font-size: var(--size-small);
  font-weight: 520;
  text-decoration: none;
  transition: color var(--dur-hover) ease;
}

/* On phones only "Contact" stays; the page is short enough to scroll. */
.nav-link--wide {
  display: none;
}

@media (min-width: 40rem) {
  .nav-link--wide {
    display: inline-flex;
  }
}

@media (hover: hover) and (pointer: fine) {
  .nav-link:hover {
    color: var(--ink);
  }
}

/* The switch: a physical toggle. Checked (knob right) = dark theme. */
.theme-switch {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.theme-switch-track {
  position: relative;
  display: block;
  width: 3.25rem;
  height: 1.875rem;
  border-radius: 999px;
  background-color: var(--bg-raised);
  transition: transform var(--dur-press) var(--ease-out);
}

.theme-switch:active .theme-switch-track {
  transform: scale(0.95);
}

.theme-icon {
  position: absolute;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: -0.45rem;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon--sun  { left: 0.5rem; }
.theme-icon--moon { right: 0.5rem; }

.theme-switch-knob {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background-color: var(--ink);
  transition: transform 320ms var(--ease-out);
}

/* Knob sits over the icon of the CURRENT theme, so the visible icon is the other one. */
.theme-switch[aria-checked="true"] .theme-switch-knob {
  transform: translateX(1.375rem);
}

:root:not(.js) .theme-switch {
  display: none;
}


/* ==========================================================================
   6. Hero
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(15rem, 1fr) auto;
  min-height: calc(100vh - 5.25rem);
  min-height: calc(100svh - 5.25rem);
  /* Full viewport width so the bowl can meet both edges like a horizon; the
     padding keeps the copy aligned with the rest of the page. */
  padding: clamp(1.5rem, 1rem + 4vh, 4.5rem) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))) clamp(1.25rem, 1rem + 2vh, 2.5rem);
}

/* The canvas spans the whole hero, edge to edge. script.js fits the bowl to
   the height of .hero-stage and stretches it to the full width. */
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  touch-action: pan-y; /* vertical swipes still scroll the page on phones */
}

.hero-canvas.is-aiming {
  cursor: pointer;
}

/* Copy sits above the canvas but lets pointer events fall through around it. */
.hero-copy {
  pointer-events: none;
}

.hero-copy > * {
  pointer-events: auto;
}

.hero-title {
  /* Capped by width so "Hard problems," always fits on one line (two-line headline). */
  font-size: min(var(--size-display), 12vw);
  font-weight: 640;
  line-height: 1;
  letter-spacing: -0.035em;
}

.hero-title .line {
  display: block;
}

.hero-side {
  margin-top: clamp(1.25rem, 0.8rem + 1.5vw, 2rem);
}

.hero-lead {
  max-width: 40ch;
  font-size: var(--size-h3);
  line-height: 1.38;
  letter-spacing: -0.01em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
}

/* Layout only: it reserves the bowl's space but must let pointer events
   through to the canvas underneath. */
.hero-stage {
  min-height: 15rem;
  pointer-events: none;
}

/* Without JavaScript, a static drawing of the bowl takes the canvas's place. */
:root:not(.js) .hero-stage {
  background: url("assets/bowl.svg") center bottom / contain no-repeat;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 2rem;
  color: var(--ink-soft);
  font-size: var(--size-small);
  line-height: 1.5;
}

.hero-caption {
  max-width: 62ch;
}

/* Filled in by script.js after each drop: where the point started and how
   many descent steps it took. Real output of the interaction, so tabular figures. */
.hero-readout {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hero-readout {
  min-height: 1.5em; /* reserved, so the first drop never shifts the layout */
}

.hero-readout:empty {
  visibility: hidden;
}

/* Phones: a tighter top so the bowl shows in the first screen. */
@media (max-width: 40rem) {
  .site-header {
    padding-block: 0.75rem;
  }

  .hero {
    padding-top: 0.75rem;
  }

  /* Room for a two-line readout, reserved before the first drop. */
  .hero-readout {
    min-height: 3em;
  }

  .hero-lead {
    font-size: var(--size-body);
    line-height: 1.5;
  }

  .hero-actions {
    gap: 0.5rem 1rem;
    margin-top: 1.25rem;
  }

  /* Both actions on one row from 360px up. */
  .hero-actions .btn,
  .hero-actions .text-btn {
    font-size: var(--size-small);
  }

  .hero-actions .btn {
    min-height: 3rem;
    padding-inline: 1.1rem;
  }
}

:root:not(.js) .caption-js {
  display: none;
}

/* Desktop: a low horizon. Type owns the top band (headline left, the lead and
   actions beside it), and the bowl owns everything below, edge to edge. */
@media (min-width: 64rem) {
  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
  }

  .hero-copy,
  .hero-stage,
  .hero-foot {
    grid-column: 1 / -1;
  }

  .hero-copy {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
    align-items: end;
  }

  .hero-copy .hero-title {
    grid-column: 1 / span 7;
    font-size: min(var(--size-display), 7vw); /* fits its seven columns */
  }

  .hero-side {
    grid-column: 8 / -1;
    margin-top: 0;
    padding-bottom: 0.4rem;
  }
}

/* Wide screens: the caption fits on one line. */
@media (min-width: 72rem) {
  .hero-caption {
    max-width: none;
  }
}


/* ==========================================================================
   7. Services: rows read across like a timetable
   ========================================================================== */

/* The services section runs full-bleed so alternate bands can step the ground
   tone edge to edge; its contents keep to the page width. */
.services {
  max-width: none;
  padding-inline: 0;
}

.services .section-head,
.services-note {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.service {
  padding: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) var(--gutter);
}

.section-head {
  display: grid;
  gap: 1.5rem;
  margin-bottom: clamp(3rem, 2rem + 4vw, 6rem);
}

.service-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service:nth-child(even) {
  background-color: var(--bg-raised);
}

.service-inner {
  display: grid;
  align-items: start;
  gap: 1.75rem;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin-inline: auto;
}

.service-name {
  font-size: var(--size-h3);
  font-weight: 620;
  letter-spacing: -0.02em;
}

.field-label {
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
  font-size: var(--size-small);
  font-weight: 520;
}

.service-field p:not(.field-label) {
  max-width: 40ch;
}

.service-work ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-work li {
  padding-block: 0.15rem;
}

/* Illustrative code: separated from the band by a tone step only */
.service-sample {
  margin: 0;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  border-radius: 14px;
  background-color: var(--bg-raised);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--size-small);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  tab-size: 2;
}

.service:nth-child(even) .service-sample {
  background-color: var(--bg);
}

.service-sample .k {
  color: var(--ink);
}

/* Very narrow phones: wrap long sample lines rather than hide them behind a
   sideways scroll that keyboard users cannot reach. */
@media (max-width: 25rem) {
  .service-sample {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

.services-note {
  margin-top: 2rem;
  color: var(--ink-soft);
  font-size: var(--size-small);
}

@media (min-width: 48rem) {
  .section-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
  }

  .section-head .section-title {
    grid-column: 1 / span 6;
  }

  .section-head .section-intro {
    grid-column: 7 / -1;
  }

  .service-inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 2.5rem;
  }

  .service-name    { grid-column: 1 / span 12; }
  .service-field   { grid-column: span 6; }
  .service-work    { grid-column: 1 / span 6; }
  .service-sample  { grid-column: 7 / span 6; align-self: start; }
}

/* Wide screens: the timetable row reads Name | When | You get, and the
   specifics sit under it: the work list under the name, the sample beside. */
@media (min-width: 72rem) {
  .service-name   { grid-column: 1 / span 4; }
  .service-field  { grid-column: span 4; }
  .service-work   { grid-column: 1 / span 4; }
  .service-sample { grid-column: 5 / -1; }
}


/* ==========================================================================
   8. Approach: the principles sit along one descent
   ========================================================================== */

.approach {
  display: grid;
  gap: 2.5rem;
}

.approach-aside {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.descent {
  width: 100%;
  max-width: 26rem;
  height: auto;
  margin-top: 1rem;
  overflow: visible;
}

.descent-dots {
  fill: var(--dots);
}

.descent-station {
  fill: var(--bg);
  stroke: var(--dots);
  stroke-width: 1.5;
  transition: stroke var(--dur-hover) ease;
}

.descent-station.is-passed {
  stroke: var(--ink);
}

.descent-marker {
  fill: var(--accent);
  transition: transform 900ms var(--ease-in-out);
}

.principles {
  margin: 0;
  padding: 0;
  list-style: none;
}

.principle {
  padding-block: 1.75rem;
}

.principle-title {
  margin-bottom: 0.6rem;
  font-size: var(--size-h3);
  font-weight: 620;
  letter-spacing: -0.02em;
}

.principle p {
  max-width: 44ch;
}

@media (min-width: 64rem) {
  .approach {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
  }

  .approach-aside {
    grid-column: 1 / span 5;
    position: sticky;
    top: 12vh;
    align-self: start;
  }

  .principles {
    grid-column: 7 / -1;
    padding-top: 6vh;
  }

  /* Room to scroll, so the marker can travel one station per principle. */
  .principle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 24vh;
  }
}


/* ==========================================================================
   9. Contact: the page closes on a full-width band of the raised tone
   ========================================================================== */

.contact {
  max-width: none;
  margin-top: var(--section);
  padding: clamp(4.5rem, 2.5rem + 7vw, 9rem) var(--gutter);
  background-color: var(--bg-raised);
}

.contact-inner {
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin-inline: auto;
}

.contact-intro {
  max-width: 46ch;
  margin-top: 1.5rem;
}

/* The address itself is the action: large, ink, with an accent underline. */
.email-link {
  display: inline-block;
  margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  font-size: min(var(--size-display), 8.6vw);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
  transition: color var(--dur-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
  .email-link:hover {
    color: var(--accent);
  }
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 1.75rem;
}

.contact-inner {
  display: grid;
  align-items: start;
}

.contact-next {
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
}

.contact-next-title {
  margin-bottom: 1rem;
  font-size: var(--size-h3);
  letter-spacing: -0.02em;
}

/* Order is real, so it is an <ol>; the order reads from position, not numerals. */
.contact-steps {
  display: grid;
  gap: 0.9rem;
  max-width: 38ch;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Desktop: the address and its actions on the left, what happens next on the right. */
@media (min-width: 64rem) {
  .contact-inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
  }

  .contact-inner > * {
    grid-column: 1 / -1;
  }

  .contact-inner > .section-title,
  .contact-inner > .contact-intro {
    grid-column: 1 / span 7;
  }

  /* Beside the heading and intro; the address below keeps the full width. */
  .contact-inner > .contact-next {
    grid-column: 9 / -1;
    grid-row: 1 / span 2;
    align-self: end;
    margin-top: 0;
  }
}

/* Copy button: the two labels cross-fade with a short blur (bridges the swap). */
.copy-btn {
  display: inline-grid;
}

.copy-label {
  grid-area: 1 / 1;
  transition: opacity 200ms ease, filter 200ms ease;
}

.copy-label[data-state="done"],
.copy-btn.is-done .copy-label[data-state="idle"] {
  opacity: 0;
  filter: blur(3px);
}

.copy-btn.is-done .copy-label[data-state="done"] {
  opacity: 1;
  filter: none;
}


/* ==========================================================================
   10. Footer
   ========================================================================== */

.site-footer {
  display: grid;
  gap: 0.75rem 2rem;
  max-width: var(--max);
  margin-inline: auto;
  padding: 2.5rem var(--gutter) 3rem;
  background-color: var(--bg);
  color: var(--ink-soft);
  font-size: var(--size-small);
}

.footer-name {
  color: var(--ink);
  font-weight: 640;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  font-variant-numeric: tabular-nums;
}

.footer-top {
  justify-self: start;
  font-size: var(--size-small);
  color: var(--ink-soft);
}

@media (min-width: 48rem) {
  .site-footer {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}


/* ==========================================================================
   11. 404 page
   ========================================================================== */

/* Header, main and footer share one viewport; main takes the space between. */
.page-404 {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.page-404 > .site-header,
.page-404 > .site-footer {
  width: 100%;
}

.notfound {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: start;
  gap: 1.25rem;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 1rem var(--gutter) 2rem;
}

.nf-curve {
  width: min(100%, 27rem);
  height: auto;
  margin-bottom: 0.5rem;
  overflow: visible;
}

.nf-dots {
  fill: var(--dots);
}

.nf-optimum {
  fill: none;
  stroke: var(--dots);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  transition: stroke var(--dur-hover) ease, fill 400ms ease;
}

.nf-optimum.is-reached {
  fill: var(--accent);
  stroke: var(--accent);
}

.nf-marble {
  fill: var(--accent);
}

.notfound .hero-title {
  max-width: 14ch;
  font-size: min(var(--size-display), 12vw, 6vw + 1rem);
  line-height: 1.06; /* free-wrapping display lines need room for descenders */
}

.notfound p:not(.hero-title) {
  max-width: 40ch;
  font-size: var(--size-h3);
  line-height: 1.38;
}

.notfound .btn {
  margin-top: 0.5rem;
}


/* ==========================================================================
   12. Motion
   One authored moment: the bowl (script.js). Besides it, only the hero copy
   rises in once on load, and controls answer hover and press. Sections below
   do not animate in: their content is simply there.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Hero: plays once on load */
  .js .reveal-load {
    animation: rise 800ms var(--ease-out) both;
  }

  .js .reveal-load[data-d="1"] { animation-delay: 60ms; }
  .js .reveal-load[data-d="2"] { animation-delay: 140ms; }
  .js .reveal-load[data-d="3"] { animation-delay: 200ms; }
  .js .reveal-load[data-d="4"] { animation-delay: 260ms; }

  /* Theme switch: a quick cross-fade of the whole page (View Transitions) */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 280ms;
    animation-timing-function: ease;
  }
}

/* Reduced motion: no travel. The descent marker jumps instead of gliding. */
@media (prefers-reduced-motion: reduce) {
  .descent-marker,
  .theme-switch-knob {
    transition: none;
  }
}

/* Starts already readable (60% opacity) and only travels a short way. */
@keyframes rise {
  from {
    opacity: 0.6;
    transform: translateY(14px);
  }
}
