/* ============================================================
   RESOURCES PAGE (resources.html)
   Dark theme that matches the waitlist visual language. Shared
   tokens, fonts and the .theme-dark shell come from dtii.css.

   SECTIONS
     1. Top nav
     2. Flip-book hero
     3. Pill buttons
     4. References list
     5. Footer
     6. Responsive
   ============================================================ */

/* ---------- 1) TOP NAV ----------
   The header now uses the SHARED .site-header / .site-logo / .site-pill components
   in dtii.css — identical markup and styling to index.html. Nothing page-specific
   is needed here. */

/* ---------- 2) FLIP-BOOK HERO ---------- */
/* Transparent — the branded blue rays + glow come from the SHARED fixed backdrop
   (.theme-dark::before in dtii.css), exactly like index, so the book sits in the
   same visual world. No page-specific gradient/scrim. */
.flip-hero{position:relative;overflow:hidden;padding:clamp(1.5rem,4vh,3rem) 24px 56px;
  background:transparent;}
.flip-hero .wrap{position:relative;z-index:1;max-width:var(--maxw);margin:0 auto;}
.flip-hero .sec-head{text-align:center;max-width:760px;margin:0 auto 24px;}
.flip-hero .sec-head h1{color:var(--white);font-size:clamp(30px,4.4vw,52px);margin:6px 0 14px;}
.flip-hero .sec-head .eyebrow{color:var(--sky);}
.flip-hero .sec-head p{color:var(--on-dark-60);font-size:17px;}

.flip-wrap{position:relative;z-index:0;display:flex;flex-direction:column;align-items:center;gap:24px;}
/* The stage stays in normal flow (position:relative, NOT absolute/fixed). Its
   height is set by resources.js to the fitted (~70vh) book height, and
   overflow:hidden is a hard cap so the book can never exceed the container and
   spill over the References section below it. */
.flip-stage{position:relative;z-index:0;width:100%;max-width:1180px;height:70vh;
  overflow:hidden;display:grid;place-items:center;}
.flip-book{margin:0 auto;}
.flip-book .stf__item,.flip-book .page{background:var(--white);box-shadow:0 18px 50px -24px rgba(0,0,0,.7);}
.flip-book img{width:100%;height:100%;display:block;}

/* ---- CLOSED-BOOK COVER (intro state) ----
   Overlays the flip book on load: a centered single cover (PDF page 1) styled
   to read as a CLOSED book — spine shadow on the left, stacked page edges on
   the right, drop shadow, pointer cursor, hover lift and a "Click to open"
   hint. Clicking it flips the real book open (resources.js). */
.flip-cover{position:absolute;inset:0;z-index:5;display:grid;place-items:center;
  cursor:pointer;transition:opacity .35s ease;}
.flip-cover.is-opening{opacity:0;pointer-events:none;}
/* width/height are set inline by resources.js to one StPageFlip leaf size */
.flip-cover-book{position:relative;background:var(--white);
  border-radius:2px 6px 6px 2px;
  /* stacked page edges (right) + soft drop shadow */
  box-shadow:2px 0 0 #ececec, 4px 0 0 #e0e0e0, 6px 0 0 #d4d4d4,
             0 26px 60px -22px rgba(0,0,0,.75);
  transition:transform .25s ease, box-shadow .25s ease;}
.flip-cover-book img{width:100%;height:100%;display:block;object-fit:cover;border-radius:2px 6px 6px 2px;}
/* spine shadow down the left (binding) edge */
.flip-cover-book::before{content:"";position:absolute;top:0;bottom:0;left:0;width:16px;z-index:2;
  pointer-events:none;border-radius:2px 0 0 2px;
  background:linear-gradient(to right, rgba(0,0,0,.42), rgba(0,0,0,.14) 55%, rgba(0,0,0,0));}
.flip-cover:hover .flip-cover-book,
.flip-cover:focus-visible .flip-cover-book{transform:translateY(-5px);
  box-shadow:2px 0 0 #ececec, 4px 0 0 #e0e0e0, 6px 0 0 #d4d4d4,
             0 36px 72px -22px rgba(0,0,0,.82);}
.flip-cover:focus-visible{outline:none;}
/* dark pill so it stays legible over the WHITE cover page */
.flip-cover-hint{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);
  display:inline-flex;align-items:center;gap:7px;white-space:nowrap;
  font-family:'DM Sans';font-weight:500;font-size:13px;letter-spacing:.04em;color:#fff;
  background:rgba(3,13,42,.82);border:1px solid rgba(150,190,255,.32);border-radius:999px;
  padding:7px 15px;box-shadow:0 8px 22px -8px rgba(0,0,0,.7);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  animation:coverPulse 2.4s ease-in-out infinite;}
.flip-cover-hint::before{content:"";width:9px;height:11px;border:1.5px solid var(--sky);
  border-radius:1px 2px 2px 1px;border-left-width:2.5px;display:inline-block;}
.flip-cover:hover .flip-cover-hint,
.flip-cover:focus-visible .flip-cover-hint{border-color:rgba(150,190,255,.7);
  box-shadow:0 10px 26px -8px rgba(0,0,0,.8);}
@keyframes coverPulse{0%,100%{opacity:.72;}50%{opacity:1;}}
@media(prefers-reduced-motion:reduce){
  .flip-cover-hint{animation:none;}
  .flip-cover-book{transition:none;}
}

.flip-loading{color:var(--on-dark-60);font-size:14px;display:flex;align-items:center;gap:10px;}
.flip-spin{width:18px;height:18px;border-radius:50%;border:2px solid rgba(255,255,255,.25);
  border-top-color:var(--sky);animation:flipspin .8s linear infinite;}
@keyframes flipspin{to{transform:rotate(360deg);}}

.flip-controls{display:flex;align-items:center;gap:16px;}
.flip-controls button{display:grid;place-items:center;width:46px;height:46px;border-radius:50%;
  background:rgba(255,255,255,.07);border:1px solid var(--dark-line);color:var(--white);
  cursor:pointer;font-size:20px;line-height:1;transition:.2s;}
.flip-controls button:hover:not(:disabled){background:var(--blue);border-color:var(--blue);transform:translateY(-1px);}
.flip-controls button:disabled{opacity:.38;cursor:default;}
.flip-controls .pageno{font-family:'DM Sans';font-size:14px;color:var(--on-dark-60);
  min-width:84px;text-align:center;font-variant-numeric:tabular-nums;}
.flip-hint{font-size:12.5px;color:var(--on-dark-40);letter-spacing:.02em;}
.flip-fallback{font-size:14px;color:var(--on-dark-60);text-align:center;}
/* The offline-download trigger is a <button> (no direct PDF href), styled to
   look like the inline text link it replaces. */
.flip-fallback-btn{background:none;border:0;padding:0;margin:0;cursor:pointer;
  font-family:inherit;font-size:inherit;line-height:inherit;}
.flip-fallback a,.flip-fallback-btn{color:var(--sky);font-weight:500;
  text-decoration:underline;text-underline-offset:3px;}
.flip-fallback-btn:hover{color:var(--white);}

/* ---------- 3) PILL BUTTONS ---------- */
/* .btn-pill (.solid / .ghost) is now defined in the SHARED dtii.css so index and
   resources use the exact same button. Nothing page-specific needed here. */

/* ---------- 4) REFERENCES ---------- */
/* Normal flow, no negative margins, and a clean stacking context that sits
   ABOVE the flip-book hero so nothing from the book can ever cover it. */
/* Transparent so the branded deep-blue body + glow shows through (the flip
   stage is height-capped with overflow:hidden, so nothing overlaps here). */
.res-section{position:relative;z-index:1;background:transparent;
  max-width:none;margin:0;padding:64px 24px;}
.res-section > *{max-width:var(--maxw);margin-left:auto;margin-right:auto;}
.res-section .sec-head{text-align:center;max-width:720px;margin:0 auto 36px;}
.res-section .sec-head h2{color:var(--white);font-size:clamp(26px,3.4vw,42px);}
.res-section .sec-head .eyebrow{color:var(--sky);}
.res-section .sec-head p{color:var(--on-dark-60);font-size:16px;margin-top:12px;}

.ref-list{list-style:none;display:grid;gap:14px;max-width:880px;margin:0 auto;padding:0;}
.ref-item{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;
  background:var(--dark-card);border:1px solid var(--dark-line);border-radius:14px;padding:18px 22px;transition:.25s;}
.ref-item:hover{border-color:rgba(0,93,248,.5);background:rgba(255,255,255,.06);
  box-shadow:0 20px 44px -28px rgba(0,93,248,.5);}
.ref-name{display:flex;align-items:center;gap:14px;min-width:0;}
.ref-name span:last-child{font-family:'Ancorli';text-transform:uppercase;letter-spacing:.01em;
  font-size:17px;color:var(--white);line-height:1.2;}
.ref-ico{flex:0 0 38px;width:38px;height:38px;border-radius:10px;position:relative;display:inline-block;
  background:rgba(0,93,248,.16);border:1px solid rgba(0,93,248,.4);}
.ref-ico::before{content:"";position:absolute;inset:9px 11px;border:1.6px solid var(--sky);border-radius:2px;}
.ref-ico::after{content:"";position:absolute;left:14px;right:14px;top:15px;height:1.6px;
  background:var(--sky);box-shadow:0 4px 0 var(--sky),0 8px 0 var(--sky);}
.ref-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}

/* ---------- 5) FOOTER ---------- */
.dark-footer{border-top:1px solid var(--dark-line);padding:40px 24px;text-align:center;
  color:var(--on-dark-40);font-size:13px;}
.dark-footer .ico{height:24px;width:auto;opacity:.7;margin:0 auto 14px;}
/* social icons — same circular brand pills as index */
.footer-social{display:flex;justify-content:center;gap:14px;margin:0 auto 18px;}
.footer-social a{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;
  border:1px solid rgba(236,236,239,.55);background:rgba(8,18,48,.35);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:.2s;}
.footer-social a:hover{border-color:rgba(150,190,255,.85);background:rgba(0,93,248,.22);transform:translateY(-2px);}
.footer-social img{width:18px;height:18px;display:block;}

/* ---------- 6) GATED-DOWNLOAD MODAL ---------- */
.dl-modal{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:1.25rem;}
.dl-modal[hidden]{display:none;}
.dl-overlay{position:absolute;inset:0;background:rgba(0,6,22,.76);
  -webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);}
.dl-dialog{position:relative;z-index:1;width:100%;max-width:30rem;
  background:var(--brand-blue-2);border:1px solid var(--dark-line);border-radius:18px;
  padding:clamp(1.5rem,4vw,2.25rem);color:var(--on-dark);
  box-shadow:0 40px 90px -34px rgba(0,0,0,.85);
  animation:dlIn .2s ease both;}
@keyframes dlIn{from{opacity:0;transform:translateY(10px) scale(.98);}to{opacity:1;transform:none;}}
@media(prefers-reduced-motion:reduce){.dl-dialog{animation:none;}}

.dl-close{position:absolute;top:.85rem;right:.85rem;width:2.1rem;height:2.1rem;border-radius:50%;
  display:grid;place-items:center;cursor:pointer;font-size:1.35rem;line-height:1;
  background:rgba(255,255,255,.06);border:1px solid var(--dark-line);color:var(--on-dark);transition:.2s;}
.dl-close:hover{background:rgba(255,255,255,.13);color:var(--white);}
.dl-title{font-family:'Ancorli';text-transform:uppercase;color:var(--white);font-size:1.4rem;margin-bottom:.4rem;}
.dl-sub{color:var(--on-dark-60);font-size:.9rem;margin-bottom:1rem;}
.dl-resource{font-size:.85rem;color:var(--on-dark);margin-bottom:1.1rem;padding:.6rem .8rem;border-radius:10px;
  background:rgba(0,93,248,.12);border:1px solid rgba(0,93,248,.3);word-break:break-word;}
.dl-resource span{font-weight:600;color:#cfe0ff;}

/* .dl-field / label / input now use the SHARED pill-input rule in dtii.css
   (identical to index's waitlist modal). Only the optional-label tint is local. */
.dl-optional{font-weight:400;color:var(--on-dark-40);}

/* per-field inline error (small red text under the field) */
.dl-field-error{color:#ff9b9b;font-size:.78rem;padding-left:.2rem;}
.dl-field-error[hidden]{display:none;}

.dl-error{color:#ff9b9b;font-size:.85rem;margin:0 0 .6rem;}
.dl-error[hidden]{display:none;}
.dl-submit{width:100%;justify-content:center;height:3rem;margin-top:.35rem;}
.dl-submit:disabled{opacity:.65;cursor:default;transform:none;}

/* ---------- 7) RESPONSIVE ---------- */
@media(max-width:640px){
  .flip-hero{padding:80px 16px 56px;}
  .res-section{padding:52px 18px;}
  .ref-item{flex-direction:column;align-items:flex-start;gap:14px;}
  .ref-actions{width:100%;}
  .btn-pill{flex:1;justify-content:center;}
}
