/* WBH Stage 1 — a CSS perspective scene, not a WebGL model.
   Scoped to the homepage opening; the existing design system remains intact. */

.wbh-opening {
  --device-y: 0px;
  --device-rx: 8deg;
  --device-ry: -15deg;
  --device-rz: -3deg;
  --device-scale: 1;
  --portal-opacity: .48;
  position: relative;
  padding: clamp(3rem, 5.6vw, 5.25rem) 0 2.75rem;
  background: radial-gradient(ellipse at 78% 42%, #282217 0, #11120f 23%, transparent 56%), #070809;
  overflow: clip;
}

.wbh-opening::before {
  background: linear-gradient(90deg, transparent 49.8%, rgba(244, 215, 156, .025) 50%, transparent 50.2%);
  background-size: 160px 100%;
  mask-image: linear-gradient(180deg, transparent, #000 35%, transparent);
}

.wbh-opening::after {
  position: absolute;
  inset: auto 0 0;
  height: 140px;
  background: linear-gradient(transparent, #070809);
  pointer-events: none;
  content: "";
}

.wbh-opening-layout {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 96px));
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  grid-template-rows: auto auto;
  gap: 2rem clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.wbh-opening-copy {
  position: relative;
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.wbh-opening .eyebrow {
  margin-bottom: 1.6rem;
  font-size: .67rem;
  line-height: 1.65;
  letter-spacing: .14em;
}

.wbh-opening h1 {
  max-width: none;
  font-size: clamp(2.8rem, 4.55vw, 4.25rem);
  line-height: 1.045;
  letter-spacing: -.043em;
  text-wrap: balance;
}

.wbh-heading-accent { color: var(--gold-bright); }

.wbh-opening .hero-text {
  max-width: 49ch;
  margin: 1.6rem 0 1.8rem;
  font-size: 1.025rem;
  line-height: 1.75;
}

.wbh-opening .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.wbh-opening .hero-actions .btn {
  min-height: 54px;
  padding: .95rem 1.2rem;
  font-size: .85rem;
}

.wbh-opening-trust {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  gap: 1rem;
  padding-top: .2rem;
}

.wbh-opening-trust > div { padding-left: .8rem; }
.wbh-opening-trust strong { font-size: .76rem; }
.wbh-opening-trust span { font-size: .72rem; }

.wbh-opening-scene {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  align-self: center;
  min-width: 0;
  width: 100%;
  margin: 0;
}

.wbh-scene-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(390px, 37vw, 540px);
  perspective: 1600px;
  perspective-origin: 50% 40%;
}

.wbh-scene-stage > [aria-hidden="true"],
.wbh-laptop, .wbh-laptop * { pointer-events: none; }

.wbh-scene-light {
  position: absolute;
  inset: 7% -3% 0;
  background: radial-gradient(ellipse at 54% 47%, rgba(217, 168, 79, .17), transparent 64%);
}

.wbh-scene-portal {
  position: absolute;
  inset: 4% 12% 10%;
  border: 1px solid rgba(244, 215, 156, .28);
  border-bottom-color: transparent;
  border-radius: 46% 46% 3px 3px;
  opacity: var(--portal-opacity);
  transform: translateY(3%) rotate(-7deg);
  box-shadow: inset 0 0 60px rgba(217, 168, 79, .025);
}

.wbh-scene-rule {
  position: absolute;
  top: 20%;
  right: 2%;
  width: 1px;
  height: 33%;
  background: linear-gradient(transparent, rgba(244, 215, 156, .45), transparent);
}

.wbh-scene-floor {
  position: absolute;
  inset: auto -2% 4%;
  height: 23%;
  background:
    radial-gradient(ellipse, rgba(217, 168, 79, .11), transparent 67%),
    linear-gradient(90deg, transparent, rgba(244, 215, 156, .14), transparent) 50% 47% / 100% 1px no-repeat;
  transform: rotate(-5deg);
}

.wbh-laptop-shadow {
  position: absolute;
  left: 10%;
  right: 9%;
  bottom: 8%;
  height: 11%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .82), transparent 68%);
  transform: rotate(-5deg);
}

.wbh-laptop {
  position: relative;
  width: 92%;
  margin-top: -5%;
  transform-style: preserve-3d;
  transform: translate3d(0, var(--device-y), 0) rotateX(var(--device-rx)) rotateY(var(--device-ry)) rotateZ(var(--device-rz)) scale(var(--device-scale));
  transform-origin: 50% 60%;
}

.wbh-laptop-lid {
  position: relative;
  border: 1px solid #ad956a;
  border-radius: 16px 16px 7px 7px;
  padding: 18px 10px 13px;
  background: linear-gradient(135deg, #5e5748, #242522 5%, #111310 55%, #544b39);
  box-shadow: 1px 1px 0 #ded0ad, 4px 4px 0 #302d25, 6px 6px 0 #0b0d0b, 20px 28px 55px rgba(0, 0, 0, .62);
  transform: translateZ(3px);
}

.wbh-laptop-camera {
  position: absolute;
  top: 6px;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #060909;
  box-shadow: inset 0 0 0 1px #3c453e;
}

.wbh-laptop-screen {
  position: relative;
  overflow: hidden;
  border: 1px solid #070908;
  border-radius: 5px;
  background: #090b0b;
  aspect-ratio: 1895 / 859;
  isolation: isolate;
}

.wbh-screen-fallback {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
  place-content: center;
  gap: .5rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 20%, #27251c, #080a09 75%);
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2.2vw, 2rem);
}

.wbh-screen-fallback small {
  font: .55em/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
  letter-spacing: .05em;
}

.wbh-screen-picture, .wbh-screen-picture img {
  width: 100%;
  height: 100%;
}

.wbh-screen-picture img { object-fit: contain; }
.wbh-opening-scene[data-asset-state="unavailable"] .wbh-screen-picture { visibility: hidden; }

.wbh-screen-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(127deg, rgba(244, 237, 218, .1), transparent 40%, transparent 70%, rgba(244, 215, 156, .025));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.wbh-laptop-hinge {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -5px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(#080b09, #6c6250, #151713);
  transform: translateZ(1px);
}

.wbh-laptop-deck {
  position: absolute;
  top: calc(100% - 1px);
  left: -6%;
  width: 112%;
  height: 30%;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(125deg, #877c62, #4e4d42 29%, #242a26 66%, #8d7d58);
  border: 1px solid #a99978;
  transform-origin: 50% 0;
  transform: rotateX(57deg);
  transform-style: preserve-3d;
  box-shadow: 0 5px 0 #423e31, 0 7px 0 #b29f74, 0 9px 0 #141913;
}

.wbh-laptop-keyboard {
  position: absolute;
  top: 10%;
  left: 12%;
  right: 12%;
  height: 42%;
  border: 2px solid #363a31;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 6.4%, #4c4c3d 6.6%, #4c4c3d 7.3%),
    repeating-linear-gradient(0deg, #141a16 0, #141a16 22%, #55513e 24%, #55513e 27%);
}

.wbh-laptop-trackpad {
  position: absolute;
  width: 25%;
  height: 29%;
  left: 37.5%;
  bottom: 10%;
  border: 1px solid rgba(16, 22, 17, .65);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(218, 205, 165, .09), rgba(9, 17, 11, .13));
  box-shadow: 0 1px 0 rgba(236, 218, 177, .26);
}

.wbh-scene-caption {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .4rem .6rem 0;
}

.wbh-project-label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: #d9d0bd;
  font-size: .68rem;
  letter-spacing: .035em;
}

.wbh-project-label::before {
  content: "";
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(217, 168, 79, .3);
}

.wbh-motion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .5rem .7rem;
  border: 1px solid rgba(244, 215, 156, .17);
  border-radius: 999px;
  background: rgba(10, 12, 11, .75);
  color: #c9c0af;
  cursor: pointer;
  font-size: .65rem;
  line-height: 1.2;
}

.wbh-motion-toggle[hidden] { display: none; }
.wbh-motion-toggle:disabled { cursor: default; }
.wbh-motion-toggle:hover:not(:disabled) { border-color: var(--gold); color: var(--text); }
.wbh-motion-toggle:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.wbh-motion-symbol { width: 7px; height: 8px; border-inline: 2px solid currentColor; }
.wbh-motion-toggle[aria-pressed="true"] .wbh-motion-symbol { border: 0; border-left: 7px solid; border-block: 4px solid transparent; }

.wbh-opening-bridge {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1320px, calc(100% - 96px));
  margin: 3.5rem auto 0;
  height: 25px;
}

.wbh-opening-bridge::before,
.wbh-opening-bridge::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(217, 168, 79, .25));
}

.wbh-opening-bridge::after { transform: rotate(180deg); }
.wbh-opening-bridge span { width: 1px; height: 24px; margin-inline: 1.25rem; background: linear-gradient(var(--gold), transparent); }
.wbh-opening-values { position: relative; background: #070809; border-top: 0; }

@media (max-width: 1100px) and (min-width: 961px) {
  .wbh-opening-layout { width: calc(100% - 64px); gap: 1.75rem; }
  .wbh-opening h1 { font-size: 3rem; }
  .wbh-opening .hero-text { font-size: .95rem; }
  .wbh-opening .hero-actions .btn { padding: .9rem; font-size: .76rem; }
  .wbh-scene-stage { height: 370px; }
}

@media (max-width: 960px) {
  .wbh-opening { --device-rx: 6deg; --device-ry: -8deg; --device-rz: -2deg; padding-top: 2.6rem; padding-bottom: 1.2rem; }
  .wbh-opening-layout { width: min(660px, calc(100% - 48px)); grid-template-columns: 1fr; gap: 1.7rem; }
  .wbh-opening-copy, .wbh-opening-scene, .wbh-opening-trust { grid-column: 1; grid-row: auto; }
  .wbh-opening h1 { max-width: 18ch; font-size: clamp(2.35rem, 6.3vw, 3.5rem); }
  .wbh-opening .hero-text { max-width: 58ch; font-size: 1rem; }
  .wbh-opening-scene { margin-top: -.5rem; }
  .wbh-scene-stage { height: clamp(250px, 52vw, 390px); perspective: 1200px; }
  .wbh-scene-portal { inset: 1% 13% 8%; }
  .wbh-laptop { width: 90%; }
  .wbh-opening-trust { width: 100%; max-width: none; margin-top: .75rem; }
  .wbh-opening-bridge { width: calc(100% - 48px); margin-top: 1.8rem; }
}

@media (max-width: 480px) {
  .wbh-opening { padding-top: 1.8rem; background: radial-gradient(ellipse at 70% 62%, #211e15, transparent 38%), #070809; }
  .wbh-opening-layout { width: calc(100% - 36px); gap: 1.15rem; }
  .wbh-opening .eyebrow { font-size: .58rem; margin-bottom: 1.1rem; letter-spacing: .12em; }
  .wbh-opening h1 { font-size: clamp(2.08rem, 8.65vw, 2.6rem); max-width: 17ch; line-height: 1.08; }
  .wbh-opening .hero-text { font-size: .91rem; line-height: 1.7; margin: 1.1rem 0 1.35rem; }
  .wbh-opening .hero-actions { gap: .55rem; flex-wrap: nowrap; }
  .wbh-opening .hero-actions .btn { flex: 1; min-width: 0; min-height: 50px; padding: .85rem .6rem; font-size: .75rem; gap: .4rem; }
  .wbh-scene-stage { height: clamp(205px, 63vw, 285px); perspective: 1000px; }
  .wbh-laptop { width: 91%; }
  .wbh-laptop-lid { border-radius: 9px 9px 4px 4px; padding: 12px 5px 8px; box-shadow: 1px 1px 0 #ded0ad, 3px 3px 0 #302d25, 4px 4px 0 #0b0d0b, 10px 18px 34px #0008; }
  .wbh-laptop-camera { top: 4px; width: 3px; height: 3px; }
  .wbh-laptop-screen { border-radius: 2px; }
  .wbh-laptop-deck { height: 28%; border-radius: 0 0 7px 7px; box-shadow: 0 3px 0 #423e31, 0 4px 0 #b29f74, 0 5px 0 #141913; }
  .wbh-laptop-keyboard { border-width: 1px; }
  .wbh-laptop-trackpad { border-radius: 2px; }
  .wbh-scene-rule { display: none; }
  .wbh-scene-caption { padding: 0; gap: .25rem; }
  .wbh-project-label { font-size: .59rem; gap: .4rem; letter-spacing: 0; }
  .wbh-motion-toggle { font-size: .59rem; padding: .5rem .55rem; }
  .wbh-opening-trust { gap: .6rem; padding-top: .7rem; margin-top: 0; }
  .wbh-opening-trust > div { padding-left: .6rem; }
  .wbh-opening-trust strong { font-size: .65rem; }
  .wbh-opening-trust span { font-size: .65rem; }
  .wbh-opening-bridge { width: calc(100% - 36px); margin-top: 1.4rem; height: 18px; }
  .wbh-opening-bridge span { height: 18px; }
}

@supports not (transform-style: preserve-3d) {
  .wbh-laptop { transform: none; }
  .wbh-laptop-deck, .wbh-laptop-hinge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wbh-opening .wbh-laptop { transform: rotateX(6deg) rotateY(-7deg) rotateZ(-2deg); }
  .wbh-opening .wbh-scene-portal { opacity: .48; }
}
