/* ================================================================
   ققنوس داناپرداز — Visual System v5
   ----------------------------------------------------------------
   Dark-first. Ember-led. Editorial. Architectural. Restrained.

   Design principles
     1. Every element earns its place.
     2. Whitespace is the primary design material.
     3. One accent per surface.
     4. Motion is short, purposeful, transform+opacity only.
     5. Surfaces distinguish themselves by tone, not by borders.
     6. Persian typography first. Latin appears only as metadata.
     7. Each route is its own environment — same DNA, different weather.

   PERFORMANCE-TIER SYSTEM REMOVED.
     Every device now gets the full experience: blurred orbs, aura,
     WebGL phoenix stream, backdrop-filter, custom cursor, music
     equaliser, full transition portal, all animations.
     Only `prefers-reduced-motion` is still honoured (accessibility).
   ================================================================ */


/* ================================================================
   1. TOKENS
   ================================================================ */
:root{
  /* ---- surface ladder ---- */
  --surface-0:      #08090C;
  --surface-1:      #0C0E13;
  --surface-2:      #12151B;
  --surface-warm:   #100C09;
  --surface-cool:   #0A0C14;

  /* ---- hairlines ---- */
  --line:           rgba(255,255,255,.055);
  --line-2:         rgba(255,255,255,.09);
  --line-3:         rgba(255,255,255,.16);

  /* ---- text ladder ---- */
  --tx:             #E8EBEF;
  --tx-2:           #9DA5B0;
  --tx-3:           #6E7682;
  --tx-4:           #4B515C;

  /* ---- brand accent ---- */
  --ember:          #E86A1E;
  --ember-soft:     #F2A96B;
  --ember-deep:     #A8440A;
  --ember-tint:     rgba(232,106,30,.10);
  --ember-line:     rgba(232,106,30,.28);

  /* ---- secondary accents ---- */
  --violet:         #9D8BF5;
  --violet-soft:    #C4B5FD;
  --violet-tint:    rgba(157,139,245,.09);
  --cyan:           #5FD4E8;
  --cyan-tint:      rgba(95,212,232,.08);

  /* ---- state ---- */
  --ok:             #4ADE80;
  --warn:           #F87171;

  /* ---- gradients ---- */
  --g-fire:         linear-gradient(135deg, #F5A96B 0%, var(--ember) 55%, var(--ember-deep) 100%);
  --g-duo:          linear-gradient(120deg, var(--ember) 0%, var(--violet) 100%);

  /* ---- geometry ---- */
  --r-sm:  9px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-pill: 999px;

  --maxw:  1180px;
  --pad:   32px;

  /* ---- spacing rhythm ---- */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-7:  32px;
  --s-8:  40px;
  --s-9:  56px;
  --s-10: 72px;
  --s-11: 96px;
  --s-12: 128px;
  --s-13: 168px;

  /* ---- motion language ---- */
  --e:      cubic-bezier(.22,.68,.24,1);
  --e-out:  cubic-bezier(.16,1,.3,1);
  --t-fast: 200ms;
  --t-base: 320ms;
  --t-slow: 500ms;

  /* ---- z ladder ---- */
  --z-atmos:   0;
  --z-reel:    1;
  --z-content: 4;
  --z-nav:     60;
  --z-chat:    80;
  --z-drawer:  90;
  --z-loader:  100;

  /* ---- page-transition direction (JS overrides these on <html>) ---- */
  --dir-x: 1;
  --dir-y: 0;
}
@media (max-width:768px){
  :root{ --pad:22px; }
}


/* ================================================================
   2. RESET
   ================================================================ */
*,*::before,*::after{ box-sizing:border-box; }

html{
  -webkit-text-size-adjust:100%;
  scroll-behavior:smooth;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar{ width:0; height:0; }

body{
  margin:0;
  background:var(--surface-0);
  color:var(--tx);
  font-family:var(--font-site);
  font-size:1.125rem;
  line-height:1.85;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
  -webkit-tap-highlight-color:transparent;
}
body.is-locked{ overflow:hidden; }

img,video,svg{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
button,input,textarea,select{ font:inherit; color:inherit; }
ul,ol{ margin:0; padding:0; list-style:none; }
button{ border:0; background:none; padding:0; cursor:pointer; }
h1,h2,h3,h4{ margin:0; font-weight:800; line-height:1.35; text-wrap:balance; }
p{ margin:0; }

::selection{ background:var(--ember); color:#0A0503; }
:focus-visible{
  outline:2px solid var(--ember-soft);
  outline-offset:3px;
  border-radius:var(--r-sm);
}


/* ================================================================
   3. TYPE SCALE
   ================================================================ */
.t-display{
  font-size:clamp(2.1rem, 1.85rem + 1.15vw, 3.6rem);
  line-height:1.14;
  letter-spacing:-.028em;
  font-weight:800;
}
.t-h2{
  font-size:clamp(1.65rem, 1.5rem + .8vw, 2.5rem);
  line-height:1.28;
  letter-spacing:-.022em;
  font-weight:800;
}
.t-h3{
  font-size:clamp(1.08rem, 1rem + .28vw, 1.35rem);
  line-height:1.5;
  font-weight:700;
  letter-spacing:-.01em;
}
.t-lead{
  font-size:clamp(1rem, .96rem + .18vw, 1.14rem);
  color:var(--tx-2);
  line-height:1.95;
  font-weight:400;
}
.t-sm{
  font-size:1rem;
  color:var(--tx-2);
  line-height:1.85;
}
.t-mono{
  font-family:var(--font-site);
  font-size:11.5px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--tx-3);
}

@media (min-width:1500px){
  body{ font-size:17px; }
  .t-display{ font-size:clamp(52px, 3.6vw, 72px); }
  .t-h2{ font-size:clamp(36px, 2.5vw, 50px); }
  .t-h3{ font-size:clamp(19px, 1.25vw, 24px); }
  .t-lead{ font-size:clamp(17px, 1.1vw, 21px); }
  .t-sm{ font-size:clamp(14.5px, .9vw, 16px); }
  .t-mono{ font-size:clamp(11.5px, .7vw, 13.5px); }
}

.grad,
.grad-duo{
  -webkit-background-clip:text;
          background-clip:text;
  color:transparent;
  -webkit-text-fill-color:transparent;
}
.grad{ background-image:var(--g-fire); }
.grad-duo{ background-image:var(--g-duo); }
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .grad,.grad-duo{ color:var(--ember-soft); -webkit-text-fill-color:currentColor; }
}


/* ================================================================
   5. LAYOUT
   ================================================================ */
.wrap{
  width:100%;
  max-width:var(--maxw);
  margin-inline:auto;
  padding-inline:var(--pad);
}
main, .footer{ position:relative; z-index:var(--z-content); }

.section{
  position:relative;
  isolation:isolate;
  padding-block:clamp(88px, 12vw, 168px);
  content-visibility:auto;
  contain-intrinsic-size:1px 720px;
}
.section-head{
  max-width:640px;
  margin-bottom:clamp(52px, 6vw, 84px);
}
.section-head .t-lead{ margin-top:20px; }

.section[data-tone]::before{
  content:'';
  position:absolute; inset:0;
  z-index:-1; pointer-events:none;
}
.section[data-tone="warm"]::before{
  background:linear-gradient(180deg,
    transparent 0%,
    var(--surface-warm) 42%,
    transparent 100%);
}
.section[data-tone="cool"]::before{
  background:linear-gradient(180deg,
    transparent 0%,
    var(--surface-cool) 48%,
    transparent 100%);
}
.section[data-tone="deep"]::before{
  background:linear-gradient(180deg,
    transparent 0%,
    var(--surface-1) 50%,
    transparent 100%);
}
.section + .section::after{
  content:'';
  position:absolute;
  inset-block-start:0;
  inset-inline:18%;
  height:1px;
  z-index:-1;
  background:linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:12px;
  color:var(--ember-soft);
  font-family:var(--font-site);
  font-size:clamp(12.5px, 1vw, 15px);
  font-weight:600;
  letter-spacing:.13em;
  text-transform:none;
  margin-bottom:18px;
  opacity:.94;
}
.eyebrow::before{
  content:'';
  width:22px; height:1px;
  flex:none;
  background:linear-gradient(90deg, var(--ember), transparent);
}
.section-head .eyebrow{ font-size:clamp(12.5px, 1.02vw, 15px); margin-bottom:14px; }
.reel-slide .eyebrow{ font-size:clamp(13.5px, 1.15vw, 17px); letter-spacing:.12em; margin-bottom:20px; }


/* ================================================================
   6. BUTTONS
   ================================================================ */
.btn{
  --btn-bg:transparent;
  --btn-line:var(--line-2);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:48px;
  padding:0 22px;
  border:1px solid var(--btn-line);
  border-radius:var(--r-md);
  background:var(--btn-bg);
  font-weight:600;
  font-size:14.5px;
  color:var(--tx);
  cursor:pointer;
  transition:
    border-color var(--t-fast) var(--e),
    background var(--t-fast) var(--e),
    color var(--t-fast) var(--e),
    transform var(--t-fast) var(--e);
  -webkit-backdrop-filter:blur(6px);
          backdrop-filter:blur(6px);
}
.btn:hover{
  border-color:rgba(242,169,107,.32);
  background:rgba(255,255,255,.025);
}
.btn:active{ transform:translateY(1px); }

.btn-primary{
  --btn-bg:linear-gradient(135deg, var(--ember) 0%, var(--ember-deep) 100%);
  --btn-line:transparent;
  color:#160803;
  font-weight:700;
  -webkit-backdrop-filter:none;
          backdrop-filter:none;
  box-shadow:0 4px 18px -10px rgba(232,106,30,.5);
}
.btn-primary:hover{
  background:linear-gradient(135deg, var(--ember-soft) 0%, var(--ember) 100%);
  border-color:transparent;
  box-shadow:0 6px 22px -10px rgba(232,106,30,.65);
}
.btn-lg{ min-height:54px; padding:0 26px; font-size:15px; }
.btn-sm{ min-height:34px; padding:0 14px; font-size:13px; border-radius:var(--r-sm); }

.slide-cta{ margin-top:32px; display:flex; flex-wrap:wrap; gap:12px; }


/* ================================================================
   7. ATMOSPHERE — aura (reads per-page tokens)
   ================================================================ */
.aura{
  position:fixed;
  inset:0;
  z-index:var(--z-atmos);
  pointer-events:none;
  overflow:hidden;
  contain:strict;
}
.aura i{
  position:absolute;
  display:block;
  width:54vmax;
  aspect-ratio:1;
  border-radius:50%;
  filter:blur(110px);
  opacity:.16;
  will-change:transform;
}
.aura i:nth-child(1){
  background:radial-gradient(circle, var(--aura-a) 0%, transparent 68%);
  top:-22%; inset-inline-end:-16%;
  animation:drift-a 34s var(--e) infinite alternate;
}
.aura i:nth-child(2){
  background:radial-gradient(circle, var(--aura-b) 0%, transparent 68%);
  bottom:-26%; inset-inline-start:-18%;
  opacity:.10;
  animation:drift-b 40s var(--e) infinite alternate;
}
.aura i:nth-child(3){ display:none; }

@keyframes drift-a{ to{ transform:translate3d(-5vw,7vh,0) scale(1.10); } }
@keyframes drift-b{ to{ transform:translate3d(7vw,-5vh,0) scale(1.14); } }

body.home .aura{ opacity:.14; filter:saturate(.2); }
body.home .grad,
body.home .grad-duo{
  background:none;
  -webkit-text-fill-color:currentColor;
  color:var(--tx);
}
body.home .eyebrow{ color:var(--tx-3); }
body.home .eyebrow::before{ background:linear-gradient(90deg, var(--tx-3), transparent); }


/* ================================================================
   8. LOADER
   ================================================================ */
#loader{
  position:fixed;
  inset:0;
  z-index:var(--z-loader);
  display:grid;
  place-items:center;
  overflow:hidden;
  background:var(--surface-0);
  transition:opacity 460ms var(--e), visibility 460ms;
}
#loader.done{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.loader-core{
  display:grid;
  place-items:center;
  gap:26px;
  text-align:center;
  position:relative;
  z-index:2;
}
.loader-mark{
  position:relative;
  width:clamp(108px, 13vw, 148px);
  aspect-ratio:1;
  display:grid;
  place-items:center;
}
.loader-mark img{
  width:100%; height:100%;
  object-fit:contain;
  padding:14%;
  border-radius:50%;
  box-shadow:
    0 0 0 1px var(--line-2),
    0 0 34px rgba(232,106,30,.18);
  filter:drop-shadow(0 0 16px rgba(232,106,30,.35));
}
.loader-ring{
  position:absolute;
  inset:-8%;
  border-radius:50%;
  border:1px solid transparent;
  background:conic-gradient(from 0deg,
    transparent 0deg,
    rgba(232,106,30,.85) 44deg,
    rgba(242,169,107,.6) 72deg,
    transparent 124deg) border-box;
  -webkit-mask:linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
          mask-composite:exclude;
  animation:ring-spin 2.2s linear infinite;
  opacity:.85;
  will-change:transform;
}
@keyframes ring-spin{ to{ transform:rotate(360deg); } }

.loader-bar{
  width:clamp(140px, 18vw, 200px);
  height:2px;
  background:rgba(255,255,255,.06);
  border-radius:2px;
  overflow:hidden;
}
.loader-bar i{
  display:block;
  height:100%;
  width:var(--pc, 0%);
  background:linear-gradient(90deg, var(--ember-deep), var(--ember), var(--ember-soft));
  border-radius:2px;
  transition:width 200ms var(--e);
}
.loader-word{
  color:var(--tx-3);
  font-weight:600;
  letter-spacing:.26em;
  font-family:var(--font-site);
  font-size:12.5px;
  opacity:.9;
}


/* ================================================================
   9. NAVIGATION
   ================================================================ */
.nav{
  position:fixed;
  inset-block-start:0;
  inset-inline:0;
  z-index:var(--z-nav);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:14px var(--pad);
  border-bottom:1px solid transparent;
  transition:
    background var(--t-base) var(--e),
    border-color var(--t-base) var(--e);
}
.nav::before{
  content:'';
  position:absolute;
  inset:-1px 0 auto 0;
  height:180%;
  z-index:-1;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(4,5,7,.72) 0%, rgba(4,5,7,.4) 45%, transparent 100%);
  transition:opacity var(--t-base) var(--e);
}
.nav.stuck::before{ opacity:0; }
.nav.stuck{
  background:rgba(7,8,10,.66);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
          backdrop-filter:blur(14px) saturate(140%);
  border-bottom-color:var(--line);
}

.brand{ display:flex; align-items:center; gap:12px; }
.brand img{ width:40px; height:40px; object-fit:contain; flex:none; }
.brand-tx{ display:grid; gap:0; line-height:1.15; }
.brand-tx b{
  font-size:16.5px;
  font-weight:700;
  letter-spacing:-.005em;
  color:var(--tx);
}
.brand-tx span{
  font-size:9.5px;
  font-weight:600;
  letter-spacing:.18em;
  color:var(--tx-3);
  margin-top:4px;
}

.nav-links{ display:flex; align-items:center; gap:2px; }
.nav-links a{
  display:block;
  padding:8px 13px;
  border-radius:var(--r-sm);
  font-size:.915rem;
  color:#BCC4CF;
  transition:
    color var(--t-fast) var(--e),
    background var(--t-fast) var(--e);
}
.nav-links a:hover,
.nav-links a[aria-current="true"]{
  color:var(--tx);
  background:rgba(255,255,255,.03);
}

.nav-act{ display:flex; align-items:center; gap:8px; }
.icon-btn{
  width:38px; height:38px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:var(--r-md);
  background:transparent;
  cursor:pointer;
  color:var(--tx-2);
  transition:
    border-color var(--t-fast) var(--e),
    color var(--t-fast) var(--e),
    background var(--t-fast) var(--e);
}
.icon-btn:hover{
  border-color:rgba(242,169,107,.35);
  color:var(--ember-soft);
  background:rgba(255,255,255,.02);
}
.icon-btn.on{ color:var(--ember-soft); border-color:var(--ember-line); }
.icon-btn svg{ width:17px; height:17px; }
.nav-act #sound{ display:none; }

/* ================================================================
   10. BURGER + DRAWER
   ================================================================ */
.burger{
  display:none;
  flex-direction:column;
  gap:4px;
  padding:4px;
  justify-content:center;
  align-items:center;
  width:38px; height:38px;
  cursor:pointer;
  color:inherit;
}
.burger span{
  display:block;
  width:18px; height:2px;
  background:currentColor;
  border-radius:2px;
  transition:transform var(--t-base) var(--e), opacity var(--t-fast) var(--e);
}
.burger.open span:nth-child(1){ transform:translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2){ opacity:0; transform:scaleX(0); }
.burger.open span:nth-child(3){ transform:translateY(-6px) rotate(-45deg); }

.drawer{
  position:fixed;
  inset:0;
  z-index:var(--z-drawer);
  background:rgba(6,7,10,.97);
  -webkit-backdrop-filter:blur(18px) saturate(150%);
          backdrop-filter:blur(18px) saturate(150%);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  justify-content:safe center;
  gap:2px;
  padding:calc(72px + env(safe-area-inset-top, 0px)) clamp(14px, 4vw, 30px)
          calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y:auto;
  overscroll-behavior:contain;
  opacity:0;
  visibility:hidden;
  transition:opacity var(--t-slow) var(--e), visibility var(--t-slow);
}
.drawer.open{ opacity:1; visibility:visible; }
.drawer a{
  flex:none;
  max-inline-size:100%;
  font-size:clamp(1rem, 2.2vw, 1.3125rem);
  font-weight:700;
  padding:13px 30px;
  text-align:center;
  overflow-wrap:anywhere;
  color:var(--tx-2);
  transform:translateY(14px);
  opacity:0;
  transition:
    color var(--t-fast) var(--e),
    transform var(--t-slow) var(--e-out),
    opacity var(--t-slow) var(--e-out);
}
.drawer.open a{ opacity:1; transform:translateY(0); }
.drawer.open a:nth-child(1){ transition-delay:50ms; }
.drawer.open a:nth-child(2){ transition-delay:85ms; }
.drawer.open a:nth-child(3){ transition-delay:120ms; }
.drawer.open a:nth-child(4){ transition-delay:155ms; }
.drawer.open a:nth-child(5){ transition-delay:190ms; }
.drawer.open a:nth-child(6){ transition-delay:225ms; }
.drawer.open a:nth-child(7){ transition-delay:260ms; }
.drawer.open a:nth-child(8){ transition-delay:295ms; }
.drawer a:hover{ color:var(--ember-soft); }
/* Was a style="" attribute on index.php's drawer button, which CSP
   blocked - the button rendered at its intrinsic width with no top
   margin. */
.drawer .drawer-cta{
  margin-top:12px;
  width:100%;
  justify-content:center;
}
.drawer-close{
  position:absolute;
  top:calc(12px + env(safe-area-inset-top, 0px));
  left:max(14px, env(safe-area-inset-left, 0px));
  width:40px; height:40px;
  border-radius:50%;
  border:1px solid var(--line);
  background:transparent;
  color:var(--tx-2);
  display:grid;
  place-items:center;
  font-size:24px;
  line-height:1;
  transition:color var(--t-fast), border-color var(--t-fast);
}
.drawer-close:hover{ color:var(--ember-soft); border-color:var(--ember-line); }

@media (max-width:900px){
  .nav-links{ display:none; }
  .burger{ display:flex; }
  .btn-primary{ white-space:nowrap; }
  .nav.stuck{
    -webkit-backdrop-filter:none;
            backdrop-filter:none;
    background:rgba(7,8,10,.94);
  }
}


/* ================================================================
   11. REEL — desktop
   ================================================================ */
.reel{ position:relative; }

.reel-stage{
  position:sticky;
  top:0;
  height:100vh;
  height:100dvh;
  overflow:hidden;
  z-index:var(--z-reel);
  background:#040507;
  contain:paint;
}
.reel-video{
  position:absolute;
  inset:0;
  width:100%; height:100%;
  object-fit:cover;
  opacity:0;
  z-index:2;
  pointer-events:none;
  transition:opacity 560ms linear;
}
.reel-video.live{ opacity:1; z-index:3; }
.reel-video.holding{ opacity:1; z-index:2; transition:none; }

.reel-copy{
  position:absolute;
  inset:0;
  z-index:5;
  display:grid;
  align-items:center;
  padding-inline:clamp(28px, 6vw, 96px);
  padding-block:96px 168px;
}
.reel-slide{
  grid-area:1/1;
  width:clamp(300px, 42%, 580px);
  position:relative;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateX(-4px);
  transition:opacity var(--t-slow) var(--e), visibility var(--t-slow);
}
.reel-slide.live{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}
.reel-slide:last-child{
  transition:opacity 820ms var(--e), visibility 820ms;
}
.reel-slide[data-side="right"]{ justify-self:right; text-align:right; }
.reel-slide[data-side="left"]{  justify-self:left;  text-align:right; }

.reel-slide[data-chapter="1"]{ align-self:end;  }
.reel-slide[data-chapter="2"],
.reel-slide[data-chapter="3"]{ align-self:start; margin-top:8%; }
.reel-slide[data-chapter="4"],
.reel-slide[data-chapter="5"]{ align-self:start; margin-top:12%; }
.reel-slide[data-chapter="6"]{ align-self:center; }
.reel-slide[data-chapter="7"]{ align-self:end; margin-bottom:4%; }

.reel-slide h1,
.reel-slide h2,
.reel-slide p,
.reel-slide .eyebrow{
  text-shadow:0 1px 2px rgba(0,0,0,.62), 0 2px 22px rgba(0,0,0,.42);
}
.reel-slide .t-lead{ margin-top:20px; color:#C8CFD8; }
.reel-slide .chips{ margin-top:26px; }
.reel-slide .slide-cta{ margin-top:34px; }

.reel-slide:first-child .t-display,
.reel-slide:first-child .t-lead,
.reel-slide:first-child .eyebrow{
  text-shadow:0 1px 3px rgba(0,0,0,.78), 0 2px 18px rgba(0,0,0,.55);
}
.reel-slide:first-child .t-lead{ color:#E0E4EA; }

.rv{ display:block; overflow:hidden; }
.rv > i{
  display:block;
  font-style:normal;
  transform:translateY(105%) rotate(1.8deg);
  opacity:0;
  transition:transform 820ms var(--e-out), opacity 620ms var(--e);
}
.live .rv > i{ transform:none; opacity:1; }
.live .rv:nth-child(1) > i{ transition-delay:40ms; }
.live .rv:nth-child(2) > i{ transition-delay:110ms; }
.live .rv:nth-child(3) > i{ transition-delay:180ms; }

.stg{
  opacity:0;
  transform:translateY(12px);
  transition:opacity var(--t-slow) var(--e), transform var(--t-slow) var(--e);
}
.live .stg{ opacity:1; transform:none; }
.live .stg-1{ transition-delay:220ms; }
.live .stg-2{ transition-delay:300ms; }
.live .stg-3{ transition-delay:380ms; }

.reel-rail{
  position:absolute;
  inset-block:0;
  inset-inline-start:clamp(22px, 2.8vw, 38px);
  display:grid;
  align-content:center;
  gap:16px;
  z-index:6;
}
.reel-rail button{
  --w:3px;
  width:var(--w);
  height:34px;
  padding:0;
  border-radius:2px;
  border:0;
  background:rgba(255,255,255,.11);
  position:relative;
  overflow:hidden;
  transition:background var(--t-base) var(--e);
}
.reel-rail button::after{
  content:'';
  position:absolute;
  inset-inline:0;
  inset-block-start:0;
  height:var(--fill, 0%);
  border-radius:2px;
  background:var(--ember-soft);
}
.reel-rail button[aria-current="true"]{ background:rgba(255,255,255,.22); }
.reel-rail button:hover{ background:var(--ember-soft); }

.reel-hint{
  position:absolute;
  bottom:34px;
  inset-inline-end:clamp(28px, 6vw, 96px);
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--tx-3);
  z-index:6;
  font-size:10.5px;
  letter-spacing:.12em;
  opacity:.55;
  transition:opacity var(--t-base) var(--e);
}
.reel-hint:hover{ opacity:.85; }
.reel-hint.gone{ opacity:0; }
.reel-hint .t-mono{ font-size:10.5px; letter-spacing:.12em; }
.hint-arrow{
  width:13px; height:13px;
  color:var(--ember-soft);
  animation:hint-bob 2.1s var(--e) infinite;
}
@keyframes hint-bob{
  0%,100%{ transform:translateY(0); opacity:.5; }
  50%    { transform:translateY(4px); opacity:1; }
}

.reel-loader{
  position:absolute;
  inset:0;
  z-index:5;
  display:grid;
  place-items:center;
  background:radial-gradient(120% 90% at 50% 40%,
    rgba(8,7,14,.55) 0%,
    rgba(6,5,12,.85) 68%,
    rgba(3,2,6,.96) 100%);
  -webkit-backdrop-filter:blur(5px);
          backdrop-filter:blur(5px);
  transition:opacity var(--t-slow) var(--e), backdrop-filter var(--t-slow) var(--e);
  pointer-events:none;
}
.reel-loader.is-gone{
  opacity:0;
  -webkit-backdrop-filter:blur(0);
          backdrop-filter:blur(0);
}
.reel-loader__ring{
  width:36px; height:36px;
  border-radius:50%;
  border:1.5px solid rgba(255,255,255,.09);
  border-top-color:rgba(232,106,30,.85);
  animation:reel-spin .95s linear infinite;
}
@keyframes reel-spin{ to{ transform:rotate(360deg); } }

/* ----------------------------------------------------------------
   Hero buffering indicator
   ----------------------------------------------------------------
   Distinct from .reel-loader above, which is the page-entry loader
   and holds the scroll lock. This one only says "the hero clip is
   still filling its buffer": it never locks anything, sits in a
   corner instead of over the whole stage, and the poster stays fully
   visible behind it. reel.js creates the element and toggles .is-on.

   It is shown while the clip buffers for the first time and again if
   playback ever runs dry mid-loop, so the visitor sees a deliberate
   loading state rather than a stuttering picture.
   ---------------------------------------------------------------- */
.hero-buffering{
  position:absolute;
  inset-inline-end:22px;
  inset-block-end:22px;
  z-index:6;
  display:grid;
  place-items:center;
  width:34px; height:34px;
  border-radius:50%;
  background:rgba(8,7,14,.52);
  -webkit-backdrop-filter:blur(4px);
          backdrop-filter:blur(4px);
  opacity:0;
  transition:opacity var(--t-slow) var(--e);
  pointer-events:none;
}
.hero-buffering.is-on{ opacity:1; }
.hero-buffering__ring{
  width:17px; height:17px;
  border-radius:50%;
  border:1.5px solid rgba(255,255,255,.12);
  border-top-color:rgba(232,106,30,.9);
  animation:reel-spin .95s linear infinite;
}

@media (max-height:860px) and (min-width:901px){
  .reel-slide .t-display{ font-size:clamp(28px, 4.4vh, 46px); }
  .reel-slide .t-lead{ font-size:clamp(13.5px, 1.9vh, 16.5px); margin-top:14px; }
  .reel-slide .slide-cta{ margin-top:22px; }
  .reel-slide .chips{ margin-top:16px; }
  .reel-copy{ padding-block:88px 148px; }
}
@media (max-height:700px) and (min-width:901px){
  .reel-slide .t-display{ font-size:clamp(24px, 4vh, 38px); }
  .reel-slide .btn-lg{ min-height:42px; padding:0 18px; font-size:13.5px; }
  .reel-copy{ padding-block:80px 120px; }
  .reel-hint{ display:none; }
}


/* ================================================================
   12. MOBILE INTRO
   ================================================================ */
.mob-intro{ display:none; }

@media (max-width:768px), (max-width:900px) and (any-pointer:coarse){
  .reel{ display:none; }
  .mob-intro{ display:block; }
}

@media (max-width:1400px){
  .mob-hero{
    position:relative;
    overflow:hidden;
    min-height:100vh;
    min-height:100svh;
    display:flex;
    align-items:flex-end;
    background:var(--surface-warm) url('../img/mob-poster.webp') 50% 30% / cover no-repeat;
  }
  .mob-hero video{
    position:absolute;
    inset:0;
    z-index:0;
    width:100%; height:100%;
    object-fit:cover;
    object-position:50% 30%;
  }
  .mob-hero-copy{
    position:relative;
    z-index:2;
    width:100%;
    padding:28px 22px calc(44px + env(safe-area-inset-bottom));
  }
  .mob-hero-copy .eyebrow{
    color:var(--ember-soft);
    text-shadow:0 2px 16px rgba(0,0,0,.85);
  }
  .mob-hero-copy .t-display{
    font-size:clamp(28px, 8.4vw, 40px);
    line-height:1.2;
    margin-block:10px 12px;
    text-shadow:0 4px 24px rgba(0,0,0,.85);
  }
  .mob-hero-copy .t-lead{
    font-size:clamp(14px, 3.9vw, 16px);
    line-height:1.9;
    color:rgba(255,255,255,.9);
  }
  .mob-hero-copy .slide-cta{
    flex-direction:column;
    gap:10px;
    margin-top:24px;
  }
  .mob-hero-copy .slide-cta .btn{
    width:100%;
    min-height:50px;
    font-size:14.5px;
    justify-content:center;
  }

  .mob-chapters{ display:grid; gap:2px; background:var(--surface-0); }
  .mob-chapter{
    position:relative;
    overflow:hidden;
    padding:60px 22px 56px;
    background:var(--surface-0);
    content-visibility:auto;
    contain-intrinsic-size:1px 420px;
  }
  .mob-chapter::before{
    content:'';
    position:absolute;
    inset:0;
    z-index:0;
    pointer-events:none;
    opacity:.85;
  }
  .mob-chapter[data-glow="warm"]::before{
    background:linear-gradient(180deg, var(--surface-warm) 0%, transparent 60%);
  }
  .mob-chapter[data-glow="cool"]::before{
    background:linear-gradient(180deg, var(--surface-cool) 0%, transparent 60%);
  }
  .mob-chapter + .mob-chapter{ border-top:1px solid var(--line); }
  .mob-chapter > *{ position:relative; z-index:1; }
  .mob-chapter .eyebrow{ color:var(--ember-soft); }
  .mob-chapter .t-h2{
    font-size:clamp(24px, 7vw, 30px);
    line-height:1.3;
    margin-block:10px 12px;
  }
  .mob-chapter .t-lead{
    font-size:clamp(14px, 3.8vw, 15.5px);
    line-height:1.9;
    color:var(--tx-2);
  }
  .mob-chapter .chips{ margin-top:16px; gap:7px; }
  .mob-chapter .slide-cta{
    flex-direction:column;
    gap:10px;
    margin-top:24px;
  }
  .mob-chapter .slide-cta .btn{
    width:100%;
    min-height:50px;
    font-size:14.5px;
    justify-content:center;
  }
}
@media (max-width:480px){ .mob-chapter{ padding:52px 18px 48px; } }


/* ================================================================
   13. CHIPS
   ================================================================ */
.chips{ display:flex; flex-wrap:wrap; gap:7px; min-width:0; }
.chip{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  border:1px solid var(--line-2);
  border-radius:var(--r-pill);
  background:rgba(12,14,20,.5);
  font-size:.82rem;
  color:var(--tx-2);
  transition:
    border-color var(--t-fast) var(--e),
    color var(--t-fast) var(--e),
    background var(--t-fast) var(--e);
  max-width:100%;
}
.chip:hover{
  border-color:var(--ember-line);
  color:var(--ember-soft);
  background:var(--ember-tint);
}


/* ================================================================
   14. GRIDS + CARDS
   ================================================================ */
.grid{ display:grid; gap:20px; }
.grid-2{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
.grid-3{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
.grid-4{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
@media (max-width:1100px){ .grid-4{ grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width:980px){ .grid-3{ grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width:620px){ .grid-2,.grid-3,.grid-4{ grid-template-columns:minmax(0, 1fr); } }

.card{
  position:relative;
  padding:30px 28px;
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  background:var(--surface-1);
  overflow:hidden;
  min-width:0;
  transition:
    border-color var(--t-base) var(--e),
    background var(--t-base) var(--e),
    transform var(--t-base) var(--e);
}
.card:hover{
  border-color:var(--line-2);
  background:var(--surface-2);
  transform:translateY(-2px);
}
.card h3{
  font-size:1.1rem;
  margin-bottom:12px;
  letter-spacing:-.008em;
}
.card p{
  font-size:.95rem;
  color:var(--tx-2);
  line-height:1.9;
}

.card .ico,
.info-row .ico{
  width:38px; height:38px;
  margin-bottom:20px;
  display:grid;
  place-items:center;
  border:1px solid var(--line-2);
  border-radius:var(--r-md);
  color:var(--ember-soft);
  background:transparent;
}
.card .ico svg{ width:18px; height:18px; }
.grid > .card:nth-child(3n+2) .ico{ color:var(--violet-soft); }
.grid > .card:nth-child(3n+3) .ico{ color:var(--cyan); }

.card-link{ display:block; }
.card-go{
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-top:22px;
  color:var(--ember-soft);
  font-size:12.5px;
  letter-spacing:.08em;
  transition:gap var(--t-base) var(--e);
}
.card-go::after{ content:'←'; font-size:13px; }
.card-link:hover .card-go{ gap:12px; }

.mini{
  padding:20px 18px;
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  background:var(--surface-1);
  display:grid;
  gap:5px;
  transition:border-color var(--t-base) var(--e), background var(--t-base) var(--e);
}
.mini:hover{ border-color:var(--line-2); background:var(--surface-2); }
.mini b{ font-size:15px; font-weight:700; }
.mini span{ font-size:13.5px; color:var(--tx-3); }

.cta-bar{
  margin-top:clamp(48px, 6vw, 80px);
  padding:clamp(26px, 3vw, 36px);
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:linear-gradient(120deg, var(--ember-tint), var(--violet-tint));
  display:flex;
  flex-wrap:wrap;
  gap:22px;
  align-items:center;
  justify-content:space-between;
}
.cta-bar h3{ font-size:19px; margin-bottom:5px; }


/* ================================================================
   15. SERVICE INDEX — editorial
   ================================================================ */
.svc{ position:relative; }
.svc-list{
  border-top:1px solid var(--line-2);
  border-bottom:1px solid var(--line-2);
}
.svc-row{
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:24px;
  padding:clamp(22px, 2.6vw, 32px) 4px;
  border-bottom:1px solid var(--line);
  cursor:pointer;
  min-height:clamp(80px, 7.4vw, 124px);
  transition:padding-inline var(--t-base) var(--e);
}
.svc-row:last-child{ border-bottom:0; }

.svc-row .num{
  min-width:34px;
  color:var(--tx-3);
  font-weight:700;
  font-size:clamp(12px, .95vw, 15px);
  transition:color var(--t-base) var(--e), opacity var(--t-base) var(--e);
  opacity:.55;
}
.svc-row h3{
  font-size:clamp(1.22rem, 1.1rem + .85vw, 2.15rem);
  line-height:1.45;
  font-weight:800;
  color:var(--tx-3);
  letter-spacing:-.018em;
  transition:color var(--t-base) var(--e);
}
.svc-row .go{
  width:34px; height:34px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:50%;
  color:var(--tx-3);
  opacity:0;
  transform:translateX(10px);
  transition:
    opacity var(--t-base) var(--e),
    transform var(--t-base) var(--e),
    border-color var(--t-base) var(--e),
    color var(--t-base) var(--e),
    background var(--t-base) var(--e);
}
.svc-row:hover,
.svc-row:focus-within{ padding-inline:16px; }
.svc-row:hover h3,
.svc-row:focus-within h3{ color:var(--tx); }
.svc-row:hover .num,
.svc-row:focus-within .num{ color:var(--ember-soft); opacity:1; }
.svc-row:hover .go,
.svc-row:focus-within .go{
  opacity:1;
  transform:none;
  border-color:transparent;
  color:#160803;
  background:var(--g-fire);
}
.svc-row::after{
  content:'';
  position:absolute;
  inset-block:18%;
  inset-inline-start:0;
  width:2px;
  background:var(--ember-soft);
  transform:scaleY(0);
  transform-origin:center;
  transition:transform var(--t-base) var(--e-out);
}
.svc-row:hover::after,
.svc-row:focus-within::after{ transform:scaleY(1); }

.svc-row.open h3{ color:var(--tx); }
.svc-row.open .num{ color:var(--ember-soft); opacity:1; }

.svc-row .inline-detail{
  display:block;
  grid-column:1/-1;
  overflow:hidden;
  max-height:0;
  opacity:0;
  padding-block:0;
  transition:
    max-height var(--t-base) var(--e),
    opacity var(--t-base) var(--e),
    padding var(--t-base) var(--e);
}
.svc-row.open .inline-detail{
  max-height:min(70vh, 620px);
  opacity:1;
  padding-block:6px 22px;
}
.svc-row .inline-detail p{
  font-size:clamp(14px, .95vw, 16.5px);
  color:var(--tx-2);
  line-height:1.95;
  max-width:72ch;
}
.svc-row .inline-detail .chips{ margin-top:16px; }
body.svc-float .svc-row .inline-detail{ display:none; }

.svc-detail{
  display:none;
  position:fixed;
  inset-inline-end:26px;
  bottom:26px;
  width:min(340px, calc(100vw - 52px));
  z-index:calc(var(--z-chat) - 5);
  padding:22px 24px;
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:rgba(10,12,15,.9);
  -webkit-backdrop-filter:blur(16px) saturate(140%);
          backdrop-filter:blur(16px) saturate(140%);
  opacity:0;
  transform:translateY(16px) scale(.98);
  pointer-events:none;
  transition:opacity var(--t-base) var(--e), transform var(--t-base) var(--e);
}
.svc-detail::before{
  content:'';
  position:absolute;
  inset-block-start:0;
  inset-inline:0;
  height:2px;
  border-radius:2px 2px 0 0;
  background:var(--g-duo);
  opacity:.7;
}
.svc-detail.live{ opacity:1; transform:none; }
body.svc-float .svc-detail{ display:block; }
.svc-detail .t-mono{
  color:var(--ember-soft);
  display:block;
  margin-bottom:10px;
  font-size:11px;
}
.svc-detail p{ font-size:13.5px; color:var(--tx-2); line-height:1.9; }
.svc-detail .chips{ margin-top:16px; }
.svc-detail .chip{ font-size:11px; padding:4px 10px; }

@media (min-width:1500px){
  .svc-detail{ width:min(28vw, 400px); }
  .svc-detail p{ font-size:clamp(14px, .85vw, 16.5px); }
  .svc-row{ min-height:clamp(100px, 6.8vw, 140px); }
  .svc-row h3{ font-size:clamp(30px, 2.1vw, 46px); }
}


/* ================================================================
   16. PRODUCT + PROCESS
   ================================================================ */
.product{ position:relative; overflow:hidden; }
.product::before{
  content:'';
  position:absolute;
  inset-block-start:-30%;
  inset-inline-end:-10%;
  width:56vw;
  aspect-ratio:1;
  border-radius:50%;
  background:radial-gradient(circle, var(--ember-tint), transparent 68%);
  pointer-events:none;
}
.product-grid{
  display:grid;
  grid-template-columns:1fr 1.05fr;
  gap:clamp(32px, 5vw, 68px);
  align-items:center;
}
@media (max-width:940px){ .product-grid{ grid-template-columns:1fr; } }

.shot{
  position:relative;
  border-radius:var(--r-lg);
  overflow:hidden;
  border:1px solid var(--line-2);
  background:var(--surface-1);
  box-shadow:0 30px 80px -50px rgba(0,0,0,.9);
}
.shot-bar{
  display:flex;
  align-items:center;
  gap:7px;
  padding:11px 14px;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border-bottom:1px solid var(--line);
}
.shot-bar i{ width:9px; height:9px; border-radius:50%; display:block; flex:none; }
.shot-bar i:nth-child(1){ background:#FF5F57; }
.shot-bar i:nth-child(2){ background:#FEBC2E; }
.shot-bar i:nth-child(3){ background:#28C840; }
.shot-bar span{
  margin-inline-start:auto;
  font-size:11px;
  color:var(--tx-3);
  letter-spacing:.04em;
}
.shot img{ display:block; width:100%; height:auto; }
.shot-cap{
  font-size:13px;
  color:var(--tx-3);
  margin-top:12px;
  text-align:center;
  line-height:1.9;
}
.shot-note{
  padding:9px 14px;
  font-size:11.5px;
  color:var(--ember-soft);
  background:var(--ember-tint);
  border-top:1px dashed var(--ember-line);
}

.shots{
  display:grid;
  gap:clamp(28px, 3.6vw, 52px);
  margin-top:clamp(32px, 4vw, 56px);
}
.shots .shot{ width:100%; }
.shot-lead{ width:90%; justify-self:start; margin-right:0; }
.shot-lead-in{ max-width:72ch; margin:clamp(10px, 1.6vw, 20px) 0 4px; }
.shot-lead-in h3{ margin:0 0 .45em; color:var(--tx); }
.shot-lead-in p{ margin:0; color:var(--tx-2); line-height:1.95; font-size:.98rem; }
.shot-sub{ width:min(760px, 100%); justify-self:center; margin-top:6px; }

.feat{ display:grid; gap:14px; margin-top:26px; }
.feat li{
  display:flex;
  gap:12px;
  align-items:flex-start;
  font-size:14.5px;
  color:var(--tx-2);
  line-height:1.85;
}
.feat li svg{
  flex:none;
  width:16px; height:16px;
  margin-top:6px;
  color:var(--ember-soft);
}
.feat li:nth-child(2n) svg{ color:var(--violet-soft); }
.feat li:nth-child(3n) svg{ color:var(--cyan); }

.steps{
  counter-reset:s;
  display:grid;
  gap:0;
  margin-top:24px;
}
.step{
  counter-increment:s;
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:clamp(24px, 4vw, 56px);
  align-items:start;
  padding:clamp(28px, 3.4vw, 44px) 0;
  border-bottom:1px solid var(--line);
}
.step:first-child{ border-top:1px solid var(--line); }
.step::before{
  content:counter(s, decimal-leading-zero);
  font-family:var(--font-site);
  font-size:clamp(28px, 3vw, 44px);
  font-weight:800;
  line-height:1;
  letter-spacing:-.03em;
  color:var(--tx-4);
  padding-top:6px;
  transition:color var(--t-base) var(--e);
}
.step:hover::before{ color:var(--ember-soft); }
.step h3{ font-size:19px; margin-bottom:10px; }
.step p{
  font-size:15px;
  color:var(--tx-2);
  line-height:1.95;
  max-width:70ch;
}


/* ================================================================
   17. PRIVATE AI — evidence, not feature cards
   ================================================================ */
#private-ai .grid-3{
  border-top:1px solid var(--line-2);
  padding-top:clamp(40px, 5vw, 64px);
  gap:clamp(24px, 3vw, 44px);
}
#private-ai .card{
  border:0;
  border-radius:0;
  background:transparent;
  padding:0 clamp(16px, 2vw, 28px) 0 0;
}
#private-ai .card:hover{
  background:transparent;
  transform:none;
  border-color:transparent;
}
#private-ai .card + .card{
  padding-inline-start:clamp(24px, 3vw, 44px);
  border-inline-start:1px solid var(--line);
}
#private-ai .card .ico{
  color:var(--ember-soft);
  border-color:var(--line-2);
  margin-bottom:22px;
}
#private-ai .card h3{
  font-size:1.08rem;
  margin-bottom:12px;
}
#private-ai .card p{
  font-size:14.5px;
  line-height:1.95;
}


/* ================================================================
   18. CONTACT / FORM
   ================================================================ */
.contact-grid{
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  gap:clamp(32px, 4.5vw, 60px);
}
@media (max-width:940px){ .contact-grid{ grid-template-columns:1fr; } }

.info-row{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding:16px 0;
  border-bottom:1px solid var(--line);
}
.info-row .ico{
  margin-bottom:0;
  width:36px; height:36px;
  color:var(--ember-soft);
}
.info-row .ico svg{ width:16px; height:16px; }
.info-row:nth-child(2) .ico{ color:var(--violet-soft); }
.info-row:nth-child(3) .ico{ color:var(--cyan); }
.info-row b{
  display:block;
  font-size:.98rem;
  color:var(--tx);
  font-weight:600;
  margin-bottom:3px;
}
.info-row a,
.info-row span{ font-size:.96rem; line-height:1.9; }
.info-row a:hover{ color:var(--ember-soft); }
.info-row a bdi{
  direction:ltr;
  unicode-bidi:isolate;
  font-family:var(--font-site);
  letter-spacing:.02em;
}
.phones{ display:grid; gap:2px; }
.phones a{
  direction:ltr;
  text-align:right;
  font-family:var(--font-site);
  letter-spacing:.02em;
}

.form{ display:grid; gap:16px; }
.field{ display:grid; gap:7px; }
.field label{
  font-size:.96rem;
  font-weight:600;
  color:var(--tx);
  margin-bottom:7px;
  display:block;
}
.field .req{ color:var(--ember-soft); margin-inline-start:3px; }
.field input,
.field textarea,
.field select{
  width:100%;
  padding:13px 15px;
  border:1px solid var(--line-2);
  border-radius:var(--r-md);
  background:var(--surface-2);
  color:var(--tx);
  font-size:1rem;
  line-height:1.7;
  transition:
    border-color var(--t-fast) var(--e),
    background var(--t-fast) var(--e);
}
.field input::placeholder,
.field textarea::placeholder{ color:var(--tx-4); }
.field input:focus,
.field textarea:focus,
.field select:focus{
  outline:none;
  border-color:var(--ember-line);
  background:rgba(255,255,255,.02);
}
.field textarea{ min-height:120px; resize:vertical; line-height:1.9; }
.field input[type=tel]{ direction:ltr; text-align:right; }
.field .err{ font-size:.85rem; color:var(--warn); min-height:0; }
.field .hint{ font-size:.85rem; color:var(--tx-3); margin-top:6px; }
.field.bad input, .field.bad textarea{ border-color:var(--warn); }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:620px){ .form-row{ grid-template-columns:1fr; } }
.hp{
  position:absolute;
  inset-inline-start:-9999px;
  width:1px; height:1px;
  opacity:0;
}
.form-note{ font-size:12.5px; color:var(--tx-3); }
.form-msg{
  padding:13px 15px;
  border-radius:var(--r-md);
  font-size:14px;
  border:1px solid var(--line);
  display:none;
}
.form-msg.ok{
  display:block;
  border-color:rgba(74,222,128,.32);
  background:rgba(74,222,128,.06);
  color:#86EFAC;
}
.form-msg.no{
  display:block;
  border-color:rgba(248,113,113,.32);
  background:rgba(248,113,113,.06);
  color:#FCA5A5;
}

select option, select optgroup{ background:#FFFFFF; color:#111418; }
select option:checked, select option:hover{ background:#FFE8D2; color:#111418; }
.field select{ color:var(--tx); background-color:var(--surface-2); }

.map{
  margin:22px 0 0;
  border-radius:var(--r-lg);
  overflow:hidden;
  border:1px solid var(--line-2);
  background:var(--surface-1);
}
.map img{ display:block; width:100%; height:auto; }
.map figcaption{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:13px 16px;
  font-size:13px;
  color:var(--tx-3);
  border-top:1px solid var(--line);
}
.map figcaption a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--ember-soft);
  font-size:13px;
  white-space:nowrap;
}
.map figcaption a svg{ width:14px; height:14px; }
.map figcaption a:hover{ text-decoration:underline; }
@media (max-width:520px){
  .map figcaption{ flex-direction:column; align-items:flex-start; gap:8px; }
}


/* ================================================================
   19. FOOTER
   ================================================================ */
.footer{
  position:relative;
  border-top:1px solid var(--line-2);
  background:var(--surface-0);
  padding-block:clamp(56px, 7vw, 88px) clamp(28px, 3.4vw, 40px);
}
.footer::before{
  content:'';
  position:absolute;
  inset-block-start:-1px;
  inset-inline:0;
  height:1px;
  background:linear-gradient(90deg, transparent, var(--ember), var(--violet), transparent);
  opacity:.28;
}
.footer-grid{
  display:grid;
  grid-template-columns:1.6fr 1fr 1fr;
  gap:clamp(32px, 5vw, 80px);
  align-items:start;
}
@media (max-width:940px){
  .footer-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .footer-grid > div:first-child{ grid-column:1/-1; margin-bottom:16px; }
}
@media (max-width:560px){
  .footer-grid{ grid-template-columns:1fr; gap:32px; }
  .footer-grid > div:first-child{ margin-bottom:0; }
}
.footer .brand img{ width:52px; height:52px; }
.footer .brand-tx b{ font-size:20px; }
.footer .brand-tx span{ font-size:10.5px; }
.footer h4{
  font-size:11px;
  letter-spacing:.16em;
  color:var(--ember-soft);
  opacity:.8;
  font-weight:500;
  text-transform:uppercase;
  padding-bottom:14px;
  margin-bottom:16px;
  border-bottom:1px solid var(--line);
}
.footer ul{ display:grid; gap:2px; }
.footer li a{
  display:block;
  padding:7px 0;
  font-size:14px;
  color:var(--tx-2);
  transition:color var(--t-fast);
}
.footer li a:hover{ color:var(--ember-soft); }
.footer li a bdi{
  direction:ltr;
  unicode-bidi:isolate;
  font-family:var(--font-site);
  letter-spacing:.02em;
}
.footer-btm{
  margin-top:clamp(44px, 5vw, 64px);
  padding-top:24px;
  border-top:1px solid var(--line);
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  /* `space-between` only spreads things apart when there is more
     than one child, and this row carries a single copyright span.
     With one child it collapsed to the start edge - the right-hand
     side in RTL - instead of sitting under the middle of the
     footer. Centre the row and the text inside it. */
  justify-content:center;
  text-align:center;
  font-size:12.5px;
  color:var(--tx-3);
}
.foot-blurb{
  margin-top:20px;
  max-width:38ch;
  font-size:14px;
  color:var(--tx-2);
  line-height:1.9;
}

.social{ display:flex; gap:8px; margin-top:18px; }
.social a{
  width:30px; height:30px;
  border-radius:var(--r-sm);
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  color:var(--tx-3);
  background:transparent;
  transition:
    color var(--t-fast) var(--e),
    border-color var(--t-fast) var(--e),
    background var(--t-fast) var(--e);
}
.social a:hover{
  color:var(--ember-soft);
  border-color:var(--ember-line);
  background:var(--ember-tint);
}
.social svg{ width:14px; height:14px; stroke-width:1.5; }


/* ================================================================
   20. CHAT PANEL
   ================================================================ */
.chat-fab{
  position:fixed;
  bottom:24px;
  inset-inline-start:26px;
  z-index:var(--z-chat);
  width:52px; height:52px;
  border-radius:50%;
  border:1px solid var(--line-2);
  background:linear-gradient(150deg, var(--ember-tint), rgba(12,14,20,.9));
  -webkit-backdrop-filter:blur(12px);
          backdrop-filter:blur(12px);
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 12px 32px -16px rgba(232,106,30,.45);
  transition:transform var(--t-base) var(--e), border-color var(--t-base) var(--e);
}
.chat-fab:hover{ transform:scale(1.04); border-color:var(--ember-line); }
.chat-fab img{ width:26px; height:26px; object-fit:contain; }
.chat-fab::after{
  content:'';
  position:absolute;
  inset:-4px;
  border-radius:50%;
  border:1px solid transparent;
  background:conic-gradient(from 0deg,
    transparent 0deg,
    var(--ember-soft) 90deg,
    rgba(242,169,107,.7) 150deg,
    transparent 220deg) border-box;
  -webkit-mask:linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
          mask:linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
          mask-composite:exclude;
  animation:ring-spin 3.6s linear infinite;
  pointer-events:none;
  opacity:.7;
}
.chat-fab.open::after{ display:none; }

.chat-panel{
  position:fixed;
  bottom:88px;
  inset-inline-start:26px;
  z-index:var(--z-chat);
  width:min(392px, calc(100vw - 32px));
  height:min(600px, calc(100dvh - 128px));
  display:flex;
  flex-direction:column;
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:var(--surface-1);
  box-shadow:
    0 30px 80px -30px rgba(0,0,0,.9),
    0 0 0 1px rgba(255,255,255,.02) inset;
  overflow:hidden;
  opacity:0;
  visibility:hidden;

  /* --cx / --cy carry the drag offset, written by chat.js.
     They are composed INTO the transform here rather than the script
     setting `transform` directly: an inline transform would replace
     this one and the panel would lose its open/close motion. */
  --cx:0px;
  --cy:0px;
  transform:translate3d(var(--cx), calc(var(--cy) + 14px), 0) scale(.98);
  transition:
    opacity var(--t-base) var(--e),
    transform var(--t-base) var(--e-out),
    visibility var(--t-base);
}
.chat-panel.open{
  opacity:1;
  visibility:visible;
  transform:translate3d(var(--cx), var(--cy), 0) scale(1);
}
/* While dragging, the pointer IS the animation - a transition here
   would make the panel lag behind the cursor. */
.chat-panel.is-dragging{
  transition:opacity var(--t-base) var(--e), visibility var(--t-base);
  box-shadow:0 40px 90px -28px rgba(0,0,0,.95);
  cursor:grabbing;
}
/* A moved panel is no longer anchored to the launcher, so it gets a
   slightly stronger edge to read as a floating window. */
.chat-panel.is-moved{ border-color:var(--line-2); }

.chat-top{
  display:flex;
  align-items:center;
  gap:10px;
  padding:13px 14px;
  border-bottom:1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent),
    var(--surface-2);
  cursor:grab;
  /* The header is a drag handle: stop the browser turning a drag
     into a text selection or a native image drag. */
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
}
.chat-top:focus-visible{
  outline:2px solid var(--ember-line);
  outline-offset:-2px;
}
.chat-panel.is-dragging .chat-top{ cursor:grabbing; }

/* Grip: three short bars, the conventional "this moves" cue. */
.chat-grip{
  display:grid;
  gap:2px;
  flex:none;
  padding:2px 1px;
  opacity:.4;
  transition:opacity var(--t-fast) var(--e);
}
.chat-grip i{
  display:block;
  width:11px; height:1.5px;
  border-radius:1px;
  background:var(--tx-3);
}
.chat-top:hover .chat-grip{ opacity:.75; }
.chat-top img{ width:28px; height:28px; object-fit:contain; }
.chat-top .who{
  flex:1;
  display:grid;
  line-height:1.35;
  min-width:0;
}
.chat-top .who b{
  font-size:13.5px;
  font-weight:600;
  letter-spacing:-.005em;
}
.chat-top .who span{
  font-size:11px;
  color:var(--tx-3);
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:2px;
}
.dot{ width:5px; height:5px; border-radius:50%; background:var(--ok); flex:none; }
.dot.off{ background:var(--tx-3); }
.chat-top .chat-top-btn{
  flex:none;
  width:30px; height:30px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:var(--r-sm);
  background:transparent;
  color:var(--tx-2);
  cursor:pointer;
  /* The header swallows pointer gestures for dragging; its buttons
     must not. */
  touch-action:auto;
  transition:color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.chat-top .chat-top-btn:hover{
  color:var(--tx);
  border-color:var(--line-2);
  background:rgba(255,255,255,.04);
}
.chat-top .chat-top-btn[hidden]{ display:none; }

.chat-body{
  flex:1;
  overflow-y:auto;
  padding:18px 16px;
  display:flex;
  flex-direction:column;
  gap:14px;
  scrollbar-width:thin;
  scrollbar-color:var(--line-2) transparent;
}
.chat-body::-webkit-scrollbar{ width:6px; }
.chat-body::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:3px; }

.msg{
  display:flex;
  gap:9px;
  max-width:88%;
  animation:msg-in 320ms var(--e-out);
}
@keyframes msg-in{ from{ opacity:0; transform:translateY(6px); } }
.msg.me{ align-self:flex-end; flex-direction:row-reverse; }
.msg.ai{ align-self:flex-start; }
.msg .av{
  flex:none;
  width:24px; height:24px;
  border-radius:50%;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:1px solid var(--line);
  background:var(--surface-2);
}
.msg .av img{ width:16px; height:16px; object-fit:contain; }
.msg .bub{
  padding:11px 14px;
  border-radius:var(--r-md);
  font-size:14px;
  line-height:1.9;
  border:1px solid var(--line);
  overflow-wrap:anywhere;
  word-break:break-word;
  min-width:0;
}
.msg.ai .bub{
  background:var(--surface-2);
  border-start-end-radius:4px;
}
.msg.me .bub{
  background:linear-gradient(135deg, var(--ember-tint), var(--violet-tint));
  border-color:var(--ember-line);
  border-start-start-radius:4px;
}
.msg .bub p{ margin:0; }
.msg .bub p + p{ margin-top:9px; }
.msg .bub ul{ list-style:disc; padding-inline-start:19px; margin:8px 0; }
.msg .bub li{ margin:3px 0; }
.msg .bub code{
  font-family:var(--font-site);
  font-size:12.5px;
  background:rgba(255,255,255,.06);
  padding:1px 5px;
  border-radius:4px;
}
.msg .bub a{ color:var(--ember-soft); text-decoration:underline; }

.srcs{
  margin-top:10px;
  padding-top:9px;
  border-top:1px dashed var(--line);
}
.srcs b{ font-size:11px; color:var(--tx-3); font-weight:400; }
.srcs .chips{ margin-top:6px; }
.srcs .chip{ font-size:10.5px; padding:3px 9px; }

.typing{ display:flex; gap:4px; padding:12px 15px; }
/* Appears a couple of seconds into a wait — see the note in chat.js. */
.typing-hint{
  display:block;
  padding:0 15px 11px;
  margin-top:-6px;
  font-size:11px;
  line-height:1.7;
  color:var(--tx-3);
}
.typing-hint[hidden]{ display:none; }
.typing i{
  width:5px; height:5px;
  border-radius:50%;
  background:var(--tx-3);
  animation:blink 1.3s var(--e) infinite;
}
.typing i:nth-child(2){ animation-delay:.18s; }
.typing i:nth-child(3){ animation-delay:.36s; }
@keyframes blink{
  0%,60%,100%{ opacity:.25; transform:translateY(0); }
  30%        { opacity:1; transform:translateY(-3px); }
}

.chat-foot{
  padding:12px 14px;
  border-top:1px solid var(--line);
  display:grid;
  gap:8px;
}
.chat-input{
  display:flex;
  align-items:flex-end;
  gap:8px;
  border:1px solid var(--line);
  border-radius:var(--r-md);
  background:var(--surface-2);
  padding:6px;
  transition:border-color var(--t-fast);
}
.chat-input:focus-within{ border-color:var(--ember-line); }
.chat-input textarea{
  flex:1;
  border:0;
  background:transparent;
  resize:none;
  max-height:112px;
  padding:7px 8px;
  font-size:14px;
  line-height:1.7;
}
.chat-input textarea:focus{ outline:none; }
.chat-send{
  flex:none;
  width:32px; height:32px;
  border-radius:var(--r-sm);
  border:0;
  background:var(--g-fire);
  color:#160803;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition:opacity var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.chat-send:disabled{ opacity:.35; cursor:not-allowed; }
.chat-send:not(:disabled):hover{ transform:scale(1.04); }
.chat-send svg{ width:15px; height:15px; grid-area:1/1; }

/* The same button is "send" and, while a reply streams, "stop".
   Only one icon is ever shown. */
.chat-send .i-stop{ display:none; }
.chat-send.is-stop .i-send{ display:none; }
.chat-send.is-stop .i-stop{ display:block; }
.chat-send.is-stop{
  background:none;
  border:1px solid var(--ember-line);
  color:var(--ember-soft);
}
.chat-send.is-stop svg{ width:13px; height:13px; }
/* A quiet ring while generating, so the stop affordance is obviously
   live rather than just a differently-shaped send button. */
.chat-send.is-stop::after{
  content:'';
  position:absolute;
  inset:-5px;
  border-radius:inherit;
  border:1px solid var(--ember-line);
  opacity:0;
  animation:chat-stop-pulse 1.6s var(--e) infinite;
  pointer-events:none;
}
.chat-input{ position:relative; }
@keyframes chat-stop-pulse{
  0%   { opacity:.55; transform:scale(.88); }
  70%  { opacity:0;   transform:scale(1.05); }
  100% { opacity:0;   transform:scale(1.05); }
}
@media (prefers-reduced-motion: reduce){
  .chat-send.is-stop::after{ animation:none; opacity:.4; transform:none; }
}

/* A reply the user stopped: kept on screen, marked as incomplete so
   it is never mistaken for a finished answer. */
.msg.is-stopped .bub{
  border-style:dashed;
  border-color:var(--line-2);
}
.msg.is-stopped .bub::after{
  content:'…';
  color:var(--tx-3);
  margin-inline-start:2px;
}
.msg.is-warn .bub{
  border-color:rgba(255,107,107,.55);
  background:rgba(70,26,26,.45);
}
.chat-note{
  align-self:center;
  font-size:11px;
  color:var(--tx-3);
  padding:2px 10px;
  border:1px dashed var(--line);
  border-radius:999px;
}
.chat-legal{
  font-size:10.5px;
  color:var(--tx-3);
  text-align:center;
  line-height:1.7;
}

.music-fab{
  position:fixed;
  bottom:26px;
  inset-inline-end:26px;
  z-index:calc(var(--z-chat) - 1);
  width:38px; height:38px;
  border-radius:50%;
  display:grid;
  place-items:center;
  cursor:pointer;
  border:1px solid var(--line);
  background:rgba(12,14,20,.62);
  -webkit-backdrop-filter:blur(10px);
          backdrop-filter:blur(10px);
  color:var(--tx-3);
  overflow:hidden;
  transition:
    color var(--t-fast) var(--e),
    border-color var(--t-fast) var(--e),
    transform var(--t-fast) var(--e),
    background var(--t-fast) var(--e),
    box-shadow var(--t-base) var(--e);
}
.music-fab:hover{
  transform:scale(1.05);
  border-color:var(--ember-line);
  color:var(--ember-soft);
  background:rgba(12,14,20,.85);
}
.music-fab.on{ color:var(--ember-soft); border-color:var(--ember-line); }
.music-fab svg{ width:15px; height:15px; }
.music-fab .i-off{ display:none; }
.music-fab.muted .i-on{ display:none; }
.music-fab.muted .i-off{ display:block; }
.music-fab.muted{ color:var(--tx-3); border-color:var(--line); }

/* ----------------------------------------------------------------
   MUSIC PLAYING — equaliser bars + warm pulse glow
   ----------------------------------------------------------------
   `.playing` is toggled by app1.js only when audio is *actually
   audible* (not merely when the user wants sound). That way the
   animation never lies: if the browser has muted autoplay, or the
   tab is hidden, the button shows the plain speaker icon.
   ---------------------------------------------------------------- */

.music-eq{
  position:absolute;
  inset:0;
  display:none;
  align-items:flex-end;
  justify-content:center;
  gap:2px;
  padding:9px 0 10px;
  pointer-events:none;
}
.music-fab.playing .music-eq{ display:flex; }
.music-fab.playing .i-on,
.music-fab.playing .i-off{ display:none; }
.music-fab.playing{
  color:var(--ember-soft);
  border-color:var(--ember-line);
}

.music-eq i{
  display:block;
  width:2px;
  height:35%;
  border-radius:2px;
  background:linear-gradient(180deg, var(--ember-soft), var(--ember));
  box-shadow:0 0 5px rgba(242,169,107,.55);
  transform-origin:bottom center;
  animation:eq-bounce 1.1s ease-in-out infinite;
}
.music-eq i:nth-child(1){ animation-delay:0s; }
.music-eq i:nth-child(2){ animation-delay:.16s; }
.music-eq i:nth-child(3){ animation-delay:.32s; }
.music-eq i:nth-child(4){ animation-delay:.10s; }

@keyframes eq-bounce{
  0%,100%{ height:22%; }
  50%    { height:82%; }
}

.music-fab.playing{
  animation:music-glow 2.2s ease-in-out infinite;
}
@keyframes music-glow{
  0%,100%{
    box-shadow:
      0 0 0 0 rgba(232,106,30,.45),
      0 0 14px rgba(232,106,30,.22);
  }
  55%{
    box-shadow:
      0 0 0 7px rgba(232,106,30,0),
      0 0 18px rgba(232,106,30,.38);
  }
  100%{
    box-shadow:
      0 0 0 0 rgba(232,106,30,0),
      0 0 14px rgba(232,106,30,.22);
  }
}

/* Reduced-motion fallback: static bars, no pulse */
@media (prefers-reduced-motion: reduce){
  .music-eq i{ animation:none; height:60%; }
  .music-fab.playing{ animation:none; box-shadow:0 0 12px rgba(232,106,30,.28); }
}

/* ----------------------------------------------------------------
   CHAT PANEL — phones
   ----------------------------------------------------------------
   Below 560px the panel stops being a floating window and becomes a
   bottom sheet: full width, pinned to the bottom edge, and NOT
   draggable (chat.js gates on the same breakpoint). There is nowhere
   to drag a full-width sheet to, and a half-dragged sheet on a phone
   is just a sheet you cannot reach.

   The offset properties are forced back to 0 here so that a position
   saved on a desktop cannot push the sheet off a phone screen when
   the same account opens the site on a narrow window.
   ---------------------------------------------------------------- */
@media (max-width:560px){
  .chat-panel{
    --cx:0px;
    --cy:0px;
    inset-inline:8px;
    width:auto;
    bottom:max(8px, env(safe-area-inset-bottom));
    /* dvh, not vh: on mobile Safari and Chrome the URL bar makes vh
       taller than the visible area, which would hide the input under
       the browser chrome. */
    height:min(78dvh, calc(100dvh - 92px));
    border-radius:18px;
  }
  .chat-top{ cursor:default; touch-action:auto; padding:12px; }
  .chat-grip{ display:none; }

  /* Comfortable touch targets. */
  .chat-top .chat-top-btn{ width:36px; height:36px; }
  .chat-send{ width:38px; height:38px; }
  .chat-send svg{ width:17px; height:17px; }
  .chat-input textarea{ font-size:16px; }   /* 16px stops iOS zooming on focus */
  .chat-body{ padding:14px 12px; gap:12px; }
  .msg{ max-width:94%; }
  .msg .bub{ font-size:14.5px; line-height:1.85; }
  .chat-legal{ font-size:10px; }
}

/* Very short landscape phones: the sheet must not eat the whole
   screen, and the message list needs to stay scrollable. */
@media (max-height:460px) and (max-width:900px){
  .chat-panel{ height:calc(100dvh - 24px); bottom:12px; }
  .chat-legal{ display:none; }
}

@media (max-width:520px){
  .music-fab{ bottom:20px; inset-inline-end:20px; width:36px; height:36px; }
  .music-fab svg{ width:13px; height:13px; }
  .music-eq{ padding:8px 0 9px; gap:2px; }
  .music-eq i{ width:2px; }
  .chat-fab{ inset-inline-start:20px; bottom:20px; width:48px; height:48px; }
}

/* ================================================================
   21. INNER PAGES — page hero
   ================================================================ */
.page-hero{
  position:relative;
  isolation:isolate;
  padding-block:clamp(120px, 15vh, 190px) clamp(64px, 9vw, 110px);
}
.page-hero[data-tone]::before{
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
}
.page-hero[data-tone="warm"]::before{
  background:linear-gradient(180deg, var(--surface-warm), transparent 70%);
}
.page-hero[data-tone="cool"]::before{
  background:linear-gradient(180deg, var(--surface-cool), transparent 70%);
}
.page-hero .t-display{ margin-bottom:22px; }
.page-hero .t-lead{ max-width:54ch; }
.page-hero-grid{
  display:grid;
  grid-template-columns:1fr 1.1fr;
  gap:clamp(32px, 5vw, 68px);
  align-items:center;
}
@media (max-width:940px){ .page-hero-grid{ grid-template-columns:1fr; } }

.page-hero-grid > .mark-card{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:clamp(20px, 2.4vw, 32px);
  align-items:center;
  text-align:right;
}
.page-hero-grid > .mark-card img{ width:clamp(96px, 11vw, 128px); }
.page-hero-grid > .mark-card figcaption{ margin-top:0; }
.page-hero-grid > .mark-card figcaption span{ max-width:38ch; }
@media (max-width:760px){
  .page-hero-grid > .mark-card{
    grid-template-columns:1fr;
    justify-items:center;
    text-align:center;
  }
}

.story-body{ max-width:72ch; display:grid; gap:22px; }
.story-body p{
  font-size:clamp(15px, 1.18vw, 17px);
  color:var(--tx-2);
  line-height:2.05;
}
.story-lead{
  font-size:clamp(20px, 2.4vw, 27px) !important;
  font-weight:800;
  line-height:1.6 !important;
  color:var(--tx) !important;
  background-image:var(--g-fire);
  -webkit-background-clip:text;
          background-clip:text;
  -webkit-text-fill-color:transparent;
}
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .story-lead{ -webkit-text-fill-color:currentColor; color:var(--ember-soft) !important; }
}
.story-mark{
  color:var(--tx) !important;
  font-weight:700;
  padding-inline-start:18px;
  border-inline-start:2px solid transparent;
  border-image:var(--g-duo) 1;
}
.story-quote{
  margin:14px 0 0;
  padding:26px 28px;
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:linear-gradient(120deg, var(--ember-tint), var(--violet-tint));
  font-size:clamp(17px, 1.9vw, 21px);
  font-weight:700;
  line-height:1.85;
}


/* ================================================================
   22. VOICE DEMO PANEL
   ================================================================ */
.voice-grid{
  display:grid;
  grid-template-columns:1.05fr 1fr;
  gap:clamp(32px, 5vw, 64px);
  align-items:start;
}
@media (max-width:980px){ .voice-grid{ grid-template-columns:1fr; } }

.vdemo{
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:var(--surface-1);
  padding:20px;
  box-shadow:0 30px 80px -44px rgba(0,0,0,.9);
  position:relative;
  overflow:hidden;
  contain:paint;
}
.vdemo::before{
  content:'';
  position:absolute;
  inset-block-start:0;
  inset-inline:0;
  height:2px;
  background:linear-gradient(90deg, var(--ember), var(--violet), transparent);
  opacity:.6;
}
.vdemo-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}
.vdemo-top b{ display:block; font-size:14.5px; }
.vdemo-top .t-sm{
  color:var(--tx-3);
  font-size:12.5px;
  display:flex;
  align-items:center;
  gap:7px;
}
.vdemo-top .t-sm::before{
  content:'';
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--ok);
  animation:live-dot 2.4s var(--e) infinite;
}
@keyframes live-dot{
  0%  { box-shadow:0 0 0 0 rgba(74,222,128,.45); }
  70% { box-shadow:0 0 0 7px rgba(74,222,128,0); }
  100%{ box-shadow:0 0 0 0 rgba(74,222,128,0); }
}
.live-dot{ display:inline-flex; align-items:center; gap:6px; color:var(--cyan); }
.live-dot::before{
  content:'';
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--cyan);
  animation:live-pulse 1.9s var(--e) infinite;
}
@keyframes live-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.25; } }

.vwave{
  display:flex;
  align-items:center;
  gap:14px;
  padding:13px 15px;
  margin-bottom:16px;
  border:1px solid var(--line);
  border-radius:var(--r-md);
  background:var(--surface-2);
  contain:paint;
}
.vplay{
  position:relative;
  flex:none;
  width:50px; height:50px;
  border-radius:50%;
  background:var(--g-fire);
  color:#160803;
  display:grid;
  place-items:center;
  transition:transform var(--t-fast) var(--e);
}
.vplay::after{
  content:'';
  position:absolute;
  inset:-4px;
  border-radius:50%;
  border:1px solid var(--ember-line);
  pointer-events:none;
  animation:pulse-ring 2.6s var(--e) infinite;
}
.vplay.on::after{ animation-duration:1.3s; }
.vplay:hover{ transform:scale(1.05); }
.vplay svg{ width:20px; height:20px; }
.vplay .i-stop{ display:none; }
.vplay.on .i-play{ display:none; }
.vplay.on .i-stop{ display:block; }

.vbars{
  flex:1;
  display:flex;
  align-items:center;
  gap:3px;
  height:42px;
  direction:ltr;
}
.vbars i{
  flex:1;
  display:block;
  min-width:2px;
  border-radius:2px;
  height:var(--h, 18%);
  background:linear-gradient(180deg, var(--ember-soft), var(--ember));
  opacity:.5;
}
.vbars i.hot{
  opacity:1;
  background:linear-gradient(180deg, #fff, var(--ember-soft));
}
.vcount{ flex:none; color:var(--tx-3); }

.vlines{
  display:grid;
  gap:8px;
  max-height:340px;
  overflow-y:auto;
  padding-inline-end:4px;
  scrollbar-width:none;
  contain:content;
  overscroll-behavior:contain;
}
.vlines::-webkit-scrollbar{ width:0; }
.vline{ min-width:0; }
.vline-btn{
  width:100%;
  text-align:start;
  position:relative;
  display:grid;
  gap:5px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:var(--r-md);
  background:transparent;
  min-width:0;
  transition:
    border-color var(--t-fast) var(--e),
    background var(--t-fast) var(--e);
}
.vline-btn::before{
  content:'';
  position:absolute;
  inset-block:10px;
  inset-inline-start:0;
  width:2px;
  border-radius:2px;
  background:var(--line-3);
  transition:background var(--t-fast) var(--e);
}
.vline-btn:hover{
  border-color:var(--line-2);
  background:rgba(255,255,255,.02);
}
.vwho{
  color:var(--tx-3);
  font-size:clamp(11.5px, .85vw, 13px) !important;
  letter-spacing:.1em;
}
.vtext{
  font-size:14px;
  line-height:1.9;
  color:var(--tx-2);
  overflow-wrap:anywhere;
  min-width:0;
}
.vline-bot{ background:linear-gradient(90deg, var(--ember-tint), transparent); }
.vline-bot::before{ background:var(--ember-soft); }
.vline-bot .vwho{ color:var(--ember-soft); }
.vline-usr,
.vline-human{ background:linear-gradient(90deg, var(--violet-tint), transparent); }
.vline-usr::before,
.vline-human::before{ background:var(--violet); }
.vline-usr .vwho,
.vline-human .vwho{ color:var(--violet-soft); }
.vline.on .vline-btn,
.vline-btn.playing{
  border-color:var(--ember-line);
  background:linear-gradient(90deg, var(--ember-tint), transparent);
}
.vline.on .vline-btn::before,
.vline-btn.playing::before{
  background:linear-gradient(180deg, var(--ember-soft), var(--violet));
}
.vline.on .vtext{ color:var(--tx); }
.vline.done .vline-btn{ opacity:.5; }
.vnote{
  margin-top:14px;
  padding-top:12px;
  border-top:1px dashed var(--line);
  color:var(--tx-3);
  font-size:12px;
}
.voice-grid .chips{ margin-top:22px; }


/* ================================================================
   23. CHAT PREVIEW (rag hero)
   ================================================================ */
.hero-split .wrap{
  display:grid;
  gap:clamp(30px, 4vw, 64px);
  align-items:center;
}
@media (min-width:1000px){
  .hero-split .wrap{ grid-template-columns:1.15fr .85fr; }
}
.hero-demo{
  display:grid;
  justify-items:center;
  width:90%;
  justify-self:start;
}

.cw{
  width:min(460px, 100%);
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  overflow:hidden;
  background:var(--surface-1);
  box-shadow:0 30px 80px -44px rgba(0,0,0,.9);
  transform:perspective(1200px) rotateY(8deg) rotateX(2deg) scale(1.02);
  transform-origin:center right;
  transition:transform var(--t-slow) var(--e-out);
}
.hero-demo:hover .cw{
  transform:perspective(1200px) rotateY(2deg) rotateX(1deg) scale(1.04);
}
.cw-top{
  display:flex;
  align-items:center;
  gap:11px;
  padding:13px 15px;
  border-bottom:1px solid var(--line);
  background:var(--surface-2);
}
.cw-top img{ border-radius:6px; flex:none; }
.cw-top > div{ display:grid; gap:3px; min-width:0; }
.cw-top b{ font-size:14.5px; }
.cw-top span{
  font-size:11px;
  color:var(--tx-3);
  display:flex;
  align-items:center;
  gap:6px;
}
.cw-top span i{
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--ok);
  flex:none;
}
.cw-x{
  margin-inline-start:auto;
  color:var(--tx-3);
  font-size:18px;
  line-height:1;
}
.cw-body{
  direction:ltr;
  padding:15px;
  display:grid;
  gap:11px;
  overflow-y:auto;
  overscroll-behavior:contain;
  min-width:0;
}
.cw-msg{
  direction:rtl;
  font-size:1rem;
  line-height:1.95;
  padding:11px 14px;
  border-radius:var(--r-md);
  max-width:88%;
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.cw-msg.bot{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-top-left-radius:5px;
  justify-self:start;
  color:var(--tx-2);
}
.cw-msg.me{
  background:linear-gradient(135deg, var(--ember-tint), rgba(232,106,30,.05));
  border:1px solid var(--ember-line);
  border-top-right-radius:5px;
  justify-self:end;
  color:var(--tx);
}
.cw-src{
  display:block;
  margin-top:9px;
  padding-top:8px;
  border-top:1px dashed var(--line);
  font-size:10.5px;
  color:var(--ember-soft);
  letter-spacing:.03em;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.cw-in{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 15px;
  border-top:1px solid var(--line);
  background:rgba(0,0,0,.2);
}
.cw-in span{ flex:1; font-size:12.5px; color:var(--tx-3); }
.cw-in i{
  width:26px;
  height:26px;
  border-radius:var(--r-sm);
  flex:none;
  background:var(--g-fire);
}


/* ================================================================
   24. REALTIME ORB
   ================================================================ */
.rt-grid{
  display:grid;
  gap:clamp(30px, 4vw, 60px);
  align-items:center;
  margin-top:clamp(26px, 3vw, 44px);
}
@media (min-width:980px){ .rt-grid{ grid-template-columns:.9fr 1.1fr; } }

.rt-orb-wrap{
  display:grid;
  justify-items:center;
  gap:22px;
  padding:clamp(28px, 4vw, 48px);
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:var(--surface-1);
}
/* ----------------------------------------------------------------
   VOICE CLOUD
   ----------------------------------------------------------------
   The liquid metaball body on voice.php, ported from
   example-voice.html. voice-cloud.js builds the nodes and writes only
   what changes per frame; everything static is here.

   It has to be here and not in a style attribute: `style-src` carries
   a nonce and no 'unsafe-inline', and a nonce covers a <style>
   ELEMENT, never a style ATTRIBUTE. The original's one big innerHTML
   string of `style="..."` would have been blocked outright.

   `.rt-orb` and its `.rt-core`/`.rt-ring`/`.rt-spark` children below
   are the previous visual. They are left in place deliberately: the
   markup that used them is gone from voice.php, so they cost nothing,
   and keeping them makes going back a one-paragraph edit.
   ---------------------------------------------------------------- */
/* ----------------------------------------------------------------
   Opt this one section out of content-visibility.
   ----------------------------------------------------------------
   config.php sets `main > .section { content-visibility: auto }`,
   which skips a section's layout entirely while it is off screen.
   For every other section that is free performance. For this one it
   was the cause of a real, intermittent bug: voice-cloud.js has to
   measure its container to scale a fixed-size design canvas, and
   inside a skipped subtree getBoundingClientRect() returns the
   `contain-intrinsic-size` placeholder instead of the real box.

   Measured across repeated loads: the same page produced
   scale(0.1556) from a 112px placeholder on one load and the correct
   scale(0.5254) from a 378px box on the next. At 0.1556 the cloud is
   a sixth of its size - which is what "sometimes the realtime part
   does not load, refresh a few times and it works" actually was.

   One section laying out eagerly costs a few elements' worth of
   layout. Making the measurement deterministic is worth that.
   ---------------------------------------------------------------- */
#realtime{
  content-visibility:visible;
  contain-intrinsic-size:auto;
}

.vc{
  position:relative;
  width:100%;
  max-width:420px;
  aspect-ratio:1;
  overflow:hidden;
  border-radius:var(--r-lg);
  /* The halo is written by JS as one custom property rather than a
     full background string, so the per-frame work is a single
     variable write instead of re-parsing a gradient. */
  --vc-halo:rgba(124,140,248,.05);
  background:
    radial-gradient(120% 80% at 50% 42%, var(--vc-halo) 0%, rgba(9,10,14,0) 62%),
    #090A0E;
  /* Its own compositing layer: the blob layer repaints every frame
     and must not drag the rest of the section into the repaint. */
  contain:paint;
}
.vc-fit{
  position:absolute;
  left:50%;
  top:50%;
  transform-origin:50% 50%;
}
.vc-cam{ position:absolute; inset:0; }

.vc-bloom,
.vc-floor,
.vc-spec,
.vc-hot{ position:absolute; border-radius:50%; pointer-events:none; }
.vc-bloom{ filter:blur(48px); }
.vc-floor{ filter:blur(24px); }
.vc-spec{ mix-blend-mode:screen; filter:blur(18px); opacity:.55; }
.vc-hot{ filter:blur(9px); background:rgba(255,255,255,.85); }

.vc-ripples,
.vc-bars,
.vc-body{ position:absolute; inset:0; }

.vc-ripple{
  position:absolute;
  border-radius:50%;
  border:1.5px solid transparent;
}
.vc-bar{
  position:absolute;
  width:3.2px;
  border-radius:3px;
  transform-origin:50% 0;
}
.vc-blob{ position:absolute; border-radius:50%; }

/* The goo filter is what fuses the separate blobs into one body.
   Only applied at the `high` tier — see the tier notes in
   voice-cloud.js for why it is the most expensive thing here. */
.vc-goo{ filter:url(#vcGoo); }

.vc-defs{ position:absolute; width:0; height:0; }

/* A dark vignette, so the body sits in the frame rather than
   floating on a flat panel. */
.vc::after{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(115% 78% at 50% 46%,
    rgba(0,0,0,0) 52%, rgba(0,0,0,.55) 100%);
}

/* The mic and reset are real controls now, not decoration.
   They were <span>s before, so they had no size of their own and
   collapsed to their icon: measured 16x16 for the reset, which is
   not a target anyone can hit with a thumb. Both get an explicit
   control size, and more of it on a touch screen. */
.rt-bar .rt-mic,
.rt-bar .rt-reset{
  flex:none;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:50%;
  cursor:pointer;
  transition:color var(--t-fast) var(--e), background var(--t-fast) var(--e),
             border-color var(--t-fast) var(--e);
}
.rt-bar .rt-mic:hover{ color:var(--tx); }
.rt-bar .rt-mic.is-on{
  color:#0E1014;
  background:var(--ember-soft);
  border-color:var(--ember-soft);
}
.rt-bar .rt-mic:disabled{ opacity:.5; cursor:progress; }
.rt-bar .rt-reset{
  background:transparent;
  border:0;
  color:var(--tx-3);
}
.rt-bar .rt-reset:hover{ color:var(--tx-2); }
.rt-bar .rt-mic:focus-visible,
.rt-bar .rt-reset:focus-visible{
  outline:2px solid var(--ember-line);
  outline-offset:2px;
}
.rt-bar [hidden]{ display:none; }

@media (pointer: coarse){
  .rt-bar .rt-mic,
  .rt-bar .rt-reset{ width:44px; height:44px; }
  .rt-bar{ gap:16px; }
}

@media (max-width:520px){
  .vc{ max-width:300px; }
}

.rt-orb{
  position:relative;
  width:min(240px, 58vw);
  aspect-ratio:1;
  display:grid;
  place-items:center;
}
.rt-core{
  position:absolute;
  inset:16%;
  border-radius:50%;
  background:radial-gradient(circle at 42% 34%, #FFA366 0%, var(--ember) 46%, var(--ember-deep) 100%);
  box-shadow:
    0 0 55px rgba(232,106,30,.4),
    inset 0 0 45px rgba(255,220,180,.18);
  animation:rt-breathe 3.4s var(--e) infinite;
}
.rt-ring{
  position:absolute;
  inset:6%;
  border-radius:50%;
  border:1px solid var(--ember-line);
  animation:rt-pulse 3.4s var(--e) infinite;
}
.rt-ring.d2{
  inset:-4%;
  animation-delay:1.1s;
  border-color:rgba(232,106,30,.14);
}
.rt-spark{
  position:absolute;
  inset:16%;
  border-radius:50%;
  overflow:hidden;
  background:
    radial-gradient(2px 2px at 30% 35%, rgba(255,230,190,.9), transparent),
    radial-gradient(2px 2px at 68% 28%, rgba(255,230,190,.75), transparent),
    radial-gradient(1.6px 1.6px at 44% 66%, rgba(255,230,190,.8), transparent),
    radial-gradient(1.6px 1.6px at 74% 60%, rgba(255,230,190,.6), transparent);
  animation:rt-drift 6s linear infinite;
}
@keyframes rt-breathe{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.04); } }
@keyframes rt-pulse{
  0%  { transform:scale(.94); opacity:.8; }
  100%{ transform:scale(1.2); opacity:0; }
}
@keyframes rt-drift{
  0%  { transform:translateY(0) rotate(0); }
  100%{ transform:translateY(-6px) rotate(360deg); }
}
.rt-bar{
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid var(--line-2);
  background:var(--surface-2);
}
.rt-mic{
  width:34px;
  height:34px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg, #22C55E, #16A34A);
  color:#05210F;
  flex:none;
}
.rt-mic svg{ width:15px; height:15px; }
.rt-speed{ display:flex; align-items:center; gap:9px; }
.rt-speed i{
  width:70px;
  height:3px;
  border-radius:2px;
  display:block;
  background:linear-gradient(90deg, var(--ember-soft) 0 62%, rgba(255,255,255,.14) 62%);
  position:relative;
}
.rt-speed i::after{
  content:'';
  position:absolute;
  inset-inline-start:62%;
  top:50%;
  width:11px;
  height:11px;
  margin-top:-5.5px;
  margin-inline-start:-5.5px;
  border-radius:50%;
  background:var(--ember-soft);
}
.rt-speed b{ font-size:12px; color:var(--tx-3); font-weight:500; }
.rt-reset{ color:var(--tx-3); display:grid; place-items:center; }
.rt-reset svg{ width:16px; height:16px; }
.rt-cap{ color:var(--tx-3); margin:0; }
.rt-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:0;
}
.rt-list li{
  display:grid;
  gap:7px;
  padding:clamp(17px, 2vw, 22px) 0;
  border-bottom:1px solid var(--line);
  min-width:0;
}
.rt-list li:first-child{ border-top:1px solid var(--line); }
.rt-list b{ font-size:clamp(15.5px, 1.2vw, 18px); }
.rt-list span{
  color:var(--tx-2);
  font-size:clamp(14px, 1vw, 15.5px);
  line-height:1.95;
}


/* ================================================================
   25. RAG PIPELINE
   ================================================================ */
.pipe{
  position:relative;
  list-style:none;
  margin:clamp(30px, 4vw, 52px) 0 0;
  padding:0;
  display:grid;
  gap:0;
}
.pipe::before{
  content:'';
  position:absolute;
  z-index:0;
  inset-block:2.6rem 2.6rem;
  inset-inline-start:calc(1.5rem - 1px);
  width:1px;
  background:linear-gradient(180deg,
    transparent 0%,
    var(--line-3) 12%,
    var(--line-3) 88%,
    transparent 100%);
}
.pipe-step{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:clamp(18px, 2.6vw, 34px);
  padding:clamp(22px, 3vw, 34px) 0;
  border-top:1px solid var(--line);
  position:relative;
  z-index:1;
  align-items:start;
}
.pipe-step:last-child{ border-bottom:1px solid var(--line); }
.pipe-n{
  font-family:var(--font-site);
  font-size:clamp(14px, 1vw, 17px);
  font-weight:700;
  color:#fff;
  width:3rem;
  height:3rem;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:radial-gradient(circle at center,
    rgba(232,106,30,.5) 0%,
    rgba(232,106,30,.14) 55%,
    transparent 85%);
  border:1px solid var(--ember-line);
  box-shadow:0 0 20px rgba(232,106,30,.22);
}
.pipe-body h3{
  font-size:clamp(18px, 1.55vw, 23px);
  margin:0 0 .5em;
}
.pipe-body p{
  color:var(--tx-2);
  line-height:1.95;
  max-width:72ch;
  margin:0;
  overflow-wrap:anywhere;
  min-width:0;
}
.pipe-body .chips{ margin-top:15px; }
.pipe-body{ min-width:0; }
@media (max-width:640px){
  .pipe::before{ display:none; }
  .pipe-step{ grid-template-columns:1fr; gap:10px; }
  .pipe-n{ width:2.4rem; height:2.4rem; min-width:0; }
}

.rag-demo{
  display:grid;
  gap:0;
  margin-top:clamp(24px, 3vw, 40px);
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:var(--surface-1);
  overflow:hidden;
}
.rag-demo > div{ padding:clamp(18px, 2.4vw, 28px); min-width:0; }
.rag-demo .t-mono{ display:block; color:var(--tx-3); margin-bottom:10px; }
.rag-q p{ margin:0; font-size:clamp(17px, 1.5vw, 20px); color:var(--tx); }
.rag-arrow{
  display:grid;
  place-items:center;
  padding:0 !important;
  height:34px;
  color:var(--ember-soft);
  opacity:.55;
}
.rag-arrow svg{ width:18px; height:18px; }
.rag-hits{ background:rgba(0,0,0,.2); border-block:1px solid var(--line); }
.rag-hits ul{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}
.rag-hits li{
  display:flex;
  align-items:baseline;
  gap:12px;
  flex-wrap:wrap;
  font-size:14.5px;
  color:var(--tx-2);
}
.rag-hits b{
  font-variant-numeric:tabular-nums;
  color:var(--ember-soft);
  min-width:3.4em;
  font-weight:600;
}
.rag-hits i{ color:var(--tx-3); font-style:normal; font-size:12.5px; }
.rag-hits li.drop{ opacity:.4; text-decoration:line-through; }
.rag-hits li.drop b{ color:var(--tx-3); }
.rag-a{ background:linear-gradient(180deg, var(--violet-tint), transparent); }
.rag-a p{ margin:0 0 12px; color:var(--tx); }
.rag-a .phones{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:6px;
}
.rag-note{ margin-top:18px; color:var(--tx-3); max-width:76ch; }


/* ================================================================
   26. MARK CARD
   ================================================================ */
.mark-card{
  margin:0;
  display:grid;
  justify-items:center;
  text-align:center;
  padding:clamp(24px, 3vw, 38px);
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:var(--surface-1);
}
.mark-card img{
  width:min(140px, 32vw);
  height:auto;
  border-radius:16px;
  box-shadow:
    0 20px 56px -30px rgba(232,106,30,.45),
    0 0 0 1px rgba(255,255,255,.05);
  transition:transform var(--t-base) var(--e);
}
.mark-card:hover img{ transform:translateY(-4px); }
.mark-card figcaption{
  margin-top:22px;
  display:grid;
  gap:9px;
}
.mark-card figcaption b{ font-size:clamp(17px, 1.3vw, 20px); }
.mark-card figcaption span{
  font-size:clamp(14px, 1vw, 15.5px);
  color:var(--tx-2);
  line-height:1.95;
  max-width:46ch;
}
@media (min-width:900px){
  .mark-card{
    display:grid;
    grid-template-columns:auto 1fr;
    gap:clamp(22px, 3vw, 38px);
    justify-items:start;
    text-align:right;
    align-items:center;
  }
  .mark-card figcaption{ margin-top:0; }
  .mark-card figcaption span{ max-width:52ch; }
}


/* ================================================================
   27. PROJECTS PAGE
   ================================================================ */
.page-hero.projects-hero{
  padding-block:clamp(104px, 9vw, 128px) 20px;
}
.projects-hero .t-display{
  font-size:clamp(2.1rem, 1.75rem + 1.3vw, 3.2rem);
}
.section.projects-list{
  padding-block:0 clamp(62px, 8vw, 104px);
}
.proj-grid{
  display:grid;
  gap:clamp(18px, 2.8vw, 32px);
  grid-template-columns:repeat(2, minmax(0, 1fr));
}
.proj{
  display:flex;
  height:100%;
  flex-direction:column;
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:linear-gradient(155deg, #1f1a1c, var(--surface-1) 72%);
  overflow:hidden;
  transition:
    border-color var(--t-base) var(--e),
    transform var(--t-base) var(--e);
}
.proj:hover, .proj:focus-visible{
  border-color:var(--ember-line);
  transform:translateY(-3px);
}
.proj-media{
  aspect-ratio:16/9;
  overflow:hidden;
  background:var(--surface-2);
  border-bottom:1px solid var(--line);
}
.proj-media img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  transition:transform var(--t-slow) var(--e-out);
}
.proj:hover img{ transform:scale(1.025); }
.proj-body{
  display:flex;
  flex:1;
  flex-direction:column;
  gap:8px;
  padding:clamp(17px, 2.1vw, 24px);
}
.proj-meta{ color:var(--ember-soft); font-size:.94rem; }
.proj-body h2{ font-size:clamp(1.45rem, 1.25rem + .7vw, 1.85rem); }
.proj-body > p:not(.proj-meta){ color:var(--tx-2); line-height:1.8; }
.proj-open{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:8px 14px;
  margin-top:auto;
  padding-top:16px;
  border-top:1px solid var(--line);
  font-size:.98rem;
  color:var(--ember-soft);
}
.proj-body > p:not(.proj-meta){ margin-bottom:10px; }
.proj-open bdi{ color:var(--tx-2); overflow-wrap:anywhere; }
.proj-open [aria-hidden]{ margin-inline-start:4px; }
@media (max-width:640px){
  .page-hero.projects-hero{ padding-block:94px 20px; }
  .proj-grid{ grid-template-columns:1fr; }
}

/* ================================================================
   27b. 404 PAGE
   ----------------------------------------------------------------
   404.php shipped with `.err-links` / `.err-link` markup and no CSS
   for it at all, so the four "continue from here" links rendered as
   bare stacked text 23px tall - unstyled, and too small to tap.
   Same gap projects.php had before its styles were written.

   Deliberately built on the `.mini` card family rather than a new
   treatment, so the error page looks like the rest of the site.
   ================================================================ */
.err-links{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-top:clamp(24px, 3vw, 34px);
  max-width:640px;
}
.err-link{
  padding:18px 18px;
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  background:var(--surface-1);
  display:grid;
  gap:5px;
  align-content:start;
  min-width:0;
  transition:
    border-color var(--t-base) var(--e),
    background var(--t-base) var(--e),
    transform var(--t-base) var(--e);
}
.err-link:hover{
  border-color:var(--ember-line);
  background:var(--surface-2);
  transform:translateY(-2px);
}
.err-link b{ font-size:15px; font-weight:700; color:var(--tx); }
.err-link span{ font-size:13px; color:var(--tx-3); line-height:1.75; }

@media (max-width:560px){
  .err-links{ grid-template-columns:1fr; gap:10px; }
  .err-link{ padding:15px 16px; }
}


/* ================================================================
   28. TEXT CONTAINMENT
   ================================================================ */
.cw-msg, .cw-src, .rag-q p, .rag-a p, .rag-hits li,
.vtext, .vline-btn, .chip, .svc-row .inline-detail p,
.pipe-body p, .card p, .shot-cap, .rt-list span,
.msg .bub, .mini b, .mini span{
  overflow-wrap:anywhere;
  word-break:break-word;
  min-width:0;
}
.cw-body, .cw-top > div, .rag-demo > div, .pipe-body,
.vline-btn, .rt-list li, .card, .svc-row{ min-width:0; }
.cw, .rag-demo, .vdemo{ overflow:hidden; }

/* ----------------------------------------------------------------
   Touch targets
   ----------------------------------------------------------------
   Measured on a coarse pointer: the footer social icons were 30x30,
   footer and inline links 23-29px tall, and the nav brand 30px.
   Anything under about 40px is a target people miss with a thumb.

   Scoped to `pointer: coarse` so the desktop layout, which was
   designed around these sizes, is untouched. The links grow by
   padding rather than by height, so the text itself does not move.
   ---------------------------------------------------------------- */
@media (pointer: coarse){
  .social a{ width:40px; height:40px; }
  .footer li a{ padding-block:9px; }
  .footer-btm a{ padding-block:6px; display:inline-block; }
  .phones a{ padding-block:5px; display:inline-block; }
  .info-row a{ padding-block:4px; display:inline-block; }
  figcaption a{ padding-block:6px; }
  .brand{ padding-block:4px; }
  /* 16px on any touch device, not just under 560px: iPad Safari
     applies the same zoom-on-focus rule and sits at 768-1024px. */
  .chat-input textarea,
  .field input, .field textarea, .field select{ font-size:16px; }
}

/* ----------------------------------------------------------------
   Grid blowout — the structural half of the same problem
   ----------------------------------------------------------------
   `grid-template-columns: 1fr` means `minmax(auto, 1fr)`, and that
   `auto` minimum is the item's min-content width unless the item has
   an explicit `min-width`. So a single unbreakable token - an email
   address, a URL, "PDF/Word/Excel/PowerPoint" - makes its track
   wider than the container and shoves the whole layout sideways.

   Measured on contact.php at 320px before this rule: .contact-grid
   resolved to a 326px column inside a 292px box, and 38 elements
   hung 20px off the edge.

   The list above fixes it case by case, which is why the bug keeps
   coming back on whatever markup was added since. This fixes the
   containers instead: every direct child of a known grid or flex
   container is allowed to shrink, so the track's auto minimum
   resolves to 0 and `1fr` behaves like `minmax(0, 1fr)`.
   ---------------------------------------------------------------- */
.grid-2 > *, .grid-3 > *, .grid-4 > *,
.contact-grid > *, .product-grid > *, .page-hero-grid > *,
.voice-grid > *, .rt-grid > *, .proj-grid > *, .pipe-step > *,
.form-row > *, .footer-grid > *, .hero-split .wrap > *,
.steps > *, .svc-list > *, .intro-pair > *,
.err-links > *, .info-row, .info-row > *{
  min-width:0;
}

/* And the text half: once a track can shrink, the long tokens inside
   it have to be allowed to break or they just overflow their own box
   instead of the grid. */
.info-row b, .info-row span, .info-row a, .info-row bdi,
.phones a, .footer li a, .footer-btm, figcaption{
  overflow-wrap:anywhere;
 
}


/* ================================================================
   29. SCROLL REVEAL
   ================================================================ */
[data-rv]{
  opacity:0;
  transform:translateY(20px);
}
[data-rv].seen{
  opacity:1;
  transform:none;
  transition:
    opacity 640ms var(--e-out),
    transform 640ms var(--e-out);
  transition-delay:var(--d, 0ms);
  
}


/* ================================================================
   30. MISC
   ================================================================ */
#top{
  display:block;
  position:absolute;
  inset-block-start:0;
  scroll-margin-block-start:0;
}


/* ================================================================
   31. REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
  [data-rv]{ opacity:1; transform:none; }
  .rv > i{ transform:none; opacity:1; }
  .stg{ opacity:1; transform:none; }
  .aura i{ animation:none; }
  .rt-core, .rt-ring, .rt-spark{ animation:none; }
  .rt-ring{ opacity:.5; }
  .mob-hero video{ display:none; }
  .reel-loader__ring{ animation:none; opacity:.6; }
  .reel-loader{ transition:opacity .2s linear; }
  .hero-buffering__ring{ animation:none; opacity:.6; }
  .hero-buffering{ transition:opacity .2s linear; }
  .loader-ring, .chat-fab::after, .music-fab::after,
  .vplay::after, .vdemo-top .t-sm::before,
  .hint-arrow, .live-dot::before{
    animation:none;
  }
  .hint-arrow{ opacity:.7; }
  .mark-card:hover img{ transform:none; }
}


/* ================================================================
   32. PRINT
   ================================================================ */
@media print{
  .nav, .chat-fab, .chat-panel, .music-fab,
  .reel-rail, .reel-hint, #loader, .aura, .reel-loader,
  .page-portal{
    display:none !important;
  }
  .reel-stage{ position:static; height:auto; }
  body{ background:#fff; color:#000; }
  .grad, .grad-duo, .story-lead{
    background:none;
    -webkit-text-fill-color:currentColor;
    color:#111 !important;
  }
}


/* ================================================================
   SYNTRA LAYER — parallax backdrop, scroll progress, custom cursor
   ================================================================ */

#main, .drawer, .footer, .nav, #loader, .aura,
.chat-fab, .chat-panel, .music-fab,
.sx-progress, .sx-cursor, .sx-cursor-dot, .svc-detail{
  position:relative;
}
.nav, #loader, .aura, .sx-progress, .sx-cursor, .sx-cursor-dot,
.chat-fab, .chat-panel, .music-fab, .svc-detail, .drawer{
  position:fixed;
}

/* ---------- 1. fixed parallax backdrop ---------- */
.sx-bg{
  position:fixed;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;
  contain:strict;
}
.sx-bg__grid{
  position:absolute;
  inset:-10% -10%;
  background-image:
    linear-gradient(to right, var(--grid-tint) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-tint) 1px, transparent 1px);
  background-size:104px 104px;
  -webkit-mask-image:radial-gradient(ellipse 58% 52% at 50% 40%, #000 0%, transparent 78%);
          mask-image:radial-gradient(ellipse 58% 52% at 50% 40%, #000 0%, transparent 78%);
}
.sx-orb{
  position:absolute;
  border-radius:50%;
  filter:blur(130px);
  opacity:.22;
  will-change:transform;
}
.sx-orb--warm{
  width:40vw; height:40vw;
  min-width:360px; min-height:360px;
  background:radial-gradient(circle at 35% 35%, var(--orb-warm), transparent 68%);
  top:-14vh; left:-12vw;
}
.sx-orb--violet{
  width:34vw; height:34vw;
  min-width:280px; min-height:280px;
  background:radial-gradient(circle at 60% 40%, var(--orb-violet), transparent 68%);
  top:52vh; right:-14vw;
}
.sx-orb--cyan{
  width:24vw; height:24vw;
  min-width:200px; min-height:200px;
  background:radial-gradient(circle at 50% 50%, var(--orb-cyan), transparent 68%);
  top:150vh; left:8vw;
  opacity:.5;
}
.sx-shape{ display:none; }
.sx-dust{
  position:absolute;
  width:2px; height:2px;
  border-radius:50%;
  background:rgba(255,255,255,.28);
  will-change:transform;
}
/* Positions live here, not in a style="" attribute.
   `style-src` carries a nonce and no 'unsafe-inline', and a nonce
   does NOT cover style ATTRIBUTES - only <style> elements. So every
   inline style="" on the site was being blocked outright, which left
   all four dust motes stacked at the same default position.

   `left` is deliberate, not `inset-inline-start`: the document is
   dir="rtl", so a logical property would mirror these to the other
   edge and change a layout that was chosen by eye. */
.sx-dust--a{ top:24vh;  left:22vw; }
.sx-dust--b{ top:72vh;  left:76vw; }
.sx-dust--c{ top:160vh; left:14vw; }
.sx-dust--d{ top:260vh; left:80vw; }

/* Replaces style="max-width:NNch" on intro paragraphs. The three
   pages that had it used 56/62/64ch; one value reads the same. */
.lead-measure{ max-width:62ch; }

/* ---------- 2. scroll progress ---------- */
.sx-progress{
  top:0; left:0; right:0;
  height:1.5px;
  z-index:9998;
  transform-origin:0 50%;
  transform:scaleX(0);
  background:linear-gradient(90deg, var(--ember), var(--violet), var(--cyan));
  pointer-events:none;
  opacity:.7;
}

/* ---------- 3. custom cursor ---------- */
.sx-cursor, .sx-cursor-dot{
  top:0; left:0;
  pointer-events:none;
  z-index:9999;
  border-radius:50%;
  mix-blend-mode:difference;
  will-change:transform;
}
.sx-cursor{
  width:26px; height:26px;
  margin:-13px 0 0 -13px;
  border:1px solid rgba(255,255,255,.5);
  transition:
    width .28s cubic-bezier(.22,1,.36,1),
    height .28s cubic-bezier(.22,1,.36,1),
    margin .28s cubic-bezier(.22,1,.36,1),
    background .28s,
    border-color .28s;
}
.sx-cursor-dot{
  width:3px; height:3px;
  margin:-1.5px 0 0 -1.5px;
  background:#fff;
}
.sx-cursor.is-hover{
  width:56px; height:56px;
  margin:-28px 0 0 -28px;
  background:rgba(255,255,255,.9);
  border-color:transparent;
}
@media (hover:none),(pointer:coarse){
  .sx-cursor, .sx-cursor-dot{ display:none !important; }
}

/* ---------- 4. nav sound button ---------- */
.nav-act .sound-nav{ display:grid; position:relative; }
.nav-act .sound-nav .i-off{ display:none; }
.nav-act .sound-nav:not(.on) .i-on{ display:none; }
.nav-act .sound-nav:not(.on) .i-off{ display:block; }
.nav-act .sound-nav.on{
  color:var(--ember-soft);
  border-color:var(--ember-line);
}

/* Hide the native cursor whenever the custom one is live.
   The class lives on <html> (not <body>) so it can be applied from
   an inline bootstrap in <head>, before the body is even parsed —
   that closes the "native cursor flash" during full-page navigation.
   The universal selector is required: cursor is inherited, but any
   element that explicitly sets its own cursor (.svc-row, .chat-fab,
   .music-fab, .burger, etc.) would otherwise keep the OS pointer. */
@media (hover:hover) and (pointer:fine){
  html.sx-cursor-on,
  html.sx-cursor-on *{ cursor:none; }
}


/* ================================================================
   PAGE ATMOSPHERE — per-page weather
   ----------------------------------------------------------------
   data-page on <body> overrides the ambient tokens consumed by
   .aura and .sx-bg__grid/.sx-orb. Same brand DNA, different light.

     home      ember + violet, warm and cinematic
     code      violet + cyan, cool and precise
     voice     ember + cyan, alive and signal-led
     rag       cyan + violet, cool and structured
     projects  neutral, quiet and editorial
     contact   warm ember, grounded and human
   ================================================================ */
body {
  --aura-a:    rgba(232,106,30,.16);
  --aura-b:    rgba(157,139,245,.10);
  --grid-tint: rgba(255,255,255,.018);
  --orb-warm:   rgba(232,106,30,.40);
  --orb-violet: rgba(157,139,245,.24);
  --orb-cyan:   rgba(95,212,232,.08);
}
body[data-page="code"]{
  --aura-a:    rgba(157,139,245,.16);
  --aura-b:    rgba(95,212,232,.11);
  --grid-tint: rgba(157,139,245,.030);
  --orb-warm:   rgba(157,139,245,.34);
  --orb-violet: rgba(95,212,232,.20);
  --orb-cyan:   rgba(232,106,30,.06);
}
body[data-page="voice"]{
  --aura-a:    rgba(232,106,30,.10);
  --aura-b:    rgba(95,212,232,.14);
  --grid-tint: rgba(95,212,232,.025);
  --orb-warm:   rgba(232,106,30,.30);
  --orb-violet: rgba(95,212,232,.26);
  --orb-cyan:   rgba(95,212,232,.14);
}
body[data-page="rag"]{
  --aura-a:    rgba(95,212,232,.14);
  --aura-b:    rgba(157,139,245,.12);
  --grid-tint: rgba(95,212,232,.028);
  --orb-warm:   rgba(95,212,232,.30);
  --orb-violet: rgba(157,139,245,.24);
  --orb-cyan:   rgba(232,106,30,.06);
}
body[data-page="projects"]{
  --aura-a:    rgba(232,106,30,.10);
  --aura-b:    rgba(255,255,255,.04);
  --grid-tint: rgba(255,255,255,.014);
  --orb-warm:   rgba(232,106,30,.26);
  --orb-violet: rgba(255,255,255,.10);
  --orb-cyan:   rgba(255,255,255,.05);
}
body[data-page="contact"]{
  --aura-a:    rgba(232,106,30,.18);
  --aura-b:    rgba(157,139,245,.06);
  --grid-tint: rgba(255,255,255,.012);
  --orb-warm:   rgba(232,106,30,.44);
  --orb-violet: rgba(232,106,30,.10);
  --orb-cyan:   rgba(157,139,245,.06);
}


/* ================================================================
   PAGE PORTAL — art-directed directional transitions
   ----------------------------------------------------------------
   Layers (back to front)
     1. veil         dark surface that passes through
     2. glow         warm bloom trailing the movement
     3. band         wide light band sweeping the middle
     4. embers ×6    warm particles drifting in the direction
     5. stamp        brand mark (logo + wordmark + 2 rings)
     6. brackets ×4  architectural frame at the viewport corners

   IMPORTANT
     The direction tokens --dir-x / --dir-y are NOT declared here.
     They are set by app1.js on <html> just before .page-leaving is
     added, and inherit down to every layer inside .page-portal.
   ================================================================ */
.page-portal{
  position:fixed;
  inset:0;
  z-index:9990;
  pointer-events:none;
  overflow:hidden;
  visibility:hidden;

  --portal-e:     cubic-bezier(.72, 0, .28, 1);
  --portal-e-out: cubic-bezier(.16, 1, .3, 1);
}
html.page-leaving .page-portal,
html.page-arrive  .page-portal,
html.page-reveal  .page-portal{ visibility:visible; }

/* ============================================================
   1. VEIL
   ============================================================ */
.page-portal__veil{
  position:absolute;
  inset:0;
  background:
    radial-gradient(75% 65% at 50% 50%,
      #0B0D14 0%,
      #07080E 55%,
      #05060A 100%);
  transform: translate3d(
    calc(var(--dir-x) * 100%),
    calc(var(--dir-y) * 100%),
    0
  );
  will-change: transform;
  backface-visibility: hidden;
  transform-style: flat;
  transition: transform 460ms var(--portal-e);
}

/* ============================================================
   2. GLOW
   ============================================================ */
.page-portal__glow{
  position:absolute;
  inset:0;
  background: radial-gradient(
    62% 52% at
      calc(50% - var(--dir-x) * 34%)
      calc(50% - var(--dir-y) * 34%),
    rgba(232,106,30,.26) 0%,
    rgba(157,139,245,.12) 38%,
    transparent 72%
  );
  opacity:0;
  will-change:opacity;
  backface-visibility: hidden;
  transform-style: flat;
  transition: opacity 340ms var(--portal-e) 40ms;
}

/* ============================================================
   3. BAND
   ============================================================ */
.page-portal__band{
  position:absolute;
  top:50%;
  left:50%;
  width: 170vw;
  height: 56vh;
  margin: -28vh 0 0 -85vw;
  background: radial-gradient(50% 62% at 50% 50%,
    rgba(255,238,216,.20) 0%,
    rgba(242,169,107,.11) 26%,
    rgba(232,106,30,.045) 50%,
    transparent 76%);
  opacity:0;
  transform: translate3d(
    calc(var(--dir-x) * 30%),
    calc(var(--dir-y) * 30%),
    0
  ) scale(.92);
  will-change:transform, opacity;
  backface-visibility: hidden;
  transform-style: flat;
  transition:
    transform 520ms var(--portal-e),
    opacity 340ms var(--portal-e) 50ms;
}

/* ============================================================
   4. EMBERS
   ============================================================ */
.page-portal__ember{
  position:absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle,
    #FFE6C8 0%,
    rgba(242,169,107,.7) 45%,
    transparent 78%);
  box-shadow: 0 0 10px rgba(255,206,150,.55);
  opacity:0;
  transform: translate3d(0,0,0);
  will-change: transform, opacity;
  transition:
    transform 640ms var(--portal-e),
    opacity 320ms var(--portal-e);
}
.page-portal__ember--1{ top: 32%; left: 36%; --e: 22%; transition-delay: 60ms; }
.page-portal__ember--2{ top: 58%; left: 62%; --e: 40%; transition-delay: 90ms; }
.page-portal__ember--3{ top: 44%; left: 74%; --e: 16%; transition-delay: 40ms; }
.page-portal__ember--4{ top: 68%; left: 30%; --e: 52%; transition-delay: 120ms; }
.page-portal__ember--5{ top: 26%; left: 56%; --e: 32%; transition-delay: 70ms; }
.page-portal__ember--6{ top: 76%; left: 46%; --e: 44%; transition-delay: 100ms; }

/* ============================================================
   5. BRAND STAMP
   ============================================================ */
.page-portal__stamp{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.94);
  display: grid;
  justify-items: center;
  gap: 14px;
  opacity: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-style: flat;
  transition:
    transform 520ms var(--portal-e-out),
    opacity 340ms var(--portal-e);
}
.page-portal__stamp::before{
  content:'';
  position: absolute;
  top: 50%; left: 50%;
  width: 340px; height: 340px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(232,106,30,.16) 0%,
    rgba(232,106,30,.05) 42%,
    transparent 72%);
  pointer-events: none;
}
.page-portal__mark{
  position: relative;
  width: clamp(56px, 7vw, 84px);
  height: auto;
  filter: drop-shadow(0 0 26px rgba(232,106,30,.6));
}
.page-portal__word{
  position: relative;
  font-family:var(--font-site);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(242,169,107,.82);
  white-space: nowrap;
}
.page-portal__ring{
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(242,169,107,.42);
  transform: translate(-50%, -50%) scale(.85);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-style: flat;
}
.page-portal__ring--a{
  width: 148px; height: 148px;
  transition:
    transform 780ms var(--portal-e-out) 60ms,
    opacity 340ms var(--portal-e) 60ms;
}
.page-portal__ring--b{
  width: 232px; height: 232px;
  border-color: rgba(157,139,245,.34);
  transition:
    transform 900ms var(--portal-e-out) 160ms,
    opacity 340ms var(--portal-e) 160ms;
}

/* ============================================================
   6. CORNER BRACKETS — safe-area aware
   ============================================================ */
.page-portal__bracket{
  position: absolute;
  width: 42px;
  height: 42px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition:
    transform 480ms var(--portal-e-out),
    opacity 320ms var(--portal-e);
}
.page-portal__bracket--tl{
  top: calc(34px + env(safe-area-inset-top, 0px));
  left: calc(34px + env(safe-area-inset-left, 0px));
  border-top: 1px solid rgba(242,169,107,.5);
  border-left: 1px solid rgba(242,169,107,.5);
  transform: translate(-10px, -10px);
}
.page-portal__bracket--tr{
  top: calc(34px + env(safe-area-inset-top, 0px));
  right: calc(34px + env(safe-area-inset-right, 0px));
  border-top: 1px solid rgba(242,169,107,.5);
  border-right: 1px solid rgba(242,169,107,.5);
  transform: translate(10px, -10px);
}
.page-portal__bracket--bl{
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  left: calc(34px + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(242,169,107,.5);
  border-left: 1px solid rgba(242,169,107,.5);
  transform: translate(-10px, 10px);
}
.page-portal__bracket--br{
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  right: calc(34px + env(safe-area-inset-right, 0px));
  border-bottom: 1px solid rgba(242,169,107,.5);
  border-right: 1px solid rgba(242,169,107,.5);
  transform: translate(10px, 10px);
}

/* ============================================================
   STATE: LEAVING — old page
   ============================================================ */
html.page-leaving .page-portal__veil{
  transform: translate3d(0, 0, 0);
}
html.page-leaving .page-portal__glow{ opacity:1; }

html.page-leaving .page-portal__band{
  opacity:1;
  transform: translate3d(
    calc(var(--dir-x) * -6%),
    calc(var(--dir-y) * -6%),
    0
  ) scale(1);
}

html.page-leaving .page-portal__ember{
  opacity:1;
  transform: translate3d(
    calc(var(--dir-x) * var(--e)),
    calc(var(--dir-y) * var(--e)),
    0
  );
}

html.page-leaving .page-portal__stamp{
  opacity:1;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 170ms;
}
html.page-leaving .page-portal__ring{
  opacity:1;
  transform: translate(-50%, -50%) scale(1.35);
}
html.page-leaving .page-portal__bracket{
  opacity:1;
  transform: translate(0, 0);
  transition-delay: 130ms;
}

html.page-leaving main,
html.page-leaving .footer{
  transform: translate3d(
    calc(var(--dir-x) * -58px),
    calc(var(--dir-y) * -58px),
    0
  ) scale(.985);
  opacity:.38;
  transition:
    transform 440ms var(--portal-e),
    opacity 400ms var(--portal-e);
}
html.page-leaving .nav{
  transform: translate3d(
    calc(var(--dir-x) * -28px),
    calc(var(--dir-y) * -28px),
    0
  );
  opacity:0;
  transition:
    transform 400ms var(--portal-e),
    opacity 380ms var(--portal-e);
}

/* ============================================================
   STATE: ARRIVING — new page, pre-paint
   ============================================================ */
html.page-arrive .page-portal__veil{
  transform: translate3d(0, 0, 0);
  transition:none;
}
html.page-arrive .page-portal__glow{
  opacity:1;
  transition:none;
}
html.page-arrive .page-portal__band{
  opacity:1;
  transform: translate3d(
    calc(var(--dir-x) * -6%),
    calc(var(--dir-y) * -6%),
    0
  ) scale(1);
  transition:none;
}
html.page-arrive .page-portal__ember{
  opacity:1;
  transform: translate3d(
    calc(var(--dir-x) * var(--e)),
    calc(var(--dir-y) * var(--e)),
    0
  );
  transition:none;
}
html.page-arrive .page-portal__stamp{
  opacity:1;
  transform: translate(-50%, -50%) scale(1);
  transition:none;
}
html.page-arrive .page-portal__ring{
  opacity:1;
  transform: translate(-50%, -50%) scale(1.35);
  transition:none;
}
html.page-arrive .page-portal__bracket{
  opacity:1;
  transform: translate(0, 0);
  transition:none;
}
html.page-arrive main,
html.page-arrive .footer{
  transform: translate3d(
    calc(var(--dir-x) * 64px),
    calc(var(--dir-y) * 64px),
    0
  );
  opacity:0;
  transition:none;
}
html.page-arrive .nav{
  opacity:0;
  transition:none;
}

/* ============================================================
   STATE: REVEALING — new page, JS-driven
   ============================================================ */
html.page-reveal .page-portal__veil{
  transform: translate3d(
    calc(var(--dir-x) * -100%),
    calc(var(--dir-y) * -100%),
    0
  );
  transition: transform 580ms var(--portal-e);
}
html.page-reveal .page-portal__glow{
  opacity:0;
  transition: opacity 420ms var(--portal-e) 140ms;
}
html.page-reveal .page-portal__band{
  opacity:0;
  transform: translate3d(
    calc(var(--dir-x) * 22%),
    calc(var(--dir-y) * 22%),
    0
  ) scale(1.06);
  transition:
    transform 560ms var(--portal-e),
    opacity 420ms var(--portal-e) 80ms;
}
html.page-reveal .page-portal__ember{
  opacity:0;
  transform: translate3d(
    calc(var(--dir-x) * var(--e) * 1.6),
    calc(var(--dir-y) * var(--e) * 1.6),
    0
  );
  transition:
    transform 560ms var(--portal-e),
    opacity 380ms var(--portal-e) 80ms;
}
html.page-reveal .page-portal__stamp{
  opacity:0;
  transform: translate(-50%, -50%) scale(1.06);
  transition:
    transform 480ms var(--portal-e),
    opacity 320ms var(--portal-e);
}
html.page-reveal .page-portal__ring{
  opacity:0;
  transform: translate(-50%, -50%) scale(1.85);
  transition:
    transform 640ms var(--portal-e-out),
    opacity 400ms var(--portal-e) 80ms;
}
html.page-reveal .page-portal__bracket{
  opacity:0;
  transform: translate(
    calc(var(--dir-x) * 10px),
    calc(var(--dir-y) * 10px)
  );
  transition:
    transform 480ms var(--portal-e),
    opacity 280ms var(--portal-e) 40ms;
}
html.page-reveal main,
html.page-reveal .footer{
  transform: none;
  opacity:1;
  transition:
    transform 580ms var(--portal-e),
    opacity 500ms var(--portal-e) 60ms;
}
html.page-reveal .nav{
  opacity:1;
  transition: opacity 420ms var(--portal-e) 220ms;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  .page-portal__veil{
    transform: translate3d(0, 0, 0) !important;
    transition: opacity 120ms linear !important;
    opacity: 0;
  }
  .page-portal__glow,
  .page-portal__band,
  .page-portal__ember,
  .page-portal__stamp,
  .page-portal__ring,
  .page-portal__bracket{ display:none; }

  html.page-leaving .page-portal__veil{ opacity:1; }
  html.page-arrive  .page-portal__veil{ opacity:1; }
  html.page-reveal  .page-portal__veil{ opacity:0; }

  html.page-leaving main,
  html.page-leaving .footer,
  html.page-leaving .nav,
  html.page-arrive main,
  html.page-arrive .footer,
  html.page-arrive .nav,
  html.page-reveal main,
  html.page-reveal .footer,
  html.page-reveal .nav{
    transform:none !important;
    transition: opacity 140ms linear !important;
  }
}

/* ============================================================
   MOBILE — up to 900px
   ------------------------------------------------------------
   Strategy:
     1. Pin the portal with translateZ(0) and 100dvh so it
        matches the visual viewport exactly.
     2. Veil: opacity only. No directional transform.
     3. Stamp: full-bleed grid; children centred by layout.
     4. Content nudge: none. main / .footer / .nav fade only.

   Duration is aligned with app1.js:  EXIT_MS = 320ms on mobile.
   ============================================================ */
@media (max-width: 900px){

  /* ---------- 1. Portal container ---------- */
  .page-portal{
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: opacity;
  }

  /* ---------- 2. Veil: opacity only ---------- */
  .page-portal__veil{
    transform: none !important;
    -webkit-transform: none !important;
    opacity: 0;
    transition: opacity 320ms var(--portal-e);
    will-change: opacity;
  }
  html.page-leaving .page-portal__veil{ opacity: 1; }
  html.page-arrive  .page-portal__veil{
    opacity: 1;
    transition: none;
  }
  html.page-reveal  .page-portal__veil{
    opacity: 0;
    transition: opacity 400ms var(--portal-e);
  }

  /* ---------- 3. Glow: centred, fades with the veil ---------- */
  .page-portal__glow{
    background: radial-gradient(
      62% 52% at 50% 50%,
      rgba(232,106,30,.22) 0%,
      rgba(157,139,245,.10) 38%,
      transparent 72%
    );
    transition: opacity 280ms var(--portal-e) 30ms;
  }

  /* ---------- 4. Stamp: full-bleed grid centring ---------- */
  .page-portal__stamp{
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: scale(.96);
    transform-origin: center center;
    display: grid;
    place-items: center;
    align-content: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    transition:
      transform 320ms var(--portal-e-out),
      opacity 300ms var(--portal-e);
  }
  html.page-leaving .page-portal__stamp{
    opacity: 1;
    transform: scale(1);
    transition-delay: 120ms;
  }
  html.page-arrive .page-portal__stamp{
    opacity: 1;
    transform: scale(1);
    transition: none;
  }
  html.page-reveal .page-portal__stamp{
    opacity: 0;
    transform: scale(1.05);
    transition:
      transform 340ms var(--portal-e),
      opacity 240ms var(--portal-e);
  }

  .page-portal__stamp::before{
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
  }

  /* ---------- 5. Rings — anchored to the stamp's centre ---------- */
  .page-portal__ring--a{
    width: 112px;
    height: 112px;
    transition:
      transform 560ms var(--portal-e-out) 40ms,
      opacity 260ms var(--portal-e) 40ms;
  }
  .page-portal__ring--b{ display: none; }

  /* ---------- 6. Trim the decorative layers ---------- */
  .page-portal__band{ display: none; }
  .page-portal__ember--3,
  .page-portal__ember--6{ display: none; }

  .page-portal__ember{
    transition:
      transform 520ms var(--portal-e),
      opacity 280ms var(--portal-e);
  }

  /* ---------- 7. Corner brackets ---------- */
  .page-portal__bracket{
    width: 28px;
    height: 28px;
    transition:
      transform 340ms var(--portal-e),
      opacity 200ms var(--portal-e) 30ms;
  }
  .page-portal__bracket--tl{
    top: calc(18px + env(safe-area-inset-top, 0px));
    left: calc(18px + env(safe-area-inset-left, 0px));
  }
  .page-portal__bracket--tr{
    top: calc(18px + env(safe-area-inset-top, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
  }
  .page-portal__bracket--bl{
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    left: calc(18px + env(safe-area-inset-left, 0px));
  }
  .page-portal__bracket--br{
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
  }

  /* ---------- 8. Content: fade only, no nudge ---------- */
  html.page-leaving main,
  html.page-leaving .footer{
    transform: none !important;
    opacity: .5;
    transition: opacity 280ms var(--portal-e);
  }
  html.page-arrive main,
  html.page-arrive .footer{
    transform: none !important;
    opacity: 0;
    transition: none;
  }
  html.page-reveal main,
  html.page-reveal .footer{
    transform: none !important;
    opacity: 1;
    transition: opacity 360ms var(--portal-e) 40ms;
  }

  html.page-leaving .nav{
    transform: none !important;
    opacity: 0;
    transition: opacity 260ms var(--portal-e);
  }
  html.page-arrive .nav{
    transform: none !important;
    opacity: 0;
    transition: none;
  }
  html.page-reveal .nav{
    transform: none !important;
    opacity: 1;
    transition: opacity 300ms var(--portal-e) 120ms;
  }

  /* ---------- 9. Sizing ---------- */
  .page-portal__mark{ width: 52px; }
  .page-portal__word{
    font-size: 11px;
    letter-spacing: .04em;
  }
}

/* ============================================================
   VERY NARROW — up to 480px
   ============================================================ */
@media (max-width: 480px){
  .page-portal__mark{ width: 46px; }
  .page-portal__word{ font-size: 10.5px; }
  .page-portal__stamp::before{ width: 180px; height: 180px; }
  .page-portal__ring--a{ width: 96px; height: 96px; }

  .page-portal__bracket{ width: 24px; height: 24px; }
  .page-portal__bracket--tl{
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: calc(14px + env(safe-area-inset-left, 0px));
  }
  .page-portal__bracket--tr{
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
  }
  .page-portal__bracket--bl{
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: calc(14px + env(safe-area-inset-left, 0px));
  }
  .page-portal__bracket--br{
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
  }
}

/* ================================================================
   Fullscreen WebGL quad layered inside .sx-bg. Screen-blended on
   top of the existing grid and orbs. Never intercepts input.
   ================================================================ */
#phoenixStream{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  pointer-events:none;
  mix-blend-mode:screen;
  z-index:2;
  opacity:.96;
  transition:opacity 900ms var(--e, cubic-bezier(.2,.7,.2,1)),
             filter  900ms var(--e, cubic-bezier(.2,.7,.2,1));
  will-change:opacity, filter;
  image-rendering:auto;
  filter:saturate(1.02) contrast(1.01);
}

/* Quiet the legacy orbs — the ribbon family is now the lead light source */
.sx-orb       { opacity:.08; }
.sx-orb--cyan { opacity:.26; }
.sx-dust      { opacity:.50; }

/* ---------------- Per-page atmosphere ---------------- */
/* Home (default): strongest cinematic stream — no override needed. */

/* AI / RAG: subtle cool atmosphere, slightly more data-oriented */
body[data-page="rag"] #phoenixStream{
  opacity:.90;
  filter:saturate(.96) hue-rotate(-4deg);
}

/* Voice: slightly warmer, more organic */
body[data-page="voice"] #phoenixStream{
  opacity:1;
  filter:saturate(1.06) brightness(1.02);
}
body[data-page="voice"] .sx-orb--warm{ opacity:.13; }

/* Projects: restrained, elegant */
body[data-page="projects"] #phoenixStream{
  opacity:.78;
  filter:saturate(.90) brightness(.98);
}

/* Contact: softer, calmer */
body[data-page="contact"] #phoenixStream{
  opacity:.85;
  filter:saturate(.95);
}
body[data-page="contact"] .sx-orb--warm{ opacity:.15; }

/* ---------------- Mobile — smaller, warmer, cheaper ---------------- */
@media (max-width:900px){
  #phoenixStream { opacity:.80; }
  .sx-orb        { opacity:.06; }
  .sx-orb--cyan  { opacity:.20; }
  .sx-dust       { opacity:.36; }
}

/* ---------------- Reduced motion — one soft static frame ---------------- */
@media (prefers-reduced-motion: reduce){
  #phoenixStream{
    opacity:.60;
    transition:none;
  }
}


/* ================================================================
   RESPONSIVE HARDENING
   ----------------------------------------------------------------
   These rules fill the gaps between the existing breakpoints.
   Nothing above this point is overridden unless specifically
   targeted here.

   Breakpoints
     380px   ultra-narrow phones (Galaxy Fold cover, old 320s)
     480px   small phones                (iPhone SE, small Androids)
     640px   large phones landscape
     768px   tablets portrait
     900px   nav breakpoint (existing)
     1024px  tablets landscape / small laptops
     1280px  standard desktop            (existing)
     1800px  ultrawide / large 4K panels
     short   landscape phones (height ≤ 500px)
   ================================================================ */

/* ================================================================
   GRAPHICS TIERS — data-gfx on <html>
   ----------------------------------------------------------------
   `high` is the full experience and needs no rules here: it is the
   whole stylesheet above. These blocks only take things AWAY.

   Set before first paint by the inline script in config.php, and
   lowered afterwards by app1.js if the measured frame rate says the
   machine cannot hold it. Nothing is removed from the DOM — every
   element stays exactly where it is, it just stops costing anything
   to composite.

   What is expensive here, roughly in order:
     · filter: blur(110-130px) on the aura and orb layers. A blurred
       layer has to be rasterised at size, and these are viewport
       sized. Three or four of them is most of the GPU budget on
       integrated graphics.
     · backdrop-filter on anything fixed. While a backdrop-filtered
       element is on screen the browser recomposites what is behind
       it every frame of every scroll.
     · the fullscreen WebGL quad (handled in phoenix-stream.js).
     · the custom cursor, which is a rAF loop that writes a transform
       on every pointer move (handled in app1.js).
   ================================================================ */

/* ---------------- mid: a clean static backdrop ----------------
   The line between the tiers:

     mid  no decorative BACKGROUND. The shader, the blurred orbs, the
          aura and the dust all go; the backdrop becomes a static
          gradient. Everything to do with the CONTENT stays - scroll
          reveals, hover transitions, card shadows, the grid texture,
          page transitions.
     low  also drops content motion: reveals become instant,
          decorative animations stop, shadows go.

   Reducing the blur radius was the first attempt here and it was not
   enough. A blurred layer still has to be rasterised at its own size
   and re-composited; four of them (three orbs plus the aura), moving
   under parallax, is the most expensive thing left on the page once
   the shader is gone. On the class of machine that now lands in
   `mid` - 4 cores, integrated or entry-level graphics - the honest
   answer is not to paint them at all.
   ---------------------------------------------------------------- */
html[data-gfx="mid"] .aura,
html[data-gfx="mid"] .sx-orb,
html[data-gfx="mid"] .sx-dust,
html[data-gfx="mid"] .sx-shape{
  display:none !important;
}

/* The WebGL backdrop is gone at `mid` as well as `low` (the canvas is
   never created - see phoenix-stream.js), so the fixed backdrop needs
   its own colour at both tiers or the page falls to flat black where
   the shader used to be. */
html[data-gfx="mid"] #phoenixStream,
html[data-gfx="low"] #phoenixStream{ display:none !important; }
html[data-gfx="mid"] .sx-bg,
html[data-gfx="low"] .sx-bg{
  background:
    radial-gradient(1100px 680px at 72% -10%, rgba(232,106,30,.07), transparent 70%),
    radial-gradient(900px 620px at 8% 12%, rgba(124,92,255,.05), transparent 72%),
    var(--surface-0);
}

/* The chat launcher's ring is a conic-gradient clipped by a mask and
   rotated forever. Conic gradient + mask + animation is one of the
   more expensive things a small element can do, and it runs on every
   page whether or not anyone looks at it. */
html[data-gfx="mid"] .chat-fab::after,
html[data-gfx="low"] .chat-fab::after{ display:none; }

/* The page-transition portal is a full-viewport stack of blurred,
   animated layers. At `mid` it keeps the veil - so navigation still
   reads as a deliberate transition - and loses the decoration on top
   of it, which is what costs. */
html[data-gfx="mid"] .page-portal__glow,
html[data-gfx="mid"] .page-portal__band,
html[data-gfx="mid"] .page-portal__ember,
html[data-gfx="mid"] .page-portal__ring{ display:none !important; }

/* Fixed + backdrop-filter is the worst combination for scrolling.
   The near-opaque background keeps the same reading. */
html[data-gfx="mid"] .nav.stuck,
html[data-gfx="low"] .nav.stuck{
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
  background:rgba(7,8,10,.94);
}
html[data-gfx="mid"] .chat-fab,
html[data-gfx="low"] .chat-fab,
html[data-gfx="mid"] .music-fab,
html[data-gfx="low"] .music-fab,
html[data-gfx="mid"] .reel-loader,
html[data-gfx="low"] .reel-loader{
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
}
html[data-gfx="mid"] .chat-fab,
html[data-gfx="low"] .chat-fab{ background:rgba(16,12,10,.94); }
html[data-gfx="mid"] .music-fab,
html[data-gfx="low"] .music-fab{ background:rgba(12,14,20,.92); }

/* ---------------- low: decoration off, content untouched ---------------- */
html[data-gfx="low"] .aura,
html[data-gfx="low"] .sx-orb,
html[data-gfx="low"] .sx-dust,
html[data-gfx="low"] .sx-shape,
html[data-gfx="low"] .sx-bg__grid{
  display:none !important;
}
html[data-gfx="low"] .sx-cursor,
html[data-gfx="low"] .sx-cursor-dot,
html[data-gfx="mid"] .sx-cursor,
html[data-gfx="mid"] .sx-cursor-dot{
  display:none !important;
}
/* The custom cursor is hidden, so the real one has to come back. */
html[data-gfx="mid"],
html[data-gfx="low"],
html[data-gfx="mid"] *,
html[data-gfx="low"] *{
  cursor:auto;
}
html[data-gfx="mid"] a, html[data-gfx="low"] a,
html[data-gfx="mid"] button, html[data-gfx="low"] button,
html[data-gfx="mid"] [role="button"], html[data-gfx="low"] [role="button"],
html[data-gfx="mid"] .svc-row, html[data-gfx="low"] .svc-row{
  cursor:pointer;
}
html[data-gfx="mid"] .chat-top, html[data-gfx="low"] .chat-top{ cursor:grab; }
html[data-gfx="mid"] input, html[data-gfx="low"] input,
html[data-gfx="mid"] textarea, html[data-gfx="low"] textarea{ cursor:text; }

/* The portal is a full-viewport stack of blurred, animated layers.
   At `low` the page transition becomes a plain fade. */
html[data-gfx="low"] .page-portal__glow,
html[data-gfx="low"] .page-portal__band,
html[data-gfx="low"] .page-portal__ember,
html[data-gfx="low"] .page-portal__ring,
html[data-gfx="low"] .page-portal__bracket{
  display:none !important;
}

/* Long decorative loops cost a composite per frame forever, even
   when nothing is scrolling. */
html[data-gfx="low"] .hint-arrow,
html[data-gfx="low"] .music-eq i,
html[data-gfx="low"] .chat-fab::after,
html[data-gfx="low"] .loader-ring{
  animation:none !important;
}
html[data-gfx="low"] .music-fab.playing{ animation:none !important; }

/* Entrance reveals become instant rather than animated. */
html[data-gfx="low"] [data-rv].seen{ transition:none; }
html[data-gfx="low"] .rv > i{ transition:none; }
html[data-gfx="low"] .stg{ transition:none; }

/* Shadows are cheap individually and add up across a long page. */
html[data-gfx="low"] .card,
html[data-gfx="low"] .proj,
html[data-gfx="low"] .err-link{ box-shadow:none; }

/* Voice cloud: the blur radii come down with the tier. voice-cloud.js
   also builds fewer bars and blobs and drops the goo filter — see the
   TIERS table there. */
html[data-gfx="mid"] .vc-bloom{ filter:blur(26px); }
html[data-gfx="mid"] .vc-spec{ filter:blur(10px); }
html[data-gfx="mid"] .vc-floor{ filter:blur(14px); }
html[data-gfx="low"] .vc-bloom{ display:none; }
html[data-gfx="low"] .vc-spec,
html[data-gfx="low"] .vc-floor,
html[data-gfx="low"] .vc-hot{ filter:none; }


/* ---------- Ultra-narrow phones (≤380px) ---------- */
@media (max-width: 380px){
  :root{ --pad:14px; }
  body{ font-size:15px; line-height:1.8; }

  .t-display{ font-size:clamp(1.7rem, 8.6vw, 2rem); line-height:1.18; }
  .t-h2{ font-size:clamp(1.28rem, 6.8vw, 1.55rem); }
  .t-h3{ font-size:1rem; }
  .t-lead{ font-size:14.5px; line-height:1.9; }

  .section{ padding-block:clamp(52px, 11vw, 72px); }
  .section-head{ margin-bottom:36px; }
  .section-head .t-lead{ margin-top:14px; }

  /* Nav — compress brand block and buttons */
  .nav{ padding:10px var(--pad); gap:10px; }
  .brand img{ width:30px; height:30px; }
  .brand-tx b{ font-size:14px; letter-spacing:0; }
  .brand-tx span{ font-size:8px; letter-spacing:.14em; margin-top:2px; }
  .nav-act .btn-primary{ min-height:34px; padding:0 12px; font-size:12.5px; }
  .burger{ width:34px; height:34px; }

  .card{ padding:20px 16px; border-radius:var(--r-md); }
  .card h3{ font-size:1rem; margin-bottom:9px; }
  .card p{ font-size:.9rem; }
  .card .ico{ width:34px; height:34px; margin-bottom:14px; }
  .chip{ font-size:.76rem; padding:5px 10px; }

  .svc-row{ gap:12px; padding:18px 0; min-height:64px; }
  .svc-row h3{ font-size:clamp(1.05rem, 5.4vw, 1.3rem); }
  .svc-row .num{ font-size:11px; min-width:26px; }
  .svc-row .go{ width:28px; height:28px; }

  .step{ grid-template-columns:auto 1fr; gap:14px; padding:22px 0; }
  .step::before{ font-size:22px; padding-top:4px; }
  .step h3{ font-size:16px; margin-bottom:7px; }
  .step p{ font-size:14px; }

  .btn{ min-height:42px; padding:0 16px; font-size:13.5px; border-radius:var(--r-sm); }
  .btn-lg{ min-height:46px; padding:0 18px; font-size:14px; }
  .slide-cta{ gap:8px; margin-top:20px; }

  /* Mobile hero: tighter type, less scrim */
  .mob-hero-copy{ padding:22px 16px calc(30px + env(safe-area-inset-bottom)); }
  .mob-hero-copy .t-display{ font-size:clamp(24px, 8.8vw, 32px); margin-block:6px 8px; }
  .mob-hero-copy .t-lead{ font-size:13.5px; line-height:1.8; }
  .mob-hero-copy .eyebrow{ font-size:11.5px; margin-bottom:10px; }

  .mob-chapter{ padding:44px 16px 40px; }
  .mob-chapter .t-h2{ font-size:clamp(22px, 6.8vw, 26px); }
  .mob-chapter .t-lead{ font-size:13.5px; }

  /* Floating panels — full width with slim margins */
  .chat-fab{ inset-inline-start:14px; bottom:14px; width:44px; height:44px; }
  .chat-fab img{ width:22px; height:22px; }
  .music-fab{ bottom:14px; inset-inline-end:14px; width:34px; height:34px; }
  .music-fab svg{ width:12px; height:12px; }

  .chat-panel{
    bottom:max(8px, env(safe-area-inset-bottom));
    /* inset-inline + width:auto rather than width:calc(100vw - 20px):
       100vw includes the scrollbar gutter, so the calc version can be
       a few pixels wider than the content box and push the page into
       a horizontal scroll. */
    inset-inline:8px;
    width:auto;
    height:min(78dvh, calc(100dvh - 92px));
    border-radius:18px;
  }
  .chat-top{ padding:11px; gap:9px; }
  .chat-top img{ width:24px; height:24px; }
  .chat-body{ padding:14px 12px; gap:11px; }
  .msg{ max-width:94%; }
  .msg .bub{ padding:9px 12px; font-size:14px; }
  /* 16px, not 13.5px. iOS Safari zooms the whole page when a focused
     form control is under 16px, and the page cannot zoom back out on
     its own - so a tap in the chat box left the visitor on a
     magnified, sideways-scrolling layout. */
  .chat-input textarea{ font-size:16px; }

  /* Footers */
  .footer{ padding-block:44px 24px; }
  .footer-grid{ gap:26px; }
  .footer .brand img{ width:42px; height:42px; }
  .footer .brand-tx b{ font-size:17px; }
  .footer h4{ font-size:10px; padding-bottom:11px; margin-bottom:12px; }
  .footer li a{ font-size:13px; padding:6px 0; }
  .footer-btm{ font-size:11.5px; gap:8px; }

  /* Pipes and pipelines */
  .pipe-n{ width:2.2rem; height:2.2rem; font-size:12px; }
  .pipe-body h3{ font-size:16px; }
  .pipe-body p{ font-size:13.5px; }

  /* Contact form.
     Font size stays at 16px for the same iOS zoom-on-focus reason as
     the chat box above; only the padding tightens. */
  .field input, .field textarea, .field select{
    padding:11px 12px; font-size:16px;
    border-radius:var(--r-sm);
  }
  .field label{ font-size:.9rem; }
}

/* ---------- Small phones (381px – 480px) ---------- */
@media (min-width: 381px) and (max-width: 480px){
  :root{ --pad:18px; }
  body{ font-size:15.5px; }

  .t-display{ font-size:clamp(1.85rem, 7.5vw, 2.2rem); }
  .t-h2{ font-size:clamp(1.4rem, 6vw, 1.7rem); }

  .section{ padding-block:clamp(60px, 12vw, 88px); }
  .section-head{ margin-bottom:44px; }
}

/* ---------- Landscape phones & very short viewports ---------- */
@media (max-height: 500px) and (orientation: landscape){
  .nav{ padding:8px var(--pad); }
  .brand img{ width:30px; height:30px; }
  .brand-tx span{ display:none; }
  .brand-tx b{ font-size:15px; }
  .nav-links a{ padding:5px 9px; font-size:12.5px; }
  .nav-act .btn-primary{ min-height:32px; padding:0 12px; font-size:12.5px; }

  .mob-hero{ align-items:flex-end; }
  .mob-hero-copy{ padding:18px 22px calc(16px + env(safe-area-inset-bottom)); }
  .mob-hero-copy .t-display{
    font-size:clamp(20px, 4vw, 28px);
    margin-block:6px 8px;
  }
  .mob-hero-copy .t-lead{
    font-size:13px;
    line-height:1.7;
  }
  .mob-hero-copy .slide-cta{
    flex-direction:row;
    flex-wrap:wrap;
    gap:8px;
    margin-top:12px;
  }
  .mob-hero-copy .slide-cta .btn{
    width:auto;
    flex:1 1 auto;
    min-width:0;
    min-height:38px;
    font-size:12.5px;
    padding:0 14px;
  }

  .reel-copy{ padding-block:60px 80px; }
  .reel-slide{ width:clamp(260px, 55%, 480px); }
  .reel-slide .t-h2{ font-size:clamp(16px, 3.2vh, 24px); }
  .reel-slide .t-lead{ font-size:clamp(12px, 1.7vh, 14.5px); }
  .reel-slide .slide-cta .btn-lg{ min-height:36px; padding:0 14px; font-size:12px; }
  .reel-slide .chips{ margin-top:14px; }

  .section{ padding-block:44px; }
  .section-head{ margin-bottom:24px; }
  .page-hero{ padding-block:88px 32px; }

  .svc-row{ min-height:56px; padding-block:12px; }
  .svc-row h3{ font-size:1.1rem; }

  .chat-panel{
    bottom:0; inset-inline:0;
    width:100%;
    height:calc(100dvh - 30px);
    border-radius:var(--r-lg) var(--r-lg) 0 0;
  }
  .chat-fab, .music-fab{ bottom:10px; }

  .reel-hint{ display:none; }
  .reel-rail{ gap:10px; }
  .reel-rail button{ height:22px; }
}

/* ---------- Tablets portrait & small laptops (900–1100) ---------- */
@media (min-width: 900px) and (max-width: 1100px){
  .section-head{ max-width:580px; }
  .svc-row h3{ font-size:clamp(1.35rem, 2.7vw, 1.85rem); }
  .reel-slide{ width:clamp(340px, 46%, 520px); }
  .page-hero-grid{ gap:40px; }
  .product-grid, .voice-grid, .contact-grid{ gap:36px; }
}

/* ---------- Short-height desktops (wide but not tall) ---------- */
@media (min-width: 901px) and (max-height: 720px){
  .section{ padding-block:clamp(56px, 8vh, 96px); }
  .page-hero{ padding-block:100px 48px; }
  .product-grid, .voice-grid, .contact-grid, .page-hero-grid{ gap:36px; }
}

/* ---------- Ultrawide (≥1800px) ---------- */
@media (min-width: 1800px){
  :root{ --maxw:1380px; }
  body{ font-size:17.5px; }
  .section{ padding-block:clamp(140px, 9vw, 200px); }
  .section-head{ max-width:720px; margin-bottom:clamp(64px, 5vw, 96px); }
  .t-display{ font-size:clamp(56px, 3.4vw, 82px); }
  .t-h2{ font-size:clamp(42px, 2.4vw, 58px); }
  .t-h3{ font-size:clamp(20px, 1.1vw, 26px); }
  .t-lead{ font-size:clamp(18px, 1vw, 22px); }
  .reel-slide{ width:clamp(420px, 38%, 660px); }
  .grid{ gap:26px; }
}

/* ---------- Very short-and-very-wide (degraded laptop screens) ---------- */
@media (max-width: 1400px) and (max-height: 620px){
  .nav{ padding-block:8px; }
  .brand img{ width:34px; height:34px; }
  .brand-tx b{ font-size:15px; }
  .section{ padding-block:44px; }
  .page-hero{ padding-block:88px 32px; }
}

/* ---------- Orientation change — prevent layout jump ---------- */
@media (orientation: landscape) and (max-width: 900px){
  .mob-hero-copy .slide-cta{ flex-direction:row; flex-wrap:wrap; }
  .mob-hero-copy .slide-cta .btn{ width:auto; flex:1 1 auto; }
}


/* ================================================================
   REEL LOADER — mirrors the #loader visual
   ----------------------------------------------------------------
   DOM is built by reel.js (LoaderUI.install). The container
   #reelLoader sits inside .reel-stage as a glassy veil over the
   canvas; the inner structure reuses the same class names as the
   main #loader so both look identical.

   Selectors targeted:
     .reel-loader (existing container styles from section 11)
     .reel-loader .loader-core
     .reel-loader .loader-mark
     .reel-loader .loader-bar
     .reel-loader .loader-word
     .reel-loader__pct
     .reel-loader__label
   ================================================================ */

/* Tighten the core stack for the smaller reel overlay */
.reel-loader .loader-core{
  gap:16px;
}

/* Slightly smaller mark than the full-page loader */
.reel-loader .loader-mark{
  width:clamp(78px, 9.5vw, 104px);
}

/* Shorter progress bar */
.reel-loader .loader-bar{
  width:clamp(130px, 16vw, 180px);
}

/* Softer wordmark */
.reel-loader .loader-word{
  font-size:11.5px;
  letter-spacing:.24em;
  opacity:.72;
}

/* ---- Percentage readout ----------------------------------- */
.reel-loader__pct{
  font-family:var(--font-site);
  font-size:15px;
  letter-spacing:.18em;
  color:rgba(255,255,255,.86);
  font-weight:600;
  text-transform:uppercase;
  min-width:56px;
  text-align:center;
  font-variant-numeric:tabular-nums;
  line-height:1;
}

/* ---- Status label ----------------------------------------- */
.reel-loader__label{
  font-size:10.5px;
  letter-spacing:.22em;
  color:rgba(255,255,255,.42);
  text-transform:uppercase;
  text-align:center;
  line-height:1;
  margin-top:-4px;
}



/* Hard scroll lock — applied while the reel loader is on screen.
   Multiple layers so nothing can override it:
     · class on <html> (highest specificity without !important)
     · overflow + touch-action on both html and body
     · inline styles set by JS as a second belt
   Inline styles are still cleared on unlock, so no residue. */
html.gh-locked,
html.gh-locked body{
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
  height: 100% !important;
}

/* ================================================================
   END OF FILE
   ================================================================ */

/* Shared content and numeral sizing */
.section-head > :is(.t-h2, .t-display),
.page-hero :is(.t-display, .t-h2){ text-wrap:balance; }
.section-head .t-lead,
.card p,
.proj-body > p:not(.proj-meta){ text-wrap:pretty; }
.t-mono{ letter-spacing:normal; }
.section .t-lead,
.page-hero .t-lead{ font-size:clamp(1.0625rem, 1rem + .5vw, 1.28rem); }
.card p, .proj-body > p:not(.proj-meta){ font-size:1.03rem; }
.card, .proj, .mark-card{ border-radius:var(--r-lg); }
.card, .proj{ box-shadow:0 12px 30px -24px #000c; }
.card:hover, .proj:hover{ border-color:var(--ember-line); }
@media (min-width:901px){
  .nav-links a{ font-size:.98rem; }
}
@media (max-width:768px){
  .section .t-lead,
  .page-hero .t-lead{ font-size:1.05rem; }
  .mob-hero-copy .t-lead,
  .mob-chapter .t-lead{ font-size:1rem; }
}
.svc-row .num,
.step::before,
.pipe-n,
.vcount,
a[href^="tel:"] bdi,
.err-code,
.reel-loader__pct{
  font-variant-numeric:lining-nums tabular-nums;
  font-weight:700;
}
.svc-row .num{ font-size:clamp(1.125rem, 1rem + .55vw, 1.45rem); }
.step::before{ font-size:clamp(1.35rem, 1.15rem + .6vw, 1.8rem); }
.pipe-n{ font-size:clamp(1.125rem, 1rem + .45vw, 1.4rem); }
.vcount{ font-size:1rem; }
a[href^="tel:"] bdi{ font-size:1.12em; }
.err-code{ font-size:1.2em; }

.section-head .eyebrow,
.page-hero .eyebrow,
.mob-hero-copy .eyebrow,
.mob-chapter .eyebrow{ font-size:clamp(.91rem, .85rem + .35vw, 1.05rem); }
.chip, .svc-detail .chip{ font-size:.9rem; }
.card-go,
.shot-cap,
.mini span{ font-size:.99rem; }
.footer h4{ font-size:.95rem; letter-spacing:normal; }
.footer li a{ font-size:1rem; }
.footer .brand-tx span,
.footer-btm{ font-size:.88rem; }
.cw-src,
.typing-hint,
.chat-note{ font-size:.86rem; }

/* Chat */
.chat-fab{
  border:1px solid #aa6843;
  background:radial-gradient(circle at 35% 15%, #623a29, #221819 72%);
  box-shadow:0 8px 28px #080408a0;
}
.chat-fab img{ width:30px; height:30px; }
.chat-panel{
  width:min(430px, calc(100vw - 32px));
  border:1px solid #845c484f;
  border-radius:24px;
  background:#151318;
  box-shadow:0 24px 72px #050308ad, inset 0 1px #ffffff0a;
}
.chat-top{
  flex-shrink:0;
  gap:12px;
  padding:14px 16px;
  background:linear-gradient(120deg, #35241f 0%, #211a22 70%);
  border-bottom-color:#f6ae732a;
}
.chat-avatar{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  flex:none;
  border:1px solid #f6ae733b;
  border-radius:15px;
  background:#f6ae7312;
}
.chat-top .chat-avatar img{ width:26px; height:26px; }
.chat-top .who b{ font-size:1.2rem; }
.chat-top .who span{ font-size:.86rem; color:#cfbdc4; }
.chat-top .chat-top-btn{ width:36px; height:36px; border-radius:11px; }
.chat-body{
  min-height:0;
  direction:ltr;
  padding:20px 16px;
  gap:16px;
  overscroll-behavior:contain;
  background:radial-gradient(ellipse at top right, #51302d35, transparent 65%);
}
.msg .av{ width:29px; height:29px; background:#282126; }
.msg .bub{
  padding:10px 14px;
  border-radius:17px;
  font-size:1.08rem;
  line-height:1.85;
}
.msg.ai .bub{
  background:#252127;
  border-color:#ffffff12;
  border-radius:17px;
  border-top-left-radius:5px;
}
.msg.me .bub{
  color:#fff2e8;
  background:#442d28;
  border-color:#a16d4c6b;
  border-radius:17px;
  border-top-right-radius:5px;
}
.chat-quick{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  align-self:flex-start;
  direction:rtl;
  margin-left:38px;
}
.chat-quick[hidden]{ display:none; }
.chat-quick button{
  min-height:34px;
  padding:3px 11px;
  border:1px solid #f6ae733b;
  border-radius:999px;
  color:#ffd4b2;
  background:#f6ae730b;
  font-size:.95rem;
  transition:background var(--t-fast);
}
.chat-quick button:hover{ background:#f6ae7327; }
.chat-foot{ flex-shrink:0; padding:12px 14px 10px; background:#1d181d; }
.chat-input{
  border-radius:15px;
  background:#151318;
  border-color:#ffffff20;
  padding:5px;
}
.chat-input:focus-within{ border-color:#c78459; }
.chat-input textarea{ min-width:0; font-size:1.08rem; }
.chat-input textarea:placeholder-shown{ direction:rtl; text-align:right; }
.chat-input textarea::placeholder{ color:#c1aeb7; }
.chat-send{ width:42px; height:42px; border-radius:11px; }
.chat-send svg{ width:19px; height:19px; }
.chat-legal{ font-size:.9rem; color:#cdbfc7; }

@media (max-width:560px){
  .chat-panel{
    width:auto;
    height:min(78dvh, calc(100dvh - 20px));
  }
  .chat-top{ padding:10px 12px; }
  .chat-top .chat-top-btn{ width:42px; height:42px; }
  .chat-body{ padding:15px 12px; }
  .chat-fab img{ width:26px; height:26px; }
  .music-fab{ width:42px; height:42px; }
}
@media (max-height:460px) and (max-width:900px){
  .chat-panel{ height:calc(100dvh - 24px); }
  .chat-top{ padding-block:7px; }
  .chat-body{ padding-block:10px; }
}


/* Keep a sharp frame on screen until the chapter video reaches the scroll position. */
.reel-stage{ background:#150e0d url('../img/poster-1.webp') center / cover no-repeat; }
.reel-chapter-loading{
  position:absolute;
  inset-inline-start:clamp(18px, 4vw, 52px);
  bottom:clamp(22px, 5vh, 52px);
  z-index:7;
  display:flex;
  align-items:center;
  gap:9px;
  max-inline-size:calc(100% - 36px);
  padding:6px 13px;
  border:1px solid #f6ae7340;
  border-radius:999px;
  background:#171119e8;
  color:#f9ddcc;
  font-size:.91rem;
  pointer-events:none;
}
.reel-chapter-loading[hidden]{ display:none; }
.reel-chapter-loading span{
  flex:none;
  width:30px;
  height:5px;
  border-radius:999px;
  background:linear-gradient(90deg,#463333,#ffad79,#463333) 0 / 200% 100%;
  animation:chapter-shimmer 1.2s linear infinite;
}
@keyframes chapter-shimmer{ to{ background-position:200% 0; } }
@media (prefers-reduced-motion:reduce){
  .reel-chapter-loading span{ animation:none; }
}

/* Navigation language control and readable, wrapping bilingual content. */
.language-select{
  display:flex;
  flex:none;
  align-items:center;
  gap:2px;
  padding:3px;
  border:1px solid var(--line-2);
  border-radius:999px;
  background:#171318;
}
.language-select a{
  display:grid;
  place-items:center;
  min-block-size:34px;
  padding:0 9px;
  border-radius:999px;
  font-size:.91rem;
  line-height:1.2;
  white-space:nowrap;
  color:var(--tx-2);
}
.language-select a[aria-current]{ color:#ffd5b6; background:#62422d; }
.language-select a:hover{ color:#fff0e3; }
.nav .brand, .nav-act{ min-inline-size:0; }
.nav-links a{ white-space:nowrap; }
html[lang=en] body{ word-spacing:.075em; }
html[lang=en] .brand-tx > span{ display:none; }
html[lang=en] .chat-input textarea:placeholder-shown{ direction:ltr; text-align:left; }
html[lang=en] .reel-slide[data-side]{ text-align:left; }
html[lang=en] .mob-hero-copy{ text-align:left; }
html[lang=en] .nav-links a{ padding-inline:8px; }
html[lang=en] .field input[type=tel]{ text-align:left; }
.nav .brand-tx b,
.proj-body, .service-card, .field, .cw-top > div, .rt-list li,
.chat-top .who, .slide-cta > *{
  min-inline-size:0;
  overflow-wrap:anywhere;
}
.project-chat-preview{
  display:grid;
  gap:clamp(8px, 2vw, 20px);
  height:100%;
  align-content:center;
  padding:clamp(10px, 3vw, 36px);
  background:radial-gradient(ellipse at top right,#492c2c,#17151d 72%);
}
.project-chat-head{
  display:flex;
  align-items:center;
  gap:8px;
  color:#ffdcc0;
}
.drawer .drawer-cta{ width:auto; }
.project-chat-head img{ width:32px; height:32px; object-fit:contain; }
.project-chat-messages{ display:grid; direction:ltr; gap:8px; }
.project-chat-messages span{
  display:block;
  max-width:92%;
  padding:5px 11px;
  border-radius:14px;
  background:#2a2730;
  font-size:clamp(.85rem, .82rem + .45vw, 1.06rem);
  line-height:1.55;
  justify-self:start;
}
html[lang=fa] .project-chat-messages span{ direction:rtl; }
.project-chat-messages span:first-child{ justify-self:end; background:#4b302c; }

@media (max-width:1080px){
  .nav{ gap:12px; }
  .nav .nav-links{ display:none; }
  .nav .burger{ display:flex; }
}
@media (max-width:560px){
  .nav{ padding:10px 12px; }
  .nav-act{ gap:5px; }
  .language-select a{ padding-inline:7px; }
  .nav .brand{ gap:7px; }
  .nav .brand img{ width:34px; height:34px; }
  .nav .brand-tx b{ font-size:clamp(.87rem, 4.4vw, 1.05rem); }
}


@counter-style gh-persian-decimal {
  system:numeric;
  symbols:"۰" "۱" "۲" "۳" "۴" "۵" "۶" "۷" "۸" "۹";
  pad:2 "۰";
}
html[lang=fa] .step::before{ content:counter(s, gh-persian-decimal); }


/* Pin the actions and brand on opposite sides while the menu stays centered. */
.nav{
  display:grid;
  direction:ltr;
  grid-template-columns:minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  column-gap:16px;
}
.nav > .nav-act{ grid-area:1 / 1; justify-self:start; }
.nav > .nav-links{ grid-area:1 / 2; justify-self:center; }
.nav > .brand{ grid-area:1 / 3; justify-self:end; }
html[lang=fa] .nav > .brand,
html[lang=fa] .nav > .nav-links{ direction:rtl; }
.nav-act .nav-consult{
  flex:none;
  min-height:42px;
  padding-inline:12px;
  white-space:nowrap;
}
.reel-slide .t-lead,
.mob-hero-copy .t-lead{
  color:#fff;
  text-shadow:0 2px 3px #000, 0 3px 18px #000d;
}
.reel-slide .chips .chip{
  background:transparent;
  color:#fff;
  border-color:#ffffff72;
  text-shadow:0 1px 4px #000, 0 2px 12px #000c;
}
html[lang=en] :is(main,footer,.drawer,.chat-panel){ direction:ltr; }
html[lang=en] :is(.hero-copy,.reel-copy,.mob-hero-copy,.cw-msg,.rag-demo,.chat-quick){ direction:ltr; text-align:start; }
html[lang=en] .chat-input textarea{ text-align:start; }
html[lang=en] .chat-quick{ justify-content:flex-start; }

@media (max-width:1240px){
  .nav{ grid-template-columns:auto minmax(0, 1fr); gap:10px; }
  .nav > .brand{ grid-column:2; }
  .nav > .nav-links{ display:none; }
  .nav .burger{ display:flex; flex:none; }
}
@media (max-width:600px){
  .nav-act{ gap:4px; }
  .nav-act .nav-consult{
    min-height:36px;
    inline-size:clamp(70px, 18vw, 90px);
    padding:3px 5px;
    white-space:normal;
    text-align:center;
    line-height:1.2;
  }
  .nav .burger{ width:32px; }
  .nav .brand-tx span{ display:none; }
}
@media (max-width:360px){
  .nav .brand-tx{ display:none; }
  .language-select a{ padding-inline:6px; }
}

/* Screen edges, touch controls and tablet reading layouts. */
:root{
  --screen-edge:max(8px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --floating-edge:max(24px, var(--screen-edge));
  --floating-bottom:max(24px, env(safe-area-inset-bottom, 0px));
}
.nav{
  padding-inline-start:max(var(--pad), env(safe-area-inset-left, 0px));
  padding-inline-end:max(var(--pad), env(safe-area-inset-right, 0px));
  padding-block-start:max(14px, env(safe-area-inset-top, 0px));
}
.chat-fab, .chat-panel{ inset-inline-start:var(--floating-edge); }
.music-fab{ inset-inline-end:var(--floating-edge); }
.chat-fab, .music-fab{ bottom:var(--floating-bottom); }
.chat-panel{
  --chat-headroom:104px;
  --chat-size:430px;
  --chat-height:600px;
  bottom:calc(var(--floating-bottom) + 64px);
  width:min(var(--chat-size), calc(100% - var(--floating-edge) - var(--floating-edge)));
  height:min(var(--chat-height), calc(100vh - var(--floating-bottom) - var(--chat-headroom)));
  height:min(var(--chat-height), calc(100dvh - var(--floating-bottom) - var(--chat-headroom)));
}
.chat-top .who > span > span{ min-inline-size:0; }
.chat-panel .msg .chat-msg-content{
  flex:0 1 auto;
  min-inline-size:0;
  max-inline-size:calc(100% - 38px);
}
.msg .bub pre{
  max-inline-size:100%;
  overflow-x:auto;
  direction:ltr;
  text-align:start;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.chat-quick button{ max-inline-size:100%; overflow-wrap:anywhere; }
.field :is(input, textarea, select){ min-inline-size:0; }

@media (min-width:621px) and (max-width:1180px){
  :root{ --pad:clamp(24px, 3.5vw, 38px); }
  .section{ padding-block:clamp(64px, 8vw, 94px); }
  .section-head{ margin-bottom:clamp(34px, 4.5vw, 52px); }
  .grid{ gap:clamp(14px, 2vw, 22px); }
  .card{ padding:clamp(19px, 2.5vw, 28px); }
  .contact-grid, .product-grid, .voice-grid, .page-hero-grid{
    gap:clamp(24px, 3.6vw, 44px);
  }
}

@media (min-width:561px) and (max-width:1180px), (min-width:561px) and (max-width:1400px) and (any-pointer:coarse){
  .chat-panel{
    --chat-size:clamp(400px, 51vw, 560px);
    --chat-height:680px;
  }
}

@media (min-width:621px) and (max-width:1400px){
  .mob-hero-copy{
    max-inline-size:780px;
    margin-inline:auto;
    padding-inline:clamp(24px, 5vw, 56px);
  }
  .mob-hero-copy .t-display{ font-size:clamp(2rem, 5.3vw, 3.25rem); }
  .mob-hero-copy .t-lead{ max-inline-size:58ch; font-size:clamp(1rem, 2.05vw, 1.18rem); }
  .mob-hero-copy .slide-cta{ flex-direction:row; flex-wrap:wrap; }
  .mob-hero-copy .slide-cta .btn{ width:auto; max-inline-size:100%; }
  .mob-chapters{
    width:min(100%, var(--maxw));
    margin-inline:auto;
    padding-inline:var(--pad);
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:16px;
  }
  .mob-chapter{
    min-inline-size:0;
    padding:clamp(20px, 3.6vw, 44px);
    border:1px solid var(--line);
    border-radius:var(--r-lg);
    contain-intrinsic-size:auto 320px;
  }
  .mob-chapter .t-h2{ font-size:clamp(1.3rem, 2.8vw, 1.85rem); }
}

/* A viewport change can keep the reel mode chosen when the scripts started. */
@media (min-width:769px) and (max-width:1400px){
  main:has(#mobHeroVid[preload="auto"]) > .mob-intro{ display:block; }
  main:has(#mobHeroVid[preload="auto"]) > .reel{ display:none; }
}
@media (min-width:561px) and (max-width:900px){
  #reel[style*="height:"]{ display:block; }
  #reel[style*="height:"] ~ .mob-intro{ display:none; }
}
@media (min-width:561px) and (max-width:1366px){
  .reel-copy{
    padding-inline:clamp(44px, 7vw, 96px);
    padding-block:clamp(76px, 11vh, 102px) clamp(64px, 12vh, 140px);
  }
  .reel-slide{ width:min(58%, 570px); }
  .reel-slide .slide-cta{ margin-top:clamp(15px, 3vh, 26px); }
}

@media (max-width:980px){
  .hero-demo,
  .product-grid > .shot,
  .voice-grid > .vdemo{
    inline-size:min(100%, 680px);
    justify-self:center;
  }
}

@media (any-pointer:coarse){
  .nav .burger, .drawer-close,
  .chat-top .chat-top-btn, .chat-send{
    width:44px;
    height:44px;
  }
  .drawer a, .language-select a, .chat-quick button{
    min-block-size:44px;
  }
  #chatPanel .msg .chat-copy{ min-inline-size:44px; min-block-size:44px; }
  .svc-row .go{ opacity:1; transform:none; }
  .svc-row h3{ color:var(--tx); }
  .svc-row:not(:has(.go))::before{
    content:'';
    grid-area:1 / 3;
    width:9px;
    height:9px;
    margin-inline-end:8px;
    border:solid var(--ember-soft);
    border-width:0 1.5px 1.5px 0;
    transform:rotate(45deg);
  }
  .svc-row.open::before{ transform:rotate(225deg); }
  .chat-input textarea, .field :is(input, textarea, select){ font-size:max(16px, 1rem); }
  .reel-rail{ inset-inline-start:var(--screen-edge); gap:3px; }
  .reel-rail button,
  .reel-rail button:is(:hover, [aria-current="true"]){
    width:44px;
    height:44px;
    background:transparent;
  }
  .reel-rail button::before, .reel-rail button::after{
    content:'';
    position:absolute;
    inset-inline:20px;
    inset-block-start:0;
    border-radius:2px;
  }
  .reel-rail button::before{ height:100%; background:#ffffff38; }
}

@media (max-width:560px){
  :root{
    --floating-edge:max(14px, var(--screen-edge));
    --floating-bottom:max(14px, env(safe-area-inset-bottom, 0px));
  }
  .nav{ padding-block-start:max(10px, env(safe-area-inset-top, 0px)); }
  .chat-panel{
    inset-inline:var(--screen-edge);
    width:auto;
    bottom:max(8px, env(safe-area-inset-bottom, 0px));
    height:min(78vh, calc(100vh - 24px - env(safe-area-inset-bottom, 0px)));
    height:min(78dvh, calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)));
  }
  .chat-top{ gap:8px; padding-inline:10px; }
  .chat-avatar, .chat-top .chat-top-btn{ flex:none; }
  .chat-avatar{ width:36px; height:36px; }
  .chat-top .who b{ font-size:1.05rem; }
  .chat-top .who span{ font-size:.78rem; line-height:1.35; }
  .chat-quick{ margin-left:0; }
}

@media (max-height:500px) and (max-width:1180px){
  .nav{ padding-block-start:max(8px, env(safe-area-inset-top, 0px)); }
  .drawer a{ padding-block:7px; }
  .chat-panel{
    --cx:0px !important;
    --cy:0px !important;
    inset-inline:var(--screen-edge);
    bottom:max(8px, env(safe-area-inset-bottom, 0px));
    margin-inline:auto;
    width:auto;
    max-inline-size:560px;
    height:calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
    height:calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
  }
  .chat-top, .chat-foot{ padding-block:7px; }
  .chat-body{ padding-block:10px; }
  .chat-legal{ display:none; }
  .reel-copy{ padding-block:64px 50px; }
  .reel-slide{ width:min(75%, 570px); }
}

@media (max-height:500px) and (any-pointer:coarse){
  .reel-rail{
    inset:auto 0 max(2px, env(safe-area-inset-bottom, 0px));
    display:flex;
    justify-content:center;
  }
  .reel-rail button::before, .reel-rail button::after{
    inset-inline:auto;
    inset-inline-start:0;
    inset-block-start:20px;
    height:4px;
  }
  .reel-rail button::before{ width:100%; }
  .reel-rail button::after{ width:var(--fill, 0%); }
}


.service-links{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-block:0 clamp(24px, 3vw, 38px);
}
.service-links a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:5px 14px;
  border:1px solid var(--line-2);
  border-radius:999px;
  color:var(--ember-soft);
  font-size:1rem;
}
.service-links a:hover{ border-color:var(--ember-line); }
.agent-figure{
  min-width:0;
  margin:0;
  overflow:hidden;
  border:1px solid var(--line-2);
  border-radius:var(--r-lg);
  background:var(--surface-1);
}
.agent-figure img{ width:100%; height:auto; }
.agent-figure figcaption{ padding:12px 16px; color:var(--tx-2); font-size:.96rem; }
.service-questions{
  display:grid;
  gap:10px;
  max-inline-size:820px;
}
.service-questions details{
  padding:11px 17px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-1);
  overflow-wrap:anywhere;
}
.service-questions summary{ cursor:pointer; font-weight:700; }
.service-questions p{ margin-top:7px; color:var(--tx-2); }
.service-questions a{ color:var(--ember-soft); text-decoration:underline; }
