/* ============================================================================
   FlashFile AI — "Premium Heritage" design system (2026-07 rebuild).
   Kentucky horse country as premium texture: blue-hour navy + cobalt trust-blue
   + polished-brass accents, race-program typography (double rules, tracked small
   caps, saddle-cloth numerals). No SVG, no emoji, no icon fonts — typography and
   fal photography carry every visual. Light = warm paper; dark = blue hour.
   Shared by every page; per-page critical CSS stays tiny.
   ========================================================================== */

:root {
  --bg: #F7F5F0;            /* warm paper */
  --surface: #FFFFFF;
  --surface-2: #F1EEE7;
  --ink: #141B30;           /* deep navy ink */
  --muted: #575E70;
  --line: rgba(20, 27, 48, 0.14);
  --line-soft: rgba(20, 27, 48, 0.08);
  --primary: #2F49C0;       /* deepened cobalt (AA on paper) */
  --primary-hover: #2438A0;
  --primary-ink: #FFFFFF;
  --brass: #7A5F33;         /* dark brass for light theme (AA) */
  --brass-soft: rgba(122, 95, 51, 0.14);
  --ok: #1D7A4F;
  --warn: #8A5A00;
  --err: #B3261E;
  --focus: #7A5F33;
  --shadow: 0 1px 2px rgba(20, 27, 48, 0.05), 0 12px 32px -16px rgba(20, 27, 48, 0.18);
  --radius: 12px;
}
[data-theme="dark"] {
  --bg: #0A0E1A;            /* blue hour */
  --surface: #111726;
  --surface-2: #0E1420;
  --ink: #EDF0F8;
  --muted: #9AA3B8;
  --line: rgba(237, 240, 248, 0.14);
  --line-soft: rgba(237, 240, 248, 0.07);
  --primary: #3B5BDB;
  --primary-hover: #4C6BEA;
  --primary-ink: #FFFFFF;
  --brass: #C9A961;         /* polished brass on navy */
  --brass-soft: rgba(201, 169, 97, 0.14);
  --ok: #4CC38A;
  --warn: #E2B93B;
  --err: #F2726B;
  --focus: #C9A961;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.55);
}

/* ---- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.45em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 1.5rem + 3.6vw, 4.1rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.17rem; font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--brass-soft); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 8px; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 32px); }
section { padding: clamp(52px, 8vw, 96px) 0; }
section + section { padding-top: 0; }
/* Anchored jumps land below the sticky header, not underneath it. */
section[id], [id] { scroll-margin-top: 84px; }

/* Race-program section tag: tracked small caps over a double rule. */
.section-tag {
  display: inline-block;
  font: 600 0.72rem/1 "Inter", sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  border-top: 3px double var(--brass);
  padding-top: 9px;
  margin-bottom: 16px;
}
.lede { font-size: 1.09rem; color: var(--muted); max-width: 62ch; }

/* ---- header -------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 14px clamp(18px, 4vw, 32px);
  max-width: 1220px; margin: 0 auto;
}
.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 1.22rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand .flash { color: var(--primary); }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font: 500 0.92rem/1 "Inter", sans-serif;
}
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links .hide-m { display: none; } }

/* Theme toggle: a plain typographic switch. */
.theme-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font: 600 0.78rem/1 "Inter", sans-serif; letter-spacing: 0.08em; text-transform: uppercase;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--primary); color: var(--primary-ink);
  font: 600 1rem/1 "Inter", sans-serif;
  padding: 15px 26px; border-radius: 10px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--primary-hover); color: var(--primary-ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-lg { padding: 17px 30px; font-size: 1.06rem; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); box-shadow: none;
}
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

/* ---- hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 0; }
.hero .art { position: absolute; inset: 0; }
.hero .art img { width: 100%; height: 100%; object-fit: cover; }
.hero .art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(78deg,
    rgba(10, 14, 26, 0.88) 0%, rgba(10, 14, 26, 0.62) 44%, rgba(10, 14, 26, 0.18) 100%);
}
.hero .container {
  position: relative; z-index: 1;
  padding-top: clamp(84px, 13vw, 168px);
  padding-bottom: clamp(84px, 13vw, 168px);
}
.hero h1, .hero .lede { color: #F4F6FC; }
.hero .lede { max-width: 54ch; font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.18rem); }
.hero .section-tag { border-top-color: #C9A961; color: #C9A961; }
.hero .sub-cta { color: rgba(244, 246, 252, 0.75); font-size: 0.92rem; margin-top: 14px; }
.hero .sub-cta a { color: #C9A961; }
/* Rail stripe: a single restrained silks accent along the hero's base. */
.hero .rail-stripe {
  position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: 2;
  background: repeating-linear-gradient(90deg,
    var(--primary) 0 46px, #C9A961 46px 58px);
  opacity: 0.9;
}

/* Price chip row (typographic, no icons). */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 6px; }
.chip {
  font: 600 0.83rem/1 "Inter", sans-serif;
  color: #EDF0F8; background: rgba(17, 23, 38, 0.55);
  border: 1px solid rgba(237, 240, 248, 0.28);
  padding: 9px 14px; border-radius: 999px; letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

/* ---- cards / grids -------------------------------------------------------- */
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); margin: 0; font-size: 0.97rem; }
.hl { color: var(--brass); }

/* Saddle-cloth step numerals. */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.step .n {
  font: 700 2.1rem/1 "Space Grotesk", sans-serif;
  color: var(--brass);
  border-bottom: 3px double var(--brass);
  display: inline-block; padding-bottom: 6px; margin-bottom: 14px;
}
.step p { color: var(--muted); margin: 0; font-size: 0.97rem; }

/* Included list: typographic markers, no icons. */
.inc { list-style: none; padding: 0; margin: 18px 0 0; }
.inc li { padding: 9px 0 9px 26px; position: relative; border-top: 1px solid var(--line-soft); }
.inc li:first-child { border-top: 0; }
.inc li::before {
  content: "·"; position: absolute; left: 4px; top: 4px;
  color: var(--brass); font: 700 1.6rem/1.4 "Space Grotesk", sans-serif;
}

/* ---- pricing ------------------------------------------------------------- */
.price-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: clamp(26px, 4vw, 44px); box-shadow: var(--shadow);
  position: relative;
}
.price-card .big {
  font: 700 clamp(3rem, 2.2rem + 3vw, 4.6rem)/1 "Space Grotesk", sans-serif;
}
.price-card .big small { font-size: 0.35em; color: var(--muted); font-weight: 500; }
.price-note { color: var(--muted); font-size: 0.95rem; }

/* ---- forms ---------------------------------------------------------------- */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow); margin-top: 30px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg.full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .fg { grid-column: auto; } }
.fg label { font: 600 0.86rem/1.3 "Inter", sans-serif; }
.fg label .req { color: var(--err); }
.fg input, .fg select, .fg textarea {
  font: 400 1rem/1.4 "Inter", sans-serif;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
  width: 100%;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus);
}
.fg .hint { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }
.fg input[aria-invalid="true"], .fg select[aria-invalid="true"] { border-color: var(--err); }

/* Composed-name preview: the "Will be filed as" ribbon. */
.name-preview {
  border: 1px dashed var(--line); border-left: 3px solid var(--brass);
  background: var(--surface-2); border-radius: 8px;
  padding: 10px 14px; margin-top: 8px;
}
.name-preview .cap { font: 600 0.7rem/1 "Inter", sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.name-preview .val { font: 600 1.08rem/1.35 "Space Grotesk", sans-serif; margin-top: 3px; word-break: break-word; }

.name-feedback { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.nf { font-size: 0.86rem; line-height: 1.5; border-radius: 7px; padding: 8px 12px; border: 1px solid; }
.nf-ok   { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 35%, transparent);   background: color-mix(in srgb, var(--ok) 8%, transparent); }
.nf-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.nf-info { color: var(--muted); border-color: var(--line); background: var(--surface-2); }

.order-summary {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); padding: 20px 22px; margin-top: 26px;
}
.order-summary h4 {
  font: 600 0.72rem/1 "Inter", sans-serif; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--brass); margin: 0 0 12px;
}
.os-line { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 0.96rem; }
.os-line em { color: var(--muted); font-style: normal; }
.os-amt { font-weight: 600; white-space: nowrap; }
.os-total {
  display: flex; justify-content: space-between; gap: 14px;
  border-top: 3px double var(--brass); margin-top: 10px; padding-top: 12px;
  font: 600 1.08rem/1.4 "Space Grotesk", sans-serif;
}
.os-note { color: var(--muted); font-size: 0.85rem; margin: 12px 0 0; }
.form-submit { margin-top: 26px; }
.form-submit .btn-lg { width: 100%; text-align: center; }
.form-legal { color: var(--muted); font-size: 0.82rem; margin-top: 16px; line-height: 1.6; }

/* ---- confirm dialog (the human checkpoint before payment) ------------------ */
dialog.confirm {
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink);
  padding: 0; max-width: 560px; width: calc(100vw - 40px);
  box-shadow: 0 24px 80px -24px rgba(0, 0, 0, 0.5);
}
dialog.confirm::backdrop { background: rgba(8, 11, 20, 0.62); backdrop-filter: blur(3px); }
.confirm .head { padding: 22px 26px 0; }
.confirm .head h3 { margin: 0; }
.confirm .body { padding: 14px 26px 6px; }
.confirm .row { padding: 11px 0; border-top: 1px solid var(--line-soft); }
.confirm .row:first-child { border-top: 0; }
.confirm .cap { font: 600 0.68rem/1 "Inter", sans-serif; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.confirm .val { font: 600 1.05rem/1.4 "Space Grotesk", sans-serif; margin-top: 3px; word-break: break-word; }
.confirm .val.exact { font-size: 1.3rem; color: var(--brass); }
.confirm .note { color: var(--muted); font-size: 0.86rem; }
.confirm .actions { display: flex; gap: 12px; padding: 18px 26px 24px; flex-wrap: wrap; }
.confirm .actions .btn { flex: 1; min-width: 180px; text-align: center; }

/* ---- FAQ (native details/summary — zero JS, no icons) ---------------------- */
.faq-list { border-top: 1px solid var(--line); margin-top: 8px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer; list-style: none; position: relative;
  font: 600 1.02rem/1.45 "Inter", sans-serif;
  padding: 18px 44px 18px 2px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font: 500 1.5rem/1 "Space Grotesk", sans-serif; color: var(--brass);
}
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list .faq-a { padding: 0 2px 20px; color: var(--muted); max-width: 72ch; }

/* ---- photo band (section divider imagery) ---------------------------------- */
.photo-band { position: relative; }
.photo-band img { width: 100%; height: clamp(220px, 34vw, 420px); object-fit: cover; border-radius: var(--radius); }
.photo-band figcaption {
  position: absolute; left: 18px; bottom: 14px;
  font: 600 0.72rem/1 "Inter", sans-serif; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(244, 246, 252, 0.85); background: rgba(10, 14, 26, 0.55);
  padding: 7px 12px; border-radius: 6px; backdrop-filter: blur(4px);
}

/* ---- callout / notice ------------------------------------------------------ */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--brass);
  background: var(--surface-2); border-radius: 10px;
  padding: 18px 22px; margin-top: 26px; font-size: 0.97rem;
}

/* ---- footer ----------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line);
  margin-top: clamp(40px, 7vw, 80px);
  padding: 44px 0 54px;
  background: var(--surface-2);
}
.site-foot .foot-logo { font: 700 1.25rem/1 "Space Grotesk", sans-serif; }
.site-foot .foot-logo .flash { color: var(--primary); }
.site-foot .foot-parent { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.site-foot .foot-disc { color: var(--muted); font-size: 0.8rem; line-height: 1.7; margin-top: 18px; max-width: 74ch; }
.site-foot a { color: var(--muted); }
.site-foot .foot-links { margin-top: 16px; font-size: 0.86rem; display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ---- text pages (terms / privacy) ------------------------------------------- */
.prose { max-width: 76ch; }
.prose h2 { font-size: 1.35rem; margin-top: 2em; }
.prose h3 { font-size: 1.05rem; margin-top: 1.6em; }
.prose li { margin-bottom: 0.4em; }

/* ---- utility ----------------------------------------------------------------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
