/* ==========================================================================
   AlienWeb ADCA — design system
   Shares the tokens/typography of alienweb.in so the subdomain reads as the
   same brand, with quiz-specific components layered on top.
   ========================================================================== */

:root{
  --bg:#FBFAF7; --bg-raised:#FFFFFF; --bg-sunken:#F3F1EA;
  --border:#E6E2D8; --border-strong:#D8D3C4;
  --text:#1F1E1C; --text-muted:#5B5850; --text-faint:#8A8676;
  --accent:#1F8181; --accent-hover:#186A6A; --accent-soft:#E4F1F1; --accent-contrast:#FFFFFF;
  --link:#1F8181;
  --ok:#2E7D4F; --ok-soft:#E3F2E9;
  --bad:#C0523F; --bad-soft:#FBE9E5;
  --warn:#B8842A;
  --shadow-sm:0 1px 2px rgba(31,30,28,.06);
  --shadow-md:0 4px 16px rgba(31,30,28,.08);
  --radius-sm:8px; --radius-md:14px; --radius-lg:20px; --radius-pill:999px;
  --font-sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-serif:"Source Serif 4",Georgia,serif;
  --font-mono:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
  --header-h:64px;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#17181A; --bg-raised:#1E2022; --bg-sunken:#131415;
  --border:#2C2E30; --border-strong:#3A3C3E;
  --text:#EDEBE4; --text-muted:#A8A497; --text-faint:#757269;
  --accent:#3FC1C0; --accent-hover:#56D2D1; --accent-soft:#1B3536; --accent-contrast:#0E1414;
  --link:#3FC1C0;
  --ok:#6FCB93; --ok-soft:#16301F;
  --bad:#E28374; --bad-soft:#3A1F1A;
  --warn:#E3B65C;
  color-scheme:dark;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]):not([data-theme="dark"]){
    --bg:#17181A; --bg-raised:#1E2022; --bg-sunken:#131415;
    --border:#2C2E30; --border-strong:#3A3C3E;
    --text:#EDEBE4; --text-muted:#A8A497; --text-faint:#757269;
    --accent:#3FC1C0; --accent-hover:#56D2D1; --accent-soft:#1B3536; --accent-contrast:#0E1414;
    --link:#3FC1C0;
    --ok:#6FCB93; --ok-soft:#16301F;
    --bad:#E28374; --bad-soft:#3A1F1A;
    --warn:#E3B65C;
    color-scheme:dark;
  }
}

*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:var(--bg);color:var(--text);
  font-family:var(--font-sans);font-size:16px;line-height:1.65;
  -webkit-font-smoothing:antialiased;overflow-x:clip;
}
img,svg{display:block;max-width:100%}
a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{font-family:var(--font-serif);font-weight:700;line-height:1.15;margin:0 0 .5em;color:var(--text)}
h1{font-size:clamp(1.8rem,4vw,2.6rem)}
h2{font-size:clamp(1.35rem,2.6vw,1.85rem)}
h3{font-size:1.1rem}
p{margin:0 0 1em;color:var(--text-muted)}
.container{max-width:1080px;margin:0 auto;padding:0 20px}
.narrow{max-width:800px}
.skip-link{position:absolute;left:-999px;background:var(--accent);color:var(--accent-contrast);padding:10px 16px;z-index:200}
.skip-link:focus{left:0}

/* ---------- header ---------- */
.site-header{
  position:sticky;top:0;z-index:100;height:var(--header-h);
  background:color-mix(in srgb,var(--bg) 90%,transparent);
  backdrop-filter:saturate(180%) blur(10px);border-bottom:1px solid var(--border);
}
.nav-container{height:var(--header-h);display:flex;align-items:center;gap:18px}
.logo{display:flex;align-items:center;gap:9px;font-weight:700;font-size:1.08rem;color:var(--text);flex-shrink:0}
.logo:hover{text-decoration:none}
.logo .mark{width:30px;height:30px;border-radius:9px;background:var(--accent);display:grid;place-items:center;color:var(--accent-contrast);font-family:var(--font-serif);font-weight:700}
/* The nav stays visible on phones as a single scrollable row rather than
   collapsing into a drawer. Most of this site's traffic is students on mobile,
   and there are only five short destinations — hiding them behind a toggle
   (or, as before, hiding them entirely) just costs page views. */
.main-nav{
  display:flex;gap:18px;font-size:.92rem;margin-left:auto;
  min-width:0;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.main-nav::-webkit-scrollbar{display:none}
.main-nav a{color:var(--text-muted);white-space:nowrap}
.main-nav a:hover{color:var(--accent);text-decoration:none}
@media(max-width:819px){
  .main-nav{gap:16px;font-size:.86rem;margin-left:14px;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
  /* The logo wordmark is the first thing to go when space is tight. */
  .logo .word{display:none}
}
.header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.icon-btn{
  width:36px;height:36px;border-radius:var(--radius-pill);border:1px solid var(--border);
  background:var(--bg-raised);color:var(--text);display:grid;place-items:center;cursor:pointer;flex-shrink:0
}
.icon-btn:hover{border-color:var(--accent);color:var(--accent)}
.icon-btn svg{width:17px;height:17px}
.theme-toggle .sun{display:none}
:root[data-theme="dark"] .theme-toggle .sun{display:block}
:root[data-theme="dark"] .theme-toggle .moon{display:none}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:12px 24px;border-radius:var(--radius-pill);border:1px solid transparent;
  font-family:var(--font-sans);font-weight:600;font-size:.95rem;cursor:pointer;transition:.15s ease
}
.btn:hover{text-decoration:none}
.btn-primary{background:var(--accent);color:var(--accent-contrast)}
.btn-primary:hover{background:var(--accent-hover)}
.btn-secondary{background:var(--bg-raised);color:var(--text);border-color:var(--border)}
.btn-secondary:hover{border-color:var(--accent);color:var(--accent)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-lg{padding:15px 32px;font-size:1rem}

/* ---------- hero ---------- */
.hero{padding:52px 0 30px;text-align:center}
.eyebrow{
  display:inline-block;font-size:.72rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;
  color:var(--accent);background:var(--accent-soft);padding:6px 13px;border-radius:var(--radius-pill);margin-bottom:16px
}
.hero h1{max-width:19ch;margin-left:auto;margin-right:auto}
.hero .lede{max-width:60ch;margin:18px auto 26px;font-size:1.05rem}
.hero-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}

.stat-row{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-top:34px}
.stat{background:var(--bg-raised);border:1px solid var(--border);border-radius:var(--radius-md);padding:16px 22px;min-width:120px}
.stat b{display:block;font-family:var(--font-serif);font-size:1.6rem;line-height:1;color:var(--accent)}
.stat span{font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint)}

/* ---------- cards ---------- */
.section{padding:36px 0}
.section-head{margin-bottom:20px}
.section-head p{margin:6px 0 0}
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}
.test-card{
  background:var(--bg-raised);border:1px solid var(--border);border-radius:var(--radius-md);
  padding:22px;display:flex;flex-direction:column;gap:8px;transition:.16s ease
}
.test-card:hover{border-color:var(--accent);box-shadow:var(--shadow-sm);transform:translateY(-2px);text-decoration:none}
.test-card .badge{
  align-self:flex-start;font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  background:var(--accent-soft);color:var(--accent);padding:4px 10px;border-radius:var(--radius-pill)
}
.test-card h3{margin:4px 0 0;font-family:var(--font-sans);font-size:1.02rem}
.test-card p{margin:0;font-size:.88rem;flex:1}
.test-card .meta{font-size:.8rem;color:var(--text-faint);font-weight:600}

/* ---------- quiz engine ---------- */
.quiz-shell{
  background:var(--bg-raised);border:1px solid var(--border);border-radius:var(--radius-lg);
  padding:26px;margin:26px 0;box-shadow:var(--shadow-sm)
}
.quiz-top{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin-bottom:16px}
.quiz-count{font-size:.85rem;font-weight:600;color:var(--text-faint);letter-spacing:.03em}
.quiz-timer{
  font-family:var(--font-mono);font-size:.92rem;font-weight:500;
  background:var(--bg-sunken);border:1px solid var(--border);border-radius:var(--radius-pill);padding:6px 15px
}
.quiz-timer.low{color:var(--bad);border-color:var(--bad)}
.progress{height:6px;background:var(--bg-sunken);border-radius:99px;overflow:hidden;margin-bottom:22px}
.progress > i{display:block;height:100%;background:var(--accent);width:0;transition:width .25s ease}

.q-text{font-family:var(--font-serif);font-size:clamp(1.1rem,2vw,1.3rem);font-weight:700;line-height:1.4;margin:0 0 18px;color:var(--text)}
.options{display:grid;gap:10px;margin:0 0 22px;padding:0;list-style:none}
.option{
  display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;
  background:var(--bg);border:1.5px solid var(--border);border-radius:var(--radius-sm);
  padding:14px 16px;font:inherit;font-size:.97rem;color:var(--text);cursor:pointer;transition:.13s ease
}
.option:hover:not(:disabled){border-color:var(--accent);background:var(--accent-soft)}
.option .key{
  flex-shrink:0;width:24px;height:24px;border-radius:6px;background:var(--bg-sunken);
  display:grid;place-items:center;font-size:.78rem;font-weight:700;color:var(--text-muted)
}
.option.selected{border-color:var(--accent);background:var(--accent-soft)}
.option.selected .key{background:var(--accent);color:var(--accent-contrast)}
.option.correct{border-color:var(--ok);background:var(--ok-soft)}
.option.correct .key{background:var(--ok);color:#fff}
.option.wrong{border-color:var(--bad);background:var(--bad-soft)}
.option.wrong .key{background:var(--bad);color:#fff}
.option:disabled{cursor:default}

.quiz-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.quiz-actions .spacer{flex:1}
.feedback{font-size:.9rem;font-weight:600;margin:0 0 14px}
.feedback.ok{color:var(--ok)}
.feedback.bad{color:var(--bad)}

/* results */
.result{text-align:center;padding:14px 0}
.result .score{font-family:var(--font-serif);font-size:3.4rem;font-weight:700;line-height:1;color:var(--accent)}
.result .outof{font-size:1rem;color:var(--text-faint);margin-top:4px}
.result .verdict{font-size:1.05rem;font-weight:600;margin:16px 0 6px}
.result-bars{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:22px 0}
.result-bars div{background:var(--bg-sunken);border-radius:var(--radius-sm);padding:12px 18px;min-width:96px}
.result-bars b{display:block;font-size:1.3rem;font-family:var(--font-serif)}
.result-bars span{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint)}

/* review list */
.review{margin-top:26px;border-top:1px solid var(--border);padding-top:22px}
.review h3{margin-bottom:14px}
.review-item{border:1px solid var(--border);border-radius:var(--radius-sm);padding:15px 17px;margin-bottom:10px;background:var(--bg)}
.review-item .rq{font-weight:600;margin:0 0 8px;color:var(--text);font-size:.97rem}
.review-item .ra{margin:0;font-size:.88rem}
.review-item .ra .tag{font-weight:700}
.review-item.ok{border-left:3px solid var(--ok)}
.review-item.bad{border-left:3px solid var(--bad)}

/* ---------- static Q&A (crawlable) ---------- */
.qa-list{margin:26px 0;counter-reset:qa}
.qa-item{border-bottom:1px solid var(--border);padding:18px 0}
.qa-item:first-child{border-top:1px solid var(--border)}
.qa-q{font-weight:600;color:var(--text);margin:0 0 10px;display:flex;gap:10px}
.qa-q::before{counter-increment:qa;content:counter(qa) ".";color:var(--accent);font-weight:700;flex-shrink:0}
.qa-opts{list-style:none;padding:0;margin:0 0 8px 26px;display:grid;gap:4px}
.qa-opts li{font-size:.92rem;color:var(--text-muted)}
.qa-opts li.is-ans{color:var(--ok);font-weight:600}
.qa-ans{margin:0 0 0 26px;font-size:.88rem;color:var(--text-faint)}
.qa-ans b{color:var(--ok)}

/* ---------- certificate offer on the result screen ---------- */
.cert-cta{
  margin:26px 0 0;padding:26px 24px;text-align:center;
  border:1px solid var(--accent);border-radius:var(--radius-md);
  background:var(--accent-soft);
}
.cert-badge{
  display:inline-block;margin-bottom:10px;padding:5px 12px;border-radius:var(--radius-pill);
  background:var(--accent);color:var(--accent-contrast);
  font-size:.7rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
}
.cert-cta h3{margin:0 0 10px;font-family:var(--font-serif);font-size:1.25rem;color:var(--text)}
.cert-cta p{margin:0 auto 18px;max-width:52ch;font-size:.95rem;color:var(--text-muted)}
.cert-cta .cert-note{margin:12px auto 0;font-size:.78rem;color:var(--text-faint)}
/* WhatsApp green is fixed in both themes — it is the brand cue people look for. */
.btn-wa{background:#25D366;color:#06301A;display:inline-flex;align-items:center;gap:10px}
.btn-wa:hover{background:#1FBA57;color:#06301A}
.btn-wa svg{width:20px;height:20px;flex-shrink:0}
.retry-note{
  margin:22px 0 0;padding:16px 18px;border:1px dashed var(--border-strong);
  border-radius:var(--radius-md);background:var(--bg-sunken);text-align:center;
}
.retry-note p{margin:0;font-size:.9rem;color:var(--text-muted)}
/* Separated from the result buttons above so the ad is never mistaken for one
   of the actions — an accidental-click layout is an AdSense policy problem. */
.result-ad{margin:30px 0;padding-top:26px;border-top:1px solid var(--border);text-align:center}
.result-ad:empty{display:none}

/* The static version of the offer, shown in the page body before a test is
   taken. Deliberately quieter than .cert-cta, which is the earned reward. */
.cert-panel{
  margin:34px 0;padding:28px 24px;text-align:center;
  border:1px solid var(--border-strong);border-radius:var(--radius-md);
  background:var(--bg-raised);box-shadow:var(--shadow-sm);
}
.cert-panel h2{margin:0 0 10px;font-size:1.3rem}
.cert-panel p{margin:0 auto 18px;max-width:58ch;color:var(--text-muted)}
.cert-actions{display:flex;gap:12px;flex-wrap:wrap;justify-content:center}

/* ---------- misc ---------- */
.ad-slot{margin:26px 0;text-align:center}
.ad-slot .ad-label{font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;color:var(--text-faint);margin-bottom:8px}
.prose h2{margin-top:1.7em}
.prose ul,.prose ol{color:var(--text-muted);padding-left:1.3em}
.prose li{margin-bottom:.45em}
.breadcrumbs{font-size:.82rem;color:var(--text-faint);margin:18px 0 0}
.breadcrumbs a{color:var(--text-faint)}
.breadcrumbs a:hover{color:var(--accent)}
.faq details{border-bottom:1px solid var(--border);padding:16px 2px}
.faq{border-top:1px solid var(--border)}
.faq summary{cursor:pointer;font-weight:600;list-style:none;display:flex;justify-content:space-between;gap:12px;color:var(--text)}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";color:var(--accent);font-size:1.25rem;flex-shrink:0}
.faq details[open] summary::after{content:"\2212"}
.faq p{margin:11px 0 0}

.site-footer{border-top:1px solid var(--border);margin-top:52px;padding:34px 0 26px;background:var(--bg-sunken)}
.foot-grid{display:grid;grid-template-columns:1.5fr 1fr 1fr;gap:24px}
.foot-grid h4{font-size:.74rem;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);margin:0 0 10px}
.foot-grid ul{list-style:none;padding:0;margin:0;display:grid;gap:7px}
.foot-grid a{font-size:.86rem;color:var(--text-muted)}
.foot-grid a:hover{color:var(--accent);text-decoration:none}
.foot-bottom{margin-top:26px;padding-top:16px;border-top:1px solid var(--border);font-size:.8rem;color:var(--text-faint);display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}

@media (max-width:700px){
  .foot-grid{grid-template-columns:1fr 1fr}
  .quiz-shell{padding:20px 17px}
  .card-grid{grid-template-columns:1fr}
}
@media (max-width:460px){
  .foot-grid{grid-template-columns:1fr}
  .hero{padding:38px 0 24px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
