/* ═════════════════════════════════════════════════════════════════════
   base.css · Global resets and element styles
═════════════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  /* Safe-area on iOS shows the html bg through the status-bar zone.
     Setting html bg to brand navy keeps continuity with the navy band
     beneath it; body bg cream picks up where the navy band ends. */
  background: var(--accent);
}

/* d62a13 · In dark theme the body bg (near-black) was painting the iOS
   status-bar safe area instead of navy, leaving a black strip above the
   navy band. Pin a brand-navy fill behind the status bar so the top
   always reads as one continuous navy band. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--accent);
  z-index: 90;
  pointer-events: none;
}

html, body {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  transition: background var(--t-slow), color var(--t-slow);
}

body {
  background: var(--bg);
}

@font-face {
  font-display: swap;
  font-family: 'Fraunces';
  src: local('Fraunces');
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  color: var(--ink);
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

em.accent, .ital-accent {
  font-style: italic;
  color: var(--gold-deep);
  font-weight: 500;
}

a {
  color: var(--gold-deep);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--gold); }

p { line-height: 1.6; }

code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
}

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

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

input:focus, textarea:focus, select:focus, button:focus {
  outline: none;
}
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

::selection {
  background: var(--gold-bg-2);
  color: var(--ink);
}

/* iOS no-zoom-on-focus */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea,
select {
  font-size: var(--fs-md);
}
@media (min-width: 720px) {
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  textarea,
  select {
    font-size: var(--fs-sm);
  }
}

/* Hover effects only on devices that actually have hover. Saves
   stuck-hover artifacts on touch where :hover persists after tap. */
@media (hover: none) {
  * { cursor: default !important; }
}

/* ── Universal label / eyebrow patterns ───────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  color: var(--muted);
  font-weight: 500;
}

/* The gold-bar section eyebrow. Reserve for hero / page-defining
   sections — overuse kills its meaning. */
.section-eyebrow {
  position: relative;
  padding-left: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  color: var(--ink);
  font-weight: 600;
}
.section-eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
}

/* Italic gold (editorial accent) — wordmark only, not data. */
.gold-italic {
  font-style: italic;
  color: var(--gold-deep);
}

/* Empty state — quiet italic serif */
.empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-family: var(--font-serif);
  font-style: italic;
}

/* Day-34: in-section empty state. Tighter padding so it doesn't dwarf
   a small section header, and a centered mono mark to signal "this
   slot is intentionally empty, not broken". Use class="empty empty-inset"
   (or just empty-inset). */
.empty-inset {
  text-align: center;
  padding: var(--sp-5) var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-family: var(--font-serif);
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.empty-inset::before {
  content: '·';
  display: block;
  font-family: var(--font-mono);
  font-size: 28px;
  line-height: 1;
  color: var(--border);
  font-style: normal;
}

/* ── Mono labels (single canonical size, no more 9px) ─────────────── */
.mono-label-sm,
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  color: var(--muted);
  font-weight: 500;
}

/* ── Serif numerals for monetary values ───────────────────────────── */
.serif-number {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
  font-weight: 500;
}
.mono-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── SVG icon helper (used by js/ui/icons.js) ─────────────────────── */
.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Visually-hidden text for icon-only buttons (accessibility). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
