/* =====================================================================
   responsive.css – responsive-specific rules for the page-wide light flow
   (the paths themselves are laid out by the light-flow script in
   assets/js/main.js from the real element positions, so they re-fit on
   every resize / rotation; the rules below only tune stroke weights,
   glow size and clipping for smaller screens)
   ===================================================================== */

/* never wider than the screen: no horizontal scrolling, no layout shift */
#lightFlow {
  max-width: 100%;
  overflow: hidden;
  contain: layout paint;
}

/* ---------- Tablet (<= 991px) ---------- */
@media (max-width: 991.98px) {
  #lightFlow .lf-glow { stroke-width: 7; }
  #lightFlow .lf-core { stroke-width: 1.7; }
  #lightFlow .lf-run  { stroke-width: 2.6; }
  #lightFlow .lf-land { opacity: .4; }
}

/* ---------- Mobile (<= 767px) ---------- */
@media (max-width: 767.98px) {
  #lightFlow .lf-glow { stroke-width: 5; opacity: .16; }
  #lightFlow .lf-core { stroke-width: 1.5; }
  #lightFlow .lf-run  { stroke-width: 2.2; stroke-dasharray: 3 100; }
  #lightFlow .lf-node { r: 3px; }
  #lightFlow .lf-land { opacity: .35; }

  /* softer glow on the panels the light lights up, so it stays inside the screen */
  .about-card.lf-lit,
  .vm-card.lf-lit {
    box-shadow: 0 0 26px 1px color-mix(in srgb, var(--c) 50%, transparent),
                inset 0 0 18px color-mix(in srgb, var(--c) 16%, transparent);
  }
}

/* ---------- Small phones (<= 575px) ---------- */
@media (max-width: 575.98px) {
  #lightFlow .lf-glow { stroke-width: 4; }
}

/* ---------- About: the three themed branches stay bold on small screens ---------- */
@media (max-width: 991.98px) {
  #lightFlow .lf-core.lf-thick { stroke-width: 2.4; }
  #lightFlow .lf-glow.lf-thick { stroke-width: 9; }
}
@media (max-width: 767.98px) {
  #lightFlow .lf-core.lf-thick { stroke-width: 2; }
  #lightFlow .lf-glow.lf-thick { stroke-width: 7; }
}

/* ---------- Phones: About branches run as three narrow lanes, so keep them slim and distinct ---------- */
@media (max-width: 575.98px) {
  #lightFlow .lf-core.lf-thick { stroke-width: 1.9; }
  #lightFlow .lf-glow.lf-thick { stroke-width: 5; opacity: .22; }
}

/* ---------- Team heading: 4.2rem on desktop, scaled down so it fits smaller screens ---------- */
@media (max-width: 991.98px) { .team-title { font-size: 3.2rem; } }
@media (max-width: 575.98px) { .team-title { font-size: 2.4rem; } }

/* ---------- Footer legal links: keep the larger right margin from crowding small screens ---------- */
@media (max-width: 991.98px) { .footer-legal { --legal-mr: 5rem; } }
@media (max-width: 767.98px) { .footer-legal { --legal-mr: 3rem; } }
@media (max-width: 575.98px) { .footer-legal { --legal-mr: 0px; } }

/* ---------- Navigation logo: larger, with the hero kept clear of the taller menu bar ---------- */
@media (max-width: 991.98px) {
  .hero-inner { padding-top: 9rem; }                   /* menu bar is about 129px tall with the 100px logo */
}
@media (max-width: 767.98px) {
  /* mobile order: hero text first (below the menu bar), the founder photo underneath */
  .hero-inner { order: 1; padding-top: 9rem; padding-bottom: 1.5rem; }
  .hero-person { order: 2; margin-top: 0; }
}
@media (max-width: 575.98px) {
  .brand-logo { width: 84px; height: 84px; }           /* phones: slightly smaller so the bar stays compact */
  .hero-inner { padding-top: 8rem; }                   /* phones: slightly smaller menu bar */
}

/* ---------- Sticky navigation bar: tablet and mobile ---------- */
@media (max-width: 991.98px) {
  html { scroll-padding-top: 80px; }
  .site-header { --logo-full: 100px; --logo-compact: 60px; --nav-bg-min: .55; }   /* tablet: bar is always a little tinted */
  /* an open menu never runs off the screen: it scrolls inside the bar */
  .site-header .navbar-collapse { max-height: calc(100vh - 100px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 575.98px) {
  html { scroll-padding-top: 72px; }
  .site-header { --logo-full: 84px; --logo-compact: 52px; }
}

/* ---------- Team: five members, consistent card widths on every screen ---------- */
@media (max-width: 1199.98px) {   /* laptop: 3 + 2 (last row centred) */
  .team-card { flex-basis: calc((100% - 2 * var(--team-gap)) / 3); }
}
@media (max-width: 991.98px) {    /* tablet: 2 + 2 + 1 (last card centred) */
  .team-card { flex-basis: calc((100% - var(--team-gap)) / 2); }
}
@media (max-width: 575.98px) {    /* mobile: swipeable row, as before */
  .team-track { justify-content: flex-start; }
  .team-card { flex: 0 0 72%; }
}

/* ---------- Team ("The People Behind the Possibilities."): phone refinements ---------- */
@media (max-width: 767.98px) {
  .team-title { line-height: 1.12; overflow-wrap: break-word; }
}
@media (max-width: 575.98px) {
  .team { padding: 3rem 0 3.5rem; }
  .team-title { font-size: 2.2rem; margin-bottom: 1.4rem; }
  .team-track {
    gap: .8rem;
    scroll-padding-left: 1rem;                 /* a card snaps with the same left margin as the heading */
    overscroll-behavior-x: contain;            /* swiping the cards doesn't drag the whole page sideways */
    -webkit-overflow-scrolling: touch;
  }
  .team-track::after { content: ""; flex: 0 0 .2rem; }   /* a little breathing room after the last card */
  .team-card { flex: 0 0 78%; max-width: 320px; }          /* the next card always peeks in, hinting at the swipe */
  .team-card h3 { font-size: 1.05rem; }
}

/* ---------- Team slider controls on small screens ---------- */
@media (max-width: 575.98px) {
  .team-controls { gap: .8rem; margin-top: 1.4rem; }
  .team-controls .team-progress { max-width: none; }
  .team-nav { width: 38px; height: 38px; }
}

/* ---------- Footer "PRISM UNIVERSE" watermark: always fully visible, centred ---------- */
.footer-watermark { max-width: 100%; box-sizing: border-box; }
@media (max-width: 991.98px) { .footer-watermark { margin-top: 1.8rem; } }
@media (max-width: 575.98px) { .footer-watermark { margin-top: 1.4rem; } }

/* ---------- Footer watermark: a little smaller on narrow screens, so "PRISM UNIVERSE" is never cut off ----------
   --wm-scale shrinks the exact-fit size computed by the script in main.js (and the fallback size below). */
.footer-watermark { --wm-scale: 1; }
@media (max-width: 576px) { .footer-watermark { --wm-scale: .95; font-size: clamp(1.4rem, calc(10.6vw * .95), 14rem); } }
@media (max-width: 430px) { .footer-watermark { --wm-scale: .93; font-size: clamp(1.4rem, calc(10.6vw * .93), 14rem); } }
@media (max-width: 400px) { .footer-watermark { --wm-scale: .91; font-size: clamp(1.4rem, calc(10.6vw * .91), 14rem); } }
@media (max-width: 390px) { .footer-watermark { --wm-scale: .90; font-size: clamp(1.4rem, calc(10.6vw * .90), 14rem); } }
@media (max-width: 375px) { .footer-watermark { --wm-scale: .88; font-size: clamp(1.4rem, calc(10.6vw * .88), 14rem); } }
@media (max-width: 360px) { .footer-watermark { --wm-scale: .86; font-size: clamp(1.4rem, calc(10.6vw * .86), 14rem); } }
@media (max-width: 320px) { .footer-watermark { --wm-scale: .82; font-size: clamp(1.4rem, calc(10.6vw * .82), 14rem); } }

/* ---------- Awards at ~1280px: slightly smaller titles so they read without crowding the certificate ---------- */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .award-card h3 { font-size: 1.1rem; }
  .award-card p { font-size: .88rem; max-width: 300px; }
}

/* ---------- About cards at ~1200px: the narrow cards need smaller text so it stays inside the box ---------- */
@media (min-width: 1100px) and (max-width: 1299.98px) {
  .about-card { padding-left: .6rem; padding-right: .6rem; }
  .about-card h4,
  .about-card.lf-lit h4 { font-size: .7rem; letter-spacing: .05em; overflow-wrap: anywhere; }
  .about-card p { font-size: .74rem; }
}

/* ---------- Brands: tablet and mobile (stacked, centred, still airy) ---------- */
@media (max-width: 991.98px) {
  .brands { padding: 5rem 0 5.5rem; }
  .brands-row { margin-top: 3rem; }
  .omt-stage { max-width: 680px; margin: 0 auto; }
  .bx-copy { padding-left: 0; text-align: center; }
  .bx-copy .omt-logo { margin-left: auto; margin-right: auto; }
  .bx-copy .founder-eyebrow { justify-content: center; }
  .bx-text { margin-left: auto; margin-right: auto; }
  .bx-actions { justify-content: center; }
  .bx-closing { margin-top: 4.5rem; }
}
@media (max-width: 575.98px) {
  .brands { padding: 4rem 0 4.5rem; }
  .brands-row { margin-top: 2.2rem; }
  .omt-stage { padding: 1rem 1rem 2.6rem 1rem; }
  .omt-stage .omt-phone { width: 29%; right: 0; bottom: 0; }
  .bx-chip-a { width: 13%; }
  .bx-chip-b { width: 10%; }
  .bx-copy { text-align: left; }
  .bx-copy .omt-logo { margin-left: 0; }
  .bx-copy .founder-eyebrow { justify-content: flex-start; }
  .bx-text { margin-left: 0; font-size: .95rem; }
  .bx-actions { flex-direction: column; }
  .bx-actions .btn { width: 100%; text-align: center; }
  .bx-closing { margin-top: 3.2rem; }
}

/* Brands: cards and chips scale down with the showcase on tablet and mobile */
@media (max-width: 991.98px) {
  .omt-stage { padding: 2rem 2rem 3.2rem 2rem; }
}
@media (max-width: 575.98px) {
  .omt-stage { padding: 1.4rem 1.2rem 2.8rem 1.2rem; }
  .bx-card-a { width: 15%; }
  .bx-card-b { width: 16%; bottom: 9%; }
  .bx-chip-b { left: 26%; }
}

/* ---------- Awards at ~576px: smaller titles ---------- */
@media (min-width: 560px) and (max-width: 640px) {
  .award-card h3 { font-size: 1.15rem; }
}

/* Team slider on phones: one member in view at a time, centred (the slider still scrolls card by card) */
@media (max-width: 575.98px) {
  .team-track {
    max-width: 320px; margin-left: auto; margin-right: auto;
    scroll-padding-left: .2rem;                /* matches the track padding, so the card snaps exactly centred */
  }
  .team-card { flex: 0 0 100%; max-width: none; }
}

/* Team slider arrows on phones: a little smaller, still top right */
@media (max-width: 575.98px) {
  .team-head { gap: 1rem; margin-bottom: 1.4rem; }
  .team-controls { gap: .5rem; margin: 0; }
}


/* ---------- Hero, desktop 1200px - 1919px: keep the text clear of the founder photo ----------
   The photo is sized from the hero height (capped at 45% of the width), so on narrower desktops its
   shoulders reach into the text column. The text column now starts just right of the photo's visible
   edge (photo left + ~88% of its width + a small gap) and takes the remaining width.
   1920px and wider, tablet and mobile are untouched. */
@media (min-width: 1200px) and (max-width: 1919.98px) {
  .hero {
    --hero-img-w: min(80.3vh, calc(45vw - 7px));                       /* rendered width of the founder photo */
    --hero-text-left: calc(8vw + var(--hero-img-w) * .88 + 16px);      /* where the text may start (viewport x) */
    --hero-text-ml: max(0px, calc(var(--hero-text-left) - 24px));      /* minus the container padding */
  }
  .hero-content {
    flex: 0 0 auto;
    width: calc(100% - max(var(--hero-text-ml), 41.6667% + 0px));
    margin-left: max(var(--hero-text-ml), 41.6667%);
  }
}
