/* =========================================================
   Nova Education — shared stylesheet
   Dark editorial-meets-tech. Inherits parent's electric-blue
   accent on near-black, with serif treatments for the books.
   ========================================================= */

:root {
  /* Surface */
  --bg:           #08080a;
  --bg-2:         #0c0d11;
  --bg-3:         #11131a;
  --line:         #1c1f28;
  --line-2:       #262a35;

  /* Ink */
  --ink:          #f3f4f7;
  --ink-2:        #b5b8c2;
  --ink-3:        #74778290;
  --ink-4:        #4a4d57;

  /* Accent — electric blue from parent */
  --blue:         #2b6bff;
  --blue-2:       #4d8cff;
  --blue-dim:     #1a48b8;
  --blue-glow:    rgba(43, 107, 255, 0.45);
  --blue-soft:    rgba(43, 107, 255, 0.08);

  /* Type */
  --sans: "Sora", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Rhythm */
  --rail: clamp(20px, 4vw, 64px);
  --maxw: 1320px;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 78% -10%, rgba(43,107,255,0.22), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(43,107,255,0.08), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--blue); color: white; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--rail);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 22px 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(8,8,10,0.82), rgba(8,8,10,0.55));
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark { width: 36px; height: 36px; }
.brand-text {
  font-size: 16px;
  letter-spacing: -0.005em;
}
.brand-text .dim { color: var(--ink-3); font-weight: 400; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 14.5px;
  color: var(--ink-2);
}
.nav-links a {
  position: relative;
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  border: 1px solid color-mix(in srgb, var(--blue-2) 60%, transparent);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 8px 24px -8px var(--blue-glow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover {
  background: #3a78ff;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 14px 32px -10px var(--blue-glow);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.03);
  border-color: #3a3e4a;
  box-shadow: none;
}

/* ---------- Eyebrow tag ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow .slash { color: var(--blue); margin-right: 4px; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(80px, 14vh, 160px) 0 clamp(100px, 16vh, 180px);
  position: relative;
}
.hero-eyebrow { margin-bottom: 32px; }
.hero h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(48px, 8.4vw, 132px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0 0 36px;
  max-width: 18ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--blue-2);
  background: linear-gradient(180deg, #6d9eff 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 .period { color: var(--blue); -webkit-text-fill-color: var(--blue); }

.hero-sub {
  font-size: clamp(17px, 1.4vw, 19.5px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 40px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-meta > div {
  background: var(--bg);
  padding: 22px 26px 24px;
}
.hero-meta-k {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.hero-meta-v {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.4;
}
@media (max-width: 840px) {
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Section title ---------- */
.section { padding: clamp(70px, 10vw, 130px) 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 64px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.section-head h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 14px 0 0;
  max-width: 14ch;
}
.section-head .right {
  text-align: right;
  font-size: 14.5px;
  color: var(--ink-2);
  max-width: 38ch;
  line-height: 1.55;
}
@media (max-width: 720px) {
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head .right { text-align: left; }
}

/* ---------- Book grid ---------- */
.library {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 2px;
}
@media (max-width: 1040px) { .library { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .library { grid-template-columns: 1fr; } }

.book-card {
  background: var(--bg);
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  cursor: pointer;
  transition: background .25s ease;
}
.book-card:hover { background: var(--bg-2); }
.book-card:hover .cover-inner { transform: translateY(-4px); }
.book-card:hover .read-link { color: var(--blue-2); }
.book-card:hover .read-link .arrow { transform: translate(3px, -3px); }

.cover {
  aspect-ratio: 5 / 7;
  display: flex;
  align-items: stretch;
  justify-content: center;
  perspective: 800px;
}
.cover-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 22px 20px;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 30px 60px -30px rgba(0,0,0,0.7),
    0 10px 24px -16px rgba(0,0,0,0.5);
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.cover-inner::before {
  /* subtle paper grain */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.05), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(0,0,0,0.15), transparent 50%);
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Real cover art (replaces .cover-inner when an actual jacket exists) */
.cover-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 30px 60px -30px rgba(0,0,0,0.7),
    0 10px 24px -16px rgba(0,0,0,0.5);
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.book-card:hover .cover-art { transform: translateY(-4px); }
.cover-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.cover-top .rule {
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  margin: 0 12px;
}
.cover-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.cover-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.cover-foot .imprint { font-weight: 600; }
.cover-foot .imprint-sub { opacity: 0.6; font-weight: 400; }

.book-meta { display: flex; flex-direction: column; gap: 14px; }
.book-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.book-tag .dot { width: 6px; height: 6px; border-radius: 50%; }
.book-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0;
}
.book-sub {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
}
.read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  transition: color .15s ease;
}
.read-link .arrow {
  display: inline-block;
  transition: transform .2s ease;
  font-family: var(--mono);
}

/* ---------- Newsletter ---------- */
.newsletter {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(70px, 9vw, 110px) 0;
  position: relative;
  overflow: hidden;
}
.newsletter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 80% at 50% 100%, rgba(43,107,255,0.12), transparent 70%);
  pointer-events: none;
}
.newsletter-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: center;
}
@media (max-width: 880px) {
  .newsletter-inner { grid-template-columns: 1fr; gap: 40px; }
}
.newsletter h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 14px 0 18px;
}
.newsletter p {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  max-width: 46ch;
}

.signup {
  display: flex;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  align-items: center;
}
.signup input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  padding: 10px 0;
}
.signup input::placeholder { color: var(--ink-3); }
.signup .btn { padding: 10px 18px; }
.signup-meta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Footer ---------- */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer ul a { color: var(--ink-2); font-size: 14.5px; transition: color .15s ease; }
.footer ul a:hover { color: var(--ink); }
.footer-about {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 38ch;
  margin: 0;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  gap: 24px;
  flex-wrap: wrap;
}

/* ---------- Sub-pages (privacy, terms, support) ---------- */
.page {
  padding: clamp(60px, 10vw, 120px) 0 clamp(60px, 8vw, 100px);
}
.page-head {
  margin-bottom: 64px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 40px;
}
.page-head h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 18px 0 14px;
  max-width: 18ch;
}
.page-head p {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0;
}

.prose-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 880px) {
  .prose-layout { grid-template-columns: 1fr; gap: 40px; }
}
.toc {
  position: sticky;
  top: 100px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toc h5 { color: var(--ink-3); font-weight: 500; margin: 0 0 16px; font-size: 11px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc ol li {
  counter-increment: toc;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.toc ol li a { color: var(--ink-2); display: flex; gap: 14px; transition: color .15s ease; }
.toc ol li a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--ink-4);
}
.toc ol li a:hover { color: var(--ink); }

.prose { color: var(--ink-2); font-size: 16px; line-height: 1.7; max-width: 70ch; }
.prose h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
  margin: 64px 0 18px;
  scroll-margin-top: 100px;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 .num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--blue);
  display: block;
  margin-bottom: 8px;
  font-weight: 400;
}
.prose h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
  margin: 36px 0 10px;
  letter-spacing: -0.01em;
}
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 22px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--blue-2); border-bottom: 1px solid color-mix(in srgb, var(--blue-2) 30%, transparent); }
.prose a:hover { border-bottom-color: var(--blue-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

/* Support page contact cards */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 0 0 80px;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: var(--bg);
  padding: 32px 30px 30px;
}
.contact-card .icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.contact-card h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.contact-card p {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 18px;
}
.contact-card a.email {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--blue-2);
  word-break: break-all;
}

.faq {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 20px;
  color: var(--ink-3);
  transition: transform .2s ease, color .2s ease;
}
.faq details[open] summary::after { content: "−"; color: var(--blue-2); }
.faq .answer {
  padding-top: 14px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
  max-width: 72ch;
}

/* utility */
.spark { color: var(--blue); }
