/* ==========================================================================
   ROYA Proof Pages
   Tokens extracted from book.flexxable.com/optin — see docs/design-system.md
   ========================================================================== */

:root {
  /* Surfaces */
  --blue:        #1e2a78;
  --blue-dark:   #16205c;
  --navy:        #071e36;
  --navy-deep:   #020028;
  --indigo:      #140172;
  --grey-bg:     #eeeeee;
  --white:       #ffffff;

  /* Type colours */
  --ink:         #101010;
  --ink-soft:    #3d3d46;
  --ink-faint:   #6b6b78;
  --blue-text:   #050190;

  /* Accents */
  --gold:        #f1b900;
  --gold-deep:   #cc7c00;
  --gold-light:  #ffd54c;
  --gold-shadow: #995d00;
  --red:         #ff0000;
  --red-soft:    #d81f1f;
  --green:       #0d8a3e;

  /* Shape */
  --r-btn:   5px;
  --r-card:  10px;
  --r-lg:    20px;
  --r-pill:  999px;

  --sh-card:  0 4px 24px rgba(0,0,0,.17);
  --sh-card-h: 0 10px 34px rgba(0,0,0,.22);
  --sh-btn:   inset 0 1px 0 var(--gold-light), inset 0 -1px 2px var(--gold-shadow), 0 4px 4px rgba(0,0,0,.25);

  /* Layout */
  --container: 1100px;
  --text-col:  760px;
  --gutter:    20px;

  /* Space scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Barlow, "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-text); }

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

/* --------------------------------------------------------------- primitives */

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--text { max-width: var(--text-col); }

.section { padding: var(--s8) 0; }
.section--tight { padding: var(--s7) 0; }

.section--blue  { background: var(--blue); color: #fff; }
.section--navy  { background: var(--navy); color: #fff; }
.section--grey  { background: var(--grey-bg); }
.section--white { background: var(--white); }

.section--blue a, .section--navy a { color: var(--gold-light); }

/* Textured blue, echoing the book page's photographic overlay */
.section--blue {
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.06) 0%, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(0,0,0,.22) 0%, transparent 48%),
    linear-gradient(var(--blue), var(--blue-dark));
}

/* ---------------------------------------------------------------- typography */

h1, h2, h3, h4 { font-weight: 800; line-height: 1.06; margin: 0 0 var(--s4); letter-spacing: -.015em; }

h1 { font-size: clamp(30px, 5.2vw, 48px); }
h2 { font-size: clamp(27px, 4.2vw, 42px); }
h3 { font-size: clamp(21px, 2.6vw, 28px); line-height: 1.15; }
h4 { font-size: 20px; line-height: 1.2; }

p { margin: 0 0 var(--s5); }
.lede { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.45; }

.gold  { color: var(--gold); }
.center { text-align: center; }
.eyebrow {
  font-size: 15px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .11em; color: var(--gold-deep); margin: 0 0 var(--s3);
}
.section--blue .eyebrow, .section--navy .eyebrow { color: var(--gold); }

.label-red {
  color: var(--red); font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; font-size: 15px;
}

/* Yellow marker highlight — matches the book page exactly */
.mark {
  background: var(--gold);
  color: #000;
  font-weight: 700;
  font-style: italic;
  text-decoration: underline;
  padding: 0 .18em;
  border-radius: 2px;
  box-decoration-break: clone;
}

.hand {
  font-family: Caveat, cursive;
  font-weight: 500;
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.25;
}

/* --------------------------------------------------------------------- CTAs */

.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: inherit; font-size: 20px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  padding: 17px 30px; border: 0; border-radius: var(--r-btn);
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover  { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(var(--gold), var(--gold-deep));
  color: #000;
  box-shadow: var(--sh-btn);
}
.btn--ghost {
  background: transparent; color: #fff;
  border: 2px solid rgba(255,255,255,.55);
  box-shadow: none;
}
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.section--white .btn--ghost, .section--grey .btn--ghost {
  color: var(--ink); border-color: rgba(0,0,0,.3);
}
.section--white .btn--ghost:hover, .section--grey .btn--ghost:hover {
  border-color: var(--ink); background: rgba(0,0,0,.04);
}

.cta-row {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  justify-content: center; align-items: center;
}

/* -------------------------------------------------------------- site chrome */

.topbar {
  background: var(--navy-deep); color: #fff;
  padding: var(--s3) 0;
  position: relative; z-index: 30;
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-width: 0; }
.brand {
  font-size: 25px; font-weight: 800; letter-spacing: -.02em;
  color: #fff; text-decoration: none;
}
.brand span { color: var(--gold); }
.topbar__links {
  display: flex; gap: var(--s5); align-items: center;
  min-width: 0; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.topbar__links::-webkit-scrollbar { display: none; }
.topbar__links a {
  color: #fff; text-decoration: none; font-weight: 600; font-size: 17px;
  white-space: nowrap; flex: none;
}
.topbar__links a:hover { color: var(--gold); }

.crumbs { font-size: 16px; padding: var(--s4) 0 0; color: var(--ink-faint); }
.crumbs a { color: var(--ink-faint); }

.footer { background: var(--navy-deep); color: #fff; padding: var(--s7) 0 var(--s8); font-size: 17px; }
.footer a { color: var(--gold-light); }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: var(--s6); }
.footer h4 { font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: var(--s2); }
.footer li a { text-decoration: none; color: rgba(255,255,255,.85); }
.footer li a:hover { color: var(--gold); }

/* ---------------------------------------------------------- objection tiles */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: var(--s5); }
.tile {
  display: block; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: var(--r-card); padding: var(--s6);
  box-shadow: var(--sh-card); border-top: 5px solid var(--gold);
  transition: transform .16s ease, box-shadow .16s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--sh-card-h); }
.tile__q { font-size: 21px; font-weight: 800; line-height: 1.18; margin: 0 0 var(--s3); }
.tile__a { font-size: 17px; color: var(--ink-soft); margin: 0 0 var(--s4); line-height: 1.4; }
.tile__go { font-size: 16px; font-weight: 700; color: var(--blue-text); text-transform: uppercase; letter-spacing: .05em; }

/* ------------------------------------------------------------- proof strip */

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: var(--s5); text-align: center; }
.strip__n { font-size: clamp(34px, 4.6vw, 46px); font-weight: 900; color: var(--gold); line-height: 1; }
.strip__l { font-size: 16px; margin-top: var(--s2); color: rgba(255,255,255,.85); line-height: 1.3; }
.strip-note { font-size: 15px; color: rgba(255,255,255,.6); text-align: center; margin: var(--s5) 0 0; }

/* -------------------------------------------------------------- proof cards */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: var(--s5); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(430px,1fr)); }

.card {
  background: #fff; border-radius: var(--r-card); box-shadow: var(--sh-card);
  padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3);
  position: relative;
}
.card--quote { background: var(--blue); color: #fff; }
.card--quote .card__q { font-size: 22px; font-weight: 700; line-height: 1.3; }
.card--shot { padding: var(--s4); }

.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.card__who { font-weight: 800; font-size: 18px; }
.card__when { font-size: 15px; color: var(--ink-faint); }
.card--quote .card__when { color: rgba(255,255,255,.65); }

.card__q { font-size: 18px; line-height: 1.42; margin: 0; }
.card__q::before { content: '\201C'; }
.card__q::after  { content: '\201D'; }
.card__sum { font-size: 17px; line-height: 1.42; color: var(--ink-soft); margin: 0; }

.card__meta { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding-top: var(--s3); }

.chip {
  font-size: 14px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill);
  background: #f2f3f7; color: var(--ink-soft); white-space: nowrap;
}
.chip--result { background: var(--gold); color: #000; }
.chip--niche  { background: rgba(5,1,144,.09); color: var(--blue-text); }
.chip--time   { background: rgba(255,0,0,.08); color: var(--red-soft); }
.card--quote .chip { background: rgba(255,255,255,.16); color: #fff; }

/* Red screenshot frame — the established Flexxable proof convention */
.shot {
  border: 3px solid var(--red); border-radius: 8px; overflow: hidden;
  background: #fff; cursor: zoom-in; display: block; width: 100%;
  padding: 0; appearance: none;
}
.shot img { width: 100%; display: block; }
.shot--tall img { max-height: 340px; object-fit: cover; object-position: top; }

.viewsrc {
  align-self: flex-start; background: none; border: 0; padding: 0;
  font: inherit; font-size: 15px; font-weight: 700; color: var(--blue-text);
  text-decoration: underline; cursor: pointer;
}
.card--quote .viewsrc { color: var(--gold-light); }

/* ------------------------------------------------------------------ filters */

.filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s5); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.field select, .field input {
  font: inherit; font-size: 17px; padding: 11px 13px;
  border: 2px solid #d2d4dd; border-radius: 8px; background: #fff; color: var(--ink);
  min-width: 165px;
}
.field input { min-width: 235px; }
.field select:focus, .field input:focus { border-color: var(--gold-deep); outline: none; }

.count { font-size: 17px; color: var(--ink-faint); margin: 0 0 var(--s4); }
.count b { color: var(--ink); }
.empty { padding: var(--s7) 0; text-align: center; color: var(--ink-faint); }

/* ------------------------------------------------------------------- modal */

dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-card); max-width: min(940px, 94vw);
  width: 100%; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.5);
}
dialog.modal::backdrop { background: rgba(2,0,40,.78); }
.modal__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s4) var(--s5); border-bottom: 1px solid #e7e8ee;
  position: sticky; top: 0; background: #fff; border-radius: var(--r-card) var(--r-card) 0 0;
}
.modal__t { font-weight: 800; font-size: 18px; }
.modal__x {
  background: #f2f3f7; border: 0; border-radius: 50%; width: 38px; height: 38px;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); flex: none;
}
.modal__x:hover { background: #e2e4ec; }
.modal__body { padding: var(--s5); max-height: 74vh; overflow: auto; }
.modal__body img { border: 3px solid var(--red); border-radius: 8px; margin: 0 auto; }
.modal__note { font-size: 15px; color: var(--ink-faint); margin: var(--s4) 0 0; }

/* ------------------------------------------------------- steps / faq / misc */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: var(--s5); counter-reset: s; }
.step { counter-increment: s; }
.step__n {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold); color: #000; font-weight: 900; font-size: 22px;
  display: grid; place-items: center; margin-bottom: var(--s3);
}
.step__n::before { content: counter(s); }
.step h4 { margin-bottom: var(--s2); }
.step p { font-size: 17px; line-height: 1.45; margin: 0; color: var(--ink-soft); }
.section--navy .step p, .section--blue .step p { color: rgba(255,255,255,.85); }

details.faq {
  border-bottom: 1px solid #dcdee7; padding: var(--s4) 0;
}
details.faq summary {
  font-weight: 800; font-size: 20px; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: var(--s4); align-items: flex-start;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; font-size: 27px; line-height: 1; color: var(--gold-deep); flex: none; }
details.faq[open] summary::after { content: '\2013'; }
details.faq p { font-size: 18px; line-height: 1.5; margin: var(--s3) 0 0; color: var(--ink-soft); }

.disclaimer {
  background: var(--grey-bg); border-top: 3px solid var(--gold);
  padding: var(--s6) 0; font-size: 16px; line-height: 1.5; color: var(--ink-soft);
}
.disclaimer strong { color: var(--ink); }
.todo {
  display: inline-block; background: #fff3cd; border: 2px dashed var(--gold-deep);
  color: #6b4a00; padding: 2px 9px; border-radius: 5px;
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}

/* -------------------------------------------------------------- share tools */

.share { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.share__btn {
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  background: #fff; color: var(--ink); border: 2px solid #d2d4dd;
  border-radius: var(--r-btn); padding: 10px 16px;
}
.share__btn:hover { border-color: var(--ink); }
.share__btn.ok { background: var(--green); border-color: var(--green); color: #fff; }

/* Internal-only sales mode (?sales=1) */
.salesbar { display: none; background: var(--navy); color: #fff; padding: var(--s5) 0; }
body.sales .salesbar { display: block; }
.salesbar__t { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--gold); margin: 0 0 var(--s3); }
.salesline {
  background: rgba(255,255,255,.07); border-left: 4px solid var(--gold);
  padding: var(--s4); border-radius: 0 8px 8px 0; margin-bottom: var(--s3);
  display: flex; gap: var(--s4); align-items: flex-start; justify-content: space-between;
}
.salesline p { margin: 0; font-size: 17px; line-height: 1.45; }
.salesline button {
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; flex: none;
  background: var(--gold); color: #000; border: 0; border-radius: var(--r-btn); padding: 8px 13px;
}

/* -------------------------------------------------------------- story pages */

.story__hero { display: grid; gap: var(--s6); }
.storymeta { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px,1fr)); gap: var(--s4); }
.storymeta div { background: rgba(255,255,255,.08); border-radius: 8px; padding: var(--s4); }
.storymeta dt { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--gold); font-weight: 700; }
.storymeta dd { margin: var(--s1) 0 0; font-size: 19px; font-weight: 700; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 var(--s6) var(--s7);
  border-left: 3px solid #dcdee7; margin-left: 9px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -11px; top: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--gold); border: 3px solid #fff; box-shadow: 0 0 0 2px #dcdee7;
}
.timeline__d { font-size: 15px; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .05em; }
.timeline h4 { margin: var(--s1) 0 var(--s2); }
.timeline p { font-size: 17px; line-height: 1.45; margin: 0; color: var(--ink-soft); }

.pullquote {
  border-left: 5px solid var(--gold); padding-left: var(--s5);
  font-size: clamp(21px, 2.5vw, 27px); font-weight: 600; line-height: 1.35;
  margin: var(--s6) 0;
}

/* ------------------------------------------------------------------- niches */

.nichegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: var(--s4); }
.nichecard {
  background: #fff; border-radius: var(--r-card); box-shadow: var(--sh-card);
  padding: var(--s5); text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: var(--s2);
  transition: transform .16s ease, box-shadow .16s ease;
}
.nichecard:hover { transform: translateY(-3px); box-shadow: var(--sh-card-h); }
.nichecard b { font-size: 20px; }
.nichecard span { font-size: 16px; color: var(--ink-faint); }

.geostrip { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; }
.geostrip span {
  background: rgba(255,255,255,.11); border-radius: var(--r-pill);
  padding: 9px 17px; font-size: 17px; font-weight: 600;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .section { padding: var(--s7) 0; }
  .grid, .grid--2 { grid-template-columns: 1fr; }
  /* Nav becomes a scrollable strip below the logo — the page itself never scrolls sideways */
  .topbar__in { flex-direction: column; align-items: stretch; gap: var(--s3); }
  .brand { text-align: center; }
  .topbar__links {
    gap: var(--s4);
    justify-content: flex-start;
    mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
  }
  .topbar__links a { font-size: 15px; }
  .cta-row .btn { width: 100%; justify-content: center; }
  .salesline { flex-direction: column; }
}

@media (max-width: 420px) {
  body { font-size: 19px; }
  .btn { font-size: 18px; padding: 15px 22px; width: 100%; justify-content: center; }
  .field input, .field select { min-width: 0; width: 100%; }
  .field { width: 100%; }
  .timeline li { padding-left: var(--s5); }
}

/* Wide content must scroll inside itself, never the page */
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* -------------------------------------------------------------------- print */

@media print {
  .topbar, .footer, .filters, .share, .salesbar, .viewsrc, .crumbs, .btn { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .section { padding: 14pt 0; break-inside: avoid; }
  .section--blue, .section--navy { background: #fff !important; color: #000 !important; }
  .section--blue *, .section--navy * { color: #000 !important; }
  .strip__n, .gold { color: #000 !important; }
  .card { box-shadow: none; border: 1pt solid #999; break-inside: avoid; page-break-inside: avoid; }
  .grid, .grid--2, .tiles { display: block; }
  .card, .tile { margin-bottom: 10pt; }
  h1 { font-size: 21pt; } h2 { font-size: 17pt; } h3 { font-size: 13pt; }
  details.faq { break-inside: avoid; }
  details.faq[open] summary::after, details.faq summary::after { content: ''; }
  details.faq > p { display: block !important; }
  .shot img { max-height: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  .disclaimer { border-top: 1pt solid #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
