/* ============================================================================
   Rumborak — Academic Industrial
   ----------------------------------------------------------------------------
   Hand-written from the tokens in DESIGN.md. The Stitch export loaded Tailwind
   from cdn.tailwindcss.com, which is a browser-side JIT compiler meant only for
   prototyping — it shipped ~3MB and rebuilt the stylesheet on every page load.
   Everything it generated is reproduced here as ~15KB of static CSS.

   Where DESIGN.md and the export's inline Tailwind config disagreed, the inline
   config won, because that is what actually rendered screen.png:
     - body font is Hanken Grotesk (DESIGN.md said Anybody)
     - --radius-full is 0.75rem (DESIGN.md said 9999px)
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Colour. The palette is a deep midnight blue over warm parchment, with
     amber reserved for accents. */
  --surface: #fef9ef;
  --surface-variant: #e7e2d8;
  --surface-container: #f2ede3;
  --on-surface: #1d1c16;
  --on-surface-variant: #44474d;

  --primary: #021124;
  --primary-container: #17263a;
  --on-primary: #ffffff;

  --secondary: #8c4f00;
  --on-secondary: #ffffff;

  --outline: #75777d;
  --outline-variant: #c5c6cd;
  --silver-slate: #94a3b8;
  --parchment-white: #fdfcfb;

  --error: #ba1a1a;

  /* Type */
  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing — an 8px base grid, per DESIGN.md */
  --unit: 8px;
  --gutter: 24px;
  --margin-edge: 32px;
  --section-gap: 120px;
  --container-max: 1280px;
  --header-h: 80px;

  /* Shape */
  --radius: 0.125rem;
  --radius-lg: 0.25rem;
  --radius-xl: 0.5rem;
  --radius-full: 0.75rem;
}

@media (max-width: 767px) {
  :root {
    --margin-edge: 20px;
    --section-gap: 72px;
  }
}

/* --- Reset ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, figure { margin: 0; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

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

/* Anything scrolled to via an anchor must clear the fixed header, or the
   heading lands underneath it. */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* --- Utilities ------------------------------------------------------------ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--margin-edge);
  z-index: 100;
  padding: 12px 20px;
  background: var(--primary-container);
  color: var(--on-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--margin-edge);
}

/* --- Typography ----------------------------------------------------------- */

.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4.5rem); /* 40 → 72px */
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); /* 17 → 20px */
  line-height: 1.6;
  color: var(--on-surface-variant);
}

.body-md { font-size: 1rem; line-height: 1.6; }

/* Small monospaced caps — the "industrial" half of the design system. */
.label-caps {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The pill/eyebrow above each section heading. */
.eyebrow {
  display: inline-block;
  padding: 8px 24px;
  background: var(--primary-container);
  color: var(--on-primary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
}
.eyebrow--amber { background: var(--secondary); color: var(--on-secondary); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.btn--primary {
  background: var(--primary-container);
  color: var(--on-primary);
}
.btn--primary:hover { opacity: 0.9; }

.btn--outline {
  background: transparent;
  border-color: var(--primary-container);
  color: var(--primary-container);
}
.btn--outline:hover {
  background: var(--primary-container);
  color: var(--on-primary);
}

.btn--sm { padding: 8px 24px; }
.btn--block { width: 100%; }

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(254, 249, 239, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--margin-edge);
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

/* Desktop nav sits dead-centre regardless of how wide the wordmark gets. */
.site-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--on-surface-variant);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.nav-link:hover { color: var(--secondary); }
.nav-link.is-active {
  color: var(--primary);
  font-weight: 700;
  border-bottom-color: var(--primary);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  color: var(--primary);
  cursor: pointer;
}

/* --- Mobile menu ---------------------------------------------------------- */

.mobile-nav {
  display: none;
  position: absolute;
  inset: var(--header-h) 0 auto 0;
  flex-direction: column;
  padding: 8px var(--margin-edge) 24px;
  background: rgba(254, 249, 239, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.mobile-nav[data-open="true"] { display: flex; }

/* :not(.btn) matters — without it these rules repaint the Contact button's
   text in --primary over its own --primary-container fill, i.e. navy on navy. */
.mobile-nav a:not(.btn) {
  padding: 14px 0;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--primary);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.mobile-nav a:not(.btn):last-of-type { border-bottom: 0; }
.mobile-nav .btn { margin-top: 16px; }

@media (max-width: 1023px) {
  /* Hide the header's own CTA only. A descendant selector here would also
     match the identical button inside the mobile panel and collapse it to
     0x0, which is exactly what it used to do. */
  .site-nav,
  .site-header__cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* --- Hero ----------------------------------------------------------------- */

/* min-height, never height. The export used a fixed 100vh here and on every
   other section, which clipped content on short or zoomed viewports. */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 48px) var(--margin-edge) 64px;
  overflow: hidden;
  text-align: center;
}

@supports not (min-height: 100svh) {
  .hero { min-height: 100vh; }
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* The treated portrait and its wash sit on top and fade away on hover to
   reveal the untreated one underneath. */
.hero__img--top { z-index: 1; }

.hero__wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(253, 252, 251, 0.3),
    rgba(253, 252, 251, 0.8)
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

/* The hover reveal, guarded three ways: hover-capable pointers only (on touch
   it could never fire), and reduced-motion off (a 0.7s cross-fade is motion).
   Folding the reduced-motion test into this one query, rather than unpicking it
   further down, is what stops the treatment ever being half-applied — the copy
   can only turn cream in the same breath as the ground it has to sit on.

   The photograph behind the copy runs from pure black to near-white, so the
   text-shadow is load-bearing rather than decorative: it is the only thing
   holding the cream off the highlights it crosses. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero__img--top,
  .hero__wash,
  .hero__title,
  .hero__copy,
  .hero .btn--outline {
    transition: opacity 0.7s ease-in-out, color 0.7s ease-in-out,
                border-color 0.7s ease-in-out, text-shadow 0.7s ease-in-out;
  }

  .hero:hover .hero__img--top,
  .hero:hover .hero__wash { opacity: 0; }

  .hero:hover .hero__title,
  .hero:hover .hero__copy {
    color: var(--surface);
    text-shadow: 0 1px 2px rgba(2, 17, 36, 0.92),
                 0 2px 18px rgba(2, 17, 36, 0.8),
                 0 0 48px rgba(2, 17, 36, 0.65);
  }

  /* The outlined button is drawn in ink and would vanish with the rest. */
  .hero:hover .btn--outline {
    border-color: var(--surface);
    color: var(--surface);
  }

  /* Must come last: same specificity as the rule above, and this is the state
     that wins when the pointer is actually on the button. */
  .hero .btn--outline:hover {
    background: var(--surface);
    border-color: var(--surface);
    color: var(--primary);
    text-shadow: none;
  }
}

.hero__content {
  position: relative;
  z-index: 3;
  max-width: 56rem;
  margin-inline: auto;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3rem, 1.9rem + 5.5vw, 6rem); /* 48 → 96px */
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin-bottom: 24px;
}

.hero__copy { margin-bottom: 40px; }

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

@media (min-width: 640px) {
  .hero__actions { flex-direction: row; }
  .hero__actions .btn { min-width: 180px; }
}

@media (max-width: 639px) {
  .hero__actions .btn { width: 100%; }
}

/* The hero copy carries hard line breaks tuned for wide viewports. Below the
   md breakpoint they would produce a ragged four-line block, so they collapse
   and the paragraph wraps naturally. */
@media (max-width: 767px) {
  .hero__copy br { display: none; }
}

/* --- Sections ------------------------------------------------------------- */

.section {
  padding-block: var(--section-gap);
}

.section--amber { background: var(--secondary); color: var(--surface); }
.section--muted { background: var(--surface-variant); }
.section--ink   { background: var(--primary-container); color: var(--surface); }

.section__head {
  text-align: center;
  margin-bottom: 64px;
}
.section__head .display { margin-bottom: 24px; }

.section--amber .display,
.section--ink .display { color: var(--surface); }
.section:not(.section--amber):not(.section--ink) .display { color: var(--primary); }

/* --- The Incentives ------------------------------------------------------- */

.narrative {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
}

@media (min-width: 1024px) {
  .narrative {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--gutter);
  }
  .narrative__body   { grid-column: 2 / span 7; }
  .narrative__figure { grid-column: 10 / span 3; }
}

.narrative__eyebrow { margin-bottom: 24px; }
.narrative__body .display { margin-bottom: 24px; }

.prose > p + p { margin-top: 24px; }

.narrative__figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

/* --- Card grids ----------------------------------------------------------- */

.grid-2,
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
}

.card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.card__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card__text { font-size: 16px; line-height: 1.6; }

/* --- Experience tiles ----------------------------------------------------- */

.tile {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tile img { width: 100%; height: auto; display: block; }

/* The export placed white labels straight onto photography, which fails
   contrast wherever the image happens to be light. A scrim fixes it without
   touching the layout. */
.tile__label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 16px 16px;
  font-size: 20px;
  font-weight: 700;
  text-align: right;
  color: var(--surface);
  background: linear-gradient(to top, rgba(2, 17, 36, 0.75), transparent);
}

/* --- The Outcome ---------------------------------------------------------- */

.outcome { text-align: center; }
.outcome__eyebrow { margin-bottom: 40px; }

.outcome__frame {
  max-width: 56rem;
  margin-inline: auto;
}

.outcome__frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--surface);
  border-radius: var(--radius-xl);
}

.outcome__caption {
  margin-top: 32px;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--surface-variant);
}

.outcome__note {
  margin-top: 8px;
  font-size: 16px;
  color: rgba(231, 226, 216, 0.8);
}

/* --- Contact -------------------------------------------------------------- */

.contact {
  max-width: 56rem;
  margin-inline: auto;
  padding-inline: var(--margin-edge);
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-block: var(--section-gap);
}

.contact .display { color: var(--primary); margin-bottom: 24px; }
.contact .lede { margin-bottom: 40px; }

.subscribe {
  max-width: 28rem;
  margin-inline: auto;
  text-align: left;
}

.subscribe__field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--primary-container);
}

.subscribe__field svg { flex: none; color: var(--primary); }

.subscribe__field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 8px;
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--primary);
}
.subscribe__field input::placeholder {
  color: var(--silver-slate);
  text-transform: uppercase;
}
.subscribe__field input:focus { outline: none; }
.subscribe__field:focus-within {
  border-bottom-color: var(--secondary);
  box-shadow: 0 1px 0 0 var(--secondary);
}

.subscribe button {
  font-family: var(--font-body);
  font-size: 14px;
}
.subscribe button[disabled] { opacity: 0.55; cursor: progress; }

/* Bot bait. Hidden from people and from assistive tech; anything that fills it
   in is not a person. */
.subscribe__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.subscribe__status {
  margin-top: 16px;
  min-height: 1.4em;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
}
.subscribe__status[data-state="ok"]    { color: var(--secondary); }
.subscribe__status[data-state="error"] { color: var(--error); }

/* --- Legal pages ---------------------------------------------------------- */

.legal {
  max-width: 44rem;
  margin-inline: auto;
  padding: calc(var(--header-h) + var(--section-gap)) var(--margin-edge) var(--section-gap);
}

.legal__eyebrow { margin-bottom: 24px; }
.legal .display { color: var(--primary); margin-bottom: 40px; }

.legal h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  line-height: 1.2;
  color: var(--primary);
  margin-top: 48px;
  margin-bottom: 16px;
}

.legal .prose > p { color: var(--on-surface-variant); }
.legal .prose > p + p { margin-top: 20px; }
.legal .prose > h2 + p { margin-top: 0; }

.legal__link {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal__meta {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--outline);
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-block: 64px;
  font-size: 14px;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gutter);
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--margin-edge);
  text-align: center;
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.site-footer__links a {
  color: var(--on-surface-variant);
  opacity: 0.8;
  transition: color 0.25s ease, opacity 0.25s ease;
}
.site-footer__links a:hover { color: var(--secondary); opacity: 1; }

.site-footer__legal { color: var(--on-surface-variant); opacity: 0.8; }

/* --- Motion preferences --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* The hero reveal needs no override here — its whole query is gated on
     prefers-reduced-motion: no-preference, so it simply never applies and the
     hero rests on its intended composition. */
}
