:root {
  color-scheme: dark;
  --bg: #101312;
  --panel: rgba(20, 24, 22, 0.78);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.68);
  --accent: #5ee0a7;
  --accent-2: #e9c46a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
}

.shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.hero {
  position: relative;
  min-height: 58svh;
  padding: 28px clamp(18px, 4vw, 64px) 42px;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(16, 19, 18, 0.98), rgba(16, 19, 18, 0.58) 48%, rgba(16, 19, 18, 0.18)),
    url("data:image/svg+xml,%3Csvg width='1400' height='900' viewBox='0 0 1400 900' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1400' height='900' fill='%23252825'/%3E%3Cg transform='translate(170 90) skewX(-14)'%3E%3Cpath d='M0 560 1040 330 1170 790 130 830Z' fill='%233b3f38'/%3E%3Cg stroke='%238d9788' stroke-opacity='.48' stroke-width='3'%3E%3Cpath d='M40 585 1080 350M75 650 1114 414M108 716 1148 478M142 782 1182 542M240 540 360 850M390 506 510 816M540 472 660 782M690 438 810 748M840 404 960 714M990 370 1110 680'/%3E%3C/g%3E%3C/g%3E%3Cg opacity='.7'%3E%3Crect x='860' y='115' width='410' height='290' fill='%231b201e'/%3E%3Cg stroke='%235ee0a7' stroke-opacity='.35' stroke-width='2'%3E%3Cpath d='M860 170h410M860 225h410M860 280h410M860 335h410M930 115v290M1000 115v290M1070 115v290M1140 115v290M1210 115v290'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  z-index: -1;
  background: linear-gradient(0deg, var(--bg), transparent);
}

.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(18px, 4vw, 64px);
  color: rgba(245, 241, 232, 0.82);
  font-size: 14px;
}

.brand {
  font-weight: 760;
  letter-spacing: 0;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
}

.hero-copy {
  max-width: 720px;
  animation: rise 760ms ease-out both;
}

.kicker {
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 104px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.52;
}

.content {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.section-title {
  margin: 0 0 18px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.product {
  display: grid;
  min-height: 260px;
  padding: 24px;
  background: #151917;
  text-decoration: none;
  align-content: space-between;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.product:hover,
.product:focus-visible {
  background: #1b211e;
  transform: translateY(-3px);
  outline: none;
}

.product h2 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: 0;
}

.product p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tag {
  width: fit-content;
  color: #0f1512;
  background: var(--accent);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 760;
}

.tag.secondary {
  background: var(--accent-2);
}

.demo-page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 19, 18, 0.92);
  backdrop-filter: blur(14px);
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
}

.topbar strong {
  font-size: 15px;
}

.sample-frame {
  width: 100%;
  height: calc(100svh - 56px);
  border: 0;
  background: #090b0a;
}

.frame-fallback {
  padding: 18px;
  color: var(--muted);
}

.xr-canvas {
  position: fixed;
  inset: 0;
}

.xr-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  pointer-events: none;
}

.xr-panel {
  width: min(520px, 100%);
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.xr-panel h1 {
  font-size: 18px;
  line-height: 1.15;
}

.occlusion-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ar-actions[hidden] {
  display: none !important;
}

.surface-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: min(420px, 100%);
  padding: 18px;
  background: rgba(16, 19, 18, 0.96);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 220ms ease;
  overflow-y: auto;
}

.surface-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.drawer-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

#surface-picker-close {
  min-width: 42px;
  font-size: 24px;
  line-height: 1;
}

.surface-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.surface-option {
  display: grid;
  gap: 8px;
  padding: 8px;
  text-align: left;
}

.surface-option img {
  width: 100%;
  aspect-ratio: 1.18;
  object-fit: cover;
  display: block;
}

.surface-option span {
  font-size: 13px;
  font-weight: 760;
}

.surface-option.is-selected {
  border-color: var(--accent);
  background: rgba(94, 224, 167, 0.14);
}

.model-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-option {
  min-height: 112px;
  align-content: space-between;
}

.model-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
}

.color-control,
.scale-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.color-control input {
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.scale-control {
  flex: 1 1 170px;
}

.scale-control input {
  width: min(170px, 34vw);
  accent-color: var(--accent);
}

button,
.button {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

button:hover,
.button:hover {
  background: rgba(255, 255, 255, 0.14);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.button.primary,
button.primary {
  color: #0d1511;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 760;
}

button.is-active {
  color: #0d1511;
  background: var(--accent-2);
  border-color: var(--accent-2);
  font-weight: 760;
}

.status {
  font-size: 12px;
  color: var(--muted);
}

.preview-surface {
  position: fixed;
  inset: 56px 0 0;
  background:
    linear-gradient(115deg, rgba(16, 19, 18, 0.1), rgba(16, 19, 18, 0.82)),
    repeating-linear-gradient(0deg, transparent 0 82px, rgba(255, 255, 255, 0.18) 82px 85px),
    repeating-linear-gradient(90deg, transparent 0 82px, rgba(255, 255, 255, 0.18) 82px 85px),
    linear-gradient(135deg, #66736a, #202823);
  transform: perspective(900px) rotateX(62deg) translateY(12vh) scale(1.2);
  transform-origin: center bottom;
}

.occlusion-preview::after {
  content: "";
  position: absolute;
  left: 47%;
  bottom: 18%;
  width: 18%;
  height: 48%;
  background: rgba(18, 22, 20, 0.72);
  border: 1px solid rgba(94, 224, 167, 0.34);
  transform: skewX(-7deg);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .hero {
    min-height: 64svh;
  }

  .product-list {
    grid-template-columns: 1fr;
  }

  .product {
    min-height: 210px;
  }

  .xr-overlay {
    display: block;
  }
}
