/* Stax Planner website: the legal, support and account pages (the home
   page's look is ink.css). Colors come from the app icon (Design B, Evergreen):
   deep evergreen tile, emerald leather, warm gold metal, cream pages.
   Display type: Lora (OFL, served from this site). Body: the system font. */

@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/Lora-Regular.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/Lora-Italic.ttf") format("truetype");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #050f0c;
  --night: #071712;
  --deep: #0b231c;
  --forest: #173f34;
  --emerald: #31694f;
  --leaf: #53916d;
  --sage: #9cbfa9;
  --cream: #f4ecda;
  --paper: #fbf6ea;
  --paper-2: #f2e9d4;
  --gold: #d6ad62;
  --gold-hi: #f3dca3;
  --gold-lo: #a9803d;
  --on-dark: #ece4d2;
  --on-dark-muted: rgba(236, 228, 210, 0.64);
  --on-dark-faint: rgba(236, 228, 210, 0.38);
  --on-paper: #13261f;
  --on-paper-muted: #4c5c55;
  --line-dark: rgba(214, 173, 98, 0.18);
  --line-paper: rgba(19, 38, 31, 0.12);

  --serif: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--on-dark);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* A whisper of film grain over everything. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
em { font-style: italic; }
::selection { background: var(--gold); color: var(--ink); }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 48px); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ---------- Type ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.eyebrow-dark { color: var(--gold-lo); }
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(214, 173, 98, 0.18);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(214, 173, 98, 0); } }

.display {
  font-family: var(--serif);
  font-size: clamp(48px, 7.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-top: 22px;
}
.display em, .section-title em, .statement em {
  font-style: italic;
  background: linear-gradient(100deg, var(--gold-hi), var(--gold) 45%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.06em;
}
.display-sub {
  display: block;
  margin-top: 18px;
  font-size: 0.36em;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--on-dark-muted);
  font-style: italic;
}
.display-small { font-size: clamp(38px, 5.2vw, 72px); }

.lede {
  margin-top: 28px;
  max-width: 34em;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--on-dark-muted);
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.8vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-top: 16px;
}
.section-title-dark { color: var(--on-paper); }
.section-title-dark em {
  background: linear-gradient(100deg, var(--emerald), var(--forest));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head { margin-bottom: 56px; }

/* ---------- Buttons ---------- */

.button {
  --b: linear-gradient(135deg, var(--gold-hi), var(--gold) 50%, var(--gold-lo));
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border-radius: 999px;
  background: var(--b);
  color: #1b1408;
  font-weight: 600; font-size: 16px; letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 10px 30px -10px rgba(214, 173, 98, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.button:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(214, 173, 98, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.button-ghost {
  background: transparent;
  color: var(--on-dark);
  box-shadow: inset 0 0 0 1px var(--line-dark);
}
.button-ghost:hover { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(214, 173, 98, 0.06); }
.button-small { min-height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- Header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s;
}
.site-header.is-scrolled, .page-doc .site-header {
  background: rgba(5, 15, 12, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1px 0 var(--line-dark);
}
.page-doc .site-header { background: var(--ink); backdrop-filter: none; -webkit-backdrop-filter: none; }
.header-inner { display: flex; align-items: center; gap: 32px; height: 74px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
  font-family: var(--serif); font-size: 20px; letter-spacing: -0.01em;
}
.brand img { border-radius: 9px; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6); }
.nav { display: flex; gap: 30px; margin-left: auto; }
.nav a {
  text-decoration: none; font-size: 14.5px; color: var(--on-dark-muted);
  transition: color 0.25s;
}
.nav a:hover { color: var(--on-dark); }
@media (max-width: 820px) {
  .nav { display: none; }
  .header-inner .button-small { margin-left: auto; }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); border-top: 1px solid var(--line-dark); padding: 56px 0 46px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 28px 40px; align-items: start; }
.footer-brand p { margin-top: 12px; color: var(--on-dark-faint); font-size: 14.5px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--on-dark-muted); font-size: 14.5px; }
.footer-links a:hover { color: var(--gold); }
.footer-legal { grid-column: 1 / -1; color: var(--on-dark-faint); font-size: 13px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Documents (privacy, terms, support) ---------- */

.page-doc main { background: linear-gradient(180deg, var(--paper), var(--cream)); color: var(--on-paper); }
.doc-hero { padding: 150px 0 40px; }
.doc-hero h1 { font-family: var(--serif); font-size: clamp(40px, 5.4vw, 68px); letter-spacing: -0.02em; line-height: 1.05; margin-top: 14px; }
.doc-hero .eyebrow { color: var(--gold-lo); }
.doc-updated { margin-top: 18px; color: var(--on-paper-muted); font-size: 14.5px; }
.doc { padding: 10px 0 120px; }
.doc .lead { font-size: 19px; color: var(--on-paper); margin-bottom: 18px; }
.doc h2 { font-family: var(--serif); font-size: 28px; letter-spacing: -0.01em; margin: 56px 0 14px; padding-top: 26px; border-top: 1px solid var(--line-paper); }
.doc h3 { font-family: var(--sans); font-size: 16px; font-weight: 700; margin: 26px 0 6px; color: var(--on-paper); }
.doc p, .doc li { color: var(--on-paper-muted); font-size: 16.5px; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 22px; margin: 12px 0; }
.doc li { margin: 6px 0; }
.doc a { color: var(--emerald); }
.doc strong { color: var(--on-paper); }
.doc .callout {
  margin: 28px 0; padding: 24px 26px; border-radius: 18px;
  background: rgba(19, 38, 31, 0.05); border: 1px solid var(--line-paper);
}
.doc .steps { counter-reset: s; list-style: none; padding: 0; }
.doc .steps li { counter-increment: s; position: relative; padding-left: 46px; margin: 18px 0; }
.doc .steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; color: var(--cream); background: var(--deep);
}

/* ---------- Reveal on scroll ---------- */

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

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

/* Device approval page (approve-device.php). */
.approve-device { display: flex; flex-direction: column; gap: 2px; margin: 18px 0 10px; padding: 16px 18px; border: 1px solid var(--line-paper); border-radius: 14px; }
.approve-device strong { color: var(--on-paper); font-size: 18px; }
.approve-device span { color: var(--on-paper-muted); font-size: 14px; }
.approve-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px !important; }
.approve-error { margin: 14px 0; padding: 12px 16px; border-radius: 12px; border: 1px solid #c0503f; color: #c0503f; }
/* The outline button on the light page (it is made for the dark ones). */
.approve-actions .button-ghost { color: var(--on-paper); box-shadow: inset 0 0 0 1px var(--line-paper); background: transparent; }
.approve-actions .button-ghost:hover { box-shadow: inset 0 0 0 1px var(--gold); }
