/*
 * Design tokens.
 *
 * Supersedes the palette ported from the WordPress `grabber` theme. That
 * palette was carried over verbatim so returning visitors saw a familiar site;
 * it was never designed for a storefront. Three things it got wrong for a page
 * whose job is to close a sale:
 *
 *   1. #00a0d2 on white is 2.6:1 — the BUY button was the least legible thing
 *      on the page and failed WCAG AA for text.
 *   2. One blue for links, buttons and headings, so nothing had visual
 *      priority. A buyer's eye had nowhere to land.
 *   3. Times New Roman headings in practice (see the font note below).
 *
 * The replacement keeps the blue lineage — this is still recognisably the same
 * brand — but deepens it to a contrast-safe action colour, adds a green
 * reserved exclusively for reassurance (guarantees, ticks, "paid"), and puts
 * the page on a cool near-white so white surfaces read as raised and clean.
 *
 * Token NAMES are unchanged from the ported set, so every existing template
 * keeps working; only the values moved.
 */

:root {
  /* ---- Brand ----------------------------------------------------------
   * A vivid, saturated action blue against near-black bands and white/
   * lavender content sections. --color-primary is the action colour and
   * nothing else uses it; --color-primary-strong is both its hover state and
   * the link colour, because the bright blue is only AA-safe at button sizes
   * (4.66:1) while links need the extra margin at 16px.
   *
   * The legacy cyan survives as --color-accent for decorative washes only,
   * so the old brand feel is present without ever carrying text.
   */
  --color-primary: #1a6cf5;
  --color-primary-strong: #1560e0;
  --color-secondary: #1560e0;
  --color-accent: #00a0d2;
  --color-accent-soft: #eaf1fe;

  /* ---- Dark bands -------------------------------------------------------
   * The hero, the topbar and the closing CTA sit on near-black. Alternating
   * dark and light bands is what gives the page its rhythm and stops a long
   * scroll reading as one undifferentiated column.
   */
  --color-ink: #18181b;
  --color-ink-deep: #0e0e11;
  --color-on-ink: #fff;
  --color-on-ink-muted: #a1a1aa;

  /* Legacy aliases — old templates referenced these directly. */
  --color-base: #fff;
  --color-contrast: #18181b;
  --color-black: #000;

  /* ---- Surfaces & text ---- */
  --color-bg: #fff;
  --color-surface: #fff;
  /* Neutral band, for sections that need separating from plain white. */
  --color-surface-2: #f6f6f9;
  /* Lavender band. Reserved for the "what you get" panels — a tinted section
     reads as a callout in a way another grey never does. */
  --color-lavender: #edecfc;
  --color-text: #18181b;
  --color-text-muted: #5c5c66;
  --color-border: #e6e6ec;
  --color-border-strong: #c9c9d3;

  --color-link: #1560e0;
  --color-link-hover: #1a6cf5;

  /* ---- Icon tiles -------------------------------------------------------
   * Saturated squares behind white glyphs. Each feature keeps ONE colour for
   * the life of the page so the tile becomes a recognisable marker rather
   * than decoration. All are dark enough for a white glyph to clear the 3:1
   * required of non-text graphics.
   */
  --tile-blue: #1a6cf5;
  --tile-violet: #7c3aed;
  --tile-teal: #0d9488;
  --tile-orange: #ea580c;
  --tile-green: #16a34a;
  --tile-pink: #db2777;
  --tile-ink: #18181b;

  /* ---- Status ----------------------------------------------------------
   * Green is the trust colour and is spent carefully: ticks, guarantees,
   * "payment received". Using it for anything else devalues it.
   */
  --color-success: #0f7a4d;
  --color-success-soft: #e7f6ee;
  --color-danger: #b32d2e;
  --color-danger-soft: #fdeceb;
  --color-warning: #a35a00;
  --color-warning-soft: #fdf3e3;
  /* Sale/discount marker. Warm, so it never competes with the blue CTA. */
  --color-sale: #c2410c;

  /* ---- Typography ------------------------------------------------------
   * Two families, with a strict division of labour (see the @font-face block
   * below for why they are self-hosted rather than linked from Google):
   *
   *   Manrope (--font-display)  headings, product names, marketing lines.
   *                             Geometric, slightly quirky, gives the brand
   *                             a voice.
   *   Inter   (--font-body)     everything functional: paragraphs, nav,
   *                             buttons, prices, forms, checkout, docs.
   *                             Designed for UI at small sizes, with the
   *                             tabular figures a price column needs.
   *
   * The fallbacks are ordered so that if a woff2 ever fails to load the page
   * degrades to a system UI sans, NOT to Times New Roman — which is what the
   * previous (broken) Lora @font-face did on every page for months.
   */
  --font-body: Inter, -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --font-display: Manrope, var(--font-body);
  --font-mono: "SF Mono", Consolas, Menlo, Monaco, "DejaVu Sans Mono",
    "Roboto Mono", "Courier New", monospace;

  /* Fluid scale. The clamps mean no separate mobile type rules anywhere. */
  --size-xs: 1rem; /* body */
  --size-s: 1.125rem;
  --size-m: 1.375rem;
  --size-l: clamp(1.75rem, 1.2rem + 1.9vw, 2.25rem);
  --size-xl: clamp(2.125rem, 1.4rem + 2.9vw, 3rem);
  --size-xxl: clamp(2.5rem, 1.6rem + 4vw, 3.75rem);
  --size-tiny: 0.8125rem; /* badges, meta, legal */

  /* Manrope is drawn tighter than a system sans, so it needs less optical
     correction at display sizes — the -0.021em that suited Segoe UI closes
     Manrope's counters up and costs legibility. */
  --tracking-tight: -0.014em;
  --tracking-wide: 0.07em; /* eyebrows, small caps */

  /* ---- Spacing (verbatim from the ported scale, plus a finer step) ---- */
  --space-10: 0.25rem;
  --space-20: 0.44rem;
  --space-30: 0.67rem;
  --space-40: 1rem;
  --space-50: 1.5rem;
  --space-60: 2.25rem;
  --space-70: clamp(2.25rem, 10vw, 3.38rem);
  --space-80: clamp(3.38rem, 10vw, 5.06rem);

  /* ---- Layout ---- */
  --content-width: 1179px;
  --content-narrow: 42rem;

  /* ---- Shape ------------------------------------------------------------
   * 4px corners read as "2014 admin panel". Softer, consistent radii are a
   * large part of why a page feels current and therefore safe to pay on.
   */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Layered, low-opacity shadows — depth without the grey haze of a single
     big blur. Tinted with the text hue so they sit in the palette. */
  --shadow-1: 0 1px 2px rgb(16 23 32 / 6%), 0 1px 3px rgb(16 23 32 / 4%);
  --shadow-2: 0 2px 4px rgb(16 23 32 / 5%), 0 8px 20px rgb(16 23 32 / 8%);
  --shadow-3: 0 4px 8px rgb(16 23 32 / 6%), 0 18px 40px rgb(16 23 32 / 12%);

  --focus-ring: 2px solid var(--color-primary);
  --ring-soft: 0 0 0 4px rgb(17 96 212 / 18%);

  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------- */
/* Webfonts                                                               */
/*                                                                        */
/* Manrope and Inter, both SIL OFL 1.1 (see fonts/OFL.txt), self-hosted    */
/* rather than linked from fonts.googleapis.com. Four reasons, in the      */
/* order they matter here:                                                 */
/*                                                                         */
/*  1. CSP. The Razorpay payment page sends `default-src 'self'` with a     */
/*     `style-src 'self' 'unsafe-inline'` (routes/checkout.ts). A Google    */
/*     Fonts <link> is blocked there and the gstatic woff2 with it — so     */
/*     the ONE page where the buyer types a card number would be the one    */
/*     page rendering in fallback fonts. Same-origin files are covered by   */
/*     `default-src 'self'` and need no CSP change at all.                  */
/*  2. Speed. Hotlinking costs a DNS lookup + TLS handshake to two extra    */
/*     hosts before the first byte of a font. Cache partitioning killed     */
/*     the old "the visitor already has it cached" argument years ago.      */
/*  3. Quota. /public is served by Cloudflare's asset pipeline and does     */
/*     NOT count against the Workers request budget (wrangler.jsonc).       */
/*  4. Privacy. No visitor IP handed to a third party on every page view.   */
/*                                                                         */
/* Variable fonts, so one file covers the whole weight range and there is  */
/* no separate download for bold. Latin subsets only — the site is         */
/* lang="en"; latin-ext is declared separately so it is fetched only when   */
/* a page actually contains those codepoints.                              */
/* --------------------------------------------------------------------- */

@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: Inter;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: Inter;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* --------------------------------------------------------------------- */
/* Base                                                                   */
/* --------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky header must not cover the target of an in-page anchor. */
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--size-xs);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/*
 * Tabular figures where columns of numbers must line up, and nowhere else.
 * Applied globally this makes running prose look gappy — "in 2015" gets the
 * same advance width per digit as a price. Both families ship `tnum`.
 */
.price,
.totals,
.buy-price,
.checkout-items,
table {
  font-variant-numeric: tabular-nums lining-nums;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  margin: 0 0 var(--space-40);
  text-wrap: balance;
}

h1 {
  font-size: var(--size-xl);
}
h2 {
  font-size: var(--size-l);
}
h3 {
  font-size: var(--size-m);
}
h4 {
  font-size: var(--size-s);
}

p,
ul,
ol {
  margin: 0 0 var(--space-40);
}

/* Long prose lines are a readability tax; measure is capped at the source. */
p {
  text-wrap: pretty;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
a:hover {
  color: var(--color-link-hover);
}

strong,
b {
  font-weight: 650;
}

/* Visible focus for keyboard users only — never remove the outline outright. */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Images must never overflow their container or cause layout shift. */
img,
video,
svg {
  max-width: 100%;
}
img,
video {
  height: auto;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Wide content (tables, code) scrolls inside itself; the page body never
   scrolls horizontally. */
pre,
.table-wrap {
  overflow-x: auto;
}

.table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: var(--space-30) var(--space-40);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
th {
  font-size: var(--size-tiny);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-muted);
  font-weight: 650;
}
.table-wrap tr:last-child td {
  border-bottom: 0;
}

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

.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-50);
}

.stack > * + * {
  margin-block-start: var(--space-40);
}

.grid {
  display: grid;
  gap: var(--space-50);
}

/* --------------------------------------------------------------------- */
/* Shortcodes Ultimate replacements                                       */
/*                                                                        */
/* The [su_row] / [su_column] shortcodes in legacy post content are        */
/* converted to these classes at ETL time (plan §5 step 2). This is the    */
/* minimal CSS needed to keep a decade of posts laid out correctly —       */
/* the plugin itself is not carried across.                               */
/* --------------------------------------------------------------------- */

.su-row {
  display: grid;
  gap: var(--space-50);
  grid-template-columns: 1fr;
  margin-block: var(--space-50);
}

@media (min-width: 48rem) {
  .su-row {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }
  .su-col-1-2 {
    grid-column: span 3;
  }
  .su-col-1-3 {
    grid-column: span 2;
  }
  .su-col-2-3 {
    grid-column: span 4;
  }
  .su-col-1-4 {
    grid-column: span 1;
  }
  .su-col-3-4 {
    grid-column: span 3;
  }
  /* Explicit 6-track base so the spans above divide evenly into halves,
     thirds and quarters without a separate rule per combination. */
  .su-row:has(> [class*="su-col-"]) {
    grid-auto-flow: row;
    grid-template-columns: repeat(6, 1fr);
  }
}

/* --------------------------------------------------------------------- */
/* Dark mode                                                              */
/*                                                                        */
/* Not a filter over the light theme: the blues are re-picked, because a  */
/* CTA blue that is confident on white is muddy on near-black, and the    */
/* whole point of the action colour is that it stays the loudest thing on */
/* the page.                                                              */
/* --------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0e0e11;
    --color-surface: #18181b;
    --color-surface-2: #1e1e23;
    /* The lavender band becomes a violet-tinted near-black: the point of the
       band is "this section is different", not the hue itself. */
    --color-lavender: #1b1a27;
    --color-text: #ededf0;
    --color-text-muted: #a1a1aa;
    --color-border: #2a2a31;
    --color-border-strong: #3f3f48;

    /* The dark bands need to stay distinguishable from the page around them,
       so on a dark page they go LIGHTER than the body, not darker. */
    --color-ink: #202027;
    --color-ink-deep: #17171c;

    --color-primary: #4f95f5;
    --color-primary-strong: #7bb0f8;
    --color-secondary: #7bb0f8;
    --color-accent: #35bde8;
    --color-accent-soft: #15202f;

    --color-link: #6aa8f7;
    --color-link-hover: #9cc6fa;

    --color-success: #45c98a;
    --color-success-soft: #10241b;
    --color-danger: #f0736f;
    --color-danger-soft: #2a1516;
    --color-warning: #e0a253;
    --color-warning-soft: #2a2013;
    --color-sale: #f4834f;

    /* Shadows do almost nothing on a dark ground; borders carry the depth,
       so the blurs are dropped to near-black and kept shallow. */
    --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-2: 0 4px 14px rgb(0 0 0 / 45%);
    --shadow-3: 0 12px 34px rgb(0 0 0 / 55%);
    --ring-soft: 0 0 0 4px rgb(79 149 245 / 25%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
