/* ------------------------------------------------------------------
   March2Wolf — foundations
   Tokens, reset, typography and the small shared pieces (buttons,
   badges, fields) that every page builds from.
   ------------------------------------------------------------------ */

/* ------------------------------------------------------------------
   Typefaces

   All three are served from this folder rather than from Google, so
   the site renders correctly offline and from a double-clicked file,
   loads without two extra DNS lookups, and tells nobody else who is
   reading it.

   Montserrat and Fraunces are variable fonts clipped to the weights
   actually used here. Each is split by script: the latin file is the
   one that loads, and latin-ext is fetched only if a page contains an
   accented character.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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;
}

@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/montserrat-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* Reached only by *emphasis* in a Journey entry, so it never loads
   unless a page actually sets something in italic. */
@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/montserrat-italic-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  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;
}

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
  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;
}

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-latin-ext.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* The brand's own face. It carries capitals only — lowercase letters
   render as capitals — so it is used for the uppercase micro-type and
   nothing else. It has no bold, no ampersand and no curly quotes; the
   sans behind it in the stack catches any glyph it is missing. */
@font-face {
  font-family: "The March Font";
  src: url("../assets/fonts/the-march-font.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour — drawn from the logo: charcoal, wolf grey, bronze arc */
  --ink-900: #0d1012;
  --ink-800: #121619;
  --ink-700: #171c20;
  --ink-600: #1e252a;
  --ink-500: #272f35;

  --fog-100: #f1efea;
  --fog-300: #c7c9c7;
  --fog-500: #8d9492;
  --fog-700: #5f6665;

  --wolf: #a7abac;
  --bronze: #b98b5e;
  --bronze-bright: #d8ae7e;
  --bronze-deep: #8a6540;

  --sage: #86a795;

  --line: rgba(241, 239, 234, 0.1);
  --line-strong: rgba(241, 239, 234, 0.18);
  --glow: rgba(185, 139, 94, 0.14);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-brand: "The March Font", var(--font-sans);

  --step-eyebrow: 0.75rem;
  --step-small: 0.875rem;
  --step-body: 1.0625rem;
  --step-lead: clamp(1.125rem, 1.6vw, 1.3rem);
  --step-h3: clamp(1.2rem, 1.8vw, 1.45rem);
  --step-h2: clamp(1.75rem, 3.4vw, 2.6rem);
  --step-h1: clamp(2.25rem, 5vw, 3.6rem);
  --step-display: clamp(2.6rem, 7.5vw, 5.25rem);

  /* Space */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: clamp(5rem, 11vw, 9rem);

  /* Shape */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --wrap: 1180px;
  --wrap-narrow: 720px;
  --gutter: 1.25rem;

  --header-h: 4.75rem;
  --header-h-compact: 3.75rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (min-width: 48rem) {
  :root {
    --gutter: 2rem;
  }
}

/* --- reset -------------------------------------------------------- */

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background-color: var(--ink-900);
  color: var(--fog-100);
  font-family: var(--font-sans);
  font-size: var(--step-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-sm);
  text-wrap: balance;
}

h1 { font-size: var(--step-h1); }
h2 { font-size: var(--step-h2); }
h3 { font-size: var(--step-h3); line-height: 1.25; }

p { margin: 0 0 var(--space-sm); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--bronze-bright);
  text-decoration-color: rgba(216, 174, 126, 0.4);
  text-underline-offset: 0.2em;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

a:hover {
  color: var(--fog-100);
  text-decoration-color: currentColor;
}

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

::selection {
  background: rgba(185, 139, 94, 0.3);
  color: var(--fog-100);
}

/* --- layout helpers ------------------------------------------------ */

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

.wrap-narrow {
  width: 100%;
  max-width: var(--wrap-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-3xl);
}

.section-tight {
  padding-block: var(--space-2xl);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 200;
  transform: translateY(-120%);
  background: var(--bronze);
  color: var(--ink-900);
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none;
  transition: transform 0.18s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--ink-900);
}

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

/* --- type helpers --------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 var(--space-sm);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.eyebrow-plain::before {
  display: none;
}

.lead {
  font-size: var(--step-lead);
  line-height: 1.55;
  color: var(--fog-300);
  max-width: 54ch;
}

.muted {
  color: var(--fog-500);
}

.measure {
  max-width: 62ch;
}

/* --- buttons --------------------------------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fog-100);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--step-small);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover {
  color: var(--btn-fg);
  border-color: var(--bronze);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  --btn-bg: var(--bronze);
  --btn-fg: var(--ink-900);
  --btn-border: var(--bronze);
}

.btn-primary:hover {
  --btn-bg: var(--bronze-bright);
  --btn-fg: var(--ink-900);
  --btn-border: var(--bronze-bright);
}

.btn-ghost {
  --btn-border: transparent;
  padding-inline: 0.75rem;
}

.btn-ghost:hover {
  --btn-border: var(--line-strong);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-arrow::after {
  content: "";
  width: 0.85em;
  height: 0.85em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--arrow-mask) center / contain no-repeat;
  mask: var(--arrow-mask) center / contain no-repeat;
  transition: transform 0.2s var(--ease);
  --arrow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h9M8.5 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.btn-arrow:hover::after {
  transform: translateX(3px);
}

/* --- badges & chips --------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem 0.25rem 0.55rem;
  border: 1px solid var(--badge-line, var(--line-strong));
  border-radius: var(--r-pill);
  background: var(--badge-bg, transparent);
  color: var(--badge-fg, var(--fog-300));
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.badge-soon {
  --badge-fg: var(--wolf);
  --badge-line: rgba(167, 171, 172, 0.3);
  --badge-bg: rgba(167, 171, 172, 0.08);
}

.badge-dev {
  --badge-fg: var(--bronze-bright);
  --badge-line: rgba(216, 174, 126, 0.32);
  --badge-bg: rgba(185, 139, 94, 0.1);
}

.badge-live {
  --badge-fg: var(--sage);
  --badge-line: rgba(134, 167, 149, 0.32);
  --badge-bg: rgba(134, 167, 149, 0.1);
}

.badge-hidden {
  --badge-fg: var(--fog-700);
  --badge-line: rgba(95, 102, 101, 0.35);
}

.badge-collab {
  --badge-fg: var(--fog-300);
  --badge-line: var(--line-strong);
}

.badge-collab::before {
  display: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fog-500);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.chip:hover {
  color: var(--fog-100);
  border-color: var(--line-strong);
}

.chip[aria-pressed="true"] {
  color: var(--ink-900);
  background: var(--fog-100);
  border-color: var(--fog-100);
}

.tag {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog-500);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.6rem;
}

/* --- surfaces ---------------------------------------------------------- */

.panel {
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* --- fields ------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--space-sm);
}

.field > label,
.field-label {
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--fog-300);
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--fog-500);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(13, 16, 18, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--fog-100);
  font-size: var(--step-small);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--fog-700);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: rgba(241, 239, 234, 0.26);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--bronze);
  background: rgba(13, 16, 18, 0.9);
  box-shadow: 0 0 0 3px var(--glow);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6.5l4 4 4-4' fill='none' stroke='%238d9492' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
}

/* --- motion ------------------------------------------------------------- */

/* The fade-in is hung off `.js`, which ui.js puts on <html> while the
   head is still parsing. The pages now ship with their words already in
   them, so a visitor whose scripts never ran must see those words and
   not an empty screen - and an unconditional `opacity: 0` here is
   exactly how a page full of text renders blank. Nothing is hidden
   unless the code that shows it again is running. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@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;
  }

  /* Has to out-weigh `.js .reveal` above, so it carries `.js` too. */
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
