:root {
  color-scheme: dark;
  --ink: oklch(13% 0.013 245);
  --ink-deep: oklch(7% 0.011 245);
  --panel: oklch(17% 0.012 245);
  --panel-high: oklch(22% 0.012 245);
  --ceramic: oklch(94% 0.009 160);
  --muted: oklch(70% 0.012 230);
  --copper: oklch(67% 0.105 48);
  --glass-edge: oklch(85% 0.026 205 / 0.5);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--ink-deep);
}

body {
  color: var(--ceramic);
  font-family: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(90% 100% at 42% 45%, oklch(23% 0.021 235 / 0.45), transparent 55%),
    linear-gradient(110deg, var(--ink-deep), var(--ink) 58%, oklch(10% 0.012 245));
}

.architecture {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.42;
  background-image:
    linear-gradient(90deg, transparent 33.95%, oklch(48% 0.01 245 / 0.075) 34%, transparent 34.05%, transparent 77.95%, oklch(48% 0.01 245 / 0.065) 78%, transparent 78.05%),
    radial-gradient(circle at 10% 20%, oklch(70% 0.01 245 / 0.035) 0 0.6px, transparent 0.7px);
  background-size: 100% 100%, 5px 5px;
}

.topbar {
  position: absolute;
  z-index: 10;
  inset: clamp(1.4rem, 3.2vw, 3rem) clamp(1.4rem, 4vw, 4.5rem) auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.control:focus-visible {
  outline: 2px solid var(--ceramic);
  outline-offset: 5px;
}

.topbar__meta {
  display: flex;
  gap: clamp(1rem, 3vw, 3rem);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.showcase {
  height: 100svh;
  min-height: 0;
  padding: clamp(5.75rem, 7vw, 7rem) clamp(1rem, 4vw, 4.5rem) 1rem;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 1.5rem clamp(1rem, 2.2vw, 2.5rem);
}

.case {
  position: relative;
  align-self: center;
  width: 100%;
  aspect-ratio: 1.75;
  min-height: 390px;
  background: oklch(6% 0.008 240);
  box-shadow:
    0 44px 90px oklch(2% 0.01 245 / 0.72),
    0 4px 14px oklch(2% 0.01 245 / 0.66),
    inset 0 0 0 1px oklch(70% 0.022 210 / 0.08);
  transform: perspective(1800px) rotateY(0.9deg);
  transform-origin: right center;
}

.case::before,
.case::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.case::before {
  z-index: 4;
  top: -6px;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(180deg, oklch(88% 0.026 205 / 0.42), oklch(40% 0.022 215 / 0.11));
  clip-path: polygon(1% 0, 99.3% 0, 100% 100%, 0 100%);
}

.case::after {
  z-index: 4;
  top: -5px;
  right: -5px;
  width: 5px;
  height: calc(100% + 10px);
  background: linear-gradient(90deg, oklch(83% 0.028 205 / 0.34), oklch(28% 0.018 220 / 0.12));
  clip-path: polygon(0 1%, 100% 0, 100% 100%, 0 99%);
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

canvas,
.fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

canvas {
  z-index: 1;
  cursor: default;
}

.case[data-inspecting="true"] canvas {
  cursor: grab;
}

.case[data-inspecting="true"] canvas:active {
  cursor: grabbing;
}

.fallback {
  z-index: 0;
  object-fit: cover;
  object-position: 48% center;
  opacity: 0;
  transition: opacity 700ms var(--ease);
}

.case[data-state="fallback"] .fallback {
  opacity: 1;
}

.glass {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border: 1px solid oklch(88% 0.028 205 / 0.34);
  border-bottom-width: 3px;
  box-shadow:
    inset 0 0 45px oklch(80% 0.022 210 / 0.025),
    0 22px 46px oklch(2% 0.01 240 / 0.35);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(113deg, transparent 16%, oklch(92% 0.032 205 / 0.065) 29%, transparent 45%);
  mix-blend-mode: screen;
}

.glass::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(90deg, oklch(72% 0.026 205 / 0.02), oklch(92% 0.026 205 / 0.2));
}

.loading {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  transition: opacity 450ms var(--ease), visibility 450ms;
}

.loading__line {
  display: block;
  width: 110px;
  height: 1px;
  overflow: hidden;
  background: oklch(75% 0.015 220 / 0.16);
}

.loading__line::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  background: var(--copper);
  animation: load 1.5s var(--ease) infinite;
}

.case:not([data-state="loading"]) .loading {
  opacity: 0;
  visibility: hidden;
}

.identity {
  position: relative;
  align-self: center;
  min-width: 0;
  padding-right: clamp(0rem, 2vw, 2rem);
}

.eyebrow {
  margin: 0 0 clamp(1.6rem, 3.8vw, 3.8rem);
  color: var(--copper);
  font-size: clamp(0.62rem, 0.8vw, 0.75rem);
  font-weight: 680;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.identity__logo {
  display: block;
  width: min(30vw, 470px);
  min-width: 260px;
  transform: translateX(-1.5%);
  filter: drop-shadow(0 10px 25px oklch(3% 0.01 245 / 0.25));
}

.identity__copy {
  max-width: 30ch;
  margin: clamp(1.5rem, 2.8vw, 2.8rem) 0 0;
  color: oklch(75% 0.012 230);
  font-size: clamp(0.86rem, 1.05vw, 1.02rem);
  line-height: 1.55;
}

.controls {
  grid-column: 1;
  display: flex;
  gap: 0.5rem;
}

.control {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-bottom: 1px solid oklch(75% 0.016 220 / 0.13);
  border-radius: 0;
  background: transparent;
  color: oklch(77% 0.012 230);
  cursor: pointer;
  transition: color 350ms var(--ease), border-color 350ms var(--ease), background 350ms var(--ease);
}

.control:hover,
.control[aria-pressed="true"] {
  border-color: oklch(82% 0.016 220 / 0.34);
  background: oklch(19% 0.016 240 / 0.24);
  color: var(--ceramic);
}

.control__icon {
  width: 1.1rem;
  color: var(--copper);
  font-size: 0.8rem;
  text-align: center;
}

.control__label {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.specimen-note {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: end;
  max-width: 290px;
  padding-top: 0.8rem;
  border-top: 1px solid oklch(73% 0.018 220 / 0.16);
  transform: translateY(-0.75rem);
}

.specimen-note p,
.specimen-note strong {
  margin: 0;
}

.specimen-note p {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.specimen-note strong {
  color: var(--ceramic);
  font-size: clamp(1.35rem, 2.2vw, 2.25rem);
  font-weight: 430;
  letter-spacing: -0.03em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes load {
  from { transform: translateX(-110%); }
  to { transform: translateX(260%); }
}

@media (max-width: 900px) {
  .showcase {
    height: auto;
    min-height: 100svh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    align-content: center;
    gap: 1.1rem;
    padding-top: 6.5rem;
  }

  .case {
    min-height: 0;
    aspect-ratio: 1.4;
  }

  .identity {
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(160px, 0.8fr) 1fr;
    gap: 1rem 2rem;
    align-items: end;
  }

  .eyebrow {
    grid-column: 1 / -1;
    margin: 0;
  }

  .identity__logo {
    width: 100%;
    min-width: 0;
  }

  .identity__copy {
    margin: 0;
  }

  .controls {
    grid-column: 1;
  }

  .specimen-note {
    display: none;
  }

}

@media (max-width: 560px) {
  .topbar__meta span:last-child {
    display: none;
  }

  .showcase {
    padding-inline: 1rem;
    padding-bottom: 6rem;
  }

  .case {
    aspect-ratio: 1.58;
    transform: none;
  }

  .identity {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .identity__logo {
    width: min(66vw, 320px);
  }

  .identity__copy {
    max-width: 34ch;
  }

  .controls {
    width: 100%;
  }

  .control {
    flex: 1;
    justify-content: center;
  }

  .control__label {
    font-size: 0.64rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html[data-embed="true"] .topbar,html[data-embed="true"] .identity{display:none}
html[data-embed="true"] .showcase{height:100svh;min-height:0;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto auto;padding:28px;gap:20px}
html[data-embed="true"] .case{height:100%;max-height:none;min-height:0;aspect-ratio:auto;transform:none}
html[data-embed="true"] .controls,html[data-embed="true"] .specimen-note{grid-column:1;justify-self:center}
@media(max-width:760px){html[data-embed="true"] .showcase{padding:18px;gap:16px}}
