/* ============================================================
   hyprpay/payments — landing page
   Aesthetic: financial terminal / engineering ledger.
   Deep ink, monospace-forward, one electric-lime accent,
   per-gateway pastel hues, faint graph-paper grid.
   ============================================================ */

:root {
  --ink:       #0b0d10;
  --ink-1:     #0e1116;
  --ink-2:     #12151c;
  --ink-3:     #171b24;
  --line:      rgba(233, 236, 242, 0.09);
  --line-2:    rgba(233, 236, 242, 0.16);
  --text:      #e9ecf2;
  --muted:     #99a1b0;
  --faint:     #626b7b;

  --accent:    #d6ff3f;   /* electric lime */
  --accent-dk: #a8cc1f;
  --on-accent: #10130a;   /* text on accent-filled surfaces */

  /* per-gateway hues */
  --cyber:   #7cf5c4;
  --fawry:   #ffd166;
  --paymob:  #8ab4ff;
  --paylink: #f79fd6;
  --paytabs: #c3a6ff;
  --paypal:  #38bdf8;
  --mpgs:    #ff9e64;
  --authorizenet: #f2777a;

  --display: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --sans:    "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* ── light theme ─────────────────────────────────────────────
   Surfaces flip to light; the accent becomes a deeper green so it
   still reads on a light background. Code blocks stay dark (locked
   below on .code) so the syntax palette keeps its contrast. */
[data-theme="light"] {
  --ink:    #f6f7f3;
  --ink-1:  #ffffff;
  --ink-2:  #eef1ea;
  --ink-3:  #e7eae1;
  --line:   rgba(20, 26, 20, 0.12);
  --line-2: rgba(20, 26, 20, 0.22);
  --text:   #161a13;
  --muted:  #545c53;
  --faint:  #838a80;

  --accent:    #4e7d0e;
  --accent-dk: #3c6109;
  --on-accent: #f3ffdd;

  --cyber:   #17916a;
  --fawry:   #a9760a;
  --paymob:  #2f66cf;
  --paylink: #bb3f86;
  --paytabs: #6b3fce;
  --paypal:  #0369a1;
  --mpgs:    #c2410c;
  --authorizenet: #c0392b;

  color-scheme: light;
}

/* light-theme fixups: recolor the few fixed light-greys that sit on surfaces
   which flip to light, and soften the atmospheric glow */
[data-theme="light"] code:not(pre code) { color: #2b3026; }
[data-theme="light"] .matrix td.y { color: #363c31; }
[data-theme="light"] body::before { opacity: 0.5; }
[data-theme="light"] .nav-cta:hover { background: rgba(78, 125, 14, 0.08); }

/* ── theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ── floating corner buttons (back-to-top + pulsing changelog) ───────── */
/* back-to-top: up arrow, revealed once scrolled — shared by the docs and changelog pages */
.to-top {
  position: fixed;
  right: 22px; bottom: calc(22px + var(--vv-bottom, 0px));
  z-index: 90;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  /* frosted-glass, tinted with the accent */
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
          backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  color: var(--accent);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), background 0.2s, box-shadow 0.22s;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(214, 255, 63, 0.22);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover {
  transform: translateY(-2px);
  background: color-mix(in oklab, var(--accent) 24%, transparent);
  box-shadow: 0 12px 30px -10px rgba(214, 255, 63, 0.4), inset 0 1px 0 rgba(214, 255, 63, 0.3);
}

/* pulsing "what's new" button — fixed bottom-right on every page and device */
.fab-changelog {
  position: fixed;
  right: 22px; bottom: calc(22px + var(--vv-bottom, 0px));
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--accent) 55%, transparent);
  animation: fab-pulse 2.4s var(--ease) infinite;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.fab-changelog:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -12px color-mix(in oklab, var(--accent) 60%, transparent);
}
.fab-changelog .fab-ping {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--on-accent);
  flex: none;
}
.fab-changelog .fab-ping::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--on-accent);
  animation: fab-ping 2.4s var(--ease) infinite;
}
@keyframes fab-pulse {
  0%   { box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--accent) 55%, transparent), 0 0 0 0 color-mix(in oklab, var(--accent) 45%, transparent); }
  70%  { box-shadow: 0 12px 32px -12px color-mix(in oklab, var(--accent) 60%, transparent), 0 0 0 12px transparent; }
  100% { box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--accent) 55%, transparent), 0 0 0 0 transparent; }
}
@keyframes fab-ping {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(2.3); opacity: 0; }
  100% { transform: scale(2.3); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: opacity 0.2s; }
  .fab-changelog { animation: none; }
  .fab-changelog .fab-ping::before { animation: none; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* clip, not hidden — keeps <html> the scroll root so sticky + anchor jumps behave */
}

/* atmospheric wash behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(214, 255, 63, 0.10), transparent 60%),
    radial-gradient(900px 700px at 8% 8%, rgba(138, 180, 255, 0.07), transparent 55%),
    radial-gradient(1200px 900px at 50% 118%, rgba(124, 245, 196, 0.06), transparent 60%);
}

/* film grain overlay */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--mono); }
::selection { background: var(--accent); color: var(--on-accent); }

/* ── layout helpers ───────────────────────────────────────── */
.section {
  max-width: var(--maxw);
  /* spacing lives in the top MARGIN (outside the box) so an anchor jump
     lands on the section's content edge, not below a wall of padding. */
  margin: clamp(72px, 11vw, 148px) auto 0;
  padding: 0 24px;
  scroll-margin-top: 84px; /* clear the sticky nav (~64px) + a little breathing room */
}

.section-head { max-width: 720px; margin-bottom: 54px; }
.section-no {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 5px 13px;
  margin-bottom: 22px;
}
.section-head h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.section-head h2 em { font-style: italic; color: var(--accent); }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; max-width: 60ch; }
.section-head code, .section-head b { color: var(--text); }

code:not(pre code) {
  font-size: 0.86em;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1px 6px;
  color: #d7dbe4;
}

/* ── nav ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  /* opaque fallback: older iOS Safari / in-app WebViews support neither backdrop-filter
     nor color-mix, and a translucent bar with no blur lets content bleed through */
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
/* frosted glass only where the blur actually renders, so the bar is never see-through */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav {
    background: color-mix(in oklab, var(--ink) 72%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
  }
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  background: url(logo.png) center / contain no-repeat;
}
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-hypr { color: var(--text); }
.brand-pay { color: var(--accent); font-style: italic; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 14.5px; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  color: var(--text) !important;
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 7px 15px;
}
.nav-cta:hover { border-color: var(--accent); background: rgba(214, 255, 63, 0.07); }

/* ── hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 11vw, 132px) 24px clamp(40px, 6vw, 72px);
}
.hero-grid {
  position: absolute;
  inset: -40px 0 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(120% 78% at 78% 6%, #000 0%, transparent 72%);
          mask-image: radial-gradient(120% 78% at 78% 6%, #000 0%, transparent 72%);
  opacity: 0.7;
}
.kicker {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 24px;
}
.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(42px, 8.4vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
}
.hero-title span { display: block; }
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub {
  max-width: 60ch;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
  margin: 0 0 38px;
}
.hero-sub b { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.copy {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 14px 18px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.copy:hover { border-color: var(--accent); background: var(--ink-3); transform: translateY(-1px); }
.copy-prompt { color: var(--accent); }
.copy code { background: none; border: 0; padding: 0; color: var(--text); }
.copy-icon { color: var(--faint); display: inline-flex; transition: color 0.2s, opacity 0.2s; }
.copy-icon svg { display: block; }
.copy:hover .copy-icon { color: var(--accent); }
.copy-done {
  position: absolute; right: 16px;
  font-size: 16px; letter-spacing: -0.08em;
  color: var(--accent);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.copy.is-copied .copy-icon { opacity: 0; }
.copy.is-copied .copy-done { opacity: 1; transform: translateY(0); }

.btn-ghost {
  font-size: 15px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.hero-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 58px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  background: var(--line);
}
.hero-stats li {
  background: var(--ink-1);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-stats b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  color: var(--accent);
}
.hero-stats span { font-size: 13.5px; color: var(--muted); }

/* ── ticker ───────────────────────────────────────────────── */
.ticker {
  margin-top: clamp(48px, 7vw, 84px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--ink-1);
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  white-space: nowrap;
  padding: 15px 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--faint);
  animation: ticker 42s linear infinite;
}
.ticker-track .dot { color: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ── feature cards ────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 30px 26px 28px;
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px); }
.card:hover::after { opacity: 1; }
.card-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-dk);
  letter-spacing: 0.1em;
}
.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 12px 0 10px;
}
.card p { font-size: 15px; color: var(--muted); margin: 0; }
.card code { font-size: 0.82em; }

/* ── gateways ─────────────────────────────────────────────── */
.gateways {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.gw {
  position: relative;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 26px 26px 24px;
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.gw::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gw);
  box-shadow: 0 0 26px 1px var(--gw);
  opacity: 0.85;
}
.gw:hover { transform: translateY(-4px); border-color: var(--line-2); }
.gw header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.gw-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gw);
  border: 1px solid color-mix(in oklab, var(--gw) 40%, transparent);
  border-radius: 0;
  padding: 4px 11px;
}
.gw-sig { font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em; }
.gw h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}
.gw p { font-size: 15px; color: var(--muted); margin: 0 0 18px; }
.gw footer {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.03em;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ── matrix table ─────────────────────────────────────────── */
.matrix-wrap {
  border: 1px solid var(--line);
  border-radius: 0;
  overflow-x: auto;
  background: var(--ink-1);
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 720px;
}
.matrix th, .matrix td {
  text-align: left;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.matrix thead th {
  position: sticky; top: 0;
  background: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--text);
  font-weight: 500;
}
.matrix thead th:first-child { color: var(--muted); }
.matrix tbody th {
  font-weight: 500;
  color: var(--text);
}
.matrix tbody th code { background: none; border: 0; padding: 0; color: var(--text); font-size: 13.5px; }
.matrix tbody th small { color: var(--faint); font-family: var(--sans); }
.matrix tbody tr:hover { background: rgba(233, 236, 242, 0.025); }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.matrix td.y { color: #cdd3dd; font-family: var(--mono); font-size: 12.5px; }
.matrix td.n { color: var(--faint); text-align: center; }
.matrix td:not(:first-child),
.matrix thead th:not(:first-child) { text-align: center; }

.d { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.d.cyber { background: var(--cyber); box-shadow: 0 0 10px var(--cyber); }
.d.fawry { background: var(--fawry); box-shadow: 0 0 10px var(--fawry); }
.d.paymob { background: var(--paymob); box-shadow: 0 0 10px var(--paymob); }
.d.paylink { background: var(--paylink); box-shadow: 0 0 10px var(--paylink); }
.d.paytabs { background: var(--paytabs); box-shadow: 0 0 10px var(--paytabs); }
.d.paypal { background: var(--paypal); box-shadow: 0 0 10px var(--paypal); }

/* ── gateway deck (card stack, all screens) ───────────────── */
.deck { display: none; max-width: 640px; } /* .js swaps the table for the deck; table is the no-JS fallback */
.js .deck { display: block; }
.js .matrix-wrap { display: none; }

/* single column on phones; heading beside the deck on wider screens */
.matrix-layout { display: grid; gap: 36px; }
.matrix-layout .section-head { margin-bottom: 0; }
.matrix-col { min-width: 0; }

.deck-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.deck-count { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.06em; }
.deck-count b { color: var(--text); font-weight: 600; }
.deck-hint {
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  letter-spacing: 0.04em; text-transform: lowercase;
}

.deck-stack { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; padding: 54px 0 18px; }
.deck-card {
  grid-area: 1 / 1; /* stack every card in one cell */
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 20px 20px 22px;
  overflow: hidden;
  box-shadow: 0 24px 56px -26px rgba(0, 0, 0, 0.95);
  transition: transform 0.42s var(--ease), opacity 0.42s var(--ease);
  will-change: transform;
}
.deck-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gw); box-shadow: 0 0 26px 1px var(--gw); opacity: 0.85;
}
/* only the front card shows content; the ones behind read as clean cascading
   card shells (kept in the DOM so all cards stay the same size) */
.deck-card > * { transition: opacity 0.3s var(--ease); }
.deck-card:not([data-pos="0"]) > * { opacity: 0; }
.deck-card:not([data-pos="0"]) { pointer-events: none; }
.deck-card[data-pos="0"] { z-index: 5; cursor: pointer; }
.deck-card[data-pos="0"]:active { transform: scale(0.994); }

/* phones: keep the front card full width so nothing wraps; cascade peeks
   upward (its rightward lean is clipped) */
.deck-card[data-pos="1"] { transform: translate(7px, -12px) rotate(1.4deg); z-index: 4; }
.deck-card[data-pos="2"] { transform: translate(14px, -24px) rotate(2.8deg); z-index: 3; }
.deck-card[data-pos="3"] { transform: translate(21px, -36px) rotate(4.2deg); z-index: 2; }
.deck-card[data-pos="4"] { transform: translate(28px, -48px) rotate(5.6deg); z-index: 1; }

@media (min-width: 900px) {
  .matrix-layout { grid-template-columns: 0.55fr 1fr; gap: 48px; align-items: start; }
  .matrix-layout .section-head { max-width: none; position: sticky; top: 104px; }
  .deck { max-width: none; }
  .deck-count { font-size: 14px; }
  .deck-ops .op { padding: 9px 0; }
  .deck-ops dt, .deck-ops dd { font-size: 12.5px; }
  /* cascade up-and-to-the-right like a loose stack of papers; overflow:hidden
     keeps the spread from ever widening the page */
  .deck-stack { padding: 128px 150px 22px 6px; overflow: hidden; }
  .deck-card[data-pos="1"] { transform: translate(34px, -30px) rotate(2deg); }
  .deck-card[data-pos="2"] { transform: translate(68px, -60px) rotate(4deg); }
  .deck-card[data-pos="3"] { transform: translate(102px, -90px) rotate(6deg); }
  .deck-card[data-pos="4"] { transform: translate(136px, -120px) rotate(8deg); }
}
.deck-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.deck-card-head .gw-tag, .deck-card-head .gw-sig { white-space: nowrap; }
.deck-ops { margin: 0; }
/* labels/values never wrap or break mid-word; flex-wrap lets a rare over-long
   value drop cleanly onto its own right-aligned line instead */
.deck-ops .op {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 2px 8px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.deck-ops .op:first-child { border-top: 0; }
.deck-ops dt {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  letter-spacing: 0.01em; white-space: nowrap;
}
/* inline value sits right; a rare over-long value that must drop lands
   left-aligned under its label, reading as a description not a broken wrap */
.deck-ops dd {
  margin: 0; font-family: var(--mono); font-size: 10.5px; color: var(--gw);
  white-space: nowrap;
}
.deck-ops .op.off dt, .deck-ops .op.off dd { color: var(--faint); }

/* ── quick start ──────────────────────────────────────────── */
.start-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 22px;
  align-items: stretch;
}
/* let every grid/flex level shrink below its content so long code lines scroll
   inside their block instead of widening the page on narrow screens */
.start-grid > *, .steps ol, .steps li { min-width: 0; }
/* stretch the steps column to the code column's height so the docs card can
   sit at the bottom, level with where the snippet ends */
.steps { display: flex; flex-direction: column; align-self: stretch; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps h4 {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display);
  font-weight: 600; font-size: 19px;
  margin: 0 0 12px;
}
.steps h4 span {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 0;
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}
.steps h4 small { font-family: var(--sans); font-weight: 400; font-size: 14px; color: var(--faint); }
.steps-note { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }

/* small "go to docs" button, pinned to the bottom of the steps column so its
   lower border sits level with the code snippet's lower border */
.docs-cta {
  align-self: center;         /* centered horizontally in the steps column */
  margin-top: auto;
  margin-bottom: auto;        /* centered vertically in the free space */
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--line-2);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.docs-cta:hover { border-color: var(--accent); background: rgba(214, 255, 63, 0.06); transform: translateY(-2px); }
.docs-cta-arrow { transition: transform 0.2s var(--ease); }
.docs-cta:hover .docs-cta-arrow { transform: translateX(4px); }

/* code blocks */
.code {
  /* lock to the dark palette so code stays a dark island under the light theme
     and its syntax colors keep their contrast */
  --ink-1: #0e1116;
  --ink-2: #12151c;
  --line: rgba(233, 236, 242, 0.09);
  --line-2: rgba(233, 236, 242, 0.16);
  --text: #e9ecf2;
  --muted: #99a1b0;
  --faint: #626b7b;
  --accent: #d6ff3f;
  --cyber: #7cf5c4;
  --fawry: #ffd166;
  --paymob: #8ab4ff;
  --paylink: #f79fd6;
  --paytabs: #c3a6ff;
  --paypal: #38bdf8;
  --mpgs: #ff9e64;
  --authorizenet: #f2777a;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  margin: 0; /* reset the UA figure margin so .code.big fills its column */
}
.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  color: #cdd3dd;
  tab-size: 4;
}
.code.sm pre { font-size: 12.5px; padding: 14px 16px; }
.code.big { align-self: stretch; box-shadow: 0 40px 80px -40px rgba(0,0,0,0.7); }
.code.big pre { padding: 20px 22px; }
.code figcaption {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: var(--ink-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}
.win { display: inline-flex; gap: 6px; }
.win i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.win i:first-child { background: #ff5f57; }
.win i:nth-child(2) { background: #febc2e; }
.win i:nth-child(3) { background: #28c840; }
.code .file { color: var(--muted); }

/* token colors (hand-marked) */
.code .k  { color: #ff8bd0; }             /* keyword */
.code .t  { color: var(--cyber); }        /* type / class */
.code .fn { color: var(--paymob); }       /* function / method */
.code .v  { color: #e9ecf2; }             /* variable */
.code .s  { color: var(--accent); }       /* string */
.code .n  { color: #ffd166; }             /* number */
.code .cn { color: #ffb27a; }             /* constant / enum case */
.code .a  { color: #9fb0c8; }             /* named arg */
.code .p  { color: var(--faint); }        /* punctuation */
.code .c  { color: var(--faint); font-style: italic; } /* comment */

.start-foot {
  max-width: 82ch;
  margin: 40px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 15.5px;
}
.start-foot code { font-size: 0.82em; }

/* ── cta ──────────────────────────────────────────────────── */
.cta {
  max-width: var(--maxw);
  margin: clamp(90px, 13vw, 170px) auto 0;
  padding: clamp(56px, 8vw, 96px) 24px;
  text-align: center;
  position: relative;
}
.cta::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  margin: 0 24px;
  border-radius: 0;
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 300px at 50% 0%, rgba(214,255,63,0.10), transparent 70%),
    var(--ink-1);
}
.cta h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 30px;
}
.cta-row { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-solid {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 0;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
  box-shadow: 0 0 0 rgba(214,255,63,0);
}
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(214,255,63,0.6); }
.cta .btn-ghost {
  padding: 14px 24px;
  border: 1px solid var(--line-2);
  border-radius: 0;
}
.cta .btn-ghost:hover { border-color: var(--accent); }
.req { margin: 28px 0 0; font-size: 13.5px; color: var(--faint); }
.req code { font-size: 0.85em; }

/* ── footer ───────────────────────────────────────────────── */
.foot {
  max-width: var(--maxw);
  margin: clamp(72px, 10vw, 120px) auto 0;
  padding: 40px 24px 60px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 40px;
}
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; }
.foot-brand .brand-mark { width: 26px; height: 26px; box-shadow: none; }
.foot-brand .brand-name { font-size: 16px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.foot-links a { font-size: 14px; color: var(--muted); transition: color 0.2s; }
.foot-links a:hover { color: var(--accent); }
.foot-note { width: 100%; margin: 4px 0 0; font-size: 12.5px; color: var(--faint); font-family: var(--mono); letter-spacing: 0.02em; }

/* ── reveal animation ─────────────────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
/* staggered hero */
.js .hero .reveal[data-d="0"].in { transition-delay: 0.02s; }
.js .hero .reveal[data-d="1"].in { transition-delay: 0.10s; }
.js .hero .reveal[data-d="2"].in { transition-delay: 0.18s; }
.js .hero .reveal[data-d="3"].in { transition-delay: 0.28s; }
.js .hero .reveal[data-d="4"].in { transition-delay: 0.38s; }
.js .hero .reveal[data-d="5"].in { transition-delay: 0.48s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-grid { grid-template-columns: 1fr; }
  .code.big { order: -1; }
  /* stacked layout has no free space to center into, so give the button a
     fixed gap above the last step instead */
  .docs-cta { margin-top: 30px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { padding: 14px 18px; gap: 14px; }
  .nav-links { gap: 18px; }
  /* keep Docs + GitHub reachable; hide the on-page section anchors */
  .nav-links a:nth-child(-n+4) { display: none; }
  .hero, .section, .cta, .foot { padding-left: 18px; padding-right: 18px; }
  .cta::before { margin: 0 18px; }
  /* inset the CTA content past the border so full-width buttons don't touch it */
  .cta { padding-left: 34px; padding-right: 34px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .gateways { grid-template-columns: 1fr; }
  .hero-cta { gap: 12px; }
  .copy { width: 100%; font-size: 13.5px; }
  .copy code { font-size: 13px; }
}

@media (max-width: 560px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn-solid, .hero-cta .btn-ghost { text-align: center; padding: 14px 18px; }
  .cta-row { display: flex; flex-direction: column; align-items: stretch; }
  .cta-row .btn-solid, .cta-row .btn-ghost { text-align: center; padding: 17px 24px; }
  .code pre { font-size: 12px; }
  .card, .gw { padding-left: 20px; padding-right: 20px; }
  .section-head h2, .cta h2 { font-size: clamp(26px, 7vw, 34px); }
  .hero-title { font-size: clamp(25px, 7.3vw, 40px); margin-bottom: 20px; }
  .hero-sub { font-size: 16px; margin-bottom: 30px; }
}

@media (max-width: 420px) {
  .hero-stats { grid-template-columns: 1fr; }
  .copy { font-size: 12px; padding: 12px 14px; }
  .copy code { font-size: 12px; }
  .copy-done { right: 12px; }
}

/* ── Animated theme switch ─────────────────────────────────────
   theme.js drives a circular reveal from the toggle via the View
   Transitions API; here we mute the default cross-fade so only the
   reveal plays, and provide a colour cross-fade for browsers without
   View Transitions (html.theme-anim, added for the switch only). */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

html.theme-anim,
html.theme-anim * {
  transition: background-color 0.8s var(--ease), color 0.8s var(--ease),
              border-color 0.8s var(--ease), fill 0.8s var(--ease) !important;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
}

