/* Quantum-Safe Migration Cookbook — site styles */
:root {
  --ink: #1a2332;
  --ink-soft: #46536a;
  --accent: #0b5fa5;
  --accent-dark: #084a82;
  --teal: #0e8a7d;
  --bg: #ffffff;
  --bg-alt: #f4f7fa;
  --border: #dde4ec;
  --code-bg: #101826;
  --code-ink: #d8e2f0;
  --code-comment: #6fbf8f;
  --max: 1200px;
  --content-max: 76ch;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #0f1c2e;
  border-bottom: 3px solid var(--accent);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; height: 58px;
}
.brand {
  color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: .02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: #cfe3f5; }
.topnav { margin-left: auto; display: flex; gap: 4px; }
.topnav a {
  color: #b9c7d9; padding: 8px 14px; border-radius: 6px; font-size: .95rem;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topnav a.active { color: #fff; background: rgba(255,255,255,.12); }
.menu-btn {
  display: none; margin-left: auto; background: none; border: 0; color: #fff;
  font-size: 1.5rem; cursor: pointer; padding: 4px 10px;
}

/* ---- layout ---- */
.layout { max-width: var(--max); margin: 0 auto; display: flex; min-height: 70vh; }
.layout.no-sidebar { display: block; }
.sidebar {
  width: 290px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--bg-alt);
}
.sidebar-inner { position: sticky; top: 58px; max-height: calc(100vh - 58px); overflow-y: auto; padding: 24px 18px 40px; }
.sidebar-title { font-weight: 700; font-size: .95rem; margin: 0 0 12px; }
.sidebar-title a { color: var(--ink); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 2px 0; }
.sidebar li a {
  display: block; padding: 6px 10px; border-radius: 6px;
  color: var(--ink-soft); font-size: .9rem; line-height: 1.35;
}
.sidebar li a:hover { background: #e6edf5; text-decoration: none; color: var(--ink); }
.sidebar li.current a { background: var(--accent); color: #fff; font-weight: 600; }
.content { flex: 1; min-width: 0; padding: 40px 48px 64px; }
.no-sidebar .content { max-width: 900px; margin: 0 auto; padding: 40px 24px 64px; }

/* ---- typography ---- */
.kicker {
  text-transform: uppercase; letter-spacing: .12em; font-size: .78rem;
  font-weight: 700; color: var(--teal); margin: 0 0 6px;
}
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 18px; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 42px 0 14px; padding-top: 8px; letter-spacing: -.005em; }
h3 { font-size: 1.13rem; margin: 30px 0 10px; }
.content > p, .content li { max-width: var(--content-max); }
p.lede { font-size: 1.15rem; color: var(--ink-soft); font-style: italic; margin-top: -6px; }
.signoff { margin-top: 32px; font-weight: 600; }

/* ---- chapter mini-toc ---- */
.chapter-toc {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 22px; margin: 24px 0 32px; max-width: var(--content-max);
}
.chapter-toc p { margin: 0 0 8px; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.chapter-toc ul { margin: 0; padding-left: 20px; columns: 1; }
.chapter-toc li { margin: 3px 0; font-size: .93rem; }

/* ---- code ---- */
code {
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .86em;
  background: #eef2f7; color: #0c3a66;
  padding: .12em .38em; border-radius: 4px;
}
pre {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 10px; padding: 18px 20px; overflow-x: auto;
  margin: 20px 0; max-width: 860px;
  border-left: 4px solid var(--accent);
}
pre code {
  background: none; color: inherit; padding: 0; border-radius: 0;
  font-size: .84rem; line-height: 1.55;
}
pre .c { color: var(--code-comment); }

/* ---- tables ---- */
.tbl-wrap { overflow-x: auto; margin: 22px 0; max-width: 900px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; vertical-align: top; }
thead th { background: #0f1c2e; color: #fff; font-weight: 600; border-color: #2a3a52; }
tbody tr:nth-child(even) { background: var(--bg-alt); }
td code { white-space: nowrap; }

/* ---- prev/next ---- */
.prevnext {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  max-width: 860px;
}
.prevnext a {
  display: flex; flex-direction: column; gap: 2px; max-width: 46%;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  color: var(--ink); font-weight: 600; font-size: .95rem;
}
.prevnext a span { font-size: .78rem; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.prevnext a:hover { text-decoration: none; border-color: var(--accent); background: var(--bg-alt); }
.prevnext .next { margin-left: auto; text-align: right; }

/* ---- hero / index ---- */
.hero { padding: 34px 0 10px; }
.hero h1 { font-size: 2.7rem; max-width: 21ch; }
.hero-sub { font-size: 1.3rem; color: var(--ink-soft); margin: 0 0 18px; font-weight: 600; }
.hero-desc { max-width: 72ch; }
.hero-actions { display: flex; gap: 12px; margin: 26px 0 8px; flex-wrap: wrap; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 600;
  padding: 11px 22px; border-radius: 8px;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: var(--bg-alt); }
.contents { margin-top: 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 18px; }
.card {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  color: var(--ink); background: var(--bg);
  transition: border-color .12s, box-shadow .12s;
}
.card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 3px 14px rgba(11,95,165,.10); }
.card-num { font-weight: 800; color: var(--accent); font-size: .9rem; letter-spacing: .05em; }
.card-title { font-weight: 600; line-height: 1.35; }

/* ---- books page ---- */
.book-listing { display: flex; gap: 40px; margin-top: 26px; flex-wrap: wrap; }
.book-cover { flex-shrink: 0; }
.cover-art {
  width: 230px; height: 330px; border-radius: 6px;
  background: linear-gradient(160deg, #0f1c2e 0%, #143a5c 60%, #0e8a7d 130%);
  color: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: 26px 22px; gap: 14px;
  box-shadow: 0 12px 30px rgba(15,28,46,.35);
}
.cover-title { font-weight: 800; font-size: 1.25rem; line-height: 1.3; letter-spacing: .04em; }
.cover-sub { font-size: .8rem; color: #bcd3e8; line-height: 1.4; }
.cover-author { margin-top: auto; font-size: .85rem; font-weight: 600; color: #d8ecff; }
.book-meta { flex: 1; min-width: 280px; max-width: 640px; }
.book-meta h2 { margin-top: 0; }
.book-sub { color: var(--ink-soft); font-weight: 600; margin-top: -8px; }
.meta-table { max-width: 460px; margin: 18px 0; }
.meta-table th { background: var(--bg-alt); color: var(--ink); width: 165px; }

/* ---- glossary ---- */
h2.letter {
  color: var(--accent); border-bottom: 2px solid var(--border);
  padding-bottom: 4px; max-width: var(--content-max);
}

/* ---- placeholder ---- */
.placeholder {
  border: 2px dashed var(--border); border-radius: 12px; padding: 34px;
  text-align: center; max-width: 560px; margin-top: 30px; background: var(--bg-alt);
}
.placeholder p { margin: 6px 0; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 40px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 22px 24px; font-size: .88rem; color: var(--ink-soft); }
.footer-inner p { margin: 4px 0; }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .menu-btn { display: block; }
  .topnav {
    display: none; position: absolute; top: 58px; left: 0; right: 0;
    background: #0f1c2e; flex-direction: column; padding: 10px 16px 16px;
  }
  body.nav-open .topnav { display: flex; }
  .layout.with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-inner { position: static; max-height: none; padding: 16px 18px; }
  .content { padding: 28px 20px 56px; }
  .hero h1 { font-size: 2.1rem; }
  .prevnext a { max-width: 100%; }
}

/* ---- white paper cards ---- */
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 26px; }
.wp-card {
  display: flex; flex-direction: column; gap: 7px;
  border: 1px solid var(--border); border-radius: 12px; padding: 22px;
  color: var(--ink); background: var(--bg);
  transition: border-color .12s, box-shadow .12s;
}
.wp-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 3px 14px rgba(11,95,165,.10); }
.wp-title { font-weight: 700; font-size: 1.08rem; line-height: 1.3; }
.wp-sub { color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.wp-abs { color: var(--ink-soft); font-size: .88rem; line-height: 1.55; }

/* ---- Quantum-Safe Security cover ---- */
.qss-cover {
  background:
    radial-gradient(circle at 82% 18%, rgba(60,110,170,.45) 0 14%, transparent 15%),
    radial-gradient(circle at 82% 18%, transparent 0 22%, rgba(90,140,200,.35) 22.5% 23%, transparent 24%),
    radial-gradient(circle at 82% 18%, transparent 0 32%, rgba(90,140,200,.25) 32.5% 33%, transparent 34%),
    #0e1a2b;
  padding: 0; overflow: hidden; justify-content: flex-start; gap: 0;
}
.qss-kicker {
  font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; color: #9fc0dd;
  padding: 16px 16px 0; border-bottom: 1px solid rgba(120,160,210,.4);
  padding-bottom: 6px; margin: 0 14px; text-align: left;
}
.qss-title {
  font-family: Georgia, "Times New Roman", serif; font-weight: 700;
  font-size: 1.7rem; line-height: 1.12; color: #fff; padding: 18px 16px 8px; text-align: left;
}
.qss-sub {
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: 1.05rem; color: #aecbe8; padding: 0 16px 14px;
  border-top: 1px solid rgba(120,160,210,.5); margin: 0 16px; padding-left: 0; padding-top: 8px;
  text-align: left;
}
.qss-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 16px; }
.qss-chips i {
  font-style: normal; font-size: .5rem; letter-spacing: .06em; text-transform: uppercase;
  color: #cfe2f4; border: 1px solid #3c6ea5; background: rgba(45,90,140,.5);
  border-radius: 3px; padding: 2px 6px;
}
.qss-bar {
  margin-top: auto; background: #2d6094; width: 100%; padding: 12px 16px;
  font-family: Georgia, serif; font-weight: 700; font-size: .9rem; color: #fff; text-align: left;
}
.qss-bar small { font-family: inherit; font-weight: 400; font-size: .68rem; color: #cfe2f4; }

/* ---- Quantum Computing for Engineers cover ---- */
.qce-cover {
  background:
    radial-gradient(ellipse at 10% 95%, rgba(30,80,180,.5) 0%, transparent 45%),
    radial-gradient(ellipse at 95% 90%, rgba(120,40,190,.55) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 5%, rgba(90,40,160,.35) 0%, transparent 40%),
    #05070f;
  gap: 2px; padding: 22px 18px; justify-content: flex-start;
}
.qce-t1, .qce-t2 {
  font-weight: 900; letter-spacing: .02em; line-height: 1.05; text-align: center;
}
.qce-t1 { font-size: 1.55rem; color: #fff; }
.qce-t2 { font-size: 1.25rem; background: linear-gradient(180deg,#dce9f8,#7fa9dc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qce-for { font-size: .55rem; letter-spacing: .3em; color: #9db4d4; text-align: center; margin: 4px 0; }
.qce-t3 { font-weight: 900; font-size: 1.35rem; letter-spacing: .04em; color: #d9a93c; text-align: center; }
.qce-tag { font-size: .52rem; letter-spacing: .12em; text-transform: uppercase; color: #cdd9ea; text-align: center; margin-top: 6px; }
.qce-circuit {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: .5rem; line-height: 1.9;
  color: #8fc1f0; text-align: left; margin: 14px auto 0; white-space: nowrap;
}
.qce-author {
  margin-top: auto; text-align: center; font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; color: #e8c05a;
  border-top: 1px solid rgba(216,169,60,.5); padding-top: 8px; width: 100%;
}

/* ---- real cover images & figures ---- */
.cover-img {
  width: 230px; height: auto; border-radius: 6px; display: block;
  box-shadow: 0 12px 30px rgba(15,28,46,.35);
}
figure.fig { margin: 26px 0; max-width: 860px; }
figure.fig img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}

/* ---- about page photo ---- */
.about-wrap { display: flex; gap: 36px; align-items: flex-start; flex-wrap: wrap; }
.about-wrap > div { flex: 1; min-width: 300px; }
.about-photo {
  width: 250px; height: auto; border-radius: 12px; flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(15,28,46,.18);
}
@media (max-width: 700px) {
  .about-photo { width: 200px; margin: 0 auto; }
}

/* ---- cover readability fixes: wider covers, all text >= 12pt (16px) ---- */
.cover-art { width: 290px; height: 420px; }
.cover-img { width: 290px; }
.cover-title { font-size: 1.55rem; }
.cover-sub { font-size: 16px; color: #cfe0f2; }
.cover-author { font-size: 16px; }
.qss-kicker { font-size: 16px; letter-spacing: .04em; line-height: 1.35; color: #d5e6f7; }
.qss-title { font-size: 1.95rem; padding-top: 14px; }
.qss-sub { font-size: 18px; color: #c4dcf5; }
.qss-chips i { font-size: 16px; letter-spacing: .03em; padding: 3px 9px; color: #eaf3fc; }
.qss-bar { font-size: 17px; }
.qss-bar small { font-size: 16px; }

/* ---- site color pass: textured background, dark hero, navy chapter cards ---- */
body {
  background-color: #f6f9fc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Ccircle cx='28' cy='28' r='1.1' fill='%23d3dfec'/%3E%3C/svg%3E");
}
.content { background: transparent; }

/* hero banner: menubar navy with circuit texture */
.hero {
  background-color: #0f1c2e;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%232a4a6e' stroke-width='1'%3E%3Cpath d='M10 30 h40 v40 h30'/%3E%3Cpath d='M110 90 h-30 v-50'/%3E%3C/g%3E%3Ccircle cx='50' cy='30' r='2.4' fill='%233c6ea5'/%3E%3Ccircle cx='80' cy='110' r='2.4' fill='%233c6ea5'/%3E%3Ccircle cx='10' cy='30' r='2' fill='%232a4a6e'/%3E%3C/svg%3E"),
    radial-gradient(circle at 85% 15%, rgba(14,138,125,.35) 0%, transparent 45%),
    linear-gradient(150deg, #0f1c2e 0%, #143a5c 80%);
  border-radius: 18px;
  padding: 44px 42px 40px;
  margin-top: 28px;
  box-shadow: 0 14px 36px rgba(15,28,46,.28);
}
.hero .kicker { color: #55d6c2; }
.hero h1 { color: #fff; }
.hero .hero-sub { color: #bcd3e8; }
.hero .hero-desc { color: #d8e2ef; }
.hero .hero-desc code { background: rgba(255,255,255,.14); color: #cfe3f5; }
.hero .btn { background: #55d6c2; color: #06231f; }
.hero .btn:hover { background: #7ae2d2; }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.65); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.12); }

/* chapter cards: same navy as the menu bar */
.card {
  background: #0f1c2e; border-color: #0f1c2e; color: #fff;
}
.card:hover {
  background: #143a5c; border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(11,95,165,.35);
}
.card-num { color: #55d6c2; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.card-title { color: #fff; }

/* white paper cards: teal top accent for a splash of color */
.wp-card { border-top: 4px solid var(--teal); }
.wp-card .card-num { color: var(--teal); }

/* content panels sit on white so text stays crisp */
.layout { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.no-sidebar .content { background: #fff; }
