/* =========================================
   Trulii Theme, structure-first, redundant-free
   Single source of truth for header height and offsets
   ========================================= */

/* ---------- Design tokens ---------- */
:root{
  /* Core palette */
  --navy:#1A2A6C;
  --navy-hover:#162259;
  --sky:#3A7BD5;
  --yellow:#FFD43B;
  --dark:#222;
  --light:#F7F7F7;
  --white:#FFFFFF;

  /* Support palette and mappings */
  --muted:#64748b;
  --line:#dbe3ee;
  --soft:#eef3fb;

  /* Legacy tokens mapped to new palette so existing classes keep working */
  --ink: var(--dark);
  --accent: var(--yellow);
  --accent-2:#ffe37e;
  --surface: var(--light);

  /* Radii, shadows, motion */
  --radius:16px;
  --shadow:0 10px 30px rgba(2,6,23,.08), 0 2px 6px rgba(2,6,23,.04);
  --shadow-soft:0 6px 20px rgba(2,6,23,.06);
  --speed:280ms;

  /* Layout primitives, header height is authoritative */
  --header-h:60px;
  --stage-pad:24px;

  /* Anchor offset respects safe areas */
  --offset: calc(var(--header-h) + 8px + env(safe-area-inset-top));
}

/* Anchor and scroll positioning use the same offset everywhere */
html { scroll-padding-top: var(--offset); }
[id] { scroll-margin-top: var(--offset); }

/* ---------- Base reset ---------- */
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);
  background:var(--surface);
}

/* ---------- Simple layout helpers ---------- */
section,footer { padding:24px; }
.container{ max-width:1200px; margin:0 auto; }
.row{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
a{ color:inherit; text-decoration:none; }
.brand-italic{ font-style:italic; letter-spacing:.1px; }
.trial-note {
  font-size: 0.95rem;
  color: #6b7280;
  letter-spacing: 0.02em;
  font-style: italic;
}

/* =========================================
   Components
   ========================================= */

/* ---------- Buttons ---------- */
.btn{
  display:inline-block;
  padding:12px 18px;
  border-radius:14px;
  background:var(--navy);
  color:var(--white);
  font-weight:700;
  box-shadow:var(--shadow-soft);
  transform:translateY(0);
  transition:
    transform var(--speed) ease,
    box-shadow var(--speed) ease,
    background var(--speed) ease,
    color var(--speed) ease;
}
.btn:hover{ background:var(--navy-hover); transform:translateY(-2px); box-shadow:var(--shadow); }
.btn:active{ transform:translateY(0); }
.btn.secondary{ background:var(--yellow); color:var(--dark); }
.btn.secondary:hover{ background:var(--sky); color:var(--white); }

/* ---------- Header and Navigation ----------
   Note, add or remove the .scrolled class in JS on scroll
*/
header.sticky{
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition:
    background-color var(--speed) ease,
    box-shadow var(--speed) ease,
    border-color var(--speed) ease;
}
header.sticky.scrolled{
  background: var(--white);
  border-bottom-color: var(--line);
  box-shadow: 0 2px 5px rgba(0,0,0,.1);
}

.navwrap{
  display:flex;
  justify-content:space-between;
  align-items:center;
  height: var(--header-h);  /* lock bar height on wide screens */
}

nav a{
  font-weight:600;
  margin:0 8px;
  padding:12px 10px;
  border-radius:10px;
  font-size:15px;
  transition: background var(--speed) ease, color var(--speed) ease;
}
nav a:hover{ background: var(--soft); }
nav a.active{ background: var(--sky); color: var(--white); }

/* Single authoritative logo rule, scales with header */
header.sticky .logoBox img{
  height: calc(var(--header-h) - 6px) !important;
  width: auto !important;
  max-height: none !important;
  display: block;
}
/* Anchor point for the video */
.hero p{
  margin-top: 6px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.heroVideoSlot{
  position: relative;
  margin-top: 100px;
  width: 380px;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1630;
  box-shadow: 0 14px 40px rgba(8, 18, 43, 0.10);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.heroVideoSlot:hover{
  box-shadow: 0 20px 48px rgba(8, 18, 43, 0.16);
  transform: translateY(-2px);
}

/* Video fill behavior */
.heroVideo{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* Speaker / unmute button */
.videoUnmute{
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 3;
}

.videoUnmute:hover{
  background: rgba(0,0,0,0.75);
}
/* Mobile safety */
@media (max-width: 980px){
  .grid-3,.grid-2,.shots,.stats{ grid-template-columns:1fr; }
  h1{ font-size:34px; }
  .stage{ min-height:auto; align-items:flex-start; }

  /* Hero video mobile override */
  .hero.container{
    padding-right: 0;
    padding-bottom: 0;
  }
  .heroVideoSlot{
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin-top: 16px;
  }

  /* Hero text width, mobile/tablet override */
  .hero.container > p.muted,
  .hero.container > .muted,
  .hero.container > .row{
    max-width: 100%;
  }
}

/*   New Video Treatment  */

h1{
  font-size:44px;
  line-height:1.1;
  margin:0 0 10px;
  color:var(--navy);
}
h2{
  font-size: 30px;          
  margin: 0 0 10px;         
  color: var(--sky);
}
.hero-tagline{
  font-size: 18px;
  font-weight: 500;
  color: var(--navy); 
  /* soft highlight */
  background: linear-gradient(
    90deg,
    rgba(255, 212, 59, 0.12) 0%,
    rgba(255, 212, 59, 0.05) 100%
  );

  padding: 4px 10px;
  border-radius: 6px;
  margin: 12px 0 28px;
  display: inline-block;
  line-height: 1.3;
  letter-spacing: 0.2px;

  /* stronger micro-shadow so you actually see it */
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.16),   /* soft drop */
    0 0 1px rgba(15, 23, 42, 0.12);     /* crisp edge */
}

/* ---------- Stage and Panels ----------
   First .stage clears the fixed header height cleanly.
*/
.stage{
  min-height: calc(100vh - var(--header-h) - var(--stage-pad)*2);
  padding: var(--stage-pad) 24px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}
.stage:first-of-type{ padding-top: var(--header-h) !important; }  /* clears header */
.panel{
  width:100%;
  max-width:1200px;
  opacity:0;
  transform:translateY(8px) scale(0.995);
  pointer-events:none;
  display:none;
  background:linear-gradient(180deg,var(--white) 0%, var(--soft) 100%);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
}
.panel.active{
  display:block;
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
  box-shadow:none;
}
.panel > .container{ padding:24px; }

/* Accessible focus without blue rings on the panel container */
.panel:focus,
.panel:focus-visible{ outline:none; }

/* Panel enter transitions */
.panel.enter{
  display:block;
  opacity:0;
  transform:translateY(14px) scale(0.985);
  box-shadow:0 0 0 0 rgba(58,123,213,0);
  filter:saturate(96%);
}
.panel.enter-active{
  opacity:1;
  transform:translateY(0) scale(1);
  box-shadow:0 0 24px 6px rgba(58,123,213,0.18);
  filter:saturate(100%);
  transition:
    opacity 360ms ease,
    transform 360ms cubic-bezier(.2,.8,.2,1),
    box-shadow 480ms ease-out,
    filter 360ms ease;
}

/* Reveal on activate */
.reveal{
  opacity:0;
  transform:translateY(10px);
  transition:opacity var(--speed) ease, transform var(--speed) ease;
}
.panel.active .reveal{
  opacity:1;
  transform:translateY(0);
}

/* ---------- Grids and Cards ---------- */
.grid-3{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.grid-2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }

.stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.stat{
  text-align:center;
  padding:18px;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:var(--shadow-soft);
}
.stat strong{ font-size:22px; color:var(--navy); }

.shots{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.shot{
  height:150px;
  border:2px dashed var(--line);
  border-radius:14px;
  display:grid;
  place-items:center;
  font-size:12px;
  color:var(--muted);
  text-align:center;
  padding:8px;
  background:var(--white);
  transition:transform var(--speed) ease, box-shadow var(--speed) ease, border-color var(--speed) ease;
}
.shot:hover{ transform:translateY(-2px); box-shadow:var(--shadow); border-color:#c9d8ee; }

.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:9999px;
  background:#e8f1ff;
  color:#0f3a78;
  font-size:12px;
}

/* ---------- FAQ header row, sticky title + CTAs ---------- */
.faq-header{
  position: sticky;
  top: calc(var(--header-h) + var(--stage-pad));
  z-index: 20;
  background:var(--white);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-bottom:1px solid var(--line);
  margin-bottom:12px;
}
.faq-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ---------- Investors list ---------- */
.investors{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px 24px;
  margin-top:12px;
}
.investors div{ padding:4px 0; }
/* ---------- Descriptor, kept for reuse elsewhere ---------- */
.descriptor{
  text-align:center;
  font-weight:800;
  font-size:22px;
  line-height:1.3;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  margin:0 0 12px;
  color:var(--navy);
}

/* =========================================
   Responsive rules
   Keep header height authoritative, offsets flow from it
   ========================================= */

/* Compact menu, most phones */
@media (max-width: 768px){
  :root { --header-h: 48px; } /* shorter header drives offset automatically */

  .navwrap{
    height:auto;                /* allow wrap if needed */
    min-height: var(--header-h);
    gap:6px;
    flex-wrap:wrap;
    align-items:center;
    padding:6px 0;
  }

  header{
    background-color: var(--white) !important;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    margin: 0;
    padding: 0;
    border: none;
  }

  /* Ensure nav reads well on white */
  nav, nav ul{
    background-color: var(--white) !important;
    margin:0;
    padding:0;
    border:none;
  }
  nav a{
    font-size:14px;
    padding:8px 6px;
    margin:0 4px;
    white-space:nowrap;
  }

  /* Slightly smaller buttons on phones */
  .btn{ padding:10px 14px; border-radius:12px; }

  /* Keep the logo sensible when the bar wraps */
  header.sticky .logoBox img{ height: calc(var(--header-h) - 6px) !important; }

  /* Kill tiny transparent seams on mobile portrait */
  @media (orientation: portrait){
    header{
      border-bottom:1px solid var(--line);
      display: flow-root;
      overflow:hidden;
      transform: translateZ(0);
    }
    .navwrap, nav, nav ul{
      background-color: var(--white) !important;
      margin:0 !important;
      padding:0 !important;
    }
    nav ul li:first-child,
    .navwrap > *:first-child{ margin-top:0 !important; }
  }
}

/* Ultra small phones */
@media (max-width: 380px){
  :root { --header-h: 44px; }
  nav a{ font-size:13px; padding:6px 6px; margin:0 3px; }
  .btn{ padding:8px 12px; }
}

/* FAQ header stacks nicely on small screens */
@media (max-width: 640px){
  .faq-header{ flex-direction:column; align-items:flex-start; }
  .faq-actions{ width:100%; }
}

/* Prefer reduced motion, remove nonessential animation */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; }
  .panel{ opacity:1 !important; transform:none !important; box-shadow:none !important; }
  .reveal{ opacity:1 !important; transform:none !important; }
}
/* --------------------------------------------------
   Mobile hero copy swap (phones portrait only)
   Target width: 360–430px
-------------------------------------------------- */

.heroCopy-mobile {
  display: none;
}

@media (min-width: 360px) and (max-width: 430px) {
  .heroCopy-desktop {
    display: none;
  }

  .heroCopy-mobile {
    display: block;
  }
}

/* --------------------------------------------------
   Mobile fix: Features grid stacks vertically
   Target width: 360–430px
-------------------------------------------------- */

@media (min-width: 360px) and (max-width: 430px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
