/* Inter, self-hosted (variable font, latin subset, SIL Open Font License).
   Was loaded from Google Fonts, which blocked rendering on two extra connections. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Arial scaled to Inter's metrics: text keeps its size and line breaks while Inter loads, so nothing jumps
   when it swaps in (first visits on iOS, macOS and Windows). */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('ArialMT');
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

/* ==========================================================================
   The Meta Creative Strategist Engine — custom styles
   Layered on top of the Tailwind Play CDN. Holds typography polish, glows,
   component states that JS toggles, and responsive table → card transforms.
   ========================================================================== */

:root {
  --bg: #090d16;
  --card: #0f172a;
  --card-2: #0b1120;
  --border: #1e293b;
  --accent: #10b981;
  --accent-hover: #059669;
  --amber: #f59e0b;
  --muted: #94a3b8;
  --text: #f8fafc;
}

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

/* Tailwind display utilities outrank [hidden]; keep JS-toggled elements hidden. */
[hidden] { display: none !important; }

/* Anchored sections clear the sticky header (zero specificity so Tailwind scroll-mt-* can override). */
:where(section[id], [data-anchor]) { scroll-margin-top: 5.5rem; }

::selection { background: rgba(16, 185, 129, 0.35); color: #fff; }

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.tabular { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Backgrounds & glows
   -------------------------------------------------------------------------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 35%, transparent 100%);
}

.text-gradient-burn {
  background: linear-gradient(92deg, #fbbf24 0%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-accent {
  background: linear-gradient(92deg, #34d399 0%, #a3e635 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glow-accent {
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.35),
    0 30px 80px -30px rgba(16, 185, 129, 0.55);
}

.glow-amber {
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.3),
    0 30px 80px -30px rgba(245, 158, 11, 0.45);
}

.hairline-top {
  background-image: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.6), transparent);
}

/* Primary CTA shine sweep */
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
  transform: translateX(-130%);
  animation: btn-shine 4.2s ease-in-out infinite;
}
@keyframes btn-shine {
  0%, 62% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

/* Video-editor playhead (mechanism section) */
.playhead { animation: playhead 6s linear infinite; }
@keyframes playhead {
  0% { left: 0%; }
  100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-shine::after { display: none; }
  .playhead { animation: none; left: 62%; }
}

/* --------------------------------------------------------------------------
   Code & raw-text blocks
   -------------------------------------------------------------------------- */
.code-block {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  tab-size: 2;
  color: #cbd5e1;
}

.scroll-thin { scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: #334155; border-radius: 9999px; }

/* --------------------------------------------------------------------------
   Accordions (native <details>)
   -------------------------------------------------------------------------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details .chevron { transition: transform 0.2s ease; }
details[open] > summary .chevron { transform: rotate(180deg); }
details > summary .when-open { display: none; }
details[open] > summary .when-open { display: inline; }
details[open] > summary .when-closed { display: none; }

/* --------------------------------------------------------------------------
   JS-driven states
   -------------------------------------------------------------------------- */
.is-copied {
  background-color: #059669 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 90;
  width: max-content;
  max-width: calc(100vw - 2rem);
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  border: 1px solid #1e293b;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 0.875rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

#mobile-cta {
  transform: translateY(115%);
  transition: transform 0.3s ease;
}
#mobile-cta.is-visible { transform: translateY(0); }

.modal-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Hook-door + verdict badges
   -------------------------------------------------------------------------- */
.door,
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid;
  border-radius: 9999px;
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.door-contrarian { color: #6ee7b7; background: rgba(16, 185, 129, 0.1);  border-color: rgba(16, 185, 129, 0.28); }
.door-accusation { color: #fda4af; background: rgba(244, 63, 94, 0.1);   border-color: rgba(244, 63, 94, 0.28); }
.door-demo       { color: #7dd3fc; background: rgba(14, 165, 233, 0.1);  border-color: rgba(14, 165, 233, 0.28); }
.door-confession { color: #c4b5fd; background: rgba(139, 92, 246, 0.1);  border-color: rgba(139, 92, 246, 0.3); }
.door-cost       { color: #fcd34d; background: rgba(245, 158, 11, 0.1);  border-color: rgba(245, 158, 11, 0.3); }

.verdict-scale   { color: #052e1f; background: #34d399; border-color: #34d399; }
.verdict-iterate { color: #fcd34d; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.4); }
.verdict-kill    { color: #fda4af; background: rgba(244, 63, 94, 0.12);  border-color: rgba(244, 63, 94, 0.4); }
.verdict-monitor { color: #7dd3fc; background: rgba(14, 165, 233, 0.1);  border-color: rgba(14, 165, 233, 0.35); }
.verdict-data    { color: #94a3b8; background: rgba(148, 163, 184, 0.08); border-color: #334155; }

/* Filter pills */
.filter-pill[aria-pressed='true'] {
  background: #10b981;
  border-color: #10b981;
  color: #04130d;
}

/* --------------------------------------------------------------------------
   Responsive tables → stacked cards under 768px
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .stack-table thead { display: none; }
  .stack-table,
  .stack-table tbody,
  .stack-table tr,
  .stack-table td { display: block; width: 100%; }
  .stack-table tr {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem 1.125rem;
    margin-bottom: 0.875rem;
    background: rgba(15, 23, 42, 0.7);
  }
  .stack-table tr.is-featured {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.08);
  }
  .stack-table td {
    padding: 0.375rem 0 !important;
    border: 0 !important;
    text-align: left !important;
  }
  .stack-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
  }
  .stack-table td.stack-title {
    font-size: 1.0625rem;
    padding-bottom: 0.5rem !important;
  }
}

/* --------------------------------------------------------------------------
   Testing matrix (spreadsheet UI)
   -------------------------------------------------------------------------- */
.matrix { border-collapse: separate; border-spacing: 0; }
.matrix th,
.matrix td { border-bottom: 1px solid var(--border); }
.matrix th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b1120;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  white-space: nowrap;
  text-align: left;
  padding: 0.75rem 0.625rem;
}
.matrix th.is-calc { color: #6ee7b7; }
.matrix td { padding: 0.375rem 0.375rem; vertical-align: middle; }
.matrix th:first-child,
.matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #0b1120;
  box-shadow: 1px 0 0 var(--border);
}
.matrix th:first-child { z-index: 3; }
.matrix input,
.matrix select {
  width: 100%;
  min-width: 5.25rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.4375rem 0.5rem;
  color: #f8fafc;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.matrix input.is-name { min-width: 11rem; font-weight: 600; }
.matrix select { min-width: 8.5rem; }
.matrix select option { background: #0f172a; }
.matrix input:hover,
.matrix select:hover { border-color: #1e293b; background: rgba(15, 23, 42, 0.8); }
.matrix input:focus,
.matrix select:focus { outline: none; border-color: #10b981; background: #0f172a; }
.matrix .calc {
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #e2e8f0;
  white-space: nowrap;
}
.matrix tbody tr:hover td { background: rgba(15, 23, 42, 0.6); }
.matrix tbody tr:hover td:first-child { background: #0f172a; }

/* --------------------------------------------------------------------------
   SOP manual typography (rendered from Markdown)
   -------------------------------------------------------------------------- */
.prose-sop { color: #cbd5e1; font-size: 0.9375rem; line-height: 1.75; }
.prose-sop > * + * { margin-top: 1rem; }
.prose-sop h2 { color: #f8fafc; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin-top: 2.25rem; }
.prose-sop h2:first-child { margin-top: 0; }
.prose-sop h3 { color: #f8fafc; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.prose-sop h4 { color: #6ee7b7; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1.5rem; }
.prose-sop strong { color: #f8fafc; font-weight: 700; }
.prose-sop code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125em; color: #6ee7b7; background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); border-radius: 0.375rem; padding: 0.0625rem 0.375rem; }
.prose-sop ul, .prose-sop ol { padding-left: 1.25rem; }
.prose-sop ul { list-style: disc; }
.prose-sop ol { list-style: decimal; }
.prose-sop li + li { margin-top: 0.375rem; }
.prose-sop li::marker { color: #10b981; font-weight: 700; }
.prose-sop blockquote { border-left: 3px solid #f59e0b; background: rgba(245, 158, 11, 0.06); padding: 0.75rem 1rem; border-radius: 0 0.75rem 0.75rem 0; color: #fde68a; }
.prose-sop .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 0.875rem; }
.prose-sop table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; line-height: 1.5; }
.prose-sop th { text-align: left; background: #0b1120; color: #94a3b8; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; }
.prose-sop th, .prose-sop td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; min-width: 7rem; }
.prose-sop tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Card-form placeholder (checkout + upsell "different card" form).
   Shaped like Stripe's Payment Element so nothing jumps when it appears.
   Stripe picks its layout from its own width (measured: under 444px = 4 rows,
   444-591px = 3 rows, 592px+ = 2 rows), so this uses container queries.
   -------------------------------------------------------------------------- */
.pay-skel-wrap { container-type: inline-size; }
.pay-skel { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.pay-skel > * { grid-column: span 2; }
.pay-skel > .f-exp,
.pay-skel > .f-cvc { grid-column: span 1; }
.pay-skel-label { height: 14px; margin: 3px 0 8px; border-radius: 4px; }
.pay-skel-box { height: 44px; border-radius: 12px; }
@container (min-width: 444px) {
  .pay-skel > .f-country,
  .pay-skel > .f-zip { grid-column: span 1; }
}
@container (min-width: 592px) {
  .pay-skel { grid-template-columns: 2fr 1fr 1fr; }
  .pay-skel > .f-card,
  .pay-skel > .f-country { grid-column: span 1; }
  .pay-skel > .f-zip { grid-column: span 2; }
}

/* Phones: fade the right edge of horizontally scrolling tab rows so it's clear there's more. */
@media (max-width: 767px) {
  .scroll-hint { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
}

/* Legal pages (terms.html, privacy.html, refund.html) */
.legal h2 { color: #fff; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 0.75rem; }
.legal p, .legal li { color: #cbd5e1; font-size: 0.975rem; line-height: 1.7; }
.legal p + p, .legal ul + p, .legal ol + p, .legal p + ul, .legal p + ol { margin-top: 0.75rem; }
.legal ul, .legal ol { padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
.legal a { color: #6ee7b7; text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: #fff; }

/* Split test (headline): the longer variants are sized to take about the same height as the
   control, so the hero button sits in the same place for every variant and the test measures
   the words, not the button position. Sizes match the h1's breakpoints (base / sm / lg). */
html[data-ab-headline="D"] [data-ab="headline"] { font-size: 2.1rem; }
html[data-ab-headline="E"] [data-ab="headline"] { font-size: 1.8rem; }
@media (min-width: 640px) {
  html[data-ab-headline="D"] [data-ab="headline"] { font-size: 3rem; }
  html[data-ab-headline="E"] [data-ab="headline"] { font-size: 2.75rem; }
}
@media (min-width: 1024px) {
  html[data-ab-headline="D"] [data-ab="headline"] { font-size: 3.5rem; }
  html[data-ab-headline="E"] [data-ab="headline"] { font-size: 3.25rem; }
}

/* Narrow phones (under 375px wide): slightly smaller headlines so the hero CTA stays in the first screen. */
@media (max-width: 374px) {
  [data-ab="headline"] { font-size: 2.35rem; }
  html[data-ab-headline="D"] [data-ab="headline"] { font-size: 1.9rem; }
  html[data-ab-headline="E"] [data-ab="headline"] { font-size: 1.65rem; }
}

/* --------------------------------------------------------------------------
   Form fields on phones and tablets: 16px or more, otherwise iOS Safari (and
   the Facebook / Instagram in-app browsers) zoom the page when a field gets
   focus. Covers the access hub's vault search, filters and testing matrix.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea { font-size: 16px !important; }
}

/* Touch screens: every control on the access hub is at least 44px (copy buttons, vault filters,
   reset, testing-matrix inputs and buttons). */
@media (pointer: coarse) {
  #hook-vault-app button, #hook-vault-app select, #hook-vault-app input,
  #matrix-app button, #matrix-app input, #matrix-app select,
  .filter-pill, [data-copy], [data-copy-text] { min-height: 44px; }
  #matrix-app button { min-width: 44px; }
  .filter-pill, [data-copy], [data-copy-text] { display: inline-flex; align-items: center; justify-content: center; }
}

/* Upsell pages: keep the decline message and the "different card" form clear of the sticky banner. */
[data-upsell-error], [data-card-error], [data-card-pay] { scroll-margin-top: 88px; }
