/* ==========================================================================
   AGP — Base: reset, typography, layout primitives, decoration, motion
   ========================================================================== */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 260ms;
  animation-timing-function: var(--ease-out);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* position:fixed is the only scroll lock iOS Safari fully respects. */
body.is-locked {
  position: fixed;
  top: var(--lock-top, 0px);
  left: 0;
  right: 0;
  overflow: hidden;
}

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

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

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

button {
  cursor: pointer;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.9rem);
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
}

h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

h1 em,
h2 em,
h3 em {
  font-style: italic;
  font-weight: 500;
}

p {
  margin: 0 0 1em;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: var(--z-toast);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--night);
  color: var(--gold-200);
  font-weight: 700;
  transition: top var(--dur-base) var(--ease-ios);
}

.skip-link:focus {
  top: calc(12px + var(--safe-top));
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2 * var(--gutter), 820px);
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  position: relative;
  padding-block: var(--section);
}

.section--tight {
  padding-block: calc(var(--section) * 0.65);
}

.section--flush-top {
  padding-top: 0;
}

.section--paper {
  background: var(--bg-2);
}

.section--gold {
  background: var(--surface-gold);
  color: var(--ink);
}

.section--gold .eyebrow,
.section--gold .lead {
  color: var(--ink-soft);
}

.section--night {
  background: var(--night-gold-glow), var(--night);
  color: var(--on-night);
}

.section--night h2,
.section--night h3,
.section--night h4 {
  color: #fff;
}

.section--night .lead {
  color: var(--on-night-muted);
}

.section--night .eyebrow {
  color: var(--gold-300);
}

.section > .container {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 34px;
  height: 1px;
  background: currentColor;
}

.lead {
  max-width: 62ch;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted);
}

.heading-block {
  max-width: 780px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.heading-block--center {
  margin-inline: auto;
  text-align: center;
}

.heading-block--center .eyebrow {
  justify-content: center;
}

.heading-block--center .lead {
  margin-inline: auto;
}

.heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  margin-bottom: clamp(32px, 4.5vw, 56px);
}

.heading-row .heading-block {
  margin-bottom: 0;
}

.gold-text {
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.num-display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 0.9;
  color: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   Decoration — asymmetric shapes that break the grid on purpose
   -------------------------------------------------------------------------- */
.deco {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.deco-blob {
  border-radius: 62% 38% 55% 45% / 48% 58% 42% 52%;
  background: radial-gradient(circle at 30% 30%, rgba(229, 200, 143, 0.6), rgba(207, 165, 101, 0.1) 70%);
  filter: blur(2px);
}

[data-theme="dark"] .deco-blob {
  background: radial-gradient(circle at 30% 30%, rgba(207, 165, 101, 0.2), rgba(207, 165, 101, 0.03) 70%);
}

.deco-ring {
  border: 1px solid rgba(169, 122, 60, 0.3);
  border-radius: 50%;
}

.deco-line {
  left: 0;
  width: 100%;
  height: auto;
}

.deco-line path {
  fill: none;
  stroke: url(#goldStroke);
  stroke-width: 1.4;
  opacity: 0.55;
}

.deco-grain {
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(94, 63, 29, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

.curve {
  position: absolute;
  left: 0;
  z-index: 1;
  width: 100%;
  height: clamp(40px, 7vw, 90px);
  line-height: 0;
}

.curve svg {
  width: 100%;
  height: 100%;
}

.curve path {
  fill: var(--bg);
  transition: fill 0.35s ease;
}

.curve--paper path {
  fill: var(--bg-2);
}

.curve--top {
  top: -1px;
}

.curve--bottom {
  bottom: -1px;
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 150ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

.reveal--d1 {
  --delay: 90ms;
}

.reveal--d2 {
  --delay: 180ms;
}

.reveal--d3 {
  --delay: 270ms;
}
