/* ══════════ TOKENS ══════════ */
:root{
  --bg:#FAF7F2;
  --surface:#FFFFFF;
  --alt:#F3EFE7;
  --dark:#16221F;
  --ink:#191D21;
  --muted:#6A7178;
  --line:#E4DED3;
  --amber:#C9762B;
  --amber-soft:#E9A24B;
  --teal:#0F6B58;
  --teal-soft:#3ECF9A;

  --ff-d:'Fraunces', Georgia, serif;
  --ff-b:'Inter', system-ui, -apple-system, sans-serif;

  /* illustration palette — the inline SVGs reference these so the artwork
     follows the theme instead of staying light */
  --art-panel:#FFFDFA;
  --art-panel-2:#F1EBE2;
  --art-edge:#E2DACE;
  --art-dark:#16221F;
  --art-on-dark:#F4F0E9;
  --art-screen:#FAF7F2;
  --art-chip:#F3EFE7;
  --art-track:#EFEAE1;
  --art-track-2:#D8D2C7;
  --art-notch:#2A3A36;
  --art-sky-1:#BFE0EC;
  --art-sky-2:#E8F2F0;
  --art-slat-1:#CBDAE1;
  --art-slat-2:#A9BFC9;

  --r:18px;
  --r-s:12px;
  --shadow:0 1px 2px rgba(25,29,33,.04), 0 12px 32px -12px rgba(25,29,33,.12);
  --ease:cubic-bezier(.22,.61,.36,1);
}

/* ══════════ DARK MODE ══════════
   Built from the deep green the AI section used to carry.
   A small script in <head> stamps data-theme on <html> before first paint —
   from a saved choice, else the OS setting — so this one block covers both. */
:root[data-theme="dark"]{
    --bg:#121C1A;
    --surface:#1A2724;
    --alt:#16211F;
    --dark:#0C1413;
    --ink:#ECE7DE;
    --muted:#9AA5A0;
    --line:#2C3A36;
    --amber:#E9A24B;
    --amber-soft:#E9A24B;
    --teal:#3ECF9A;
    --teal-soft:#3ECF9A;

    --art-panel:#20302C;
    --art-panel-2:#1A2724;
    --art-edge:#33443F;
    --art-dark:#0A100F;
    --art-on-dark:#F4F0E9;
    --art-screen:#16211F;
    --art-chip:#273632;
    --art-track:#2C3A36;
    --art-track-2:#3A4A45;
    --art-notch:#3A4A45;
    --art-sky-1:#254A55;
    --art-sky-2:#1D3A3C;
    --art-slat-1:#33505A;
    --art-slat-2:#263E47;

    --shadow:0 1px 2px rgba(0,0,0,.30), 0 12px 32px -12px rgba(0,0,0,.55);
}

*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:var(--ff-b);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
a,button{-webkit-tap-highlight-color:rgba(15,107,88,.12)}
a{color:inherit;text-decoration:none}
:focus-visible{outline:2px solid var(--teal);outline-offset:3px;border-radius:4px}
ul{list-style:none}
img{display:block;max-width:100%}
svg{display:block}

h1,h2,h3{font-family:var(--ff-d);font-weight:600;line-height:1.08;letter-spacing:-.02em}
h1{font-size:clamp(2.6rem,6vw,4.4rem)}
h2{font-size:clamp(2rem,4vw,3rem)}
h3{font-size:1.15rem;font-family:var(--ff-b);font-weight:600;letter-spacing:-.01em}
em{font-style:italic;color:var(--amber)}

.wrap{max-width:1160px;margin:0 auto;padding:0 28px}

/* ══════════ BUTTONS ══════════ */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:14px 28px;border-radius:999px;border:1px solid var(--dark);
  background:var(--dark);color:#FAF7F2;
  font-size:.95rem;font-weight:500;cursor:pointer;
  transition:transform .35s var(--ease), box-shadow .35s var(--ease), background .25s;
  will-change:transform;
}
.btn:hover{transform:translateY(-2px);box-shadow:0 10px 24px -8px rgba(22,34,31,.45)}
.btn:active{transform:translateY(0)}
.btn-quiet{background:transparent;color:var(--ink);border-color:var(--line)}
.btn-quiet:hover{border-color:var(--ink);box-shadow:none}
.btn-sm{padding:10px 20px;font-size:.88rem}
.btn-full{width:100%;margin-top:6px}

/* ══════════ NAV ══════════ */
.nav{
  position:fixed;top:0;left:0;right:0;z-index:60;
  transition:background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom:1px solid transparent;
}
.nav.stuck{background:rgba(250,247,242,.82);backdrop-filter:blur(12px);border-bottom-color:var(--line)}
.nav-in{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-top:16px;padding-bottom:16px}
.brand{display:inline-flex;align-items:center;gap:9px;font-weight:600;font-size:1rem;letter-spacing:-.01em}
.brand-dot{
  width:11px;height:11px;border-radius:50%;
  background:var(--amber);box-shadow:0 0 0 4px rgba(201,118,43,.16);
}
.nav-links{display:flex;gap:26px;font-size:.92rem;color:var(--muted);align-items:center}
.nav-links a{position:relative;transition:color .2s;padding:11px 0}
.nav-links a::after{
  content:'';position:absolute;left:0;right:0;bottom:5px;height:1.5px;
  background:var(--ink);transform:scaleX(0);transform-origin:right;
  transition:transform .35s var(--ease);
}
.nav-links a:hover{color:var(--ink)}
.nav-links a:hover::after{transform:scaleX(1);transform-origin:left}
.nav-cta-mobile{display:none}

/* right-hand controls */
.nav-actions{display:flex;align-items:center;gap:10px}

/* theme toggle */
.theme-toggle{
  width:40px;height:40px;flex:none;
  display:grid;place-items:center;
  border:1px solid var(--line);border-radius:999px;
  background:transparent;color:var(--ink);cursor:pointer;
  transition:border-color .25s, background .25s, transform .3s var(--ease);
}
.theme-toggle:hover{border-color:var(--ink);transform:translateY(-1px)}
.theme-toggle svg{width:18px;height:18px}
.theme-toggle .ic-sun{display:none}
[data-theme="dark"] .theme-toggle .ic-sun{display:block}
[data-theme="dark"] .theme-toggle .ic-moon{display:none}

/* hamburger */
.nav-toggle{
  display:none;width:44px;height:44px;margin-right:-10px;
  flex-direction:column;align-items:center;justify-content:center;gap:5px;
  background:none;border:0;cursor:pointer;
}
.nav-toggle span{
  display:block;width:22px;height:2px;border-radius:2px;background:var(--ink);
  transition:transform .3s var(--ease), opacity .2s var(--ease);
}
.nav.open .nav-toggle span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.nav.open .nav-toggle span:nth-child(2){opacity:0}
.nav.open .nav-toggle span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ══════════ HERO ══════════ */
.hero{padding-top:132px}
.hero-in{
  display:grid;grid-template-columns:1fr 1.05fr;gap:56px;align-items:center;
  padding-bottom:56px;
}
.kicker{
  font-size:.82rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted);font-weight:500;margin-bottom:22px;
}
.lede{font-size:1.12rem;color:var(--muted);max-width:32ch;margin-top:22px}
.hero-btns{display:flex;gap:12px;margin-top:34px;flex-wrap:wrap}

.hero-art{position:relative}
.room{width:100%;height:auto;filter:drop-shadow(0 24px 48px rgba(25,29,33,.10))}

/* room animations */
.blind{transform-box:fill-box;transform-origin:top center;animation:blind 9s var(--ease) infinite}
@keyframes blind{
  0%,12%{transform:scaleY(.16)}
  40%,58%{transform:scaleY(.88)}
  86%,100%{transform:scaleY(.16)}
}
.cone{animation:cone 9s var(--ease) infinite}
@keyframes cone{0%,30%{opacity:.25}50%,72%{opacity:1}92%,100%{opacity:.25}}
.bulb{animation:bulb 9s var(--ease) infinite}
@keyframes bulb{0%,30%{opacity:.35}50%,72%{opacity:1}92%,100%{opacity:.35}}
.therm text{opacity:0;animation:therm 9s linear infinite}
.therm .t2{animation-delay:3s}
.therm .t3{animation-delay:6s}
/* each value holds a full third of the cycle — the slight overlap at 33.4%
   stops the readout blanking out between values */
@keyframes therm{0%,33.4%{opacity:1}33.5%,100%{opacity:0}}

/* room 205 runs off-phase from 204 so the two rooms read as independent */
.blind-b{animation-delay:-4.5s}
.cone-b,.bulb-b{animation-delay:-4.5s}
/* negative delays start these mid-cycle — a positive delay would leave 205's
   readout blank for the first 1.5s after load */
.therm-b .t1{animation-delay:-7.5s}
.therm-b .t2{animation-delay:-4.5s}
.therm-b .t3{animation-delay:-1.5s}
.wire{stroke:var(--teal);stroke-width:2;stroke-dasharray:5 9;opacity:.45;animation:flow 1.1s linear infinite}
@keyframes flow{to{stroke-dashoffset:-14}}

/* in-room cabling: devices run along the ceiling and down one riser */
.raceway path{
  stroke:var(--teal);stroke-width:2;fill:none;
  stroke-dasharray:5 4;opacity:.55;
  animation:flow 1.3s linear infinite;
}
/* the tablet's link is dotted instead of dashed — no cable */
.wireless{
  stroke:var(--teal);stroke-width:2;fill:none;
  stroke-dasharray:1.5 5;stroke-linecap:round;opacity:.5;
  animation:flow 1.6s linear infinite;
}
.wireless-b{animation-delay:-.8s}
.wifi path{
  stroke:var(--teal);stroke-width:2.2;fill:none;stroke-linecap:round;
  animation:wifi 2.4s ease-in-out infinite;
}
.wifi path:nth-child(2){animation-delay:.18s}
.wifi path:nth-child(3){animation-delay:.36s}
/* tablet UI: blind slider and the row of tab buttons along the bottom */
.tab-slider{transform-box:fill-box;transform-origin:left;animation:tabSlide 7s var(--ease) infinite}
@keyframes tabSlide{0%,100%{transform:scaleX(.3)}45%,60%{transform:scaleX(.78)}}
.tab-slider-b{animation-delay:-3.5s}
.tab-btns circle{fill:var(--ink);opacity:.18;animation:tabBtn 6s ease-in-out infinite}
.tab-btns circle:nth-child(2){animation-delay:2s}
.tab-btns circle:nth-child(3){animation-delay:4s}
.tab-btns-b circle{animation-delay:-3s}
.tab-btns-b circle:nth-child(2){animation-delay:-1s}
.tab-btns-b circle:nth-child(3){animation-delay:-5s}
@keyframes tabBtn{0%,22%{fill:var(--teal);opacity:1}30%,100%{opacity:.18}}

.wifi-b path{animation-delay:-1.2s}
.wifi-b path:nth-child(2){animation-delay:-1.02s}
.wifi-b path:nth-child(3){animation-delay:-.84s}
@keyframes wifi{0%,100%{opacity:.18}45%{opacity:1}}
.gw-led{animation:led 2.2s ease-in-out infinite}
@keyframes led{0%,100%{opacity:1}50%{opacity:.3}}

/* strip */
.strip{
  display:flex;align-items:center;gap:22px;flex-wrap:wrap;justify-content:center;
  padding:26px 0 8px;border-top:1px solid var(--line);
  font-size:.85rem;color:var(--muted);letter-spacing:.02em;
}
.strip i{width:4px;height:4px;border-radius:50%;background:var(--line)}

/* ══════════ SECTIONS ══════════ */
.sec{padding:110px 0}
/* keep anchor targets clear of the fixed header */
section[id]{scroll-margin-top:80px}
.sec-alt{background:var(--alt)}
.sec-head{max-width:620px;margin-bottom:56px}
.tag{
  font-size:.78rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--amber);font-weight:600;margin-bottom:16px;
}

/* ══════════ DEEP DIVE — READ + WRITE ══════════ */
.live-card{
  background:var(--surface);border:1px solid var(--line);border-radius:28px;
  padding:36px 36px 12px;box-shadow:var(--shadow);
}
.live-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.live{width:100%;height:auto;max-height:360px}
.live-v{display:none}          /* phone-only vertical version */
/* vertical tracks flow along their own axis */
.flow-down{animation:flowDown 1s linear infinite}
.flow-up{animation:flowUp 1.3s linear infinite}
@keyframes flowDown{to{stroke-dashoffset:-14}}
@keyframes flowUp{to{stroke-dashoffset:14}}

/* write flows out to the room, read flows back — opposite directions */
.flow-w{stroke:var(--teal);stroke-width:2.5;stroke-dasharray:6 8;opacity:.8;animation:flow 1s linear infinite}
.flow-r{stroke:var(--muted);stroke-width:2.5;stroke-dasharray:6 8;opacity:.55;animation:flowBack 1.3s linear infinite}
@keyframes flowBack{to{stroke-dashoffset:14}}

/* a tap ripple on the + key, once per value change */
.rt-ring{
  fill:none;opacity:0;transform-box:fill-box;transform-origin:center;
  animation:rtPress 3s ease-out infinite;
}
@keyframes rtPress{0%{opacity:.85;transform:scale(1)}14%{opacity:0;transform:scale(1.55)}100%{opacity:0;transform:scale(1.55)}}

/* the room's readout trails the tablet's by ~0.45s, so the change reads as
   travelling outward. Negative delays keep every value on screen from load. */
.therm.rt-lag .t1{animation-delay:-8.55s}
.therm.rt-lag .t2{animation-delay:-5.55s}
.therm.rt-lag .t3{animation-delay:-2.55s}

.rt-light{animation:rtLight 9s ease-in-out infinite}
@keyframes rtLight{0%,31%{opacity:1}36%,64%{opacity:.22}69%,100%{opacity:1}}
.rt-blind{transform-box:fill-box;transform-origin:left;animation:rtBlind 9s var(--ease) infinite}
@keyframes rtBlind{0%,31%{transform:scaleX(.34)}38%,64%{transform:scaleX(.82)}71%,100%{transform:scaleX(.55)}}

.live-points{
  display:grid;grid-template-columns:repeat(3,1fr);gap:24px;
  margin-top:30px;padding-top:26px;border-top:1px solid var(--line);
}
.live-points li{display:flex;flex-direction:column;gap:4px;padding-bottom:24px}
.live-points b{font-size:.95rem;font-weight:600}
.live-points span{font-size:.88rem;color:var(--muted)}

/* ══════════ PROTOCOL DIAGRAM ══════════ */
.proto{
  display:grid;grid-template-columns:auto 1fr auto 1fr auto;
  gap:0;align-items:center;
}
.proto-col{display:flex;flex-direction:column;gap:18px}
.pchip{
  display:flex;align-items:center;gap:10px;
  background:var(--surface);border:1.5px solid var(--line);border-radius:var(--r-s);
  padding:16px 22px;font-weight:600;font-size:.95rem;color:var(--muted);
  transition:color .5s, border-color .5s, box-shadow .5s, transform .5s var(--ease);
}
.pchip svg{width:20px;height:20px}
.pchip-a{animation:live 8s var(--ease) infinite}
.pchip-b{animation:live 8s var(--ease) infinite;animation-delay:4s}
@keyframes live{
  0%,42%{color:var(--teal);border-color:var(--teal);box-shadow:0 8px 20px -10px rgba(15,107,88,.5);transform:translateX(6px)}
  50%,100%{color:var(--muted);border-color:var(--line);box-shadow:none;transform:translateX(0)}
}

.proto-link{height:120px}
.proto-link svg{width:100%;height:100%}
/* keeps the wire an even thickness even when the box is squashed narrow */
.pline{stroke:var(--line);fill:none;stroke-linecap:round;vector-effect:non-scaling-stroke}
.pline-a{animation:lineLive 8s var(--ease) infinite}
.pline-b{animation:lineLive 8s var(--ease) infinite;animation-delay:4s}
@keyframes lineLive{
  0%,42%{stroke:var(--teal);opacity:1}
  50%,100%{stroke:var(--line);opacity:.7}
}
.pline-out{
  stroke:var(--teal);stroke-dasharray:5 9;opacity:.8;
  animation:flow 1.1s linear infinite;
}

.proto-core{
  position:relative;
  background:var(--dark);color:#F4F0E9;
  padding:26px 30px;border-radius:var(--r);
  font-weight:600;font-size:1rem;text-align:center;white-space:nowrap;
}
.core-pulse{
  display:block;width:9px;height:9px;border-radius:50%;
  background:var(--teal-soft);margin:0 auto 10px;
  animation:led 2.2s ease-in-out infinite;
}

.proto-out{
  background:var(--surface);border:1.5px solid var(--line);border-radius:var(--r);
  padding:24px;box-shadow:var(--shadow);min-width:210px;
}
.po-room{font-weight:600;font-size:.95rem;margin-bottom:14px}
.proto-out ul{display:flex;flex-direction:column;gap:10px}
.proto-out li{display:flex;justify-content:space-between;gap:16px;font-size:.88rem}
.proto-out li span{color:var(--muted)}
.proto-out li b{font-weight:600;font-variant-numeric:tabular-nums}
.po-foot{
  margin-top:16px;padding-top:14px;border-top:1px solid var(--line);
  font-size:.78rem;color:var(--teal);font-weight:500;
}

/* ══════════ STEPS ══════════ */
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:26px}
.step{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
  padding:32px;transition:transform .45s var(--ease), box-shadow .45s var(--ease);
}
.step:hover{transform:translateY(-6px);box-shadow:var(--shadow)}
/* same panel treatment as the device cards, so the icons carry real weight */
.step-art{
  color:var(--teal);height:132px;margin-bottom:22px;
  background:var(--alt);border-radius:var(--r-s);
  display:grid;place-items:center;
}
.step-art svg{width:74%;height:auto}
.step h3{margin-bottom:8px}
.step p{color:var(--muted);font-size:.95rem}
.dash{stroke-dasharray:4 5;animation:flow 1s linear infinite}

/* ══════════ DEVICES ══════════ */
.devices{display:grid;grid-template-columns:repeat(3,1fr);gap:26px}
.dev{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
  padding:14px 14px 30px;overflow:hidden;
  transition:transform .45s var(--ease), box-shadow .45s var(--ease);
}
.dev:hover{transform:translateY(-6px);box-shadow:var(--shadow)}
.dev-art{
  background:var(--alt);border-radius:var(--r-s);
  height:190px;display:grid;place-items:center;margin-bottom:24px;
}
.dev-art svg{width:72%;height:auto}
.dev-light{color:#1B2024}
.dev-temp{color:var(--muted)}
.dev-blind{color:#6E8895}
.dev h3{margin:0 18px 8px}
.dev p{color:var(--muted);font-size:.95rem;margin:0 18px}

.dev-cone{animation:cone 6s var(--ease) infinite}
.dev-bulb{animation:bulb 6s var(--ease) infinite}
.mercury{transform-box:fill-box;transform-origin:bottom;animation:merc 6s var(--ease) infinite}
@keyframes merc{0%,100%{transform:scaleY(.55)}50%{transform:scaleY(1)}}
.dev-slats{transform-box:fill-box;transform-origin:top;animation:slats 6s var(--ease) infinite}
@keyframes slats{0%,100%{transform:scaleY(1)}50%{transform:scaleY(.35)}}

/* ══════════ AI ══════════ */
.ai-grid{display:grid;grid-template-columns:1fr 1fr;gap:64px;align-items:center}
.ai-list{margin-top:30px;display:flex;flex-direction:column;gap:16px}
.ai-list li{
  color:var(--muted);font-size:.95rem;padding-left:22px;position:relative;
}
.ai-list li::before{
  content:'';position:absolute;left:0;top:10px;width:7px;height:7px;border-radius:50%;
  background:var(--teal);
}
.ai-list b{color:var(--ink);font-weight:600}

.chat{
  background:#0F1A18;border:1px solid rgba(255,255,255,.09);
  border-radius:var(--r);overflow:hidden;
}
.chat-bar{
  display:flex;align-items:center;gap:7px;padding:14px 18px;
  background:rgba(255,255,255,.04);border-bottom:1px solid rgba(255,255,255,.07);
}
.chat-bar i{width:9px;height:9px;border-radius:50%;background:rgba(255,255,255,.18)}
.chat-bar span{margin-left:8px;font-size:.78rem;color:#8C948F}
.chat-body{padding:24px;display:flex;flex-direction:column;gap:14px}
.bubble{
  padding:13px 17px;border-radius:14px;font-size:.92rem;max-width:88%;
}
.bubble-in{background:rgba(255,255,255,.07);color:#EFEAE1;align-self:flex-start;border-bottom-left-radius:4px}
.bubble-out{background:var(--teal);color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.line{font-size:.85rem;color:#7F8884;padding-left:2px}
.line .ok{color:var(--teal-soft);margin-right:7px}

/* voice command */
.voice-row{display:flex;align-items:center;gap:12px;margin-bottom:11px}
.mic{
  width:28px;height:28px;border-radius:50%;flex:none;
  background:var(--teal);color:#fff;display:grid;place-items:center;
  animation:micGlow 2.4s ease-in-out infinite;
}
.mic svg{width:15px;height:15px}
@keyframes micGlow{
  0%,100%{box-shadow:0 0 0 0 rgba(62,207,154,.42)}
  60%{box-shadow:0 0 0 9px rgba(62,207,154,0)}
}
.wave{display:flex;align-items:center;gap:3px;height:24px}
.wave i{
  width:3px;height:100%;border-radius:2px;background:var(--teal-soft);
  transform-origin:center;animation:waveBar 1.15s ease-in-out infinite;
}
.wave i:nth-child(1){animation-delay:-.9s}
.wave i:nth-child(2){animation-delay:-.35s}
.wave i:nth-child(3){animation-delay:-.62s}
.wave i:nth-child(4){animation-delay:-.1s}
.wave i:nth-child(5){animation-delay:-.78s}
.wave i:nth-child(6){animation-delay:-.24s}
.wave i:nth-child(7){animation-delay:-.55s}
.wave i:nth-child(8){animation-delay:-.98s}
.wave i:nth-child(9){animation-delay:-.42s}
.wave i:nth-child(10){animation-delay:-.7s}
@keyframes waveBar{0%,100%{transform:scaleY(.2)}50%{transform:scaleY(1)}}
.vtext{font-size:.93rem;color:#EFEAE1}

/* ══════════ ANDROID APP ══════════ */
.app-grid{display:grid;grid-template-columns:.8fr 1fr;gap:72px;align-items:center}
.duo{
  width:100%;max-width:480px;height:auto;margin:0 auto;
  filter:drop-shadow(0 26px 52px rgba(25,29,33,.18));
}
/* lifts the phone off the tablet behind it */
.duo-phone{filter:drop-shadow(-10px 6px 18px rgba(25,29,33,.22))}
.app-list{margin-top:30px;display:flex;flex-direction:column;gap:16px}
.app-list li{color:var(--muted);font-size:.95rem;padding-left:22px;position:relative}
.app-list li::before{
  content:'';position:absolute;left:0;top:10px;width:7px;height:7px;border-radius:50%;
  background:var(--teal);
}
.app-list b{color:var(--ink);font-weight:600}

/* phone animations */
.tgl-track{fill:#D8D2C7;animation:tglTrack 6s var(--ease) infinite}
@keyframes tglTrack{0%,18%{fill:#D8D2C7}32%,86%{fill:#0F6B58}100%{fill:#D8D2C7}}
.tgl-knob{animation:tglKnob 6s var(--ease) infinite}
@keyframes tglKnob{0%,18%{transform:translateX(0)}32%,86%{transform:translateX(15px)}100%{transform:translateX(0)}}
.bar-light{transform-box:fill-box;transform-origin:left;animation:barLight 6s var(--ease) infinite}
@keyframes barLight{0%,18%{transform:scaleX(.04)}32%,86%{transform:scaleX(.6)}100%{transform:scaleX(.04)}}

.ph-temp text{opacity:0;animation:therm 9s steps(1,end) infinite}
.ph-temp .t2{animation-delay:3s}
.ph-temp .t3{animation-delay:6s}

.bar-blind{transform-box:fill-box;transform-origin:left;animation:barBlind 7s var(--ease) infinite}
@keyframes barBlind{0%,100%{transform:scaleX(.25)}44%,62%{transform:scaleX(.7)}}

/* ══════════ BUILDING ══════════ */
.bldg-card{
  background:var(--surface);border:1px solid var(--line);border-radius:28px;
  padding:44px 44px 12px;box-shadow:var(--shadow);
}
.bldg{width:100%;height:auto;max-height:440px}

/* each <use> is a full furnished room; fading the instance reads as the
   room's light going on and off */
.rm{animation:roomLit 5s ease-in-out infinite}
@keyframes roomLit{0%,100%{opacity:.16}44%,56%{opacity:.95}}
/* negative delays so every room is mid-cycle at load — none start blank */
.w1{animation-delay:-0s}
.w2{animation-delay:-1s}
.w3{animation-delay:-2s}
.w4{animation-delay:-3s}
.w5{animation-delay:-4s}

.riser{
  stroke:var(--teal);stroke-width:2.5;stroke-dasharray:6 9;
  opacity:.75;animation:flow 1.1s linear infinite;
}

.bldg-legend{
  display:grid;grid-template-columns:repeat(3,1fr);gap:24px;
  margin-top:34px;padding-top:28px;border-top:1px solid var(--line);
}
.bldg-legend li{display:flex;flex-direction:column;gap:4px;padding-bottom:24px}
.bldg-legend b{font-size:.95rem;font-weight:600}
.bldg-legend span{font-size:.88rem;color:var(--muted)}

/* ══════════ CTA ══════════ */
.cta{
  background:var(--surface);border:1px solid var(--line);border-radius:28px;
  padding:56px;display:grid;grid-template-columns:1fr 1fr;gap:56px;align-items:center;
  box-shadow:var(--shadow);
}
.lead{display:flex;flex-direction:column;gap:14px}
.fld{display:flex;flex-direction:column;gap:6px}
.fld span{font-size:.85rem;color:var(--muted);font-weight:500}
.fld input{
  border:1.5px solid var(--line);border-radius:var(--r-s);
  padding:13px 15px;font-family:var(--ff-b);color:var(--ink);
  /* 16px minimum — anything smaller makes iOS Safari zoom in on focus */
  font-size:16px;
  background:var(--bg);width:100%;
  transition:border-color .25s, background .25s;
}
.fld input:focus{outline:none;border-color:var(--teal);background:var(--surface)}
.fine{font-size:.8rem;color:var(--muted);text-align:center}

.done{text-align:center;padding:36px 8px}
.done-mark{
  width:52px;height:52px;border-radius:50%;background:var(--teal);color:#fff;
  display:grid;place-items:center;margin:0 auto 18px;font-size:1.5rem;
  animation:pop .5s var(--ease);
}
@keyframes pop{from{transform:scale(.4);opacity:0}to{transform:scale(1);opacity:1}}
.done h3{margin-bottom:6px}
.done p{color:var(--muted);font-size:.93rem}

/* ══════════ ROLES ══════════ */
.roles{display:grid;grid-template-columns:repeat(4,1fr);gap:22px}
.role{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
  padding:30px 26px;
  transition:transform .45s var(--ease), box-shadow .45s var(--ease);
}
.role:hover{transform:translateY(-6px);box-shadow:var(--shadow)}
.role-ic{
  display:grid;place-items:center;width:44px;height:44px;border-radius:12px;
  background:var(--alt);color:var(--teal);margin-bottom:20px;
}
.sec-alt .role-ic{background:#EDE7DC}
.role-ic svg{width:22px;height:22px}
.role h3{margin-bottom:8px}
.role p{color:var(--muted);font-size:.93rem}

/* ══════════ FOOTER ══════════ */
.foot{border-top:1px solid var(--line);padding:56px 0 28px;background:var(--bg)}
.foot-top{
  display:grid;grid-template-columns:1.1fr 1.6fr;gap:56px;
  padding-bottom:40px;
}
.foot-brand p{
  margin-top:14px;font-size:.9rem;color:var(--muted);max-width:34ch;
}
.foot-cols{display:grid;grid-template-columns:repeat(3,1fr);gap:28px}
.foot-cols h4{
  font-family:var(--ff-b);font-size:.78rem;font-weight:600;
  letter-spacing:.1em;text-transform:uppercase;color:var(--ink);margin-bottom:14px;
}
.foot-cols ul{display:flex;flex-direction:column;gap:10px}
.foot-cols li{font-size:.9rem;color:var(--muted)}
.foot-cols a{transition:color .2s;display:inline-block}
.foot-cols a:hover{color:var(--teal)}

/* Touch devices: grow hit areas without changing the desktop rhythm */
@media (pointer:coarse){
  .foot-cols ul{gap:0}
  .foot-cols li{padding:1px 0}
  .foot-cols a{padding:11px 0}
  .foot-cols li:not(:has(a)){padding:12px 0}
  .strip{gap:16px 20px}
}
.foot-bot{
  display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  border-top:1px solid var(--line);padding-top:24px;
}
.foot-bot p{font-size:.84rem;color:var(--muted)}
#gf_sink{display:none}

/* ══════════ SCROLL ANIMATION ══════════ */
.anim{opacity:0;will-change:transform,opacity}
.anim[data-anim="up"]{transform:translateY(26px)}
.anim[data-anim="fade"]{transform:scale(.98)}
.anim.seen{
  opacity:1;transform:none;
  transition:opacity .7s var(--ease), transform .7s var(--ease);
}
.anim.seen[data-delay="1"]{transition-delay:.09s}
.anim.seen[data-delay="2"]{transition-delay:.18s}
.anim.seen[data-delay="3"]{transition-delay:.27s}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition-duration:.01ms!important}
  .anim{opacity:1;transform:none}
}

/* ══════════ RESPONSIVE ══════════ */

/* ---- Tablet: 961px and below ---- */
@media (max-width:960px){
  .hero{padding-top:110px}
  .hero-in{grid-template-columns:1fr;gap:40px}
  .hero-art{max-width:560px;width:100%;margin:0 auto}
  .lede{max-width:46ch}

  /* Diagram stays horizontal at every size — it just gets tighter. */
  .proto{grid-template-columns:auto minmax(16px,.6fr) auto minmax(16px,.6fr) minmax(0,1fr)}
  .proto-out{min-width:0;padding:18px}
  .proto-core{padding:20px 18px}

  /* keep multi-column on tablet — one-per-row wastes the width */
  .steps{grid-template-columns:repeat(3,1fr);gap:16px}
  .steps .step{padding:24px 20px}
  .devices{grid-template-columns:repeat(3,1fr);gap:16px}
  .dev-art{height:150px}
  .dev h3,.dev p{margin-left:14px;margin-right:14px}

  .ai-grid{grid-template-columns:1fr;gap:40px}
  .app-grid{grid-template-columns:1fr;gap:40px}
  .app-art{order:2}
  .bldg-card{padding:28px 24px 4px}
  .bldg-legend{grid-template-columns:repeat(3,1fr);gap:18px;margin-top:24px;padding-top:22px}
  .bldg-legend li{padding-bottom:14px}
  .cta{grid-template-columns:1fr;gap:34px;padding:38px}
  .roles{grid-template-columns:repeat(2,1fr)}
  .foot-top{grid-template-columns:1fr;gap:38px}
}

/* ---- Small tablet / large phone ---- */
@media (max-width:760px){
  .sec{padding:84px 0}
  .sec-head{margin-bottom:40px}
  /* three across is too narrow here - two reads far better before the phone stack */
  .steps,.devices{grid-template-columns:repeat(2,1fr)}
  .steps .step:last-child,.devices .dev:last-child{grid-column:1/-1}
  .roles{grid-template-columns:repeat(2,1fr)}
  .bldg-legend{grid-template-columns:1fr;gap:14px}
  /* SVG text scales with the artwork — bump it back up so it stays readable */
  .gw-label{font-size:22px}
  .bldg-wings{font-size:20px}
  .room-label{font-size:19px}
  .gw-note{font-size:19px}
  .live-cap{font-size:12px}
  .live-points{grid-template-columns:1fr;gap:16px;margin-top:22px;padding-top:20px}
  .live-points li{padding-bottom:12px}
  .live-card{padding:24px 20px 6px}
  /* between phone and desktop the wide diagram scrolls rather than shrink away */
  .live{min-width:660px;max-height:none}
}

/* ---- Phone ---- */
@media (max-width:620px){
  .sec{padding:64px 0}
  .sec-head{margin-bottom:32px}
  .wrap{padding:0 20px}
  .hero{padding-top:96px}
  .hero-btns .btn{flex:1 1 auto;justify-content:center}

  /* Phone: same horizontal diagram, shrunk to fit. Text stays readable —
     only the boxes, padding and connectors get smaller. */
  .proto{
    grid-template-columns:auto minmax(24px,36px) auto minmax(24px,36px) minmax(0,1fr);
    align-items:center;
  }
  .proto-col{flex-direction:column;gap:7px}
  .pchip{width:auto;padding:8px 9px;font-size:.76rem;gap:6px;border-radius:9px}
  .pchip svg{width:14px;height:14px}
  @keyframes live{
    0%,42%{color:var(--teal);border-color:var(--teal);box-shadow:0 6px 14px -8px rgba(15,107,88,.5);transform:translateX(3px)}
    50%,100%{color:var(--muted);border-color:var(--line);box-shadow:none;transform:translateX(0)}
  }
  /* Same two merging wires as desktop, just small. The box is taller than the
     chip column so the curve ends line up with the middle of each chip. */
  .proto-link{height:92px;width:100%}
  .proto-link svg{display:block;width:100%;height:100%}
  .proto-core{padding:10px 8px;font-size:.76rem;border-radius:11px;white-space:normal}
  .core-pulse{width:7px;height:7px;margin-bottom:6px}
  .proto-out{padding:11px 12px;border-radius:11px}
  .po-room{font-size:.78rem;margin-bottom:9px}
  .proto-out ul{gap:7px}
  .proto-out li{font-size:.73rem;gap:8px}
  .po-foot{font-size:.68rem;margin-top:10px;padding-top:8px}

  .steps,.devices,.roles{grid-template-columns:1fr;gap:12px}

  /* Cards become compact rows — a big art panel per card wastes a phone screen.
     Children are placed explicitly so the markup stays unchanged. */
  .step,.role{
    display:grid;grid-template-columns:60px 1fr;
    column-gap:16px;row-gap:3px;align-items:start;
    padding:18px 18px 20px;
  }
  .step-art,.role-ic{grid-column:1;grid-row:1 / span 2;margin-bottom:0}
  .step-art{width:60px;height:60px;border-radius:12px}
  .step-art svg{width:46px;height:auto}
  .role-ic{width:60px;height:60px}
  .step h3,.role h3{grid-column:2;grid-row:1;margin:0}
  .step p,.role p{grid-column:2;grid-row:2;margin:0}

  .dev{
    display:grid;grid-template-columns:76px 1fr;
    column-gap:16px;row-gap:3px;align-items:start;
    padding:16px 18px 18px;
  }
  .dev-art{
    grid-column:1;grid-row:1 / span 2;
    width:76px;height:76px;margin-bottom:0;align-self:start;
  }
  .dev-art svg{width:78%}
  .dev h3{grid-column:2;grid-row:1;margin:0}
  .dev p{grid-column:2;grid-row:2;margin:0}

  .duo{max-width:360px}

  /* phone: swap the wide diagram for the stacked one — no sideways scrolling */
  .live{display:none}
  .live-v{display:block;width:100%;max-width:320px;height:auto;margin:0 auto}
  .live-scroll{overflow:visible}

  .cta{padding:26px 22px;border-radius:22px}
  .bldg-card{padding:22px 16px 4px;border-radius:22px}
  .foot{padding:44px 0 24px}
  .foot-cols{grid-template-columns:1fr;gap:22px}
  .foot-bot{flex-direction:column;align-items:flex-start;gap:6px}
}

/* ---- Narrow phones: give the room card enough width not to wrap values ---- */
@media (max-width:400px){
  .proto{grid-template-columns:auto 20px auto 20px minmax(0,1fr)}
  .pchip{padding:7px 8px;font-size:.72rem;gap:5px}
  .pchip svg{width:13px;height:13px}
  .proto-core{padding:9px 7px;font-size:.72rem}
  .proto-out{padding:10px}
  .po-room{font-size:.74rem;margin-bottom:8px}
  .proto-out li{font-size:.7rem;gap:6px}
  .po-foot{font-size:.65rem}
}

/* ---- Collapsed menu (phone + tablet: five links plus a CTA do not fit a tablet bar) ---- */
@media (max-width:900px){
  .nav-toggle{display:flex}
  .nav-cta{display:none}
  .nav.open{background:var(--bg);border-bottom-color:var(--line)}

  .nav-links{
    position:absolute;top:100%;left:0;right:0;
    flex-direction:column;align-items:stretch;gap:0;
    background:var(--bg);
    border-bottom:1px solid var(--line);
    padding:4px 20px 22px;
    opacity:0;visibility:hidden;transform:translateY(-10px);
    transition:opacity .28s var(--ease), transform .28s var(--ease), visibility .28s;
  }
  .nav.open .nav-links{opacity:1;visibility:visible;transform:none}
  .nav-links a{
    display:block;width:100%;text-align:left;
    padding:15px 2px;font-size:1rem;color:var(--ink);
    border-bottom:1px solid var(--line);
  }
  .nav-links a::after{display:none}
  .nav-links a.nav-cta-mobile{
    display:flex;width:100%;text-align:center;
    margin-top:20px;border-bottom:none;
    padding:15px 26px;font-size:.95rem;
    color:#FAF7F2;                 /* beats .nav-links a's ink colour */
  }
}

/* ══════════ DARK MODE — component overrides ══════════
   Must sit at the end of the file: these match the specificity of the base
   rules above, so they only win by coming later. */
/* a near-black button disappears on a dark page — use the accent instead */
[data-theme="dark"] .btn{background:var(--teal);border-color:var(--teal);color:#0C1413}
[data-theme="dark"] .btn:hover{box-shadow:0 10px 24px -8px rgba(62,207,154,.45)}
[data-theme="dark"] .btn-quiet{background:transparent;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .btn-quiet:hover{border-color:var(--ink);box-shadow:none}

[data-theme="dark"] .nav.stuck{background:rgba(18,28,26,.88);border-bottom-color:var(--line)}
[data-theme="dark"] .nav.open{background:var(--bg);border-bottom-color:var(--line)}
[data-theme="dark"] .nav-links a.nav-cta-mobile{color:#0C1413}
[data-theme="dark"] .nav-toggle span{background:var(--ink)}
[data-theme="dark"] .brand-dot{box-shadow:0 0 0 4px rgba(233,162,75,.20)}

[data-theme="dark"] .proto-core{background:#0A100F;color:var(--art-on-dark)}
[data-theme="dark"] .chat{background:#0A100F;border-color:var(--line)}
[data-theme="dark"] .bubble-out{color:#0C1413}
[data-theme="dark"] .fld input{background:var(--bg)}
[data-theme="dark"] .fld input:focus{background:var(--surface)}
[data-theme="dark"] .done-mark{color:#0C1413}
[data-theme="dark"] .step-art{background:#1E2C28}
[data-theme="dark"] .sec-alt .role-ic{background:#1E2C28}
