/* ==========================================================================
   QR Castle — marketing site design system
   Editorial, restrained. Ivory paper, ink type, one muted accent.
   Serif display (Fraunces w/ graceful fallback) + clean sans body.
   No images, no gradients-as-decoration, hairline rules, generous air.
   ========================================================================== */

:root {
  /* palette — soft peach paper, near-black ink, one muted pine accent */
  --paper:      #FBD4C2;   /* soft peach */
  --paper-2:    #FCE0D3;   /* lighter peach, faint panel */
  --ink:        #201712;   /* near-black, warm */
  --ink-soft:   #5A473C;   /* secondary text */
  --ink-faint:  #9A7E6D;   /* captions, meta */
  --rule:       #EDC1AD;   /* warm hairline on peach */
  --accent:     #2F4B3F;   /* muted pine — used sparingly */
  --accent-ink: #F7F3EA;   /* text on accent */
  --accent-2:   #7A2E22;   /* oxblood, for the rare warm mark */

  /* type */
  --serif: "Fraunces", ui-serif, "Iowan Old Style", "Palatino Linotype",
           Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* spacing scale */
  --sp-1: .5rem;  --sp-2: 1rem;   --sp-3: 1.5rem;  --sp-4: 2.5rem;
  --sp-5: 4rem;   --sp-6: 6rem;   --sp-7: 9rem;

  --maxw: 68rem;      /* page frame */
  --measure: 34rem;   /* readable text column */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- type ---------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-2);
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem); font-weight: 600; }

p { margin: 0 0 var(--sp-2); max-width: var(--measure); }
em { font-style: italic; }
strong { font-weight: 700; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}

/* Shown only to a visitor who arrived on someone's referral link — see the
   cookie lookup at the top of index.php. Sits above the headline and stays
   quieter than it: the name is the point, not the styling. */
.referred-by {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 var(--sp-2);
}

/* ---- layout -------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-3); }

/* padding-block, NOT the padding shorthand.
   Every section on these pages carries BOTH classes — <section class="section
   wrap"> — and .wrap's horizontal padding is what keeps text off the screen
   edge. A shorthand `padding: X 0` here sets left and right to zero as well,
   silently undoing it, because .section comes later in this file. On a desktop
   the 68rem max-width hides the damage; on a phone the text sat flush against
   the glass. Same trap in .hero below. */
.section { padding-block: var(--sp-6); border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.lede { font-size: 1.2em; color: var(--ink-soft); max-width: var(--measure); }

/* ---- top bar ------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) 0;
  max-width: var(--maxw); margin: 0 auto; padding-left: var(--sp-3);
  padding-right: var(--sp-3);
}
.wordmark {
  font-family: var(--serif);
  font-size: 2.6rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; display: inline-flex;
  align-items: center; gap: .7rem;
}
.wordmark:hover { color: var(--ink); }

/* Topbar links. Same colours as the footer's, so the two agree. */
.topnav { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.topnav a {
  color: var(--ink-soft); text-decoration: none; font-size: 1.05rem;
  padding: .35rem 0;
}
.topnav a:hover { color: var(--ink); }

/* On a phone the 2.6rem wordmark and three links cannot share one line, so the
   links drop underneath rather than squeezing the castle. 44px tall targets,
   because this is the one nav a thumb has to hit. */
@media (max-width: 34rem) {
  .topbar { flex-wrap: wrap; gap: var(--sp-1); }
  .topnav { width: 100%; gap: var(--sp-3); }
  .topnav a { padding: .55rem 0; }
}

/* Castle mark. The pennant rises above the wordmark's cap height, so nudge the
   mark down a hair to keep the castle's base optically aligned with the text. */
.wordmark .castlemark { display: block; margin-top: .18em; flex: none; }

/* Periwinkle pennant, gently fluttering. Honours reduced-motion. */
@keyframes qc-flutter {
  0%, 100% { transform: skewY(0deg)  scaleX(1);    }
  20%      { transform: skewY(-9deg) scaleX(0.88); }
  45%      { transform: skewY(5deg)  scaleX(1.04); }
  70%      { transform: skewY(-6deg) scaleX(0.93); }
}
.castlemark .pennant {
  transform-box: fill-box;
  transform-origin: left center;
  animation: qc-flutter 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .castlemark .pennant { animation: none; }
}
.navlinks { display: flex; gap: var(--sp-3); align-items: center; }
.navlinks a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.navlinks a:hover { color: var(--ink); }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--sans); font-weight: 700; font-size: 1rem;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.6rem;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 2px; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: #263d33; color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--rule);
}
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

/* ---- hero ---------------------------------------------------------------- */
.hero { padding-block: var(--sp-6) var(--sp-5); }   /* see the note on .section */
.hero h1 { max-width: 18ch; }
.hero .lede { margin-top: var(--sp-3); }
.hero .cta-row { margin-top: var(--sp-4); display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---- steps --------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-top: var(--sp-4); }
.step .num {
  font-family: var(--serif); font-size: 2.4rem; color: var(--accent);
  line-height: 1; display: block; margin-bottom: var(--sp-1);
}
.step h3 { margin-bottom: 0.4rem; }
.step p { margin-bottom: 0; }
@media (max-width: 40rem) { .steps { grid-template-columns: 1fr; gap: var(--sp-3); } }

/* ---- the reminder sample (looks like a quiet email) --------------------- */
.reminder {
  margin-top: var(--sp-4);
  max-width: 40rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(25,23,19,0.03), 0 18px 40px -28px rgba(25,23,19,0.35);
  overflow: hidden;
}
.reminder .rhead {
  padding: 0.9rem 1.3rem; border-bottom: 1px solid var(--rule);
  font-size: 0.85rem; color: var(--ink-faint);
  display: flex; justify-content: space-between; align-items: center;
}
.reminder .rbody { padding: 1.3rem 1.4rem 1.5rem; }
.reminder .rsubject { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin-bottom: var(--sp-2); }
.reminder .rbody p { font-size: 1rem; color: var(--ink-soft); }
.reminder .sig { color: var(--ink-faint); font-style: italic; margin-bottom: 0; }
.reminder-note { margin-top: var(--sp-2); color: var(--ink-faint); font-size: 0.95rem; font-style: italic; }

/* ---- feature list -------------------------------------------------------- */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); margin-top: var(--sp-4); max-width: 52rem; }
.feature h3 { margin-bottom: 0.3rem; }
.feature p { margin-bottom: 0; color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 40rem) { .features { grid-template-columns: 1fr; } }

/* ---- pricing ------------------------------------------------------------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: var(--sp-4); border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; background: #fff; }
.tier { padding: var(--sp-4) var(--sp-3); border-left: 1px solid var(--rule); }
.tier:first-child { border-left: 0; }
.tier .tname { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin-bottom: 0.2rem; }
.tier .tprice { font-family: var(--serif); font-size: 2.1rem; font-weight: 500; letter-spacing: -0.01em; }
.tier .tprice span { font-family: var(--sans); font-size: 0.95rem; font-weight: 400; color: var(--ink-faint); }
.tier .tmeta { color: var(--ink-soft); font-size: 0.98rem; margin: var(--sp-2) 0 var(--sp-3); }
.tier .tmeta b { color: var(--ink); font-weight: 700; }
.tier .btn { width: 100%; text-align: center; }
@media (max-width: 46rem) { .tiers { grid-template-columns: 1fr; } .tier { border-left: 0; border-top: 1px solid var(--rule); } .tier:first-child { border-top: 0; } }

.included { margin-top: var(--sp-4); max-width: 46rem; }
.included p { color: var(--ink-soft); }
.nobadge { margin-top: var(--sp-3); font-style: italic; color: var(--ink-faint); }
/* Currency note under the tiers. Added for Stripe's website review, which asks
   that the currency be explicit. Kept quiet on purpose: it is the least
   interesting line on the page and should not out-shout the prices. */
.tcurrency { margin-top: var(--sp-3); font-size: 0.92rem; color: var(--ink-faint); }

/* ---- FAQ ----------------------------------------------------------------- */
.faq { margin-top: var(--sp-4); max-width: 46rem; }
.qa { padding: var(--sp-3) 0; border-top: 1px solid var(--rule); }
.qa:last-child { border-bottom: 1px solid var(--rule); }
.qa h3 { margin-bottom: 0.4rem; }
.qa p { color: var(--ink-soft); margin-bottom: 0; }

/* ---- footer -------------------------------------------------------------- */
.sitefoot { border-top: 1px solid var(--rule); padding: var(--sp-4) 0 var(--sp-5); margin-top: var(--sp-4); color: var(--ink-faint); font-size: 0.92rem; }
.sitefoot .wrap { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.sitefoot a { color: var(--ink-soft); text-decoration: none; }
.sitefoot a:hover { color: var(--ink); }
.footlinks { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* ---- checkout: me-or-a-gift --------------------------------------------- */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-4); align-items: stretch; }
.choice-card {
  display: flex; flex-direction: column;
  padding: var(--sp-4) var(--sp-3);
  background: #fff; border: 1px solid var(--rule); border-radius: 3px;
}
.choice-card h2 { font-size: 1.7rem; margin-bottom: 0.3rem; }

/* The one distinction a buyer must not misread, said before the prose starts.
   Two colours because the two answers are opposites, not degrees: pine for the
   thing that recurs, the house orange for the thing that never does. */
.cadence {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  display: inline-block;
  padding: 0.28rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.6rem;
  align-self: flex-start;
}
.cadence.renews { background: rgba(47,75,63,0.10);  color: #2F4B3F; }
.cadence.once   { background: rgba(204,85,0,0.12);  color: #A34500; }
.choice-card p { max-width: none; }
.choice-terms { color: var(--ink-soft); font-size: 0.97rem; flex: 1; }
.choice-terms strong { color: var(--ink); }
.choice-card .btn { align-self: flex-start; margin-top: var(--sp-2); }
.choice-foot { margin-top: var(--sp-3); color: var(--ink-faint); font-size: 0.92rem; max-width: 46rem; }
@media (max-width: 46rem) { .choice { grid-template-columns: 1fr; } }

/* ---- misc ---------------------------------------------------------------- */
.center { text-align: center; }
.big-close { text-align: left; padding-block: var(--sp-5); }   /* see the note on .section */
.big-close h2 { max-width: 20ch; }

/* ---- long addresses in prose --------------------------------------------
   An email address is one word with no spaces in it, and text only wraps at
   spaces. welcome.php prints the buyer's own address into a sentence, so a
   long one ran past the right edge of a narrow phone and took the whole page
   sideways with it — a horizontal scrollbar on the first screen after paying.

   break-word rather than anywhere: it breaks ONLY when the word would not
   otherwise fit, so ordinary addresses still sit on one line. */
.addr { overflow-wrap: break-word; word-break: break-word; }
