/* ==========================================================================
   SPIRAL CAFE — CORE STYLESHEET
   Design tokens, reset, base typography, layout primitives.
   Component-level styles (nav, cards, carousel, forms) live in
   components.css. Breakpoint overrides live in responsive.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   FONT LOADING

   Brand direction: MD Nichrome (Mass-Driver) for display type.
   The licensed MD Nichrome web-font file was not supplied at build time
   (see README.md and BUILD-SPEC §16/§34). Rather than block the build,
   this is isolated behind a single @font-face block: drop the licensed
   .woff2 into assets/fonts/ and uncomment the rule below, and every
   headline on the site will switch to MD Nichrome automatically with
   zero markup or component changes elsewhere.

   Until then, --font-display falls back to Unbounded, chosen because it
   shares MD Nichrome's semi-geometric, semi-rounded proportions and
   unusually large x-height. This is a visual placeholder, not a
   permanent design decision.
   -------------------------------------------------------------------------- */

/*
@font-face {
  font-family: 'MD Nichrome';
  src: url('../assets/fonts/MDNichrome-Variable.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
*/

:root {
  /* ---- Brand color palette (per BUILD-SPEC §16 — do not add new hues) --- */
  --color-primary: #9d3e21;
  --color-white: #ffffff;
  --color-black: #000000;

  /* Derived depth/state tints — mixed from the palette above only */
  --color-primary-dark: color-mix(in srgb, var(--color-primary) 78%, black);
  --color-primary-deep: color-mix(in srgb, var(--color-primary) 45%, black);
  --color-primary-soft: color-mix(in srgb, var(--color-primary) 35%, white);
  --color-primary-tint: color-mix(in srgb, var(--color-primary) 12%, white);
  --color-black-soft: color-mix(in srgb, var(--color-black) 88%, white);
  --color-hairline: color-mix(in srgb, var(--color-white) 22%, transparent);
  --color-hairline-on-light: color-mix(in srgb, var(--color-black) 15%, transparent);
  /* For components that render on BOTH light and dark surfaces (review
     carousel, gallery placeholders): resolves against inherited text
     color, so it's correct wherever the component is dropped in without
     a per-surface override. */
  --color-hairline-adaptive: color-mix(in srgb, currentColor 22%, transparent);

  /* ---- Semantic surface roles ---- */
  --surface-primary: var(--color-primary);
  --surface-dark: var(--color-black);
  --surface-light: var(--color-white);
  --text-on-primary: var(--color-white);
  --text-on-dark: var(--color-white);
  --text-on-light: var(--color-black);

  /* ---- Typography ---- */
  --font-display: 'MD Nichrome', 'Unbounded', 'Segoe UI', sans-serif;
  --font-body: 'Manrope', 'Segoe UI', system-ui, sans-serif;

  --step-display-xl: clamp(2.75rem, 4vw + 1.75rem, 6.5rem);
  --step-display-lg: clamp(2.1rem, 3vw + 1.4rem, 4.25rem);
  --step-display-md: clamp(1.6rem, 2vw + 1.1rem, 2.75rem);
  --step-display-sm: clamp(1.25rem, 1vw + 1rem, 1.75rem);
  --step-body-lg: clamp(1.05rem, 0.3vw + 1rem, 1.25rem);
  --step-body: 1rem;
  --step-body-sm: 0.875rem;
  --step-eyebrow: 0.8rem;

  /* ---- Rhythm & layout ---- */
  --content-max: 1200px;
  --content-narrow: 40rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-pad-y: clamp(4rem, 9vw, 8rem);
  --radius-sm: 2px;
  --radius-md: 4px;

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration-fast: 180ms;
  --duration-med: 420ms;
  --duration-slow: 720ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.6;
  color: var(--text-on-primary);
  background: var(--surface-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* Visible focus states everywhere — never rely on browser defaults alone,
   but never remove them without replacing them either. */
:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.surface-dark :focus-visible,
.surface-light :focus-visible {
  outline-color: currentColor;
}

/* Skip link — visible on keyboard focus only */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--color-white);
  color: var(--color-black);
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: top var(--duration-fast) var(--ease-standard);
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad-y);
  position: relative;
}

.surface-dark {
  background: var(--surface-dark);
  color: var(--text-on-dark);
}

.surface-light {
  background: var(--surface-light);
  color: var(--text-on-light);
}

.surface-primary {
  background: var(--surface-primary);
  color: var(--text-on-primary);
}

.prose-narrow {
  max-width: var(--content-narrow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--step-eyebrow);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: '';
  width: 1.3em;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.heading-xl {
  font-size: var(--step-display-xl);
}

.heading-lg {
  font-size: var(--step-display-lg);
}

.heading-md {
  font-size: var(--step-display-md);
}

.heading-sm {
  font-size: var(--step-display-sm);
}

.lede {
  font-size: var(--step-body-lg);
  line-height: 1.7;
}

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

.placeholder-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step-body-sm);
  font-style: italic;
  opacity: 0.75;
}

.placeholder-note::before {
  content: '—';
}

/* Data-driven placeholder styling: any element awaiting real content
   uses [data-content] as a hook (see README §"Filling in placeholders"). */
[data-content][data-pending='true'] {
  opacity: 0.7;
  font-style: italic;
}
