/* ============================================================
   GRE Quant Pro — /handbook/ final revision handbook
   Extends site.css (tokens, nav, footer, .btn, .glow-*).
   Two jobs: a readable long-form screen layout with a sticky
   contents rail, and a print stylesheet good enough that
   Ctrl+P is a real alternative to the PDF.
   ============================================================ */

.hb-main{position:relative;z-index:1;padding:44px 0 100px}
.hb-wrap{max-width:1180px;margin:0 auto;padding:0 24px}

/* ---------- hero ---------- */
.hb-hero{max-width:760px;padding-bottom:34px;margin-bottom:34px;border-bottom:1px solid var(--line)}
.hb-eyebrow{font-family:var(--fm);font-size:12.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);font-weight:700;margin-bottom:14px}
.hb-hero h1{font-family:var(--fd);font-weight:640;font-size:clamp(28px,4.2vw,42px);color:var(--navy);letter-spacing:-.5px;line-height:1.12;margin-bottom:16px}
.hb-lede{font-size:17px;color:var(--ink2);line-height:1.7}

.hb-modes{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin:26px 0}
.hb-mode{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-sm);padding:15px 17px}
.hb-mode b{display:block;font-family:var(--fm);font-size:13px;color:var(--accent);font-weight:700;margin-bottom:5px}
.hb-mode span{font-size:14px;color:var(--ink2);line-height:1.55}

/* ---------- pdf gate ---------- */
.hb-cta{background:var(--blue-soft);border:1px solid #cfe0f0;border-radius:var(--radius);padding:22px 24px;margin-top:28px}
.hb-cta-copy b{display:block;font-family:var(--fd);font-weight:640;font-size:18px;color:var(--navy);margin-bottom:5px}
.hb-cta-copy span{display:block;font-size:14.5px;color:var(--ink2);line-height:1.6;max-width:520px}
.hb-form{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.hb-form input[type=email]{flex:1 1 240px;min-width:0;font-family:var(--ff);font-size:15px;color:var(--ink);background:#fff;border:1px solid var(--line2);border-radius:var(--radius-sm);padding:11px 14px}
.hb-form input[type=email]:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(26,93,166,.13)}
.hb-form .btn{white-space:nowrap;padding:0 24px;min-height:46px;font-size:15px}
.hb-form .hb-dl{text-decoration:none}
.hb-form-note{font-size:13px;color:var(--ink3);margin:10px 0 0}
.hb-form-note.is-ok{color:var(--green);font-weight:600}
.hb-form-note.is-err{color:var(--red);font-weight:600}
.hb-print-hint{font-size:13.5px;color:var(--ink3);margin-top:14px}
.hb-print-hint kbd{font-family:var(--fm);font-size:11.5px;background:var(--paper2);border:1px solid var(--line2);border-bottom-width:2px;border-radius:4px;padding:1px 5px;color:var(--ink2)}

/* ---------- layout: contents rail + document ---------- */
.hb-layout{display:grid;grid-template-columns:252px minmax(0,1fr);gap:40px;align-items:start}

.hb-toc{position:sticky;top:86px;max-height:calc(100vh - 110px);overflow-y:auto;padding-right:8px;border-right:1px solid var(--line)}
.hb-toc h2{font-family:var(--fm);font-size:11.5px;letter-spacing:.07em;text-transform:uppercase;color:var(--ink3);font-weight:700;margin:0 0 12px}
.hb-toc ul{list-style:none;margin:0;padding:0}
.hb-toc li{margin:0}
.hb-toc a{display:block;text-decoration:none;line-height:1.4;padding:4px 0;color:var(--ink2)}
.hb-toc a:hover{color:var(--blue)}
.hb-toc-2{margin-top:12px}
.hb-toc-2>a{font-family:var(--fd);font-size:14.5px;font-weight:640;color:var(--navy)}
.hb-toc-3>a{font-size:13px;padding-left:11px;border-left:1px solid var(--line)}
.hb-toc-3>a.is-active,.hb-toc-2>a.is-active{color:var(--blue);border-left-color:var(--blue);font-weight:700}

.hb-toc-mobile{display:none}

/* ---------- the document itself ---------- */
.hb-doc{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-lg);padding:42px 46px;box-shadow:var(--shadow);font-size:16px;line-height:1.72;color:var(--ink)}
.hb-doc>*:first-child{margin-top:0}

.hb-doc h1{font-family:var(--fd);font-weight:640;font-size:30px;color:var(--navy);letter-spacing:-.3px;line-height:1.18;margin:0 0 6px}
.hb-doc h2{font-family:var(--fd);font-weight:640;font-size:25px;color:var(--navy);letter-spacing:-.25px;margin:46px 0 16px;padding-bottom:11px;border-bottom:2px solid var(--accent);scroll-margin-top:86px}
.hb-doc h3{font-family:var(--fd);font-weight:640;font-size:19px;color:var(--navy);margin:32px 0 12px;scroll-margin-top:86px}
.hb-doc p{margin:0 0 13px}
.hb-doc strong{color:var(--navy);font-weight:700}
.hb-doc em{color:var(--ink2)}
.hb-doc ul,.hb-doc ol{margin:0 0 16px;padding-left:24px}
.hb-doc li{margin-bottom:7px}
.hb-doc li:last-child{margin-bottom:0}
.hb-doc hr{border:none;border-top:1px solid var(--line);margin:30px 0}

.hb-doc code{font-family:var(--fm);font-size:.9em;background:var(--paper2);border-radius:5px;padding:2px 6px;color:var(--blue-dark);white-space:nowrap}
.hb-doc pre{background:var(--navy-deep);color:#e9eef3;border-radius:var(--radius-sm);padding:16px 19px;overflow-x:auto;margin:0 0 18px}
.hb-doc pre code{font-family:var(--fm);font-size:13.5px;line-height:1.65;background:none;color:inherit;padding:0;white-space:pre}

.hb-doc blockquote{margin:0 0 16px;padding:13px 19px;background:var(--blue-soft);border-left:3px solid var(--blue);border-radius:0 var(--radius-sm) var(--radius-sm) 0;color:var(--blue-dark)}
.hb-doc blockquote p{margin:0;color:inherit}

.hb-doc table{width:100%;border-collapse:collapse;margin:0 0 20px;font-size:14.5px}
.hb-doc th,.hb-doc td{text-align:left;padding:9px 13px;border-bottom:1px solid var(--line);vertical-align:top}
.hb-doc th{font-family:var(--fm);font-size:11.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--ink3);font-weight:600;border-bottom:1.5px solid var(--line2)}
.hb-doc td{font-size:14.5px}
.hb-doc td code{font-size:.92em;white-space:nowrap}
.hb-doc tbody tr:last-child td{border-bottom:none}
.hb-doc tbody tr:nth-child(even){background:#fcfbf8}

.hb-tablewrap{overflow-x:auto;margin:0 0 20px}
.hb-tablewrap table{margin:0}

/* ---------- Pro conversion layer ---------- */
.btn-sm{padding:0 16px;min-height:38px;font-size:14px;white-space:nowrap}
.hb-free{font-size:14.5px;font-weight:600;color:var(--blue);text-decoration:none;border-bottom:1px solid rgba(26,93,166,.35)}
.hb-free:hover{border-bottom-color:var(--blue)}
.hb-print-only{display:none}
.hb-after{font-size:14px;margin:10px 0 0;color:var(--ink2)}
.hb-after a{font-weight:700;color:var(--accent);text-decoration:none}
.hb-after a:hover{text-decoration:underline}

/* bridge band: right under the hero */
.hb-bridge{background:var(--navy-deep);color:#e9eef3;border-radius:var(--radius-lg);padding:38px 42px;margin:0 0 40px;box-shadow:var(--shadow)}
.hb-bridge-eyebrow{font-family:var(--fm);font-size:12px;letter-spacing:.09em;text-transform:uppercase;color:#f0a878;font-weight:700;margin-bottom:12px}
.hb-bridge h2{font-family:var(--fd);font-weight:640;font-size:clamp(23px,3vw,31px);line-height:1.2;letter-spacing:-.3px;color:#fff;margin:0 0 12px;max-width:780px}
.hb-bridge-sub{font-size:16px;line-height:1.65;color:#c9d4de;max-width:700px;margin:0 0 24px}
.hb-bridge-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-bottom:26px}
.hb-bridge-grid>div{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-sm);padding:16px 18px}
.hb-bridge-grid b{display:block;font-family:var(--fd);font-weight:640;font-size:16.5px;color:#fff;margin-bottom:6px}
.hb-bridge-grid span{display:block;font-size:14px;line-height:1.55;color:#b9c6d2}
.hb-bridge-act{display:flex;flex-wrap:wrap;align-items:center;gap:18px}
.hb-bridge-act .btn{min-height:48px;padding:0 26px;font-size:15.5px}
.hb-bridge .hb-free{color:#fff;border-bottom-color:rgba(255,255,255,.45)}
.hb-bridge .hb-free:hover{border-bottom-color:#fff}
.hb-bridge-trust{font-size:13px;color:#93a3b3;margin:16px 0 0}

/* contents-rail card */
.hb-rail-pro{background:var(--accent-soft);border:1px solid #f0d3bd;border-radius:var(--radius-sm);padding:13px 14px;margin:0 10px 18px 0}
.hb-rail-pro b{display:block;font-family:var(--fd);font-weight:640;font-size:15px;color:var(--navy);margin-bottom:3px}
.hb-rail-pro span{display:block;font-size:13px;line-height:1.45;color:var(--ink2);margin-bottom:10px}
.hb-rail-pro .btn.btn-primary{display:flex;align-items:center;justify-content:center;width:100%;padding:0 12px;color:#fff;line-height:1}

/* end-of-section prompt */
.hb-pro{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px 24px;background:var(--accent-soft);border:1px solid #f0d3bd;border-left:4px solid var(--accent);border-radius:var(--radius-sm);padding:16px 20px;margin:34px 0 0}
.hb-pro-text{flex:1 1 320px;min-width:0}
.hb-pro-text b{display:block;font-family:var(--fd);font-weight:640;font-size:16.5px;color:var(--navy);margin-bottom:3px;line-height:1.3}
.hb-pro-text span{display:block;font-size:14px;line-height:1.55;color:var(--ink2)}
.hb-pro-act{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.hb-pro-act .btn{min-height:42px;padding:0 20px;font-size:14.5px;white-space:nowrap}

/* end-of-handbook offer */
.hb-end{margin-top:34px;background:var(--navy-deep);color:#e9eef3;border-radius:var(--radius-lg);padding:36px 42px;box-shadow:var(--shadow)}
.hb-end-eyebrow{font-family:var(--fm);font-size:12px;letter-spacing:.09em;text-transform:uppercase;color:#f0a878;font-weight:700;margin-bottom:10px}
.hb-end h2{font-family:var(--fd);font-weight:640;font-size:clamp(23px,3vw,30px);line-height:1.2;color:#fff;margin:0 0 10px;letter-spacing:-.3px}
.hb-end>p{font-size:15.5px;line-height:1.65;color:#c9d4de;max-width:640px;margin:0 0 22px}
.hb-end-plans{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:12px;margin-bottom:24px}
.hb-end-plans>div{position:relative;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-sm);padding:14px 16px 40px}
.hb-end-plans b{display:block;font-family:var(--fd);font-weight:640;font-size:15.5px;color:#fff;margin-bottom:4px}
.hb-end-plans span{display:block;font-size:13px;line-height:1.5;color:#b9c6d2}
.hb-end-plans em{position:absolute;left:16px;bottom:12px;font-style:normal;font-family:var(--fm);font-weight:700;font-size:16px;color:#fff}
.hb-end-plans s{font-family:var(--ff);font-weight:400;font-size:13px;color:#8fa0b0;margin-left:6px}
.hb-end-plans .is-best{background:rgba(198,93,33,.18);border-color:#d9763b}
.hb-end-act{display:flex;flex-wrap:wrap;align-items:center;gap:18px}
.hb-end-act .btn{min-height:48px;padding:0 26px;font-size:15.5px}
.hb-end .hb-free{color:#fff;border-bottom-color:rgba(255,255,255,.45)}
.hb-end-trust{font-size:13px;color:#93a3b3;margin:16px 0 0!important}

/* mobile bar */
.hb-bar{position:fixed;left:0;right:0;bottom:0;z-index:40;display:none;align-items:center;gap:12px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:var(--navy-deep);color:#fff;box-shadow:0 -6px 20px rgba(0,0,0,.18);font-size:14px}
.hb-bar span{flex:1 1 auto;min-width:0;line-height:1.3}
.hb-bar .btn{flex:0 0 auto;width:auto}
.hb-bar button{background:none;border:none;color:#9fb0c0;font-size:24px;line-height:1;padding:4px 8px;cursor:pointer}
.hb-bar[hidden]{display:none!important}

/* ---------- responsive ---------- */
@media(max-width:1040px){
  .hb-bar:not([hidden]){display:flex}
  .hb-layout{grid-template-columns:1fr;gap:0}
  .hb-toc{display:none}
  .hb-toc-mobile{display:block;margin-bottom:26px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius-sm)}
  .hb-toc-mobile summary{cursor:pointer;list-style:none;font-family:var(--fd);font-weight:640;font-size:16px;color:var(--navy);padding:14px 18px}
  .hb-toc-mobile summary::-webkit-details-marker{display:none}
  .hb-toc-mobile summary::after{content:"▾";float:right;color:var(--ink3)}
  .hb-toc-mobile[open] summary::after{content:"▴"}
  .hb-toc-mobile ul{list-style:none;margin:0;padding:0 18px 16px}
  .hb-toc-mobile a{display:block;padding:5px 0;font-size:14px;color:var(--ink2);text-decoration:none}
  .hb-toc-mobile .hb-toc-2>a{font-weight:700;color:var(--navy);margin-top:9px}
  .hb-toc-mobile .hb-toc-3>a{padding-left:12px;font-size:13.5px}
}
@media(max-width:640px){
  .hb-doc{padding:26px 20px;border-radius:var(--radius);font-size:15.5px}
  .hb-doc h2{font-size:21px;margin-top:38px}
  .hb-doc h3{font-size:17.5px}
  .hb-doc table{font-size:13.5px}
  .hb-doc th,.hb-doc td{padding:7px 9px}
  .hb-cta{padding:18px}
  .hb-bridge,.hb-end{padding:26px 20px}
  .hb-bridge-act,.hb-end-act{flex-direction:column;align-items:stretch;gap:14px;text-align:center}
  .hb-pro{padding:15px 16px}
  .hb-pro-act{width:100%}
  .hb-pro-act .btn{flex:1}
}

/* ============================================================
   PRINT — this is a deliverable, not an afterthought.
   Ctrl+P should produce something a student is happy to carry.
   ============================================================ */
@media print{
  @page{margin:12mm 12mm}

  nav,.mobile-menu,footer,.glow-1,.glow-2,
  .hb-toc,.hb-toc-mobile,.hb-cta,.hb-print-hint,.hb-modes,
  .hb-bridge,.hb-pro,.hb-rail-pro,.hb-bar,.hb-after{display:none!important}

  html,body{background:#fff!important;color:#000!important}

  /* Print fonts are pinned to families that exist on any machine, so the PDF
     is identical whether or not the webfonts loaded. A workhorse serif for
     headings prints better than a display face anyway. */
  body,.hb-doc,.hb-doc p,.hb-doc li,.hb-doc td,.hb-doc th{
    font-family:"Source Sans 3",Helvetica,Arial,sans-serif}
  .hb-hero h1,.hb-doc h1,.hb-doc h2,.hb-doc h3{
    font-family:Fraunces,Georgia,"Times New Roman",serif}
  .hb-doc code,.hb-doc pre,.hb-doc pre code,.hb-eyebrow{
    font-family:"DM Mono","Courier New",monospace}

  .hb-main{padding:0}
  .hb-wrap{max-width:none;padding:0}
  .hb-layout{display:block}

  .hb-hero{border-bottom:2px solid #000;padding-bottom:6mm;margin-bottom:6mm;max-width:none}
  .hb-hero h1{font-size:21pt;color:#000;line-height:1.1}
  .hb-eyebrow{color:#000;font-size:8.5pt}
  .hb-lede{font-size:10pt;color:#222;line-height:1.45}

  .hb-doc{background:#fff;border:none;border-radius:0;box-shadow:none;padding:0;
          font-size:9.3pt;line-height:1.42;color:#000}

  .hb-doc h1{font-size:18pt;color:#000}
  .hb-doc h2{font-size:13.5pt;color:#000;border-bottom:1.5pt solid #000;
             margin:0 0 3.4mm;padding-bottom:1.4mm;
             break-before:page;page-break-before:always;
             break-after:avoid;page-break-after:avoid}
  .hb-doc h2:first-of-type{break-before:auto;page-break-before:auto}
  .hb-doc h3{font-size:10.6pt;color:#000;margin:4.2mm 0 1.7mm;
             break-after:avoid;page-break-after:avoid}
  .hb-doc p{margin:0 0 1.7mm;orphans:3;widows:3}
  .hb-doc strong{color:#000}
  .hb-doc ul,.hb-doc ol{margin:0 0 2.4mm;padding-left:5mm}
  .hb-doc li{margin-bottom:.85mm}
  .hb-doc hr{display:none}

  .hb-doc code{background:#f2f2f2;color:#000;padding:0 2px;font-size:.93em}
  .hb-doc pre{background:#f6f6f6;color:#000;border:.5pt solid #bbb;
              padding:2.4mm 3mm;margin:0 0 3mm;
              break-inside:avoid;page-break-inside:avoid}
  .hb-doc pre code{font-size:8.6pt;line-height:1.5}

  .hb-doc blockquote{background:#f4f4f4;border-left:2pt solid #000;color:#000;
                     padding:2mm 3mm;margin:0 0 3mm;
                     break-inside:avoid;page-break-inside:avoid}

  .hb-doc table,.hb-tablewrap{font-size:8.5pt;margin:0 0 2.8mm;overflow:visible;
                              break-inside:avoid;page-break-inside:avoid}
  .hb-doc th,.hb-doc td{padding:.9mm 1.8mm;border-bottom:.5pt solid #999;font-size:8.5pt}
  .hb-doc th{color:#000;font-size:7.2pt;border-bottom:1pt solid #000}
  .hb-doc tbody tr:nth-child(even){background:#f7f7f7}
  .hb-doc tr{break-inside:avoid;page-break-inside:avoid}

  a{color:#000!important;text-decoration:none}

  /* The one place the PDF mentions Pro: a compact box on the last page. */
  .hb-end{background:#fff;color:#000;border:1pt solid #000;border-radius:0;box-shadow:none;
          padding:4mm 5mm;margin-top:6mm;break-inside:avoid;page-break-inside:avoid}
  .hb-end-eyebrow{color:#000;font-size:7.5pt;margin-bottom:1mm}
  .hb-end h2{font-size:12pt;color:#000;margin:0 0 1.5mm;border:none;padding:0;break-before:auto;page-break-before:auto}
  .hb-end>p{font-size:9pt;color:#000;margin:0 0 2.5mm;max-width:none}
  .hb-end-plans{display:block;margin:0 0 2.5mm}
  .hb-end-plans>div{display:block;background:none;border:none;border-bottom:.5pt solid #999;border-radius:0;padding:.9mm 0}
  .hb-end-plans b{display:inline;color:#000;font-size:8.8pt}
  .hb-end-plans span{display:inline;color:#000;font-size:8.3pt}
  .hb-end-plans span::before{content:" \2014\00a0"}
  .hb-end-plans em{position:static;color:#000;font-size:8.8pt;float:right}
  .hb-end-plans s{color:#000}
  .hb-end-plans .is-best{background:none;border-color:#999}
  .hb-end-plans .is-best b{text-decoration:underline}
  .hb-end-act,.hb-end-trust{display:none!important}
  .hb-print-only{display:block;font-family:"DM Mono","Courier New",monospace;font-size:9pt;margin:0}
}
