:root {
  color-scheme: dark;
  --intro-blue: #0001fc;
  --intro-text: #f5f7ff;
  --intro-muted: #c5ceec;
  --intro-line: #c2cfff37;
  font: 15px/1.48 "Inter", "Segoe UI", sans-serif;
  color: var(--intro-text);
  background: #090e26;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #a4bdff; outline-offset: 4px; }

.landing {
  --hero-glow-x: 65%;
  --hero-glow-y: 48%;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: max(700px, 100svh);
  overflow: hidden;
  padding: 30px clamp(25px, 4vw, 68px) 28px;
  background:
    linear-gradient(90deg, #090f2a9c 0%, #0b12354d 27%, transparent 54%),
    radial-gradient(ellipse at var(--hero-glow-x) var(--hero-glow-y), #344eff 0%, #1e35bb 28%, #152168 53%, #0d1540 72%, #0a102b 100%);
  --split: 52%;
}
.landing-header { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 13px; pointer-events: none; }
.intro-brand { display: block; position: relative; aspect-ratio: 7.4; overflow: hidden; mix-blend-mode: screen; }
.intro-brand img { position: absolute; inset: 0 auto auto 0; width: 111%; max-width: none; transform: translate(-5.5%, -37.3%); filter: grayscale(1) brightness(1.5) contrast(2.7); }
.hero-brand { z-index: 4; width: min(55vw, 790px); pointer-events: auto; }
.landing-nav { position: relative; z-index: 5; display: flex; align-items: center; gap: 9px; pointer-events: auto; }
.login-link, .landing-menu summary { align-items: center; justify-content: center; min-height: 42px; display: flex; border: 1px solid var(--intro-line); border-radius: 999px; background: #0a123b62; }
.login-link { padding: 0 15px; text-decoration: none; white-space: nowrap; font-size: 13px; }
.login-link:hover, .landing-menu summary:hover { background: #304efa9c; }
.landing-menu { position: relative; }
.landing-menu summary { flex-direction: column; gap: 5px; width: 42px; list-style: none; }
.landing-menu summary::-webkit-details-marker { display: none; }
.landing-menu summary span { display: block; width: 14px; height: 1px; background: currentColor; }
.landing-menu > div { position: absolute; right: 0; top: calc(100% + 8px); width: max-content; padding: 5px; border: 1px solid var(--intro-line); border-radius: 9px; background: #121a41; }
.landing-menu > div a { display: block; padding: 7px 10px; border-radius: 5px; text-decoration: none; font-size: 13px; }
.landing-menu > div a:hover { background: #253a8d; }
.landing[data-motion="still"] :is(.intro-still, .demo-controls, .demo-caption),
.landing[data-motion="still"]:not([data-orbit="true"]) .landing-demo,
.landing[data-motion="process"] .intro-process { display: none; }
.landing[data-motion="still"] .landing-copy { margin-bottom: 10px; }

.hero-model { position: absolute; inset: 0; margin: 0; pointer-events: none; }
.hero-composition {
  position: absolute;
  left: 24%;
  top: 54%;
  width: min(92vw, 1380px);
  aspect-ratio: 1320 / 1040;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}
.landing[data-object="burner"] .hero-composition {
  left: var(--hero-glow-x);
  top: var(--hero-glow-y);
  width: min(92vw, 1550px);
  transform: translate(-50%, -50%);
}
.landing[data-object="chair"] .hero-composition { left: 34%; top: 52%; }
.landing[data-object="vase"] .hero-composition { left: 28%; width: min(96vw, 1210px); aspect-ratio: 6 / 5; }
.hero-art { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.hero-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; cursor: grab; }
.hero-canvas:active { cursor: grabbing; }
.hero-canvas:focus-visible { outline: none; }
.landing:has(.hero-canvas:focus-visible) .hero-tools { outline: 2px solid #a4bdff; outline-offset: 3px; }
.landing[data-orbit="true"] .hero-art { visibility: hidden; }
.hero-clay-layer { position: absolute; inset: 0; opacity: 0; }
.landing[data-step="source"] .hero-clay-layer { opacity: 1; }
.landing[data-step="source"] .hero-textured { opacity: 0; }
.landing[data-step="material"] .hero-clay-layer { clip-path: inset(0 calc(100% - var(--split)) 0 0); opacity: 1; }
.hero-compare { display: none; position: absolute; inset: 0; }
.landing[data-step="material"] .hero-compare { display: block; }
.hero-compare-line { position: absolute; top: 10%; bottom: 11%; left: var(--split); width: 1px; background: linear-gradient(transparent, #dceaffda 28%, #c5d8ff 70%, transparent); filter: drop-shadow(0 0 5px #769cff); }
.hero-compare-handle { position: absolute; top: 51%; left: var(--split); transform: translate(-50%, -50%); display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #e7efffa0; border-radius: 50%; background: #111a53ae; color: white; font-size: 16px; }
#hero-split { appearance: none; position: absolute; top: 51%; left: calc(9% - 18px); width: calc(85% + 36px); height: 44px; margin: 0; transform: translateY(-50%); opacity: 0; pointer-events: none; }
#hero-split::-webkit-slider-thumb { appearance: none; width: 36px; height: 44px; cursor: ew-resize; pointer-events: auto; }
#hero-split::-moz-range-thumb { width: 36px; height: 44px; cursor: ew-resize; pointer-events: auto; }
.hero-compare:focus-within .hero-compare-handle { outline: 2px solid #a4bdff; outline-offset: 4px; }

.landing-copy { position: relative; z-index: 2; align-self: end; width: min(45%, 530px); padding: 15px 0 8px; pointer-events: none; text-shadow: 0 1px 3px #080d28c4, 0 2px 14px #080d28b0; }
.landing-copy a { pointer-events: auto; text-shadow: none; }
.landing-copy h1 { margin: 0 0 13px; font-size: clamp(35px, 4.05vw, 64px); font-weight: 670; line-height: 1.04; letter-spacing: -.05em; }
.landing-copy p { max-width: 36ch; margin: 0 0 21px; color: var(--intro-muted); font-size: clamp(15px, 1.38vw, 19px); }
.intro-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 13px;
  min-height: 47px; padding: 0 17px; color: white;
  border: 1px solid #8da4fa87; border-radius: 9px; background: var(--intro-blue);
  font-weight: 650; font-size: 14px; text-decoration: none;
}
.intro-primary:hover { background: #2337ff; }
.intro-primary span { font-size: 17px; }

.landing-demo { position: relative; z-index: 3; display: grid; gap: 9px; margin-top: 17px; }
.demo-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.demo-caption { margin-left: auto; width: min(330px, 100%); }
.demo-caption p { margin: 0; padding: 9px 12px; border: 1px solid var(--intro-line); border-radius: 9px; background: #0a12335c; color: #e6edff; font-size: 13px; }
.hero-tools { display: flex; align-items: center; gap: 10px; padding: 3px 3px 3px 10px; border: 1px solid var(--intro-line); border-radius: 9px; background: #0a1233ab; color: #e6edff; font-size: 12px; pointer-events: auto; }
.hero-tools button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--intro-line); border-radius: 6px; background: #283e8152; font-size: 18px; }
.hero-tools button:hover { background: #253d97; }
.demo-controls { display: flex; gap: 6px; padding: 6px; border: 1px solid var(--intro-line); border-radius: 13px; background: #101735ac; }
.demo-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; gap: 4px; }
.demo-steps button, .demo-play { border: 1px solid transparent; border-radius: 8px; background: transparent; }
.demo-steps button { position: relative; overflow: hidden; text-align: left; padding: 9px 10px; color: #c5ceec; line-height: 1.25; }
.demo-steps button span { margin-right: 5px; color: #98adfa; font-size: 10px; font-variant-numeric: tabular-nums; }
.demo-steps button[aria-pressed="true"] { color: white; background: #263bbb; border-color: #8da4fa69; }
.demo-steps button:hover { color: white; background: #253d978d; }
.landing[data-playing="true"] .demo-steps button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 2px;
  height: 1px;
  background: #b9cdff;
  transform-origin: left;
  animation: step-progress var(--step-duration) linear both;
}
@keyframes step-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.demo-play { position: relative; display: grid; place-items: center; flex: none; width: 42px; border-left-color: var(--intro-line); color: #e5ecff; }
.demo-play:hover { background: #253d978d; }
.pause-symbol { width: 11px; height: 13px; border: solid currentColor; border-width: 0 3px; }
.play-symbol { width: 0; height: 0; border-block: 7px solid transparent; border-left: 11px solid currentColor; }

.auth-page { min-height: 100svh; background: radial-gradient(ellipse at 65% 47%, #243dcd, #131e61 37%, #0b102b 73%); }
.auth-header { position: relative; padding: 30px clamp(20px, 4vw, 58px); }
.auth-brand { width: min(210px, 53vw); }
.auth-layout { position: relative; isolation: isolate; display: grid; align-items: center; min-height: calc(100svh - 108px); padding: 27px clamp(20px, 9vw, 160px) 57px; overflow: hidden; }
.auth-model { position: absolute; z-index: -1; left: 29%; top: 50%; width: min(90vw, 1200px); height: auto; transform: translateY(-50%); opacity: .78; }
.auth-panel { width: min(412px, 100%); padding: clamp(19px, 4vw, 33px); border: 1px solid var(--intro-line); border-radius: 15px; background: #111838eb; box-shadow: 0 18px 74px #05091c6e; }
.auth-panel h1 { margin: 0 0 7px; font-weight: 650; font-size: 28px; letter-spacing: -.025em; }
.auth-summary { margin: 0 0 20px; color: var(--intro-muted); font-size: 14px; }
.auth-field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 570; font-size: 13px; }
.auth-field input { min-width: 0; width: 100%; min-height: 44px; padding: 8px 9px; border: 1px solid var(--intro-line); border-radius: 7px; background: #0b1230; font-size: 16px; }
.auth-check { display: flex; align-items: start; gap: 8px; margin: 11px 0; color: #d6dff8; font-size: 13px; }
.auth-check input { flex: none; margin: 3px 0 0; accent-color: #526aff; }
.auth-check a { color: #b4c7ff; }
.auth-panel .intro-primary { display: flex; width: 100%; margin-top: 20px; }
.auth-demo-note, .auth-back { display: block; margin: 12px 0 0; color: var(--intro-muted); font-size: 12px; }
.auth-error { margin: -2px 0 5px; color: #ffb5ad; font-size: 12px; }

@media (max-width: 740px) {
  .landing { min-height: max(744px, 100svh); padding: 19px 14px 17px; gap: 3px; }
  .landing[data-object="burner"] { --hero-glow-x: 54%; --hero-glow-y: min(calc(68px + 51vw), 356px); }
  .hero-brand { width: min(57vw, 390px); }
  .landing-nav { gap: 4px; }
  .login-link, .landing-menu summary { min-height: 35px; }
  .login-link { padding: 0 10px; font-size: 12px; }
  .landing-menu summary { width: 35px; }
  .landing[data-object] .hero-composition { width: min(129vw, 730px); top: 68px; left: 50%; transform: translateX(-50%); }
  .landing[data-object="burner"] .hero-composition { left: var(--hero-glow-x); top: var(--hero-glow-y); transform: translate(-50%, -50%); }
  .landing-copy { width: min(100%, 415px); margin-top: 296px; padding-top: 10px; }
  .landing-copy h1 { font-size: clamp(32px, 7vw, 47px); margin-bottom: 9px; }
  .landing-copy p { margin-bottom: 13px; }
  .intro-primary { min-height: 42px; padding: 0 13px; }
  .landing-demo { margin-top: 5px; }
  .demo-caption { width: 100%; }
  .demo-caption p { font-size: 11px; padding: 6px 9px; }
  .demo-steps button { padding: 6px 5px; font-size: 10px; }
  .demo-steps button span { display: block; margin: 0 0 2px; }
  .demo-play { width: 31px; }
  .auth-layout { align-items: start; min-height: calc(100svh - 88px); padding-top: 45px; }
  .auth-model { width: 190vw; left: 50%; opacity: .45; transform: translate(-50%, -45%); }
  .auth-panel { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .landing[data-playing="true"] .demo-steps button[aria-pressed="true"]::after { animation: none; }
}

@media (pointer: coarse) {
  .landing-copy { pointer-events: auto; }
}
