/* ============================================================
   StudyVaults — minimalist redesign
   Design tokens
   ============================================================ */
:root {
  /* Light theme (default) */
  --bg:        #fbfaf7;
  --surface:   #ffffff;
  --surface-2: #f4f2ec;
  --ink:       #0f1e3d;
  --muted:     #5c6576;
  --line:      #e4e6ec;
  --accent:    #ffc629;
  --accent-ink:#946200;
  --accent-tint:#fff4d1;
  --success:   #2f9e69;
  --success-ink:#1f7d50;
  --success-tint:#e7f4ec;
  --shadow:    0 1px 2px rgba(20,18,12,.04), 0 8px 24px -12px rgba(20,18,12,.12);
  --shadow-lg: 0 24px 60px -24px rgba(20,18,12,.28);

  --radius:   18px;
  --radius-sm:12px;
  --container:1120px;
  --ease: cubic-bezier(.22,.61,.36,1);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-sans); /* was "Fraunces", serif — dropped site-wide per request */
}

[data-theme="dark"] {
  --bg:        #0e0e11;
  --surface:   #17171b;
  --surface-2: #1f1f24;
  --ink:       #f4f3ef;
  --muted:     #9c9aa3;
  --line:      #2a2a31;
  --accent:    #ffce3a;
  --accent-ink:#ffd873;
  --accent-tint:#382c0a;
  --success:   #43c08a;
  --success-ink:#6fd3a6;
  --success-tint:#16271f;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 70px -28px rgba(0,0,0,.7);
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s var(--ease), color .4s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -.02em; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 12px; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  --pad-y: 11px; --pad-x: 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: .95rem; line-height: normal;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--lg { --pad-y: 15px; --pad-x: 28px; font-size: 1.02rem; min-width: 200px; }

.btn--primary {
  background: var(--accent);
  color: #0f1e3d;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 84%, #000); transform: translateY(-2px); box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--accent) 75%, transparent); }
[data-theme="dark"] .btn--primary { color: #0f1e3d; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--muted); transform: translateY(-2px); }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 1.12rem; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  color: var(--accent);
}
.brand__name span { color: var(--accent-ink); }

.nav__links { display: flex; gap: 4px; }
.nav__links a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 500; font-size: .95rem;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--surface-2); }

.nav__actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink); cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); transform: translateY(-1px); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav__burger { display: none; flex-direction: column; gap: 5px; width: 42px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.nav__burger span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Announcement bar ---- */
.announce { background: var(--ink); color: var(--bg); text-align: center; font-size: .82rem; padding: 7px 16px; }
.announce p { margin: 0; }
.announce em { font-style: italic; opacity: .92; }
[data-theme="dark"] .announce { background: var(--accent); color: #14131a; }

/* ---- Notes dropdown ---- */
.nav__dropdown { position: relative; }
.nav__droptrigger {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: 999px;
  font: inherit; font-weight: 500; font-size: .95rem;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav__droptrigger:hover, .nav__dropdown:hover .nav__droptrigger,
.nav__dropdown.is-open .nav__droptrigger { color: var(--ink); background: var(--surface-2); }
.nav__chev { transition: transform .2s var(--ease); }
.nav__dropdown:hover .nav__chev, .nav__dropdown.is-open .nav__chev { transform: rotate(180deg); }
.nav__dropmenu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  min-width: 212px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.nav__dropdown:hover .nav__dropmenu, .nav__dropdown:focus-within .nav__dropmenu,
.nav__dropdown.is-open .nav__dropmenu { opacity: 1; visibility: visible; transform: none; }
.nav__dropmenu a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--ink); font-size: .95rem; font-weight: 500;
}
.nav__dropmenu a:hover { background: var(--surface-2); color: var(--accent-ink); }
.nav__badge {
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-ink);
}

/* ---- Coming-soon page ---- */
.coming { padding: clamp(70px, 14vw, 150px) 0; text-align: center; }
.coming__inner { max-width: 600px; margin-inline: auto; }
.coming__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.03em; margin-top: 14px; }
.coming__sub { margin: 20px auto 0; color: var(--muted); font-size: 1.1rem; max-width: 520px; }
.coming__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding: clamp(56px, 11vw, 120px) 0 clamp(48px, 8vw, 88px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 70% at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(50% 60% at 0% 10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 55%);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 880px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; opacity: .6; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  margin: 18px 0 0;
}
.hero__title em { font-style: italic; color: var(--accent-ink); }

.hero__sub {
  margin-top: 24px; max-width: 600px;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--muted);
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero__trust {
  display: flex; flex-wrap: wrap; gap: 14px 36px;
  list-style: none; margin: 52px 0 0; padding: 28px 0 0;
  border-top: 1px solid var(--line);
}
.hero__trust li { color: var(--muted); font-size: .95rem; }
.hero__trust strong {
  display: block; color: var(--ink);
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.9rem; letter-spacing: -.02em; line-height: 1;
}
.hero__proof { margin: 20px 0 0; color: var(--muted); font-size: .95rem; }
.hero__proof strong { color: var(--accent-ink); font-weight: 700; }

/* ============================================================
   Section scaffold
   ============================================================ */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section--alt { background: var(--surface-2); }

.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }
.section__head--center { justify-content: center; text-align: center; margin-bottom: 56px; }
.section__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  margin-top: 10px;
}

/* ============================================================
   Search
   ============================================================ */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 16px; height: 46px;
  min-width: 260px; color: var(--muted);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.search input { border: 0; background: transparent; outline: none; color: var(--ink); font: inherit; font-size: .95rem; width: 100%; }

/* ============================================================
   Subjects
   ============================================================ */
.subjects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.subject {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.subject:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-lg); }

.subject__icon {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-tint); color: var(--accent-ink);
  margin-bottom: 16px;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.subject__icon svg { width: 24px; height: 24px; }
.subject:hover .subject__icon { background: var(--accent); color: #0f1e3d; transform: rotate(-4deg) scale(1.05); }

.subject h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.subject p { margin-top: 8px; color: var(--muted); font-size: .92rem; line-height: 1.5; flex-grow: 1; }
.subject__go { margin-top: 18px; font-size: .88rem; font-weight: 600; color: var(--accent-ink); opacity: 0; transform: translateX(-6px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.subject:hover .subject__go { opacity: 1; transform: translateX(0); }

.subject.is-hidden { display: none; }
.subjects__empty { text-align: center; color: var(--muted); margin-top: 36px; }

/* ---- Per-subject progress ring (home dashboard) ---- */
.subject__ring { position: absolute; top: 22px; right: 22px; width: 44px; height: 44px; }
.subject__ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.subject__ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 4; }
.subject__ring-bar {
  fill: none; stroke: var(--success); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 100.53; stroke-dashoffset: 100.53;
  transition: stroke-dashoffset .7s var(--ease);
}
.subject__ring-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .64rem; font-weight: 700; color: var(--muted);
}
.subject__ring.has-progress .subject__ring-label { color: var(--success-ink); }
[data-theme="dark"] .subject__ring-bg { stroke: var(--line); }

/* ============================================================
   Features
   ============================================================ */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
/* An odd number of cards leaves the last one alone on its row — center it
   instead of letting it sit flush left. Self-correcting: if a 6th card is
   ever added, :last-child stops being :nth-child(odd) and this stops applying. */
.features .feature:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: calc(50% - 10px); margin-inline: auto; }
.feature {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feature__num {
  font-family: var(--font-display); font-size: 1rem;
  color: var(--accent-ink); font-weight: 500;
}
.feature h3 { margin-top: 14px; font-size: 1.28rem; font-weight: 600; }
.feature p { margin-top: 10px; color: var(--muted); }

/* ============================================================
   Revision tips
   ============================================================ */
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tip {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  border-left: 3px solid var(--accent);
}
.tip h3 { font-size: 1.15rem; font-weight: 600; }
.tip p { margin-top: 10px; color: var(--muted); font-size: .95rem; }

/* ============================================================
   Quote band
   ============================================================ */
.quote-band { padding: clamp(60px, 9vw, 110px) 0; background: var(--ink); color: var(--bg); }
[data-theme="dark"] .quote-band { background: var(--surface-2); color: var(--ink); }
.quote { max-width: 820px; margin: 0 auto; text-align: center; }
.quote p {
  font-family: var(--font-display); font-weight: 400; font-style: italic;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem); line-height: 1.3; letter-spacing: -.02em;
}
.quote cite { display: block; margin-top: 22px; font-style: normal; font-size: .95rem; opacity: .7; }

/* ============================================================
   CTA
   ============================================================ */
.cta { padding: clamp(64px, 9vw, 120px) 0; }
.cta__inner {
  text-align: center;
  background:
    radial-gradient(80% 120% at 50% -20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(40px, 7vw, 76px) 24px;
}
.cta__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 5vw, 3.2rem); }
.cta__sub { max-width: 540px; margin: 18px auto 0; color: var(--muted); font-size: 1.08rem; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }

/* Contact / subject-request form (feeds the admin Requests inbox; shown when accounts are on) */
.contact-form { max-width: 560px; margin: 32px auto 0; display: grid; gap: 14px; text-align: left; }
.contact-form label { display: grid; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.contact-form textarea { resize: vertical; min-height: 96px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint);
}
.contact-form__msg { font-size: .9rem; font-weight: 600; color: var(--accent-ink); margin: 0; }
.contact-form button { justify-self: center; }
@media (max-width: 560px) { .contact-form__row { grid-template-columns: 1fr; } }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding-top: 64px; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer__brand p { margin-top: 16px; color: var(--muted); font-size: .95rem; max-width: 280px; }
.footer__col h4, .footer__col-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.footer__col a { display: block; padding: 5px 0; color: var(--ink); font-size: .95rem; opacity: .85; transition: opacity .2s var(--ease), color .2s var(--ease); }
.footer__col a:hover { opacity: 1; color: var(--accent-ink); }
.footer__legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__legal a { color: var(--muted); font-size: .82rem; transition: color .2s var(--ease); }
.footer__legal a:hover { color: var(--accent-ink); }
.footer__bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 22px 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
}

/* ============================================================
   Reveal animation
   ============================================================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Mobile menu panel
   ============================================================ */
.mobile-menu {
  position: fixed; inset: 68px 0 auto 0; z-index: 49;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 16px 24px 24px;
  display: grid; gap: 6px;
  transform: translateY(-12px); opacity: 0; pointer-events: none;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
  box-shadow: var(--shadow-lg);
}
.mobile-menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
.mobile-menu a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 6px; font-size: 1.1rem; font-weight: 500; border-bottom: 1px solid var(--line); }
.mobile-menu a:last-of-type { border-bottom: 0; }
.mobile-menu .btn { margin-top: 12px; justify-content: center; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .subjects { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .features { grid-template-columns: 1fr; }
  .features .feature:last-child:nth-child(odd) { max-width: none; }
  .tips { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .subjects { grid-template-columns: 1fr; }
  .section__head { align-items: stretch; }
  .search { min-width: 0; width: 100%; }
  .footer__inner { grid-template-columns: 1fr; gap: 28px; }
  .hero__trust { gap: 18px 28px; }
}
