/* =============================================================
   Playwise365 — "Wise Owl Scholarly" Design System
   Academic journal feel · Warm cream paper · Indigo ink
   Fonts: Cardo (headings) · Mada (body)
   ============================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand palette */
  --primary: #6366f1;          /* indigo ink        */
  --primary-dark: #4f46e5;
  --primary-darker: #4338ca;
  --secondary: #a5b4fc;        /* soft indigo       */
  --bg-body: #fefce8;          /* warm cream (paper)*/
  --bg-dark: #1e1b4b;          /* deep indigo night */
  --text: #1e1b4b;             /* indigo ink text   */

  /* Extended scholarly palette */
  --paper: #fffdf3;            /* lighter card paper*/
  --paper-edge: #f4efd6;       /* aged paper edge   */
  --ink-soft: #4a466f;         /* muted ink         */
  --ink-faint: #6f6b90;        /* faint ink         */
  --gold: #c99a2e;             /* gold-leaf accent  */
  --gold-soft: #e9c877;
  --rule: #ddd5b8;             /* hairline rule     */
  --rule-strong: #c7bd97;
  --success: #2f855a;
  --warn: #b7791f;
  --danger: #b23b3b;

  /* Structure */
  --container: 1160px;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(30,27,75,.08);
  --shadow: 0 6px 24px rgba(30,27,75,.10);
  --shadow-lg: 0 18px 50px rgba(30,27,75,.18);
  --shadow-ink: 0 10px 30px rgba(67,56,202,.20);

  --ff-head: "Cardo", Georgia, "Times New Roman", serif;
  --ff-body: "Mada", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg-body);
  /* subtle laid-paper texture */
  background-image:
    radial-gradient(circle at 20% 15%, rgba(99,102,241,.045), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(201,154,46,.05), transparent 40%),
    repeating-linear-gradient(0deg, rgba(30,27,75,.015) 0 1px, transparent 1px 26px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--primary-dark); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--primary-darker); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--text); }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: 3px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--ff-head);
  font-weight: 700;
  line-height: 1.18;
  color: var(--text);
  letter-spacing: .2px;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h4 { font-size: 1.18rem; }
p { margin-bottom: 1.05rem; }
strong { font-weight: 700; color: var(--text); }
small { font-size: .82rem; }

.eyebrow {
  font-family: var(--ff-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .74rem;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.eyebrow::before, .eyebrow.center::after {
  content: "";
  width: 26px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  display: inline-block;
}
.eyebrow.center::after { background: linear-gradient(90deg, transparent, var(--gold)); }

/* Drop cap for lead paragraphs (journal feel) */
.lead { font-size: 1.16rem; color: var(--ink-soft); line-height: 1.7; }
.dropcap::first-letter {
  font-family: var(--ff-head);
  font-weight: 700;
  float: left;
  font-size: 3.6em;
  line-height: .72;
  padding: .08em .12em 0 0;
  color: var(--primary-dark);
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.4rem; }
.container-narrow { max-width: 820px; }
.section { padding: clamp(3.2rem, 7vw, 5.6rem) 0; }
.section-tight { padding: clamp(2.4rem, 5vw, 3.6rem) 0; }
.section-head { max-width: 720px; margin-bottom: 2.6rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin: .6rem 0 .5rem; }
.section-head p { color: var(--ink-soft); font-size: 1.06rem; }

.grid { display: grid; gap: 1.6rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Divider ornament */
.ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; color: var(--gold);
  margin: 2.4rem 0;
}
.ornament::before, .ornament::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--rule-strong), transparent);
}
.ornament svg { width: 26px; height: 26px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .55rem;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: .02em;
  padding: .85rem 1.7rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  white-space: nowrap;
  text-align: center;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  color: #fff;
  box-shadow: var(--shadow-ink);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 36px rgba(67,56,202,.32); }
.btn-ghost {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { color: var(--primary-darker); border-color: var(--primary); background: rgba(99,102,241,.06); transform: translateY(-2px); }
.btn-dark { background: var(--bg-dark); color: #fff; }
.btn-dark:hover { color: #fff; background: #29245c; transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #4a3607;
  box-shadow: 0 10px 26px rgba(201,154,46,.28);
}
.btn-gold:hover { color: #4a3607; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(201,154,46,.38); }
.btn-lg { padding: 1.02rem 2.1rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { color: #fff; background: #1ebe5a; transform: translateY(-2px); }

/* ---------- Header / Masthead ---------- */
.topbar {
  background: var(--bg-dark);
  color: var(--secondary);
  font-size: .8rem;
  letter-spacing: .04em;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 38px; padding-block: .35rem; }
.topbar a { color: #fff; }
.topbar .tb-motto { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--ff-head); font-style: italic; }
.topbar .tb-links { display: inline-flex; align-items: center; gap: 1.2rem; }
.topbar .tb-links span { opacity: .55; }

.masthead {
  position: sticky; top: 0; z-index: 200;
  background: rgba(254,252,232,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 3px 0 rgba(199,189,151,.35), 0 5px 0 var(--bg-body), 0 6px 20px rgba(30,27,75,.05);
}
.masthead .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand img, .brand-logo { height: 25px; width: auto; display: block; flex: none; max-width: none; }
.brand-owl { width: 40px; height: 40px; flex: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt b { font-family: var(--ff-head); font-size: 1.4rem; color: var(--text); letter-spacing: .3px; }
.brand-txt span { font-size: .62rem; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }

.nav { display: flex; align-items: center; gap: .4rem; }
.nav a.navlink {
  font-weight: 500;
  color: var(--text);
  padding: .55rem .9rem;
  border-radius: var(--radius);
  position: relative;
  font-size: .97rem;
}
.nav a.navlink::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .35rem; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .22s var(--ease);
}
.nav a.navlink:hover::after, .nav a.navlink.active::after { transform: scaleX(1); }
.nav a.navlink.active { color: var(--primary-darker); }
.nav-cta { display: flex; align-items: center; gap: .6rem; margin-left: .6rem; }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: var(--radius); border: 1.5px solid var(--rule-strong); color: var(--text); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; margin: 4px auto; transition: .25s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(3rem, 7vw, 5.4rem) 0 clamp(3rem, 6vw, 4.6rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 78% 15%, rgba(99,102,241,.12), transparent 60%),
    radial-gradient(ellipse 50% 60% at 8% 90%, rgba(201,154,46,.10), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero h1 { margin: 1rem 0 1.1rem; }
.hero h1 .accent { color: var(--primary-dark); position: relative; white-space: nowrap; }
.hero h1 .accent::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 10px;
  background: var(--secondary); opacity: .4; z-index: -1; border-radius: 4px;
}
.hero p.lead { margin-bottom: 1.8rem; max-width: 34rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.8rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.hero-meta .m b { font-family: var(--ff-head); font-size: 1.55rem; color: var(--primary-darker); display: block; }
.hero-meta .m span { font-size: .82rem; color: var(--ink-faint); }

/* Hero art card (framed owl plaque) */
.hero-art { position: relative; }
.plaque {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
}
.plaque::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--rule); border-radius: 8px; pointer-events: none;
}
.plaque-owl { width: 100%; max-width: 300px; margin: 0 auto .4rem; display: block; }
.plaque-caption { text-align: center; font-family: var(--ff-head); font-style: italic; color: var(--ink-soft); font-size: 1.05rem; }
.plaque-badge {
  position: absolute; top: -16px; right: -16px;
  width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-soft), var(--gold));
  color: #4a3607; display: grid; place-items: center; text-align: center;
  font-family: var(--ff-head); font-weight: 700; line-height: 1;
  box-shadow: 0 8px 20px rgba(201,154,46,.4); transform: rotate(8deg);
  border: 3px solid #fff8e6;
}
.plaque-badge b { font-size: 1.5rem; display: block; }
.plaque-badge span { font-size: .5rem; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.9rem;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
  position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--rule-strong); }
.card-icon {
  width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(99,102,241,.05));
  border: 1px solid rgba(99,102,241,.2); color: var(--primary-dark); margin-bottom: 1.1rem;
}
.card-icon svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); font-size: .98rem; margin-bottom: 0; }
.card .card-link { margin-top: 1.1rem; display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--primary-dark); }
.card .card-link svg { width: 1em; height: 1em; transition: transform .2s var(--ease); }
.card:hover .card-link svg { transform: translateX(4px); }

/* Numbered card (journal index) */
.card-num::before {
  content: attr(data-num);
  position: absolute; top: 1.2rem; right: 1.4rem;
  font-family: var(--ff-head); font-size: 2.6rem; font-weight: 700;
  color: var(--paper-edge); line-height: 1; z-index: 0;
}
.card-num > * { position: relative; z-index: 1; }

/* Tool card with accent bar */
.tool-card { border-top: 3px solid var(--primary); }
.tool-card .tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 700; }

/* Game showcase */
.game-card { overflow: hidden; padding: 0; }
.game-card img { width: 100%; aspect-ratio: 500/295; object-fit: cover; }
.game-card .game-body { padding: 1.3rem 1.5rem 1.6rem; }
.game-card .game-body h4 { margin-bottom: .2rem; }
.game-card .game-body p { font-size: .9rem; color: var(--ink-faint); margin: 0; }

/* Feature list with owl ticks */
.ticks { display: grid; gap: .85rem; }
.ticks li { display: flex; gap: .75rem; align-items: flex-start; color: var(--ink-soft); }
.ticks li svg { flex: none; width: 22px; height: 22px; color: var(--primary); margin-top: 2px; }

/* Stat band */
.stats { background: var(--bg-dark); color: #fff; border-radius: var(--radius-lg); padding: 2.4rem clamp(1.2rem,4vw,3rem); position: relative; overflow: hidden; }
.stats::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 20%, rgba(165,180,252,.18), transparent 45%); }
.stats .grid { position: relative; }
.stat { text-align: center; }
.stat b { font-family: var(--ff-head); font-size: clamp(2rem, 4vw, 2.8rem); color: #fff; display: block; }
.stat b .u { color: var(--gold-soft); }
.stat span { color: var(--secondary); font-size: .92rem; letter-spacing: .03em; }

/* Quote / testimonial */
.quotes { display: grid; gap: 1.6rem; }
.quote {
  background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: 1.6rem 1.7rem; box-shadow: var(--shadow-sm);
}
.quote p { font-family: var(--ff-head); font-style: italic; font-size: 1.08rem; color: var(--text); margin-bottom: .9rem; }
.quote .who { display: flex; align-items: center; gap: .7rem; }
.quote .who .av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-darker)); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--ff-head); }
.quote .who b { font-size: .95rem; }
.quote .who span { font-size: .8rem; color: var(--ink-faint); display: block; }

/* ---------- Panels / Prose ---------- */
.panel {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: clamp(1.6rem, 4vw, 3rem);
}
.prose { max-width: 760px; }
.prose h2 { margin: 2.2rem 0 .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rule); }
.prose h3 { margin: 1.7rem 0 .6rem; color: var(--primary-darker); }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.3rem; }
.prose ul li { list-style: none; position: relative; padding-left: 1.3rem; margin-bottom: .5rem; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .68em; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }
.prose ol { list-style: decimal; }
.prose ol li { margin-bottom: .5rem; padding-left: .3rem; }
.prose ol li::marker { color: var(--primary-dark); font-weight: 700; font-family: var(--ff-head); }
.prose a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }

/* Callout */
.callout { background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.2); border-radius: var(--radius); padding: 1.2rem 1.4rem; display: flex; gap: .9rem; margin: 1.4rem 0; }
.callout svg { flex: none; width: 24px; height: 24px; color: var(--primary-dark); margin-top: 2px; }
.callout.gold { background: rgba(201,154,46,.09); border-color: rgba(201,154,46,.3); }
.callout.gold svg { color: var(--warn); }
.callout p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.callout strong { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .9rem; }
.faq-item { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s var(--ease); }
.faq-item[open] { box-shadow: var(--shadow-sm); border-color: var(--rule-strong); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 1.15rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-family: var(--ff-head); font-weight: 700; font-size: 1.1rem; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .q-ico { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--rule-strong); display: grid; place-items: center; color: var(--primary-dark); transition: .25s var(--ease); }
.faq-item summary .q-ico::before, .faq-item summary .q-ico::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; }
.faq-item summary .q-ico::before { width: 11px; height: 2px; }
.faq-item summary .q-ico::after { width: 2px; height: 11px; transition: transform .25s var(--ease); }
.faq-item[open] summary .q-ico { background: var(--primary); border-color: var(--primary); color: #fff; }
.faq-item[open] summary .q-ico::after { transform: scaleY(0); }
.faq-body { padding: 0 1.4rem 1.3rem; color: var(--ink-soft); }
.faq-body p:last-child { margin-bottom: 0; }

/* ---------- Forms (auth + tools) ---------- */
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--text); }
.field .hint { font-size: .8rem; color: var(--ink-faint); margin-top: .35rem; }
.control, .input, select.control {
  width: 100%; padding: .82rem 1rem; background: #fff;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  color: var(--text); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.control:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.16); }
.control::placeholder { color: #a7a3bd; }
.input-group { position: relative; }
.input-group .prefix { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-weight: 700; }
.input-group .prefix + .control { padding-left: 2rem; }
select.control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a466f' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.6rem; }

/* Segmented radio (risk tolerance etc.) */
.segmented { display: grid; grid-auto-flow: column; gap: .5rem; background: var(--paper-edge); padding: .35rem; border-radius: var(--radius); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { text-align: center; padding: .6rem .5rem; border-radius: 5px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); cursor: pointer; transition: .18s var(--ease); margin: 0; }
.segmented input:checked + label { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.segmented label:hover { color: var(--primary-darker); }

.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 980px; margin-inline: auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--rule); }
.auth-aside { background: var(--bg-dark); color: #fff; padding: clamp(2rem, 4vw, 3rem); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.auth-aside::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 10%, rgba(165,180,252,.22), transparent 50%); }
.auth-aside > * { position: relative; }
.auth-aside h2 { color: #fff; }
.auth-aside p { color: var(--secondary); }
.auth-aside .a-owl { width: 76px; height: 76px; margin-bottom: 1.2rem; }
.auth-aside .ticks li { color: #d9dcff; }
.auth-aside .ticks li svg { color: var(--gold-soft); }
.auth-form { background: var(--paper); padding: clamp(2rem, 4vw, 3rem); }
.auth-form h1 { font-size: clamp(1.7rem, 3vw, 2.1rem); }
.divider-or { display: flex; align-items: center; gap: 1rem; color: var(--ink-faint); font-size: .82rem; margin: 1.3rem 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.check-row { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); }
.check-row input { margin-top: .25rem; accent-color: var(--primary); }
.form-foot { text-align: center; margin-top: 1.3rem; font-size: .92rem; color: var(--ink-soft); }

/* ---------- Tool UI ---------- */
.tool-shell { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; align-items: start; }
.tool-panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(1.4rem, 3vw, 2.1rem); }
.tool-panel h3 { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.3rem; padding-bottom: .8rem; border-bottom: 1px solid var(--rule); }
.tool-panel h3 svg { width: 22px; height: 22px; color: var(--primary); }
.result-empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-faint); }
.result-empty svg { width: 60px; height: 60px; color: var(--rule-strong); margin: 0 auto 1rem; }

.range-wrap { display: flex; align-items: center; gap: 1rem; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--paper-edge); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; cursor: pointer; }
.range-val { font-family: var(--ff-head); font-weight: 700; font-size: 1.2rem; color: var(--primary-darker); min-width: 3.2rem; text-align: right; }

.result-metric { display: flex; align-items: baseline; justify-content: space-between; padding: .85rem 0; border-bottom: 1px dashed var(--rule); }
.result-metric:last-child { border-bottom: none; }
.result-metric .k { color: var(--ink-soft); font-size: .92rem; }
.result-metric .v { font-family: var(--ff-head); font-weight: 700; font-size: 1.35rem; color: var(--primary-darker); }
.big-figure { text-align: center; padding: 1.4rem 0; }
.big-figure .n { font-family: var(--ff-head); font-weight: 700; font-size: clamp(2.6rem, 7vw, 3.6rem); color: var(--primary-darker); line-height: 1; }
.big-figure .l { color: var(--ink-faint); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; }

.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.badge-green { background: rgba(47,133,90,.12); color: var(--success); }
.badge-amber { background: rgba(183,121,31,.14); color: var(--warn); }
.badge-red { background: rgba(178,59,59,.12); color: var(--danger); }
.badge-indigo { background: rgba(99,102,241,.12); color: var(--primary-dark); }

.meter { height: 12px; border-radius: 999px; background: var(--paper-edge); overflow: hidden; margin: .4rem 0; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-darker)); transition: width .8s var(--ease); }
.meter.gold > i { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }

.plan-row { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-radius: var(--radius); background: rgba(99,102,241,.05); margin-bottom: .55rem; }
.plan-row .lbl { font-size: .92rem; color: var(--ink-soft); }
.plan-row .amt { font-family: var(--ff-head); font-weight: 700; color: var(--primary-darker); }

/* Quiz */
.quiz-progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.quiz-progress .bar { flex: 1; }
.quiz-progress .count { font-family: var(--ff-head); font-weight: 700; color: var(--primary-darker); white-space: nowrap; }
.q-num { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.q-text { font-family: var(--ff-head); font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin: .4rem 0 1.4rem; }
.q-options { display: grid; gap: .7rem; }
.q-opt {
  display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left;
  padding: 1rem 1.1rem; border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  background: #fff; color: var(--text); font-size: 1rem; transition: .16s var(--ease);
}
.q-opt:hover { border-color: var(--primary); background: rgba(99,102,241,.05); transform: translateX(3px); }
.q-opt .key { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--rule-strong); display: grid; place-items: center; font-weight: 700; font-family: var(--ff-head); color: var(--primary-dark); }
.q-opt.correct { border-color: var(--success); background: rgba(47,133,90,.09); }
.q-opt.correct .key { background: var(--success); border-color: var(--success); color: #fff; }
.q-opt.wrong { border-color: var(--danger); background: rgba(178,59,59,.08); }
.q-opt.wrong .key { background: var(--danger); border-color: var(--danger); color: #fff; }
.q-opt:disabled { cursor: default; }
.q-explain { margin-top: 1rem; padding: 1rem 1.2rem; background: rgba(99,102,241,.06); border-radius: var(--radius); font-size: .92rem; color: var(--ink-soft); border-left: 3px solid var(--primary); }
.score-ring { width: 180px; height: 180px; margin: 0 auto 1rem; }
.iq-scale { display: grid; gap: .5rem; margin-top: 1.2rem; }
.iq-scale .row { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.iq-scale .row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.iq-scale .row.active { font-weight: 700; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--bg-dark), #2c2668); color: #fff; border-radius: var(--radius-lg); padding: clamp(2.4rem, 5vw, 3.6rem); text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(165,180,252,.2), transparent 45%), radial-gradient(circle at 85% 80%, rgba(201,154,46,.15), transparent 45%); }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; margin-bottom: .8rem; }
.cta-band p { color: var(--secondary); max-width: 40rem; margin: 0 auto 1.7rem; }
.cta-band .hero-cta { justify-content: center; }
.cta-owl { width: 64px; height: 64px; margin: 0 auto 1rem; }

/* ---------- Page hero (interior) ---------- */
.page-hero { padding: clamp(2.6rem, 6vw, 4rem) 0 clamp(1.8rem, 4vw, 2.6rem); position: relative; }
.page-hero::after { content: ""; display: block; }
.breadcrumb { font-size: .82rem; color: var(--ink-faint); margin-bottom: .8rem; display: flex; gap: .5rem; align-items: center; }
.breadcrumb a { color: var(--primary-dark); }
.breadcrumb svg { width: 14px; height: 14px; }
.page-hero h1 { margin-bottom: .7rem; }
.page-hero p { color: var(--ink-soft); max-width: 640px; font-size: 1.08rem; }

/* ---------- Footer / Colophon ---------- */
.colophon { background: var(--bg-dark); color: var(--secondary); padding-top: 3.4rem; margin-top: 2rem; }
.colophon a { color: #cdd2ff; }
.colophon a:hover { color: #fff; }
.colophon-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.2rem; padding-bottom: 2.4rem; border-bottom: 1px solid rgba(165,180,252,.16); }
.colophon .c-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.colophon .c-brand img, .colophon .c-brand .brand-logo { height: 24px; width: auto; flex: none; max-width: none; }
.colophon .c-brand .brand-owl { width: 38px; height: 38px; }
.colophon .c-about { font-size: .92rem; color: #b9beea; max-width: 30rem; }
.colophon h5 { color: #fff; font-family: var(--ff-head); font-size: 1.05rem; margin-bottom: 1rem; letter-spacing: .04em; }
.colophon .c-links { display: grid; gap: .6rem; font-size: .92rem; }
.colophon .c-wa { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.1rem; padding: .6rem 1rem; border-radius: var(--radius); background: rgba(37,211,102,.14); border: 1px solid rgba(37,211,102,.3); color: #7ff0a8; font-weight: 600; font-size: .9rem; }
.colophon .c-wa:hover { color: #fff; background: rgba(37,211,102,.22); }
.colophon .c-wa svg { width: 18px; height: 18px; }
.colophon-legal { padding: 1.5rem 0 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; font-size: .82rem; color: #9aa0d4; }
.colophon-legal .legal-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.colophon-legal .legal-links a { color: #b9beea; }
.age-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-weight: 700; color: #fff; font-size: .78rem; }
.age-badge b { background: var(--gold); color: #3a2c05; border-radius: 4px; padding: 0 .35rem; }

.disclaimer-strip { background: #17153d; color: #8f95cc; font-size: .78rem; text-align: center; padding: .9rem 0; line-height: 1.6; }

/* ---------- Owl SVG helpers ---------- */
.owl-line { color: var(--primary); }
/* Reveal-on-scroll only engages when JS adds `.js`; without JS everything stays visible. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .6rem; } .mt-2 { margin-top: 1.2rem; } .mt-3 { margin-top: 1.8rem; }
.mb-1 { margin-bottom: .6rem; } .mb-2 { margin-bottom: 1.2rem; } .mb-3 { margin-bottom: 1.8rem; }
.muted { color: var(--ink-faint); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: .6rem; } .gap-2 { gap: 1rem; }
.wrap { flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-art { order: -1; max-width: 440px; }
  .tool-shell { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .colophon-top { grid-template-columns: 1fr 1fr; }
  .colophon .c-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw);
    background: var(--bg-body); flex-direction: column; align-items: stretch;
    padding: 5.2rem 1.4rem 2rem; gap: .3rem; transform: translateX(105%);
    transition: transform .3s var(--ease); box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--rule); z-index: 190; overflow-y: auto;
  }
  .nav.open { transform: none; }
  .nav a.navlink { padding: .85rem 1rem; border-radius: var(--radius); font-size: 1.05rem; border-bottom: 1px solid var(--rule); }
  .nav a.navlink::after { display: none; }
  .nav-cta { flex-direction: column; align-items: stretch; margin-left: 0; margin-top: .8rem; }
  .nav-cta .btn { width: 100%; }
  .nav-toggle { display: block; }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(30,27,75,.4); backdrop-filter: blur(2px); z-index: 180; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  .nav-backdrop.show { opacity: 1; pointer-events: auto; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  body { font-size: .98rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar .tb-motto { display: none; }
  .hero-meta { gap: 1.1rem; }
  .colophon-top { grid-template-columns: 1fr; }
  .colophon-legal { flex-direction: column; align-items: flex-start; }
  .plaque-badge { width: 68px; height: 68px; }
  .section { padding: 2.6rem 0; }
}
@media (max-width: 400px) {
  .brand-owl { width: 32px; height: 32px; }
  .brand img, .brand-logo { height: 20px; }
  .masthead .container { min-height: 64px; }
  .container { padding-inline: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
