/* ==========================================================================
   ReBamboo — responsive layer
   style.css is the mobile composition. Each breakpoint below re-composes
   the layout rather than just scaling it.
     ≥ 600px  large phones / small tablets
     ≥ 900px  tablets landscape / small laptops
     ≥ 1200px laptops / desktops
     ≥ 1600px large desktops
   ========================================================================== */

/* ---- ≥ 600px ------------------------------------------------------------- */
@media (min-width: 600px) {
  :root { --nav-h: 76px; }
  .nav__logo img { height: 52px; }
  .nav__cta { display: inline-flex; }

  .seg { aspect-ratio: 21 / 8.4; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grades__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cmp { aspect-ratio: 16 / 10; }
  .cmp__lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fam__items { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
  .degr__stages li { grid-template-columns: 1fr 132px; }
}

/* ---- ≥ 900px ------------------------------------------------------------- */
@media (min-width: 900px) {
  .js [data-reveal="left"] { transform: translate3d(-44px, 0, 0); }
  .js [data-reveal="right"] { transform: translate3d(44px, 0, 0); }
  .js [data-reveal="left"].is-in, .js [data-reveal="right"].is-in { transform: none; }

  .nav__links { display: flex; gap: clamp(16px, 2.2vw, 34px); }
  .nav__burger { display: none; }
  .menu { display: none; }

  /* scroll rail */
  .rail { display: block; position: fixed; right: 22px; top: 50%; z-index: 80; width: 3px; height: 168px; margin-top: -84px; border-radius: 3px; background: rgba(255, 255, 255, .28); mix-blend-mode: difference; pointer-events: none; }
  .rail__fill { position: absolute; inset: 0; border-radius: 3px; background: #fff; transform-origin: top; transform: scaleY(var(--sp, 0)); }
  .rail i { position: absolute; left: -4px; width: 11px; height: 2px; border-radius: 2px; background: #fff; opacity: .6; }
  .rail i:nth-of-type(1) { top: 25%; } .rail i:nth-of-type(2) { top: 50%; } .rail i:nth-of-type(3) { top: 75%; }

  /* hero: editorial split */
  .hero__inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: center; gap: clamp(30px, 5vw, 90px); }
  .hero__title { font-size: clamp(3.6rem, 7.7vw, 7.8rem); }
  .culm { width: 100%; max-width: 440px; justify-self: end; margin-right: 5%; }
  .seg { aspect-ratio: auto; height: clamp(124px, calc((100svh - 350px) / 3), 204px); }
  .scrollcue { display: flex; align-items: center; gap: 14px; color: var(--muted-light); }
  .scrollcue i { position: relative; width: 2px; height: 46px; border-radius: 2px; background: var(--line-light); overflow: hidden; }
  .scrollcue i::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 40%; background: var(--leaf); animation: cue 2.4s var(--ease-2) infinite; }
  @keyframes cue { 0% { transform: translateY(-110%); } 100% { transform: translateY(260%); } }

  .sec-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sec-head > .eyebrow, .sec-head > .h2 { grid-column: 1 / -1; }
  .sec-head > .eyebrow { margin-bottom: 0; }
  .sec-head > .lead, .sec-head > .sec-head__side { grid-column: 2; max-width: 36em; }

  .mission__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .mission__aside { padding-top: 6px; }

  /* journey: captions left as a list, shape on the right */
  .morph__ui { grid-template-columns: minmax(0, 400px) 1fr; grid-template-rows: auto 1fr auto; column-gap: 40px; }
  .morph__ui > div:first-child { grid-column: 1 / -1; }
  .morph__steps { align-self: center; min-height: 0; display: grid; gap: 26px; }
  .morph__steps li { position: static; opacity: .26; transform: none; pointer-events: auto; padding-left: 22px; border-left: 2px solid rgba(255, 255, 255, .14); transition: opacity .6s, border-color .6s; }
  .morph__steps li.is-active { opacity: 1; border-left-color: var(--leaf); }
  .morph__steps h3 { font-size: clamp(1.7rem, 3vw, 2.6rem); margin: 4px 0 8px; }
  .morph__steps p { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .8s var(--ease); font-size: .95rem; }
  .morph__steps p > span { overflow: hidden; min-height: 0; }
  .morph__steps li.is-active p { grid-template-rows: 1fr; }
  .morph .track { grid-column: 1 / -1; }

  .why__grid { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); align-items: start; }
  .why__media { position: sticky; top: calc(var(--nav-h) + 28px); }
  .why__photo { aspect-ratio: 3 / 4; }
  .why .h2 { font-size: clamp(2rem, 4.1vw, 3.7rem); }

  .tech__head { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: end; }
  .tech__photo { aspect-ratio: 21 / 8.4; }
  .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .research { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: center; }

  /* production: horizontal flow with a travelling line */
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding-left: 0; padding-top: 44px; }
  .flow::before, .flow::after { left: 0; right: 0; top: 9px; bottom: auto; width: auto; height: 2px; }
  .flow::after { transform-origin: left; transform: scaleX(var(--p, 0)); }
  .flow li { grid-template-columns: 1fr; gap: 12px; align-items: start; align-content: start; }
  .flow li::before { left: 0; top: -44px; margin-top: 0; }
  .flow figure { width: min(100%, 168px); }
  .prod__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); grid-template-rows: auto auto; gap: 18px; }
  .prod__photo--a { grid-row: 1 / 3; aspect-ratio: auto; min-height: 520px; }
  .caps { grid-column: 2; }

  /* ecosystem: five culms side by side that widen on hover / focus */
  .eco__cols { display: flex; gap: 10px; height: 620px; }
  .fam { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: auto 1fr; }
  .fam.is-open { flex-grow: 4.2; }
  .fam__head { align-items: flex-start; flex-direction: column; justify-content: flex-start; gap: 18px; padding: 26px 24px 0; cursor: default; }
  .fam__name { flex: none; white-space: nowrap; font-size: 1.3rem; writing-mode: vertical-rl; letter-spacing: -.02em; }
  .fam.is-open .fam__name { writing-mode: horizontal-tb; font-size: clamp(1.8rem, 2.6vw, 2.5rem); letter-spacing: -.04em; }
  .fam__plus { display: none; }
  .fam__body, .fam.is-open .fam__body { grid-template-rows: 1fr; visibility: visible; }
  .fam__body { opacity: 0; transition: opacity .3s; pointer-events: none; }
  .fam.is-open .fam__body { opacity: 1; transition: opacity .7s .3s; pointer-events: auto; }
  .fam__inner { overflow: visible; }
  .fam__pad { width: max(420px, 100%); height: 100%; align-content: space-between; padding: 22px 24px 28px; }
  .grades__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .grades__list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }

  .cmp { aspect-ratio: 21 / 10; }
  .cmp__tag { top: 26px; }
  .cmp__side--pe .cmp__tag { left: 28px; }
  .cmp__side--bamboo .cmp__tag { right: 28px; }
  .cmp__col { padding: 34px 34px 36px; }
  .cont__foot { grid-template-columns: 1fr auto; align-items: center; }

  .apps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .app { grid-template-columns: 1fr; padding: 26px 24px 28px; gap: 8px; }
  .app svg { grid-row: auto; margin-bottom: 14px; }

  /* degradation: stage copy left, final statement centred */
  .degr__sticky::after { background: linear-gradient(90deg, rgba(23, 18, 13, .88) 0%, rgba(23, 18, 13, .5) 30%, rgba(23, 18, 13, 0) 46%), linear-gradient(0deg, rgba(23, 18, 13, .8) 0%, rgba(23, 18, 13, 0) 22%); }
  .degr__ui { grid-template-columns: minmax(0, 460px) 1fr; column-gap: 40px; }
  .degr__head { grid-column: 1 / -1; }
  .degr__lower { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 460px) 1fr; column-gap: 40px; align-items: end; }
  .degr__stages { min-height: 300px; }
  .degr__stages li { grid-template-columns: 1fr 150px; }
  .degr .track { grid-column: 1 / -1; }

  .sus__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sus .h2 { font-size: clamp(2rem, 4.6vw, 4.1rem); }
  .cta__lines { display: block; }
  .cta__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .footer__grid { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: auto; }
  .footer__base { grid-template-columns: 1fr auto; align-items: end; }

  .phero__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: end; }
  .plates { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
  .plate { padding: 16px 8px; }
}

/* ---- ≥ 1200px ------------------------------------------------------------ */
@media (min-width: 1200px) {
  .hero__inner { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); }
  .culm { max-width: 470px; margin-right: 8%; }
  .apps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric { padding: 26px 26px 28px; }
  .eco__cols { height: 640px; }
  .pillar { padding: 30px 28px 32px; }
  .morph__ui { grid-template-columns: minmax(0, 440px) 1fr; }
}

/* ---- ≥ 1600px ------------------------------------------------------------ */
@media (min-width: 1600px) {
  :root { --gutter: 88px; }
  .container { width: min(100% - (var(--gutter) * 2), 1480px); }
  .hero__title { font-size: 8.4rem; }
  .culm { max-width: 520px; }
  .eco__cols { height: 680px; }
}

/* ---- short landscape viewports: keep pinned stories readable ------------- */
@media (max-height: 620px) and (min-width: 900px) {
  .morph__steps { gap: 14px; }
  .morph__steps h3 { font-size: 1.5rem; }
  .degr__head .h2 { font-size: 2.2rem; }
  .degr__stages { min-height: 220px; }
}

/* ---- pointer / hover refinements ---------------------------------------- */
@media (hover: none) {
  .btn:hover, .pcard:hover, .app:hover, .pillar:hover { transform: none; }
  .app:hover { box-shadow: none; background: rgba(255, 253, 248, .62); }
}
