/* ════════════════════════════════════════════════════════════════════
   Front9 Consulting — The Heritage Almanac
   A 1934 sporting magazine, quietly reissued.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Ink palette */
  --paper:        #fbf8f1;       /* warm cream */
  --paper-deep:   #f0ebdd;       /* nested cream */
  --paper-shade:  #ebe6d7;       /* aged cream */
  --ink:          #1a1c1b;
  --ink-soft:     #3d4541;
  --ink-faint:    #6b6f6c;

  /* Forest */
  --forest:       #003629;
  --forest-deep:  #001f18;
  --forest-mid:   #1b4d3e;

  /* Gold */
  --gold:         #a07b22;
  --gold-leaf:    #c69948;
  --gold-light:   #e9c176;
  --gold-pale:    #f1d899;

  /* Type scale */
  --type-hairline: 0.75rem;
  --shadow-paper:  0 32px 64px -12px rgba(0, 31, 24, 0.10);
  --shadow-lift:   0 16px 40px -12px rgba(0, 31, 24, 0.18);
}

/* ──────────── Reset / atmosphere ──────────── */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "kern" 1, "ss01" 1;
}

body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "ss01" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
  position: relative;
  isolation: isolate;
}

/* Paper grain — fixed overlay above content, but pointer-events:none so it never blocks clicks. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch' seed='5'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* All headings → Fraunces */
h1, h2, h3, h4, h5, h6, .font-display, .font-headline {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-feature-settings: "ss01" 1, "ss02" 1, "ss03" 1, "kern" 1;
  font-variation-settings: "opsz" 96, "SOFT" 30;
}

/* Material Symbols default */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
}

/* ──────────── Selection / focus ──────────── */
::selection { background: var(--gold-light); color: var(--forest-deep); }

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

/* ════════════════════════════════════════════════════════════════════
   TYPOGRAPHIC SCALE — The Almanac
   ════════════════════════════════════════════════════════════════════ */

.eyebrow {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow.no-rule::before { display: none; }
.eyebrow.gold-leaf { color: var(--gold-light); }

.tabular {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

.display-massive,
.display-1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.75rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 144;
}

.display-2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 96;
}

.display-3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.65rem, 4vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72;
}

.display-italic em,
em.display-italic,
.italic-flourish {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  color: var(--gold);
  letter-spacing: -0.035em;
}

.lede {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 36, "SOFT" 60;
  max-width: 56ch;
}

.body-lg {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.75;
  color: var(--ink-soft);
}

/* ──────────── Drop cap ──────────── */
.drop-cap::first-letter,
.drop-cap > p:first-of-type::first-letter {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: 5.5em;
  line-height: 0.85;
  float: left;
  padding: 0.05em 0.12em 0 0;
  margin-right: 0.05em;
  color: var(--forest);
  font-variation-settings: "opsz" 144, "SOFT" 80;
}

/* ──────────── Chapter mark — "Chapter II — Tradition Defined" ──────────── */
.chapter-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 0.35rem 0;
}
.chapter-mark .num {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: "opsz" 36, "SOFT" 100;
}
.chapter-mark .label {
  font-family: "Manrope", sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
  line-height: 1;
}

/* ──────────── Almanac rule — golf-pin glyph centered between hairlines ──────────── */
.almanac-rule {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  color: var(--gold);
}
.almanac-rule::before,
.almanac-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor 50%, transparent);
  opacity: 0.45;
}
.almanac-rule .glyph {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.5em;
  opacity: 0.6;
}
.almanac-rule.no-glyph::before,
.almanac-rule.no-glyph::after { background: linear-gradient(90deg, transparent, currentColor 35%, currentColor 65%, transparent); }

/* ──────────── Volume marker (masthead corner) ──────────── */
.volume-marker {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.volume-marker .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}

/* ──────────── Marginalia (small annotation tag) ──────────── */
.marginalia {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  line-height: 1.5;
  padding-left: 1.25rem;
  border-left: 1px solid var(--gold);
}

/* ──────────── Pull quote — magazine spread ──────────── */
.pull-quote {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 96, "SOFT" 80;
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.018em;
  color: var(--forest);
  position: relative;
  text-wrap: balance;
}
.pull-quote::before {
  content: "\201C";
  font-family: "Fraunces", serif;
  font-size: 5em;
  line-height: 0.85;
  color: var(--gold);
  position: absolute;
  top: -0.05em;
  left: -0.55em;
  font-style: italic;
  opacity: 0.35;
  pointer-events: none;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

/* ──────────── Number stack (scorecard cells) ──────────── */
.score-num {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--forest);
  font-variation-settings: "opsz" 96, "SOFT" 60;
  display: block;
}
.score-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.5rem;
  display: block;
}

/* ──────────── Editorial card (postcard / clipping) ──────────── */
.clipping {
  background: var(--paper);
  border: 1px solid var(--outline-variant, #cdc6b3);
  border-color: rgba(0, 31, 24, 0.08);
  box-shadow: var(--shadow-paper);
  position: relative;
  border-radius: 4px;
}
.clipping::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(160, 123, 34, 0.18);
  pointer-events: none;
  border-radius: 2px;
}

/* ──────────── Buttons ──────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--forest);
  color: var(--paper);
  padding: 1rem 1.65rem;
  border-radius: 12px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: background 280ms ease, transform 280ms ease, box-shadow 280ms ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--forest), var(--forest-mid));
  opacity: 0;
  transition: opacity 280ms ease;
  z-index: 0;
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary:hover { box-shadow: var(--shadow-lift); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary .arrow {
  display: inline-block;
  transition: transform 280ms cubic-bezier(0.4, 0.5, 0.2, 1);
}
.btn-primary:hover .arrow { transform: translateX(4px); }

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--gold-light);
  color: var(--forest);
  padding: 1rem 1.65rem;
  border-radius: 12px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: background 280ms ease, box-shadow 280ms ease;
  text-decoration: none;
  box-shadow: var(--shadow-paper);
}
.btn-gold:hover { background: var(--paper); box-shadow: var(--shadow-lift); }
.btn-gold .arrow,
.btn-gold .material-symbols-outlined {
  transition: transform 280ms cubic-bezier(0.4, 0.5, 0.2, 1);
}
.btn-gold:hover .arrow,
.btn-gold:hover .material-symbols-outlined { transform: translateX(4px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--forest);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0, 54, 41, 0.2);
  transition: border-color 280ms ease, gap 280ms ease;
  text-decoration: none;
}
.btn-ghost:hover {
  border-color: var(--gold);
  gap: 0.85rem;
}

/* ──────────── Glass / nav ──────────── */
.glass-nav {
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.shadow-ambient { box-shadow: 0 24px 48px -16px rgba(0, 31, 24, 0.08); }
.shadow-paper   { box-shadow: var(--shadow-paper); }
.shadow-lift    { box-shadow: var(--shadow-lift); }

.hero-gradient {
  background:
    radial-gradient(80% 60% at 30% 30%, rgba(0, 31, 24, 0.0) 0%, rgba(0, 31, 24, 0.55) 60%, rgba(0, 31, 24, 0.92) 100%),
    linear-gradient(135deg, rgba(0, 31, 24, 0.85) 0%, rgba(27, 77, 62, 0.45) 60%, rgba(0, 31, 24, 0.20) 100%);
}

/* ──────────── Mobile menu ──────────── */
.menu-drawer {
  transform: translateY(-100%);
  transition: transform 480ms cubic-bezier(0.32, 0.72, 0, 1), opacity 320ms ease;
  opacity: 0;
  pointer-events: none;
}
.menu-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
body.menu-open { overflow: hidden; }

.menu-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.25rem 0;
  transition: transform 320ms ease, color 320ms ease;
  font-variation-settings: "opsz" 96, "SOFT" 60;
}
.menu-link::before {
  content: "";
  width: 0;
  height: 1px;
  background: var(--gold-light);
  transition: width 320ms ease;
}
.menu-link:hover { transform: translateX(8px); color: var(--gold-light); }
.menu-link:hover::before { width: 36px; }
.menu-link.active { color: var(--gold-light); }
.menu-link.active::before { width: 36px; }
.menu-link .num {
  font-family: "JetBrains Mono", monospace;
  font-style: italic;
  font-size: 0.7rem;
  color: var(--gold-light);
  opacity: 0.55;
  letter-spacing: 0.05em;
  align-self: flex-start;
  padding-top: 0.85em;
}

/* ──────────── Form fields ──────────── */
.field-underline {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 31, 24, 0.20);
  border-radius: 0;
  padding: 0.85rem 0 0.65rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  color: var(--forest);
  width: 100%;
  transition: border-color 220ms ease;
}
.field-underline:focus {
  outline: none;
  border-color: var(--forest);
  border-bottom-width: 2px;
  padding-bottom: 0.55rem;
}
.field-underline::placeholder {
  color: rgba(61, 69, 65, 0.45);
  font-style: italic;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}
.field-label .num {
  font-family: "JetBrains Mono", monospace;
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/* ──────────── Tee-time chips ──────────── */
.tee-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 240ms ease, color 240ms ease, transform 240ms ease, border-color 240ms ease;
  user-select: none;
  border: 1px solid transparent;
}
.tee-chip:hover { transform: translateY(-1px); border-color: rgba(0, 54, 41, 0.15); }
.tee-chip[aria-pressed="true"] {
  background: var(--forest);
  color: var(--paper);
  border-color: var(--forest);
}
.tee-chip[aria-pressed="true"]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-light);
}

/* ──────────── Decorative grain (legacy alias) ──────────── */
.grain-bg {
  background-image: radial-gradient(rgba(0, 54, 41, 0.08) 0.5px, transparent 0.5px);
  background-size: 16px 16px;
}

/* ──────────── In-page anchor offset ──────────── */
section[id], div[id] { scroll-margin-top: 110px; }

/* ──────────── Reveal-on-scroll ──────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms cubic-bezier(0.16, 0.84, 0.44, 1),
              transform 800ms cubic-bezier(0.16, 0.84, 0.44, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-1 { transition-delay: 80ms; }
.reveal-2 { transition-delay: 160ms; }
.reveal-3 { transition-delay: 240ms; }
.reveal-4 { transition-delay: 320ms; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* ──────────── Section dividers ──────────── */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: var(--gold);
}

/* ──────────── Aged border / bookplate frame ──────────── */
.bookplate {
  position: relative;
  padding: 2rem;
}
.bookplate::before,
.bookplate::after {
  content: "";
  position: absolute;
  inset: 0.65rem;
  pointer-events: none;
  border: 1px solid currentColor;
  opacity: 0.18;
  border-radius: 2px;
}
.bookplate::after {
  inset: 1.1rem;
  border-color: currentColor;
  opacity: 0.06;
}

/* ──────────── Number badge (Roman / Arabic) ──────────── */
.num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 36, "SOFT" 80;
}

/* ──────────── Underline link (footnote-style) ──────────── */
.fn-link {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 240ms, color 240ms;
}
.fn-link:hover { color: var(--gold); text-decoration-color: currentColor; }

/* ──────────── Image refinements ──────────── */
img { max-width: 100%; display: block; }

.duotone-forest {
  filter: grayscale(100%) sepia(20%) hue-rotate(120deg) saturate(0.7) contrast(1.05);
  transition: filter 700ms ease;
}
.duotone-forest:hover { filter: none; }

/* ──────────── Vignette frame for hero ──────────── */
.frame-vignette {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.frame-vignette::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(0, 31, 24, 0.35);
}

/* ──────────── Mobile responsiveness ──────────── */
@media (max-width: 640px) {
  .pull-quote::before { left: -0.3em; font-size: 4em; }
  .drop-cap::first-letter,
  .drop-cap > p:first-of-type::first-letter { font-size: 4.2em; }
}

/* ──────────── Print (almanac honors print) ──────────── */
@media print {
  body::before { display: none; }
  .glass-nav, .menu-drawer, footer { display: none; }
}
