/* Take What You Need. Design system: "Agensi: Ivory and Gold" (locked Nov 19).
   Light is the default. Dark comes from the theme switch (data-theme on <html>, see js/theme.js)
   or from prefers-color-scheme when the visitor hasn't picked. Every color below is a token. */
:root {
  --bg: #F6F1E7;
  --surface: #FFFFFF;
  --surface-2: #F1EADB;
  --ink: #19150E;
  --muted: #5E5442;
  --line: #E5D8BE;
  --gold: #8A671C;
  --gold-gradient: linear-gradient(135deg, #F8E6A8 0%, #D9B159 42%, #A57B2A 100%);
  --on-gold: #16110A;
  --track: #ECE2CE;
  --good: #2F6B3A;
  --warn: #8A671C;
  --bad: #A33A2E;
  --tag-library: #7A4E96;
  --shadow-card: 0 24px 50px rgba(90,68,25,.12);
  --shadow-gold: 0 10px 24px rgba(165,123,42,.35);
  --radius-card: 22px;
  --radius-tile: 20px;
  --radius-pill: 999px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sans: Manrope, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #080705;
  --surface: #13110C;
  --surface-2: #1B1812;
  --ink: #F6F0E2;
  --muted: #B8AE97;
  --line: rgba(227,192,107,.30);
  --gold: #E6C46F;
  --track: #2B251A;
  --good: #8FD19E;
  --warn: #E6C46F;
  --bad: #F09A8E;
  --tag-library: #C9A0DC;
  --shadow-card: 0 30px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(248,230,168,.10);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080705;
    --surface: #13110C;
    --surface-2: #1B1812;
    --ink: #F6F0E2;
    --muted: #B8AE97;
    --line: rgba(227,192,107,.30);
    --gold: #E6C46F;
    --track: #2B251A;
    --good: #8FD19E;
    --warn: #E6C46F;
    --bad: #F09A8E;
    --tag-library: #C9A0DC;
    --shadow-card: 0 30px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(248,230,168,.10);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg);
  color: var(--ink); font: 400 15px/1.5 var(--font-sans);
}
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); }
h1 { font-size: clamp(40px, 10vw, 56px); line-height: 1.05; }
h2 { font-size: clamp(30px, 7vw, 38px); line-height: 1.1; }
h3 { font-size: 26px; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; }
.top .brand { margin-right: auto; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--ink); text-decoration: none; }
main { display: flex; flex-direction: column; gap: 28px; padding-bottom: 48px; }

.glass {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card);
  border-radius: var(--radius-card); padding: 24px; min-width: 0;
}
.hero { display: flex; flex-direction: column; gap: 16px; padding: 28px 24px; }
.lede { font-size: 17px; color: var(--muted); max-width: 60ch; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; scroll-margin-top: 24px; }
a.card:hover { transform: translateY(-2px); transition: transform .15s ease; }
.card .price { font-weight: 700; color: var(--gold); }
.card .go { margin-top: auto; font-weight: 700; color: var(--gold); }
.card--soon { background: var(--surface-2); box-shadow: none; border-radius: var(--radius-tile); padding: 18px; }
.card--soon h3 { font-size: 22px; }
.card--soon:target { outline: 2px solid var(--gold); outline-offset: 2px; }
.note { color: var(--muted); }

.tools { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tools li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-pill); border: 0; font: 700 14px var(--font-sans); text-decoration: none; cursor: pointer;
  color: var(--on-gold); background: var(--gold-gradient); box-shadow: var(--shadow-gold);
}
.btn:hover { color: var(--on-gold); filter: brightness(1.04); }
.btn:disabled { cursor: not-allowed; background: var(--track); color: var(--muted); box-shadow: none; filter: none; }
.btn--quiet { background: transparent; color: var(--gold); border: 1px solid var(--line); box-shadow: none; }
.btn--quiet:hover { color: var(--gold); background: var(--surface-2); filter: none; }
.btn--danger { background: transparent; color: var(--bad); border: 1px solid currentColor; box-shadow: none; }
.btn--danger:hover { color: var(--bad); background: var(--surface-2); filter: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.theme-toggle {
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); cursor: pointer;
  font: 700 14px var(--font-sans); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
}
.theme-toggle[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }

.chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  font: 700 13px var(--font-sans); color: var(--muted); background: var(--track);
}
.chip--good { color: var(--good); }
.chip--warn { color: var(--warn); }
.chip--bad { color: var(--bad); }
.chip--library { color: var(--tag-library); }

form { display: flex; flex-direction: column; gap: 12px; }
label { font-weight: 700; font-size: 15px; }
input[type=email] {
  min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font: 15px var(--font-sans); color: var(--ink); width: 100%;
}
.narrow { max-width: 480px; }
.msg { min-height: 1.5em; }
.msg--bad { color: var(--bad); }
.msg--good { color: var(--good); }

footer { padding: 24px 0 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }

/* Account page */
.buckets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.buckets li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-tile); padding: 14px 16px; }
.buckets .name { font-weight: 700; margin-right: auto; }
.buckets .until { color: var(--muted); font-size: 13px; width: 100%; }

/* Quiz pages */
.quiz { gap: 16px; }
.q { border: 1px solid var(--line); margin: 0; display: flex; flex-direction: column; gap: 10px; }
.q legend, .q > label:first-child { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.15; padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.opt { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.opt input { margin: 3px 0 0; accent-color: var(--gold); flex: none; width: 18px; height: 18px; }
.q textarea { min-height: 96px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font: 15px var(--font-sans); color: var(--ink); width: 100%; resize: vertical; }
.q .btn { align-self: flex-start; margin-top: 6px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.card .quiz-link { font-weight: 700; }

/* The HTML hidden attribute must win over display rules like .hero / form { display: flex }
   (backlog twyn-hidden-sections-still-show). */
[hidden] { display: none !important; }

/* Terms, privacy and refund pages (inbox #212): long text, so a readable measure and list spacing. */
.legal { max-width: 720px; }
.legal h2 { margin-top: 28px; font-size: 24px; line-height: 1.2; }
.legal li { margin: 6px 0; }
