/* Carry the homepage treatment through the existing in-page views. */
body.ready:not(.is-home) {
  --gold: #ffc36b;
  --gold-hi: #ffe5af;
  --gold-lo: #ae702d;
  --ivory: #fff7eb;
  --smoke: #d8c7ae;
  --line: #755436;
  --graphite: #15110f;
  --graphite2: #201912;
  background: #0c0b09;
  color: var(--ivory);
}

body.ready:not(.is-home) #nav {
  background: linear-gradient(180deg, #171511, #0b0a09);
  border-bottom: 1px solid #ad793868;
  box-shadow: 0 1px 18px #d98b2221;
}

body.ready:not(.is-home) #nav .logo {
  display: block;
  flex: 0 0 150px;
  width: 150px;
  height: 40px;
  background: url("../media/robohub-tab-logo.webp") center / contain no-repeat;
}
body.ready:not(.is-home) #nav .logo .word { opacity: 0; }

body.ready:not(.is-home) #navlinks a.on {
  color: #fff7e4;
  border: 1px solid #eab66d;
  border-radius: 100px;
  background: linear-gradient(135deg, #a96828, #332011 60%, #855323);
  box-shadow: inset 0 0 8px #ffda905e, 0 0 14px #e5a64b4d;
}

body.ready:not(.is-home) .after {
  background: radial-gradient(ellipse at 82% 0%, #50301b73, transparent 56rem), #0f0e0c;
}

body.ready:not(.is-home) main section[data-view] {
  background-image: radial-gradient(ellipse at 86% 26%, #8c552319, transparent 65%);
}

body.ready:not(.is-home) main .sh {
  position: relative;
  border-bottom-color: #af793c77;
}

body.ready:not(.is-home) main .sh::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(90deg, #ffe1a5, #b67e35 32%, transparent 74%);
}

body.ready:not(.is-home) main .sh h2 {
  color: #fff6e8;
  text-shadow: 0 0 34px #ed9d3d36;
}
body.ready:not(.is-home) main .sh p { color: #e1d3bd; }

body.ready:not(.is-home) main :is(.console,.metric,.phone,.bp-side,.bp-sheet,.bp-palette,.cside,.pt,.stair) {
  background-color: #1a1510;
  border-color: #b8864c80;
  box-shadow: inset 0 1px 0 #ffd68b24;
}

body.ready:not(.is-home) :is(.btn-primary,#nav .btn-primary) {
  background: linear-gradient(120deg, #ffe6ad, #edac56);
  border-color: #ffe4a4;
  color: #211509;
  box-shadow: 0 4px 18px #e298393a;
}

body.ready:not(.is-home) .after > .wrap:last-child {
  position: relative;
  padding-top: clamp(2rem, 5vw, 5rem);
}
body.ready:not(.is-home) .after > .wrap:last-child::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: clamp(24px, 4vw, 52px);
  background: url("../media/robohub-tab-wave.webp") center / 100% 100% no-repeat;
  mask-image: linear-gradient(transparent, black 25%, black 70%, transparent);
  pointer-events: none;
}
body.ready:not(.is-home) footer { border-color: #8e653a; }
body.ready:not(.is-home) footer .wm b { color: #ffc36b; }

@media (max-width:760px) {
  body.ready:not(.is-home) #nav .logo {
    flex-basis: 124px;
    width: 124px;
    height: 34px;
  }
}

/* Illustrated headings frame the existing demos and tools. */
main .tab-hero {
  --tab-art: url("../media/robohub-tab-globe.webp");
  --tab-art-opacity: .9;
  --tab-art-position: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  align-items: start;
  gap: 1rem;
  isolation: isolate;
  min-height: clamp(235px, 24vw, 350px);
  overflow: hidden;
  padding: clamp(1.45rem, 4vw, 4rem);
  padding-inline-end: 37%;
  margin-bottom: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid #a5723c;
  border-radius: 22px;
  background: radial-gradient(ellipse at 85% 30%, #683a19 0%, #23180f 37%, #13100c 72%, #0d0b09);
  box-shadow: 0 20px 60px #0006, inset 0 1px 0 #ffd38445;
}

main .tab-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block: 0;
  inset-inline-end: 0;
  width: 53%;
  background: var(--tab-art) var(--tab-art-position) / cover no-repeat;
  opacity: var(--tab-art-opacity);
  mask-image: radial-gradient(ellipse at 66% 48%, #000 15%, #000e 40%, transparent 78%);
  pointer-events: none;
}
html[dir="rtl"] main .tab-hero::before {
  mask-image: radial-gradient(ellipse at 34% 48%, #000 15%, #000e 40%, transparent 78%);
}
body.ready:not(.is-home) main .tab-hero::after {
  inset: auto 8% 0;
  background: linear-gradient(90deg, transparent, #ffcb76, transparent);
  box-shadow: 0 0 13px #ffad52b3;
}

body.ready:not(.is-home) main .tab-hero h2 {
  max-inline-size: 21ch;
  font-size: clamp(2rem, 4.45vw, 4.5rem);
  letter-spacing: -.035em;
  line-height: 1.06;
}
main .tab-hero h2 .ln + .ln { padding-inline-start: 0; }
body.ready:not(.is-home) main .tab-hero p {
  max-width: 47ch;
  font-size: clamp(.96rem, 1.2vw, 1.12rem);
  line-height: 1.6;
}

#services .tab-hero,
#contact .tab-hero {
  --tab-art: url("../media/robohub-tab-robot.webp");
  --tab-art-position: center 43%;
}
#build .tab-hero {
  --tab-art: url("../media/robohub-tab-wave.webp");
  --tab-art-opacity: .6;
}
#build .tab-hero::before { inset-block-start: 35%; }
#process .tab-hero { --tab-art-opacity: .62; }
#agent .tab-hero {
  min-height: 0;
  padding-inline-end: clamp(1.45rem, 4vw, 4rem);
}
#agent .tab-hero::before { display: none; }
body.ready:not(.is-home) #agent .tab-hero h2 { font-size: clamp(2rem, 3.8vw, 3.5rem); }

body.ready:not(.is-home) main :is(.console,.solmap,.flow-scenes,.bp,.contact) {
  border: 1px solid #926338;
  border-radius: 18px;
  box-shadow: 0 20px 48px #0006, inset 0 1px 0 #ffda8d28;
}
#live .console .bar { background: linear-gradient(110deg, #332315, #17120d); }
#live .metrics .metric,
#process .stair {
  border: 1px solid #926338;
  border-radius: 14px;
  background: radial-gradient(ellipse at top left, #50301875, transparent 72%), #17130e;
}
#build .bp {
  padding: clamp(.65rem, 1.8vw, 1.5rem);
  background: linear-gradient(145deg, #271b11, #14100c 55%);
}
#build .bp-sum { border-color: #865b32; background: #19120d; }
#agent .phone { border-color: #ba8950; box-shadow: 0 0 46px #bf752e38; }
#agent .points .pt:nth-child(n) { --pc: 255, 201, 122; }
#contact .contact::before {
  background: conic-gradient(from var(--a, 0deg), #ffcb79, transparent 26%, #d49451 50%, transparent 75%, #ffcb79);
}
#contact .cside { background: transparent; box-shadow: none; }

@media (max-width:760px) {
  main .tab-hero {
    min-height: 230px;
    padding-inline: 1.25rem;
    padding-block: 1.55rem;
  }
  main .tab-hero::before { width: 75%; opacity: .23; }
  #agent .tab-hero { padding-inline: 1.25rem; }
}

@media (max-width:760px) {
  #build .bp { grid-template-columns: minmax(0, 1fr); }
  #build .bp-sumcol { min-width: 0; }
  #build .bp-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #build .bp-chip { min-width: 0; overflow-wrap: anywhere; }
}

/* Decorative motion plays when a tab is opened. The interactive content stays in place. */
@media (prefers-reduced-motion: no-preference) {
  body.ready #live:not([hidden]) .tab-hero::before {
    animation: tab-globe-wake 4s ease-out;
    transform-origin: 68% 50%;
  }
  body.ready #live:not([hidden]) .metric {
    animation: tab-metric-light 1.05s ease-out;
  }
  body.ready #live:not([hidden]) .metric:nth-child(2) { animation-delay: .13s; }
  body.ready #live:not([hidden]) .metric:nth-child(3) { animation-delay: .26s; }
  body.ready #live:not([hidden]) .metric:nth-child(4) { animation-delay: .39s; }
  body.ready #live:not([hidden]) .metric:nth-child(5) { animation-delay: .52s; }

  body.ready #services:not([hidden]) .tab-hero::before {
    animation: tab-integration-focus 3.5s ease-out;
  }
  body.ready #services:not([hidden]) .flow-scenes {
    animation: tab-flow-power 2.8s ease-out;
  }

  body.ready #build:not([hidden]) .bp-sheet::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(transparent 33%, #e89c3b26 48%, #ffe1a983 50%, transparent 52%);
    opacity: 0;
    animation: tab-blueprint-scan 2.9s ease-out;
    pointer-events: none;
  }

  body.ready #agent:not([hidden]) .phone .screen {
    animation: tab-agent-online 3s ease-out;
  }
  body.ready #agent:not([hidden]) .phone .av {
    animation: tab-agent-signal 1.35s ease-out 2;
  }

  body.ready #process:not([hidden]) .stair {
    animation: tab-milestone-light 1.55s ease-out;
  }
  body.ready #process:not([hidden]) .stair:nth-child(2) { animation-delay: .28s; }
  body.ready #process:not([hidden]) .stair:nth-child(3) { animation-delay: .56s; }
  body.ready #process:not([hidden]) .stair:nth-child(4) { animation-delay: .84s; }

  body.ready #contact:not([hidden]) .tab-hero::after {
    transform-origin: center;
    animation: tab-contact-signal 2.6s ease-out;
  }
  body.ready #contact:not([hidden]) .cside {
    animation: tab-contact-warmth 3.3s ease-out;
  }
}

@keyframes tab-globe-wake {
  from { transform: scale(1.15); filter: brightness(.75); }
  38% { filter: brightness(1.25); }
  to { transform: scale(1); filter: brightness(1); }
}
@keyframes tab-metric-light {
  35% { box-shadow: inset 0 0 28px #ffc26832, 0 0 16px #dd8a3338; }
}
@keyframes tab-integration-focus {
  from { transform: translateY(4%) scale(1.09); filter: saturate(.65); }
  to { transform: translateY(0) scale(1); filter: saturate(1); }
}
@keyframes tab-flow-power {
  30% { box-shadow: 0 0 24px #f3a44966, inset 0 0 44px #f3a44926; }
}
@keyframes tab-blueprint-scan {
  0% { opacity: 0; transform: translateY(-48%) scaleY(.55); }
  18%, 74% { opacity: 1; }
  100% { opacity: 0; transform: translateY(48%) scaleY(.55); }
}
@keyframes tab-agent-online {
  32% { box-shadow: 0 0 56px #ffbd6670, inset 0 0 16px #ffbd6629; }
}
@keyframes tab-agent-signal {
  from { box-shadow: 0 0 0 0 #ffc46d80; }
  to { box-shadow: 0 0 0 12px #ffc46d00; }
}
@keyframes tab-milestone-light {
  35% { border-color: #ffe0a7; box-shadow: inset 0 2px 0 #ffd384c2, 0 0 26px #eb9d3f4d; }
}
@keyframes tab-contact-signal {
  from { transform: scaleX(.28); opacity: .45; }
  55% { opacity: 1; box-shadow: 0 0 20px #ffbd63; }
  to { transform: scaleX(1); }
}
@keyframes tab-contact-warmth {
  42% { filter: drop-shadow(0 0 10px #ffc36b66); }
}

/* Clearer text, panel edges, and active states across all six views. */
body.ready:not(.is-home) main { color: var(--ivory); }
body.ready:not(.is-home) main .tab-hero {
  border-color: #b6834c;
  background: radial-gradient(ellipse at 85% 30%, #593315, #201710 46%, #11100e 83%);
}
body.ready:not(.is-home) main .tab-hero h2 .gold {
  background-image: linear-gradient(110deg, #ffebbe 5%, #f6bc74 64%, #eab074);
}
body.ready:not(.is-home) main :is(.bar,.bp-label,.lbl,.metric span,.stair p,.points span) { color: var(--smoke); }
#live .flow li b,
#services .flow-scenes figcaption,
#agent .who b,
#process .stair h3,
#contact #leadForm label > span { color: #fff1da; }
#build :is(.bp-chip,.bp-node,.bp-title) {
  background-color: #1e1812;
  border-color: #a3794f;
  color: #fff0d7;
}
#build .bp-hint { color: #e0c5a1; }
body.ready #contact :is(input,textarea,select):not([aria-hidden]) {
  background-color: #181511;
  border-color: #916c48;
  color: #fff5e3;
}
body.ready:not(.is-home) main :is(a,button,input,textarea,select):focus-visible {
  outline: 2px solid #ffda93;
  outline-offset: 3px;
}

/* The artwork stays in place until the 3D renderer produces its first frame. */
main .tab-hero .tab-scene {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 51%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}
main .tab-hero.has-tab-scene .tab-scene { opacity: 1; }
body.ready main .tab-hero.has-tab-scene::before {
  animation: none;
  opacity: .2;
}
#agent .tab-hero.has-tab-scene { padding-inline-end: 40%; }
@media (max-width:760px) {
  main .tab-hero.has-tab-scene,
  #agent .tab-hero.has-tab-scene {
    padding-block-end: calc(1.5rem + 165px);
    padding-inline: 1.25rem;
  }
  main .tab-hero .tab-scene {
    inset-block: auto 0;
    width: 100%;
    height: 165px;
  }
}

main .tab-hero.has-tab-scene > :is(h2, p) {
  position: relative;
  z-index: 1;
}

.scene-toggle,
.robo-home .scene-toggle {
  position: relative;
  inset: auto;
  z-index: 2;
  width: auto;
  height: auto;
  padding: .55rem .9rem;
  border: 1px solid #bf9259;
  border-radius: 99px;
  background: #17120e;
  color: #ffe4af;
  font-family: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.scene-toggle:disabled { cursor: default; }

.home-scene {
  position: absolute;
  inset: 8% 17% auto 44%;
  height: 46%;
  pointer-events: none;
}

.robo-home .home-scene .scene-toggle {
  position: absolute;
  inset: auto 0 6% auto;
  pointer-events: auto;
}

.home-scene .tab-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  background: radial-gradient(ellipse at 55% 50%, #4a2e17, #120e0a 75%);
  border-radius: 1rem;
}

.home-scene.has-tab-scene .tab-scene { visibility: visible; }

@media (max-width:760px) {
  .home-scene {
    inset: 0 0 auto;
    height: auto;
    aspect-ratio: 426 / 354;
  }
  .robo-home .home-scene .scene-toggle { inset-inline-end: 1rem; }
}

/* Full-screen Robo Hub homepage: crisp editorial composition, not a scaled background screenshot. */
html[lang="en"] body.is-home #nav { display:block; z-index:50; }
html[lang="en"] body.is-home .robo-home { display:block; }
.robo-home {
  min-height:100svh;
  background:
    radial-gradient(ellipse at 79% 43%, rgba(228,159,70,.20), transparent 43%),
    radial-gradient(ellipse at 28% 80%, rgba(118,75,34,.20), transparent 48%),
    linear-gradient(120deg,#090b0d 0%,#171613 54%,#272019 100%);
  overflow:hidden;
}
.robo-home .robo-home-frame {
  min-height:calc(100svh - 76px);
  width:min(100%,1700px);
  margin:0 auto;
  padding:clamp(95px,12vh,155px) clamp(22px,5.6vw,94px) clamp(38px,6vh,72px);
  display:grid;
  grid-template-columns:minmax(270px,.8fr) minmax(0,1.2fr);
  grid-template-rows:1fr auto 1fr;
  align-items:center;
  gap:0 clamp(16px,3vw,48px);
}
.robo-home .robo-home-frame > picture {
  grid-column:2;
  grid-row:1 / 4;
  align-self:center;
  justify-self:center;
  width:100%;
  position:relative;
  z-index:1;
  display:block;
}
.robo-home .robo-home-art {
  display:block;
  width:100%;
  max-width:1068px;
  max-height:min(75svh,749px);
  height:auto;
  object-fit:contain;
  object-position:center;
  filter:brightness(1.14) contrast(1.12) saturate(1.13);
  image-rendering:auto;
  transform:translateZ(0);
}
.robo-home .robo-home-copy {
  grid-column:1;
  grid-row:2;
  position:relative;
  z-index:3;
  width:auto;
  height:auto;
  padding:0;
  overflow:visible;
  clip-path:none;
  white-space:normal;
  max-width:580px;
}
.robo-home .robo-home-heading {
  color:#fff8ee;
  font-family:"Sora",sans-serif;
  font-size:clamp(2.5rem,5vw,5.4rem);
  font-weight:700;
  letter-spacing:-.065em;
  line-height:1.04;
  text-wrap:balance;
  text-shadow:0 3px 28px #000a;
}
.robo-home .robo-home-copy p { color:#e5d7c5; font-size:clamp(.98rem,1.3vw,1.22rem); line-height:1.7; max-width:39ch; margin:21px 0 0; }
.robo-home .robo-home-actions {
  grid-column:1;
  grid-row:3;
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  align-self:start;
  gap:12px;
  padding:23px 0 0;
  position:relative;
  z-index:3;
}
.robo-home .robo-home-actions a {
  position:static;
  inset:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:auto;
  height:auto;
  min-height:46px;
  padding:12px 20px;
  border:1px solid #e9b665;
  border-radius:9px;
  background:linear-gradient(135deg,#ffe2a4,#d39337);
  color:#21180d;
  text-decoration:none;
  font-weight:700;
  box-shadow:0 8px 29px #0006;
}
.robo-home .robo-home-actions a:nth-child(2) {
  background:#1c1916;
  color:#ffe1a7;
  border-color:#bc8d51;
}
.robo-home .robo-home-actions a:nth-child(n+3) { display:none; }
.robo-home .robo-home-actions a span { position:static; width:auto; height:auto; padding:0; overflow:visible; clip-path:none; white-space:normal; }
.robo-home .robo-home-frame > nav { display:none; }
.robo-home .home-scene {
  position:absolute;
  inset:16% 7% 11% 52%;
  width:auto;
  height:auto;
  pointer-events:none;
  z-index:2;
}
.robo-home .home-scene .tab-scene {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  opacity:.72;
  visibility:hidden;
  pointer-events:none;
}
.robo-home .home-scene.has-tab-scene .tab-scene { visibility:visible; }
.robo-home .robo-home-discovery { position:relative; z-index:4; background:#0c0d0d; border-top:1px solid #7d5d3344; }
@media(max-width:860px) {
  .robo-home .robo-home-frame {
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:calc(100svh - 66px);
    padding:105px 22px 35px;
    gap:10px;
  }
  .robo-home .robo-home-frame > picture { order:2; width:min(100%,620px); }
  .robo-home .robo-home-copy { order:1; align-self:stretch; max-width:640px; text-align:center; }
  .robo-home .robo-home-heading { font-size:clamp(2.25rem,7vw,4.2rem); }
  .robo-home .robo-home-copy p { margin:12px auto 0; }
  .robo-home .robo-home-actions { order:3; justify-content:center; padding-top:10px; }
  .robo-home .robo-home-art { max-height:47svh; object-fit:contain; }
  .robo-home .home-scene { inset:40% 5% 13% 28%; }
}
@media(max-width:480px) {
  .robo-home .robo-home-frame { padding-top:90px; }
  .robo-home .robo-home-art { max-height:40svh; }
  .robo-home .home-scene { inset:43% 3% 14% 20%; }
  .robo-home .robo-home-actions { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .robo-home .robo-home-actions a { font-size:.82rem; padding:10px 7px; text-align:center; }
}
@media(prefers-reduced-motion:reduce) {
  .robo-home .robo-home-art { transform:none; }
}
