/* ============================================================
   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;}
/* READABILITY SCRIM — a soft dark radial behind the hero text so the title + intro
   keep contrast where the bright background beams pass through. It sits BELOW the
   content (.wrap is z-index:1) and fades out, so the branded rays still show. */
.flip-hero::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  background:radial-gradient(115% 72% at 50% 30%,
    rgba(3,10,28,.62), rgba(3,10,28,.28) 52%, transparent 76%);}
/* The flip hero gets a WIDER wrap than the rest of the page so the book can be
   large on desktop (the narrow sec-head keeps its own 760px cap). */
.flip-hero .wrap{position:relative;z-index:1;max-width:1400px;margin:0 auto;}
.flip-hero .sec-head{text-align:center;max-width:760px;margin:0 auto 24px;}
/* prominent but not shouting: smaller cap, comfortable line-height + balanced wrap */
.flip-hero .sec-head h1{color:var(--white);font-size:clamp(26px,3.4vw,40px);
  line-height:1.14;margin:6px 0 14px;text-wrap:balance;}
.flip-hero .sec-head .eyebrow{color:var(--sky);}
.flip-hero .sec-head p{color:var(--on-dark-60);font-size:16px;line-height:1.55;}

/* ---------- DEEP-LINK TARGET (printed QR → https://dtiindia.com/resources#flipbook) ----------
   id="flipbook" is the permanent anchor. <html> has scroll-behavior:smooth and
   resources.js smooth-scrolls on arrival; scroll-margin-top leaves room for the
   header so the section isn't jammed under it. When the page is opened AT
   #flipbook, the section gets a brief, tasteful blue attention-glow so it reads as
   an intentional navigation to the flip book (auto-disabled for reduced motion). */
#flipbook{scroll-margin-top:clamp(70px,9vh,108px);}
@media(prefers-reduced-motion:no-preference){
  #flipbook:target::after{
    content:"";position:absolute;inset:0;z-index:0;pointer-events:none;opacity:0;
    background:radial-gradient(72% 56% at 50% 30%, rgba(0,93,248,.34), transparent 70%);
    animation:flipTargetGlow 2.8s var(--ease) .15s 1;
  }
  @keyframes flipTargetGlow{0%,100%{opacity:0;}26%,46%{opacity:1;}}
}

.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:1360px;height:80vh;
  overflow:hidden;display:grid;place-items:center;}
/* ZOOM wrapper: fills the stage and centres the book; carries the zoom/pan
   transform. Overflow is clipped by .flip-stage so a zoomed page never spills. */
.flip-zoom{width:100%;height:100%;display:grid;place-items:center;
  transform-origin:50% 50%;will-change:transform;}
.flip-zoom.is-zanim{transition:transform .25s var(--ease);}
.flip-stage.is-zoomed{cursor:grab;touch-action:none;}
.flip-stage.is-zoomed:active{cursor:grabbing;}
/* The centring shift glides over ~the flip duration (700ms) so it rides ALONG
   with the page curl instead of sliding separately after it. */
.flip-book{margin:0 auto;transform-origin:center;transition:transform .62s var(--ease);}
@media(prefers-reduced-motion:reduce){.flip-book{transition:none;}}
.flip-book .stf__item,.flip-book .page{background:var(--white);box-shadow:0 18px 50px -24px rgba(0,0,0,.7);}
/* HTML render mode: each leaf is a real DOM page holding one full-bleed <img>
   (crisp on retina + lazy-loaded). Fill the leaf the page-flip engine sizes. */
.flip-book .flip-page{width:100%;height:100%;}
.flip-book img{width:100%;height:100%;display:block;object-fit:cover;}

/* ---- 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;justify-content:center;flex-wrap:wrap;gap:14px;}
.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:background var(--dur) var(--ease),border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease);}
.flip-controls button:hover:not(:disabled){background:var(--blue);border-color:var(--blue);
  transform:translateY(-2px);box-shadow:0 10px 22px -10px rgba(0,93,248,.6);}
.flip-controls button:active:not(:disabled){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;}

/* ---------- PAGE-TURN SOUND TOGGLE ----------
   A control-bar button: it inherits the round look + hover from
   `.flip-controls button`, sits right of the next arrow (after a thin divider),
   so it matches the arrows and never overlaps the book, counter or text. */
.flip-controls .flip-sep{width:1px;height:26px;background:var(--dark-line);margin:0 2px;flex:0 0 auto;}
.flip-sound svg{display:block;width:19px;height:19px;}
.flip-sound .ico-off{display:none;}
.flip-sound.is-muted{color:var(--on-dark-60);}        /* dimmer glyph when muted */
.flip-sound.is-muted .ico-on{display:none;}
.flip-sound.is-muted .ico-off{display:block;}

/* ZOOM buttons: +/- inherit the round control-button look; the level read-out is
   an auto-width pill that doubles as the reset-to-fit button. */
.flip-zbtn svg{display:block;}
.flip-controls .flip-zlevel{width:auto;min-width:52px;height:auto;border-radius:999px;
  padding:8px 10px;font-family:'DM Sans';font-size:12.5px;line-height:1;
  color:var(--on-dark-60);font-variant-numeric:tabular-nums;letter-spacing:.02em;}
.flip-controls .flip-zlevel:hover:not(:disabled){color:#fff;transform:translateY(-2px);}
/* these helper lines sit over the brightest part of the rays — a soft dark
   text-shadow keeps them legible without a heavy box. */
.flip-hint{font-size:12.5px;color:rgba(236,236,239,.56);letter-spacing:.02em;
  text-shadow:0 1px 3px rgba(0,6,22,.75);}
.flip-fallback{font-size:14px;color:var(--on-dark-60);text-align:center;
  text-shadow:0 1px 3px rgba(0,6,22,.75);}
/* 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. */

/* back-pill label: full text on desktop, a short "Waitlist" on phones (so the
   centred-logo mobile header — matching index — never overlaps). */
.site-pill .pill-short{display:none;}

/* ---------- 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:84px 24px;}
/* READABILITY SCRIM — soft dark wash so the heading, intro and cards keep contrast
   over the bright rays; fades at top/bottom so it blends into the hero above and
   footer below (no hard band), and stays translucent so the brand world shows. */
.res-section::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(180deg,
    transparent, rgba(3,10,28,.46) 12%, rgba(3,10,28,.46) 88%, transparent);}
.res-section > *{position:relative;z-index:1;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(24px,2.8vw,34px);line-height:1.14;}
.res-section .sec-head .eyebrow{color:var(--sky);}
.res-section .sec-head p{color:var(--on-dark-60);font-size:16px;line-height:1.55;margin-top:12px;}

.ref-list{list-style:none;display:grid;gap:16px;max-width:880px;margin:0 auto;padding:0;}
/* Cards are DARK + opaque enough (plus a blur) that the book names and buttons are
   clearly readable even when a bright beam passes directly behind them. Soft base
   depth + a gentle lift on hover = premium without heavy drop-shadows. */
.ref-item{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;
  background:rgba(7,17,42,.74);border:1px solid var(--dark-line);border-radius:16px;padding:18px 24px;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:var(--shadow-soft);
  transition:border-color var(--dur) var(--ease),background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),transform var(--dur) var(--ease);}
.ref-item:hover{border-color:rgba(0,93,248,.55);background:rgba(12,28,64,.85);transform:translateY(-3px);
  box-shadow:var(--shadow-lift),0 18px 40px -24px rgba(0,93,248,.55);}
.ref-name{display:flex;align-items:center;gap:14px;min-width:0;}
/* all-caps Ancorli reads cleaner with a touch more tracking + size + line-height */
.ref-name span:last-child{font-family:'Ancorli';text-transform:uppercase;letter-spacing:.035em;
  font-size:18px;color:var(--white);line-height:1.3;}
.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:border-color var(--dur) var(--ease),background var(--dur) var(--ease),
    transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease);}
.footer-social a:hover{border-color:rgba(150,190,255,.85);background:rgba(0,93,248,.22);
  transform:translateY(-3px) scale(1.04);box-shadow:0 12px 26px -12px rgba(0,93,248,.55);}
.footer-social a:active{transform:translateY(-1px) scale(1);}
.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 (mobile) — brand-consistent with index ---------- */
/* resources.css only loads on resources.html, so these .site-header overrides are
   automatically scoped to this page (they mirror index's own mobile header rules). */
@media(max-width:768px){
  /* HEADER: match index mobile — centre the DTII logo, float a COMPACT pill
     top-right. The back-pill switches to its short "Waitlist" label so it always
     clears the centred logo on one row with no overlap. */
  .site-header{justify-content:center;}
  .site-pill{position:absolute;top:clamp(0.8rem,2.6vw,1.2rem);right:clamp(0.8rem,3vw,1.1rem);}
  .site-pill .pill-long{display:none;}
  .site-pill .pill-short{display:inline;}

  /* FLIP HERO: drop the old sticky-nav top padding; tighten section spacing and
     scale the title/intro to comfortable phone sizes. */
  .flip-hero{padding:clamp(1rem,3vh,1.75rem) 16px 40px;}
  .flip-hero .sec-head{margin:0 auto 18px;}
  .flip-hero .sec-head h1{font-size:clamp(23px,5.8vw,30px);margin:4px 0 10px;}
  .flip-hero .sec-head p{font-size:15px;line-height:1.5;}
  .flip-wrap{gap:18px;}
  /* nudge the page-turn controls to a comfortable tap size, reachable below the book */
  .flip-controls{gap:9px;}                                        /* tighter: more buttons now */
  .flip-controls button{width:42px;height:42px;font-size:18px;}   /* incl. sound + zoom toggles */
  .flip-controls .flip-sep{height:22px;margin:0;}
  .flip-controls .pageno{min-width:64px;font-size:13px;}
  .flip-controls .flip-zlevel{min-width:46px;padding:7px 8px;font-size:12px;}
  .flip-sound svg{width:18px;height:18px;}
  .flip-zbtn svg{width:18px;height:18px;}

  /* REFERENCES: full-width stacked rows with big, tappable buttons. */
  .res-section{padding:clamp(2.5rem,7vh,3.5rem) 16px;}
  .res-section .sec-head{margin:0 auto 24px;}
  .res-section .sec-head h2{font-size:clamp(22px,5.4vw,29px);}
  .res-section .sec-head p{font-size:15px;line-height:1.5;}
  .ref-list{gap:12px;}
  .ref-item{flex-direction:column;align-items:stretch;gap:14px;padding:16px 18px;}
  .ref-name{gap:12px;}
  .ref-actions{width:100%;gap:10px;}
  .ref-actions .btn-pill{flex:1;justify-content:center;height:3rem;font-size:15px;}
}

/* ---------- SMALL PHONES (<=480px) ---------- */
@media(max-width:480px){
  .site-pill.nav-pill{font-size:0.74rem;padding:0.38rem 0.72rem;}
  .flip-hero .sec-head h1{font-size:clamp(22px,6.6vw,28px);}
  .flip-hero .sec-head p{font-size:14px;}
  .res-section .sec-head h2{font-size:clamp(22px,6.4vw,28px);}
  .ref-item{padding:14px 16px;}
  .ref-name span:last-child{font-size:15px;line-height:1.25;}
  .ref-ico{flex:0 0 34px;width:34px;height:34px;}
}
