/* ═══════════════════════════════════════════════════════════
   MAXFY — style.css

   Design inspired by nadanada.me:
   · Warm dark / soft light backgrounds with Bitcoin orange accent
   · Syne display font (bold, tight tracking)
   · Instrument Sans body font (light, clean)
   · Minimal surfaces, thin borders, generous whitespace

   Theme system:
   · Dark mode is the DEFAULT (variables defined on :root)
   · Light mode overrides variables when body.light is active
   · The sliding toggle adds/removes the .light class on <body>

   Layout:
   · .top    — sticky primary header (logo + controls)
   · .subnav — sticky secondary nav bar (site links)
   · .main   — scrollable content
   · .bottom — footer
   ═══════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────
   FONTS — Self-hosted (Tor Browser compatible)
   Replaces Google Fonts external dependency.
   ───────────────────────────────────────────────────────── */
@font-face {
    font-family:  'Syne';
    src:          url('/fontz/Syne-Bold.woff2') format('woff2');
    font-weight:  700;
    font-style:   normal;
    font-display: swap;
}
@font-face {
    font-family:  'Syne';
    src:          url('/fontz/Syne-ExtraBold.woff2') format('woff2');
    font-weight:  800;
    font-style:   normal;
    font-display: swap;
}
@font-face {
    font-family:  'Instrument Sans';
    src:          url('/fontz/InstrumentSans-Regular.woff2') format('woff2');
    font-weight:  300;
    font-style:   normal;
    font-display: swap;
}
@font-face {
    font-family:  'Instrument Sans';
    src:          url('/fontz/InstrumentSans-Regular.woff2') format('woff2');
    font-weight:  400;
    font-style:   normal;
    font-display: swap;
}
@font-face {
    font-family:  'Instrument Sans';
    src:          url('/fontz/InstrumentSans-Medium.woff2') format('woff2');
    font-weight:  500;
    font-style:   normal;
    font-display: swap;
}


/* ─────────────────────────────────────────────────────────
   RESET
   Removes browser default margins, padding, and box-sizing
   quirks so we start from a consistent baseline.
   ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    /* border-box: padding and border are included in width/height.
       Much more predictable than the default content-box model. */
    margin:  0;
    padding: 0;
}


/* ─────────────────────────────────────────────────────────
   CSS CUSTOM PROPERTIES (Design Tokens)

   Defined on :root so they are globally available.
   Dark theme values are the defaults.
   Light theme overrides them in the body.light block below.
   ───────────────────────────────────────────────────────── */
:root {
    /* ── Colours ─────────────────────────────────── */

    --bg: #1c1917;
    /* Main background. Warm dark brown-grey — softer than pure black. */

    --surface: #26231f;
    /* Card/panel background. Slightly lighter — creates subtle depth. */

    --border: #38342e;
    /* Separator lines and outlines. Warm-tinted, visible but quiet. */

    --ink: #e8e0d5;
    /* Primary text. Warm off-white — easier on eyes than pure white. */

    --muted: #7a7065;
    /* Secondary text. Warm mid-grey — recedes behind primary content. */

    --accent: #f7931a;
    /* Bitcoin orange. Used for logo, CTAs, icons, italic emphasis. */

    --accent-hover: #e07d0a;
    /* Darker orange for hover states — tactile feedback. */

    /* ── Typography ──────────────────────────────── */

    --font-head: 'Syne', sans-serif;
    /* Bold geometric display font. sans-serif fallback if fonts fail. */

    --font-body: 'Instrument Sans', sans-serif;
    /* Clean light-weight body font. */

    /* ── Layout ──────────────────────────────────── */

    --pad-x: clamp(1.25rem, 5vw, 3.5rem);
    /* Responsive horizontal padding.
       clamp(min, preferred, max) — scales with viewport, never exceeds bounds. */

    --max-w: 1000px;
    /* Maximum content width — keeps lines readable on wide monitors. */

    --radius: 5px;
    /* Border radius — modern and clean, not pill-shaped, not square. */

    --header-h:  40px;
    /* Height of the sticky primary header (.top). */

    --subnav-h:  20px;
    /* Height of the sticky secondary nav bar (.subnav).
       Shorter than the header — it is a subordinate element. */

    --footer-h:  40px;
    /* Height of the footer. */

    /* ── Transitions ─────────────────────────────── */

    --transition-theme: background 0.3s ease, color 0.25s ease, border-color 0.25s ease;
    /* Applied to elements that change colour on theme switch.
       0.3s ease: smooth without being sluggish. */
}


/* ─────────────────────────────────────────────────────────
   LIGHT THEME — Variable Overrides

   Applied when JavaScript adds class="light" to <body>.
   Only variables that change are listed — the rest inherit
   from :root automatically.
   ───────────────────────────────────────────────────────── */
body.light {
    --bg:      #f5e6d3;  /* Warm parchment — off-white, not stark */
    --surface: #e6dfd6;  /* Slightly darker card surface */
    --border:  #cec6bb;  /* Warm mid-tone border */
    --ink:     #1e1a16;  /* Warm near-black text */
    --muted:   #8a7f74;  /* Warm mid-grey secondary text */
}


/* ─────────────────────────────────────────────────────────
   BASE STYLES
   ───────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    /* Smooth scroll when clicking anchor links. */
}

body {
    background:             var(--bg);
    color:                  var(--ink);
    font-family:            var(--font-body);
    font-weight:            300;
    font-size:              1rem;
    line-height:            1.65;
    -webkit-font-smoothing: antialiased;
    /* antialiased: thinner, sharper font rendering on macOS/iOS. */

    display:        flex;
    flex-direction: column;
    /* Flexbox column: header, subnav, main, footer stack vertically. */

    min-height: 100dvh;
    /* 100dvh = dynamic viewport height — accounts for mobile browser chrome. */

    transition: var(--transition-theme);
    /* Smooth colour change when switching themes. */
}

a {
    color:           inherit;
    text-decoration: none;
    /* Links inherit colour from parent; no underline by default. */
}

ul {
    list-style: none;
    /* Remove default bullet points. */
}


/* ─────────────────────────────────────────────────────────
   VISUALLY HIDDEN
   Hides elements visually while keeping them accessible
   to screen readers and search engines.
   ───────────────────────────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width:     1px;
    height:    1px;
    padding:   0;
    margin:    -1px;
    overflow:  hidden;
    clip:      rect(0, 0, 0, 0);
    border:    0;
}


/* ─────────────────────────────────────────────────────────
   BUTTONS

   .btn is the base. Variant classes modify specific properties.
   DRY pattern — no repeated declarations.
   ───────────────────────────────────────────────────────── */
.btn {
    display:       inline-flex;
    align-items:   center;
    gap:           0.4rem;
    font-family:   var(--font-body);
    font-size:     0.82rem;
    font-weight:   400;
    padding:       0.48rem 1rem;
    border-radius: var(--radius);
    border:        1px solid var(--border);
    color:         var(--muted);
    cursor:        pointer;
    white-space:   nowrap;
    transition:    color 0.15s, border-color 0.15s, background 0.15s;
}

.btn--lg {
    font-size: 0.9rem;
    padding:   0.7rem 1.5rem;
    /* Larger hero CTA variant. */
}

.btn--accent {
    background:   var(--accent);
    color:        #1c1917;  /* Dark text on orange — always readable */
    border-color: var(--accent);
    font-weight:  500;
}
.btn--accent:hover {
    background:   var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn--outline {
    color:        var(--ink);
    border-color: var(--border);
}
.btn--outline:hover {
    border-color: var(--ink);
}

.btn--ghost {
    background:   transparent;
    color:        var(--muted);
    border-color: var(--border);
}
.btn--ghost:hover {
    color:        var(--ink);
    border-color: var(--border);
}


/* ─────────────────────────────────────────────────────────
   THEME TOGGLE — SLIDING SWITCH

   A hidden <input type="checkbox"> + a styled <label>.
   CSS :checked handles the animation — no JS for the visual.
   JS reads state to apply .light on <body> and saves to
   localStorage as maxfy_theme.

   Structure:
   .theme-switch-wrapper — sizing + positioning context
     .theme-checkbox      — hidden real checkbox
     .theme-slider        — visible pill track
       ::before           — sliding knob circle
       ::after            — ☀ / ☽ icon
   ───────────────────────────────────────────────────────── */

.theme-switch-wrapper {
    position:    relative;
    width:       52px;
    height:      28px;
    flex-shrink: 0;
    /* flex-shrink: 0 — never compress inside a flex parent. */
}

.theme-checkbox {
    position: absolute;
    opacity:  0;
    width:    100%;
    height:   100%;
    margin:   0;
    cursor:   pointer;
    z-index:  2;
    /* Invisible but covers the wrapper — clicking anywhere toggles it.
       z-index: 2 places it above the label so it receives click events. */
}

.theme-slider {
    position:      absolute;
    inset:         0;
    /* inset: 0 = top/right/bottom/left all 0 — fills the wrapper. */
    background:    var(--border);
    border-radius: 100px;  /* Large value = fully rounded pill */
    border:        1px solid var(--border);
    cursor:        pointer;
    transition:    background 0.3s ease, border-color 0.3s ease;
}

.theme-slider::before {
    /* Sliding knob */
    content:       '';
    position:      absolute;
    top:           3px;
    left:          3px;
    width:         20px;
    height:        20px;
    background:    var(--ink);
    border-radius: 50%;
    transition:    transform 0.3s ease, background 0.3s ease;
}

.theme-slider::after {
    /* Sun/moon icon */
    content:        '☀';
    position:       absolute;
    right:          5px;
    top:            50%;
    transform:      translateY(-50%);
    font-size:      13px;
    line-height:    1;
    opacity:        1;
    pointer-events: none;
    /* pointer-events: none — icon never blocks clicks on the checkbox. */
}

/* ── Checked = light mode active ── */

.theme-checkbox:checked + .theme-slider::before {
    transform:  translateX(24px);  /* Slide knob to the right */
    background: #1c1917;           /* Dark knob on orange track */
}

.theme-checkbox:checked + .theme-slider {
    background:   var(--accent);
    border-color: var(--accent);
}

.theme-checkbox:checked + .theme-slider::after {
    content: '☽';   /* Moon when light mode is on */
    right:   auto;
    left:    5px;   /* Reposition to left side */
}


/* ─────────────────────────────────────────────────────────
   LANGUAGE SELECTOR

   Dropdown next to the theme toggle.
   Trigger button shows flag + code + chevron.
   Dropdown shows flag + full language name.
   JS adds/removes .open on the wrapper to show/hide.
   ───────────────────────────────────────────────────────── */

.lang-switch {
    position:    relative;
    flex-shrink: 0;
}

.lang-switch__btn {
    display:        inline-flex;
    align-items:    center;
    gap:            0.35rem;
    background:     transparent;
    border:         1px solid var(--border);
    border-radius:  var(--radius);
    color:          var(--muted);
    font-family:    var(--font-body);
    font-size:      0.78rem;
    font-weight:    500;
    letter-spacing: 0.05em;
    padding:        0.4rem 0.65rem;
    cursor:         pointer;
    transition:     color 0.15s, border-color 0.15s;
    white-space:    nowrap;
}

.lang-switch__btn:hover {
    color:        var(--ink);
    border-color: var(--ink);
}

.lang-switch__btn #langFlag {
    font-size:   1rem;
    line-height: 1;
}

.lang-switch__btn svg {
    transition:  transform 0.2s ease;
    flex-shrink: 0;
}

.lang-switch.open .lang-switch__btn svg {
    transform: rotate(180deg);  /* Rotate chevron when menu is open */
}

.lang-switch.open .lang-switch__btn {
    color:        var(--ink);
    border-color: var(--ink);
}

.lang-switch__menu {
    display:       none;
    position:      absolute;
    top:           calc(100% + 6px);  /* 6px gap below button */
    right:         0;                 /* Align to right edge of wrapper */
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    min-width:     140px;
    list-style:    none;
    padding:       0.35rem 0;
    z-index:       200;  /* Above header (100) and subnav (99) */
    box-shadow:    0 4px 20px rgba(0, 0, 0, 0.18);
    transition:    background 0.25s ease, border-color 0.25s ease;
}

.lang-switch.open .lang-switch__menu {
    display: block;
}

.lang-switch__menu li button {
    display:     flex;
    align-items: center;
    gap:         0.6rem;
    width:       100%;
    text-align:  left;
    background:  transparent;
    border:      none;
    padding:     0.55rem 1rem;
    font-family: var(--font-body);
    font-size:   0.82rem;
    color:       var(--muted);
    cursor:      pointer;
    transition:  background 0.15s, color 0.15s;
    white-space: nowrap;
}

.lang-switch__menu li button:hover {
    background: var(--border);
    color:      var(--ink);
}

.lang-switch__flag {
    font-size:   1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.lang-switch__menu li button.active {
    color:       var(--accent);
    font-weight: 500;
}


/* ─────────────────────────────────────────────────────────
   TOP / HEADER — Primary sticky bar

   Contains logo and controls only.
   Navigation links are in .subnav below.
   z-index: 100 keeps it above all page content.
   ───────────────────────────────────────────────────────── */
.top {
    height:          var(--header-h);
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         0 var(--pad-x);
    border-bottom:   1px solid var(--border);

    position: sticky;
    top:      0;
    z-index:  100;

    background: var(--bg);
    /* Opaque — content scrolling behind doesn't show through. */
    transition: var(--transition-theme);
}

.logo {
    font-family:    var(--font-head);
    font-weight:    800;
    font-size:      1.1rem;
    letter-spacing: -0.04em;
    color:          var(--accent);
    flex-shrink:    0;
}

.top__right {
    display:     flex;
    align-items: center;
    gap:         0.75rem;
    flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────────
   SUBNAV — Secondary sticky navigation bar

   Sits directly below .top. Also sticky, with
   top: var(--header-h) so it sticks under the header.
   Shorter height than the header — it is subordinate.

   On all screen sizes the links have full bar width,
   solving the mobile squeezing issue.
   ───────────────────────────────────────────────────────── */
.subnav {
    height:          var(--subnav-h);
    display:         flex;
    align-items:     center;
    justify-content: center;
    /* Centre links horizontally — looks good on all widths. */
    gap:             2.5rem;
    padding:         0 var(--pad-x);
    border-bottom:   1px solid var(--border);

    position: sticky;
    top:      var(--header-h);
    /* Sticks immediately below the header — not at the very top. */
    z-index:  99;
    /* Just below .top (100) so header overlaps subnav on scroll edge. */

    background: var(--bg);
    transition: var(--transition-theme);
}

.subnav a {
    font-size:   0.85rem;
    color:       var(--muted);
    transition:  color 0.15s;
    white-space: nowrap;
    /* nowrap: link text never breaks onto two lines. */
}

.subnav a:hover {
    color: var(--ink);
}


/* ─────────────────────────────────────────────────────────
   MAIN CONTENT AREA
   flex: 1 fills all vertical space between subnav and footer.
   ───────────────────────────────────────────────────────── */
.main {
    flex:      1;
    width:     100%;
    max-width: var(--max-w);
    margin:    0 auto;
    padding:   0 var(--pad-x);
}


/* ─────────────────────────────────────────────────────────
   NOTICE BANNER
   Shown conditionally via DTML when stop_allBuys == 0.
   Sits between the subnav and the hero section.
   ───────────────────────────────────────────────────────── */
.noticebanner {
    background:    var(--surface);
    border:        1px solid var(--accent);
    border-radius: var(--radius);
    padding:       0.75rem 1rem;
    margin:        1.5rem 0 0;
    position:      relative;  /* added */
    /* margin-bottom intentionally 0 — hero has its own top padding */
}

.noticebanner .eyebrow {
    color:          var(--accent);
    letter-spacing: 0.1em;
    font-size:      0.72rem;
    text-transform: uppercase;
}

.noticebanner__close {
    position:    absolute;
    top:         0.3rem;
    right:       0.8rem;
    background:  transparent;
    border:      none;
    color:       var(--muted);
    cursor:      pointer;
    font-size:   1.4rem;
    line-height: 1;
    padding:     0;
}

.noticebanner__close:hover {
    color: var(--ink);
}


/* ─────────────────────────────────────────────────────────
   VOUCHER PAGE
   Individual voucher purchase page layout.
   ───────────────────────────────────────────────────────── */
.voucher-page {
    display:        flex;
    flex-direction: column;
    align-items:    flex-start;
    gap:            2rem;
    padding:        clamp(2rem, 5vh, 3.5rem) 0;
}

.voucher-page__image img {
    max-width:     320px;
    height:        auto;
    border-radius: var(--radius);
    display:       block;
}

.voucher-page__corn {
    text-align: center;
    font-size:  0.90rem;
    color:      var(--muted);
    margin-top: 0.4rem;
}

.voucher-page__form {
    display:        flex;
    flex-direction: column;
    gap:            1.25rem;
    width:          100%;
    max-width:      480px;
}

.voucher-page__field {
    display:        flex;
    flex-direction: column;
    gap:            0.4rem;
}

.voucher-page__field label {
    font-size:      0.78rem;
    color:          var(--muted);
    font-weight:    500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.voucher-page__hint {
    font-size:   0.68rem;
    color:       var(--muted);
    line-height: 1.4;
    margin-top:  -0.2rem;
}

.voucher-page__hint a {
    color:                 var(--accent);
    text-decoration:       underline;
    text-underline-offset: 3px;
}

.voucher-page__hint a:hover {
    color: var(--accent-hover);
}

.voucher-page__hint a:visited {
    color: var(--muted);
}

.voucher-page__field input {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    color:         var(--ink);
    font-family:   var(--font-body);
    font-size:     0.9rem;
    font-weight:   300;
    padding:       0.6rem 0.85rem;
    width:         100%;
    transition:    border-color 0.15s;
    outline:       none;
}

.voucher-page__field input:focus {
    border-color: var(--accent);
}

/* ── Textarea — same style as input ── */
.voucher-page__field textarea {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    color:         var(--ink);
    font-family:   var(--font-body);
    font-size:     0.9rem;
    font-weight:   300;
    padding:       0.6rem 0.85rem;
    width:         100%;
    transition:    border-color 0.15s;
    outline:       none;
    resize:        vertical;
}

.voucher-page__field textarea:focus {
    border-color: var(--accent);
}

.voucher-page__form .btn {
    justify-content: center;
}

.voucher-page__notice {
    font-size:   0.78rem;
    color:       var(--muted);
    line-height: 1.5;
}

.voucher-page__notice a {
    color:                 var(--accent);
    text-decoration:       underline;
    text-underline-offset: 3px;
}

.voucher-page__notice a:hover {
    color: var(--accent-hover);
}

.voucher-page__notice a:visited {
    color: var(--muted);
}

/* Mobile */
@media (max-width: 520px) {
    .voucher-page__form  { max-width: 100%; }
    .voucher-page__image img { max-width: 100%; }
}


/* ─────────────────────────────────────────────────────────
   PAYMENT METHODS
   Row of accepted payment method icons below the form.
   ───────────────────────────────────────────────────────── */
.payment-methods {
    display:        flex;
    flex-direction: column;
    align-items:    flex-start;
    gap:            0.5rem;
    margin-top:     0.5rem;
}

.payment-methods__label {
    font-size:   0.72rem;
    color:       var(--muted);
    max-width:   480px;
    line-height: 1.6;
}

.payment-methods__icons {
    display:     flex;
    align-items: center;
    gap:         0.5rem;
    flex-wrap:   wrap;
}

.payment-methods__icons img,
.payment-methods__icons svg {
    height:  48px;
    width:   auto;
    opacity: 1;
}


/* ─────────────────────────────────────────────────────────
   STRIPE CHECKOUT
   Container for the Stripe embedded payment form.
   ───────────────────────────────────────────────────────── */
.stripe-checkout {
    width:     100%;
    max-width: 560px;
    padding:   clamp(2rem, 5vh, 3.5rem) 0;
}

#checkout {
    width:    100%;
    overflow: hidden;
}


/* ─────────────────────────────────────────────────────────
   STRIPE ERROR MESSAGE
   ───────────────────────────────────────────────────────── */
.stripe-error {
    font-size:   0.82rem;
    color:       #ef4444;
    padding:     0.5rem 0;
    line-height: 1.5;
}


/* ─────────────────────────────────────────────────────────
   DISABLED BUTTON STATE
   ───────────────────────────────────────────────────────── */
.btn:disabled {
    opacity:        0.5;
    cursor:         not-allowed;
    pointer-events: none;
}


/* ─────────────────────────────────────────────────────────
   PAYMENT PAGE — USDC
   Layout for the USDC payment page with QR code.
   ───────────────────────────────────────────────────────── */
.payment-page {
    display:        flex;
    flex-direction: row;
    align-items:    flex-start;
    gap:            3rem;
    padding:        clamp(2rem, 5vh, 3.5rem) 0;
    flex-wrap:      wrap;
}

.payment-page__qr {
    flex-shrink: 0;
}

.payment-page__qr img {
    width:         240px;
    height:        240px;
    display:       block;
    border-radius: var(--radius);
    border:        1px solid var(--border);
    padding:       0.5rem;
    background:    #fff;  /* QR codes need white background to scan correctly */
}

.payment-page__details {
    display:        flex;
    flex-direction: column;
    gap:            1.25rem;
    flex:           1;
    min-width:      240px;
}

.payment-page__field {
    display:        flex;
    flex-direction: column;
    gap:            0.3rem;
    border-bottom:  1px solid var(--border);
    padding-bottom: 1rem;
}

.payment-page__field:last-child {
    border-bottom:  none;
    padding-bottom: 0;
}

.payment-page__label {
    font-size:      0.72rem;
    color:          var(--muted);
    font-weight:    500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.payment-page__value {
    font-size:   0.9rem;
    color:       var(--ink);
    line-height: 1.5;
}

.payment-page__value--mono {
    font-family: monospace;
    font-size:   0.78rem;
    color:       var(--ink);
    word-break:  break-all;
    /* break-all: long crypto addresses wrap correctly on small screens */
}

.payment-page__value--status {
    color:       var(--accent);
    font-weight: 500;
}

.payment-page__value--finished {
    color: #22c55e;  /* Green — payment confirmed */
}

.payment-page__copy-row {
    display:     flex;
    align-items: flex-start;
    gap:         0.6rem;
}

.payment-page__copy-btn {
    flex-shrink:                 0;
    background:                  transparent;
    border:                      1px solid var(--border);
    border-radius:               var(--radius);
    color:                       var(--muted);
    cursor:                      pointer;
    padding:                     0.25rem;
    display:                     flex;
    align-items:                 center;
    margin-top:                  2px;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance:          none;
    -webkit-user-select:         none;
    user-select:                 none;
    touch-action:                manipulation;
}

.payment-page__copy-btn svg {
    width:  16px;
    height: 16px;
}

.payment-page__copy-btn:hover {
    color:        var(--ink);
    border-color: var(--ink);
}

.payment-page__copy-btn--copied {
    color:          #22c55e !important;
    border-color:   #22c55e !important;
    pointer-events: none;
}

.payment-page__copy-btn:focus,
.payment-page__copy-btn:focus-visible,
.payment-page__copy-btn:focus-within,
.payment-page__copy-btn:active {
    outline:          none;
    box-shadow:       none;
    color:            var(--muted) !important;
    border-color:     var(--border) !important;
    background-color: transparent !important;
}

/* Mobile — stack QR above details */
@media (max-width: 520px) {
    .payment-page {
        flex-direction: column;
        gap:            2rem;
    }

    .payment-page__qr img {
        width:  100%;
        height: auto;
    }
}


/* ─────────────────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────────────────── */
.hero {
    padding:        clamp(3.5rem, 8vh, 6rem) 0 clamp(2.5rem, 5vh, 4rem);
    /* clamp() = fluid spacing that scales with viewport height. */
    display:        flex;
    flex-direction: column;
    gap:            1.25rem;
}

.eyebrow {
    font-size:      0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color:          var(--muted);
}

.headline {
    font-family:    var(--font-head);
    font-size:      clamp(2.1rem, 5.67vw, 4.05rem);
    /* clamp: scales with viewport width, between min and max. */
    font-weight:    800;
    line-height:    1.0;
    letter-spacing: -0.04em;
    color:          var(--ink);
}

.headline em {
    font-style:  italic;
    color:       var(--accent);
    white-space: nowrap;
}


.sub {
    font-size:   clamp(0.9rem, 1.5vw, 1.05rem);
    color:       var(--muted);
    max-width:   46ch;
    /* ch: width of "0" character — limits line length for readability. */
    line-height: 1.7;
}

.actions {
    display:   flex;
    gap:       0.75rem;
    flex-wrap: wrap;
    /* flex-wrap: buttons stack on small screens if needed. */
}


/* ─────────────────────────────────────────────────────────
   GENERAL HERO SECTION
   Used in help, privacy, terms and contact
   ───────────────────────────────────────────────────────── */
.hero_general {
    padding:        clamp(3.5rem, 8vh, 6rem) 0 clamp(2.5rem, 5vh, 4rem);
    /* clamp() = fluid spacing that scales with viewport height. */
    display:        flex;
    flex-direction: column;
    gap:            1.25rem;
}

.hero_general_headline {
    font-size:      1.00rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color:          var(--ink);
}

.hero_general_paragraph {
    font-size:      1.00rem;
    letter-spacing: 0.12em;
    text-transform: none;
    color:          var(--muted);
}

.hero_general a {
    color:                 var(--accent);
    text-decoration:       underline;
    text-underline-offset: 3px;
    transition:            color 0.15s, opacity 0.15s;
}

.hero_general a:hover {
    color:   var(--accent-hover);
    opacity: 0.85;
}

.hero_general a:visited {
    color: var(--accent);
}

.hero_general a:focus-visible {
    outline:        2px solid var(--accent);
    outline-offset: 3px;
    border-radius:  2px;
}


/* ─────────────────────────────────────────────────────────
   HORIZONTAL DIVIDER
   Overrides inconsistent browser default <hr> styling.
   ───────────────────────────────────────────────────────── */
.divider {
    border:     none;
    border-top: 1px solid var(--border);
    margin:     0;
    transition: border-color 0.25s ease;
}


/* ─────────────────────────────────────────────────────────
   FEATURES SECTION — Three equal columns on desktop
   ───────────────────────────────────────────────────────── */
.features {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    /* 1fr = equal fraction of available space. */
    gap:                   0;
    padding:               clamp(2rem, 5vh, 3.5rem) 0;
}

.feature {
    padding:        2rem 1.75rem;
    border-right:   1px solid var(--border);
    /* Right border creates column dividers — last removed below. */
    display:        flex;
    flex-direction: column;
    gap:            0.6rem;
    transition:     background 0.2s;
}

.feature:last-child {
    border-right: none;
}

.feature:hover {
    background: var(--surface);
}

.feature__icon {
    font-size:   1.4rem;
    line-height: 1;
}

.feature h3 {
    font-family: var(--font-head);
    font-size:   0.95rem;
    font-weight: 700;
    color:       var(--ink);
}

.feature p {
    font-size:   0.85rem;
    color:       var(--muted);
    line-height: 1.6;
}


/* ─────────────────────────────────────────────────────────
   QUOTE / TESTIMONIAL SECTION
   ───────────────────────────────────────────────────────── */
.quote-section {
    padding:         clamp(2rem, 5vh, 3.5rem) 0;
    display:         flex;
    justify-content: center;
    direction:       ltr;
}

.quote {
    max-width:  60ch;
    text-align: center;
}

.quote p {
    font-family:   var(--font-head);
    font-size:     clamp(1.1rem, 2.5vw, 1.5rem);
    font-style:    italic;
    font-weight:   700;
    line-height:   1.4;
    color:         var(--ink);
    margin-bottom: 1rem;
}

.quote__author {
    font-size:      1.00rem;
    color:          var(--muted);
    font-style:     normal;
    letter-spacing: 0.03em;
}


/* ─────────────────────────────────────────────────────────
   BOTTOM / FOOTER
   ───────────────────────────────────────────────────────── */
.bottom {
    height:          var(--footer-h);
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         0 var(--pad-x);
    border-top:      1px solid var(--border);
    gap:             1.5rem;
    flex-shrink:     0;
    transition:      var(--transition-theme);
    background:      var(--bg);
    /* Opaque background — covers anything behind the footer. */
}

.bottom__brand {
    display:     flex;
    align-items: center;
    gap:         0.85rem;
    flex-shrink: 0;
}

.bottom__logo {
    font-family:    var(--font-head);
    font-weight:    800;
    font-size:      0.9rem;
    letter-spacing: -0.03em;
    color:          var(--accent);
}

.bottom__copy {
    font-size: 0.72rem;
    color:     var(--muted);
}

.bottom__links {
    display: flex;
    gap:     1.5rem;
}

.bottom__links a {
    font-size:  0.78rem;
    color:      var(--muted);
    transition: color 0.15s;
}

.bottom__links a:hover {
    color: var(--ink);
}

.bottom__social {
    display:     flex;
    align-items: center;
    gap:         1rem;
    flex-shrink: 0;
    /* justify-content: flex-end; */
}

.bottom__social a {
    color:       var(--muted);
    display:     flex;
    align-items: center;
    transition:  color 0.15s;
}

.bottom__social a:hover {
    color: var(--ink);
}

.bottom__social svg {
    width:  18px;
    height: 18px;
}


/* ─────────────────────────────────────────────────────────
   CONSENT NOTICE — .cb

   Class deliberately named .cb (not .cookie-banner or similar)
   to avoid Brave browser's built-in cookie notice filter list
   which injects display:none on common cookie banner class names.

   Fixed to bottom of viewport — non-blocking.
   Page is fully usable while it's visible.
   Uses CSS variables so it auto-switches with the theme.
   z-index: 999 keeps it above all other content.
   ───────────────────────────────────────────────────────── */
.cb {
    position:        fixed;
    bottom:          0;
    left:            0;
    right:           0;
    z-index:         999;
    background:      #5a5248;
    border-top:      1px solid var(--border);
    padding:         6rem var(--pad-x);
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             1.5rem;
    flex-wrap:       wrap;
    transition:      var(--transition-theme);
}

.cb__text {
    display:        flex;
    flex-direction: column;
    gap:            0.35rem;
    max-width:      100ch;
}

.cb__text strong {
    font-size:   1.60rem;
    color:       var(--ink);
    font-weight: 500;
}

.cb__text p {
    font-size:   1.10rem;
    color:       var(--ink);
    line-height: 1.5;
    margin:      0;
}

.cb__link,
.cb__text a {
    color:      var(--accent);
    transition: opacity 0.15s;
}

.cb__link:hover,
.cb__text a:hover {
    opacity: 0.8;
}

.cb__actions {
    flex-shrink: 0;
}

.cb__accept {
    background:    var(--accent);
    color:         #1c1917;  /* Dark text on orange — readable on both themes */
    border:        none;
    border-radius: var(--radius);
    padding:       0.55rem 1.4rem;
    font-family:   var(--font-body);
    font-size:     1.10rem;
    font-weight:   500;
    cursor:        pointer;
    white-space:   nowrap;
    transition:    background 0.15s;
}

.cb__accept:hover {
    background: var(--accent-hover);
}


/* ─────────────────────────────────────────────────────────
   RESPONSIVE — TABLET  (max-width: 768px)
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    .features {
        grid-template-columns: repeat(2, 1fr);
        /* Collapse to 2 columns on tablet. */
    }

    .feature:nth-child(odd) {
        border-right: 1px solid var(--border);
    }

    .feature:nth-child(even) {
        border-right: none;
    }

    .feature:nth-child(-n+2) {
        border-bottom: 1px solid var(--border);
        /* Border below first row. */
    }
}


/* ─────────────────────────────────────────────────────────
   RESPONSIVE — MOBILE  (max-width: 520px)
   All mobile overrides consolidated here — including the
   consent notice — to avoid duplicate @media blocks.
   ───────────────────────────────────────────────────────── */
@media (max-width: 520px) {

    /* Subnav — tighter gap on small screens.
       Links still have the full bar width — no squeezing. */
    .subnav {
        gap:       1.25rem;
        font-size: 0.8rem;
    }

    /* Language selector — compact */
    .lang-switch__btn {
        font-size: 0.72rem;
        padding:   0.35rem 0.5rem;
        gap:       0.25rem;
    }

    .lang-switch__btn #langFlag {
        font-size: 0.9rem;
    }

    /* Footer — wrap to multiple lines */
    .bottom {
        height:    auto;
        flex-wrap: wrap;
        padding:   1rem var(--pad-x);
        gap:       0.75rem 1rem;
    }

    .bottom__links {
        gap:       1rem;
        font-size: 0.72rem;
    }

    .bottom__copy {
        display:   block;
        font-size: 0.65rem;
    }

    /* Features — single column */
    .features {
        grid-template-columns: 1fr;
    }

    .feature {
        border-right:  none;
        border-bottom: 1px solid var(--border);
    }

    .feature:last-child {
        border-bottom: none;
    }

    /* Reset tablet borders — not applicable in single column */
    .feature:nth-child(-n+2) {
        border-bottom: 1px solid var(--border);
    }

    .feature:nth-child(odd) {
        border-right: none;
    }

    /* Consent notice — stack vertically, full-width button */
    .cb {
        flex-direction: column;
        align-items:    flex-start;
        gap:            0.75rem;
        padding:        2rem var(--pad-x) 2.5rem;
    }

    .cb__accept {
        width: 100%;  /* Full-width — easier to tap on mobile */
    }

    /* Stripe checkout — full width on mobile */
    .stripe-checkout { max-width: 100%; }
}


/* ─────────────────────────────────────────────────────────
   RTL SUPPORT — Farsi and other RTL languages
   Structural chrome stays LTR (logo, controls, footer).
   Main content flows naturally RTL for Farsi speakers.
   ───────────────────────────────────────────────────────── */

[dir="rtl"] .top            { direction: ltr; }
[dir="rtl"] .subnav         { direction: ltr; }
[dir="rtl"] .bottom         { direction: ltr; }
[dir="rtl"] .quote-section  { direction: ltr; }

[dir="rtl"] .hero           { text-align: right; }
[dir="rtl"] .noticebanner   { text-align: right; }
[dir="rtl"] .features       { direction: rtl; }
[dir="rtl"] .feature        { text-align: right; }

/* Cookie notice stays LTR — it contains functional UI
   that should remain consistent regardless of language. */


/* ─────────────────────────────────────────────────────────
   VOUCHER CAROUSEL
   Two-row infinite scrolling carousel with dock magnification.
   Mouse/touch left-right controls scroll speed and direction.
   ───────────────────────────────────────────────────────── */
.carousel-wrap { padding: 0.5rem 0; overflow: hidden; user-select: none; }

.carousel-row { position: relative; height: 320px; margin-bottom: -4rem; }

.voucher-track {
    display:     flex;
    gap:         50px;
    position:    absolute;
    left:        0;
    top:         0;
    align-items: center;
    will-change: transform;
    direction:   ltr;  /* force LTR — carousel layout is always left-to-right regardless of page direction */
}

.voucher {
    flex-shrink:     0;
    width:           280px;
    height:          280px;
    border-radius:   0;
    border:          none;
    background:      transparent;
    display:         flex;
    align-items:     center;
    justify-content: center;
    cursor:          pointer;
    text-decoration: none;
    transition:      transform 0.2s;
}

.voucher:hover { border-color: transparent; }

.voucher.fiat { border-top: none; }
.voucher.usdc { border-top: none; }

.voucher img {
    width:        100%;
    height:       100%;
    object-fit:   contain;
}

.speed-hint {
    font-size:  0.80rem;
    color:      var(--muted);
    text-align: center;
    margin-top: -0.5rem;
}
