@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Manrope:wght@400;500;600&display=swap");

:root {
  --ink: #0a0a0a;
  --paper: #f4f1eb;
  --white: #fff;
  --muted: rgba(255, 255, 255, 0.58);
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(13, 13, 13, 0.72);
  --accent: #ff4b23;
  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-right: max(16px, env(safe-area-inset-right));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  --safe-left: max(16px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }

html, body, #app, #viewer { width: 100%; height: 100%; }

html { background: var(--ink); color-scheme: dark; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, textarea, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

#viewer { position: fixed; inset: 0; overflow: hidden; background: #121212; }
#viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 64px 64px;
  transition: opacity .4s ease;
}
.is-reviewing + .ambient-grid { opacity: 1; }

.glass-panel {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 18px 60px rgba(0,0,0,.24);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.is-hidden { display: none !important; }

/* Launch */
.launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  overflow: auto;
  background:
    radial-gradient(circle at 76% 44%, rgba(255,75,35,.16), transparent 30%),
    linear-gradient(115deg, rgba(5,5,5,.98) 0%, rgba(7,7,7,.88) 48%, rgba(7,7,7,.58) 100%);
}
.launch-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
}
.launch-overlay.is-leaving { animation: launchExit .72s cubic-bezier(.77,0,.18,1) forwards; }
@keyframes launchExit { to { opacity: 0; transform: scale(1.025); visibility: hidden; } }

.launch-nav, .error-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: .12em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  letter-spacing: -.08em;
}
.demo-label, .eyebrow, .panel-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.demo-label { color: rgba(255,255,255,.48); }
.launch-copy {
  position: relative;
  z-index: 1;
  width: min(820px, 86vw);
  align-self: center;
  padding: clamp(54px, 9vh, 120px) clamp(0px, 7vw, 116px);
}
.eyebrow { margin: 0 0 20px; color: var(--accent); }
.launch-copy h1 {
  margin: 0;
  max-width: 800px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(42px, 6.6vw, 100px);
  font-weight: 400;
  line-height: .93;
  letter-spacing: -.065em;
}
.launch-copy h1 span { color: rgba(255,255,255,.36); }
.launch-description {
  max-width: 540px;
  margin: 30px 0;
  color: rgba(255,255,255,.62);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.55;
}
.launch-button {
  display: inline-flex;
  min-width: 228px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 15px 17px 15px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s ease;
}
.launch-button:hover { transform: translateY(-3px); background: var(--accent); color: var(--white); }
.arrow { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: rgba(0,0,0,.08); }
.launch-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  color: rgba(255,255,255,.42);
  font-size: 9px;
  letter-spacing: .16em;
}
.launch-meta span { padding-top: 14px; }
.launch-meta span:nth-child(2) { text-align: center; }
.launch-meta span:last-child { text-align: right; }
.reveal-item { opacity: 0; transform: translateY(16px); animation: reveal .75s cubic-bezier(.16,1,.3,1) forwards; }
.reveal-item:nth-child(2) { animation-delay: .08s; }
.launch-copy .reveal-item:nth-child(2) { animation-delay: .12s; }
.launch-copy .reveal-item:nth-child(3) { animation-delay: .2s; }
.launch-copy .reveal-item:nth-child(4) { animation-delay: .28s; }
.launch-meta.reveal-item { animation-delay: .34s; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* App chrome */
.experience-ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.experience-ui button, .experience-ui textarea, .experience-ui .demo-rail, .experience-ui .topbar, .experience-ui .bottom-controls, .experience-ui .review-panel, .experience-ui .note-composer, .experience-ui .tour-controls, .experience-ui .tour-info { pointer-events: auto; }
.topbar {
  position: absolute;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(170px,1fr) auto minmax(170px,1fr);
  align-items: center;
  padding: 11px 13px;
  border-radius: 18px;
}
.brand-button { width: max-content; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.project-heading { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.project-heading span { color: rgba(255,255,255,.45); font-size: 9px; letter-spacing: .15em; }
.project-heading strong { font-weight: 500; font-size: 14px; }
.segmented-control {
  justify-self: end;
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.segment-button {
  min-width: 88px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.segment-button:hover { color: var(--white); }
.segment-button.is-active { background: var(--white); color: var(--ink); box-shadow: 0 3px 18px rgba(0,0,0,.18); }
.menu-toggle { display: none !important; justify-self: end; }
.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  cursor: pointer;
}

/* Workflow rail */
.demo-rail {
  position: absolute;
  top: calc(var(--safe-top) + 86px);
  bottom: calc(var(--safe-bottom) + 74px);
  left: var(--safe-left);
  width: min(296px, calc(100vw - 32px));
  padding: 16px;
  overflow: auto;
  border-radius: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 3px 3px 14px; color: rgba(255,255,255,.42); font-size: 9px; letter-spacing: .16em; }
.rail-close { display: none; border: 0; background: none; color: var(--white); font-size: 24px; cursor: pointer; }
.workflow-list { display: grid; gap: 8px; }
.workflow-button {
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(255,255,255,.035);
  text-align: left;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.workflow-button:hover { transform: translateX(3px); background: rgba(255,255,255,.07); }
.workflow-button.is-active { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.1); }
.workflow-top { display: flex; gap: 10px; align-items: center; }
.workflow-index { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); color: rgba(255,255,255,.52); font-size: 9px; }
.workflow-button.is-active .workflow-index { background: var(--accent); color: var(--white); }
.workflow-name { font-size: 13px; font-weight: 500; }
.workflow-description { margin: 9px 0 0 38px; color: rgba(255,255,255,.48); font-size: 11px; line-height: 1.42; }

/* View markers */
.viewpoint-layer { position: fixed; inset: 0; z-index: 22; pointer-events: none; }
.viewpoint-button {
  position: absolute;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 50%;
  background: rgba(12,12,12,.58);
  box-shadow: 0 8px 22px rgba(0,0,0,.26);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.viewpoint-button::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 5px rgba(255,255,255,.12); }
.viewpoint-button span { position: absolute; left: 50%; top: calc(100% + 8px); padding: 5px 8px; border-radius: 999px; background: rgba(0,0,0,.7); color: var(--white); font-size: 9px; letter-spacing: .1em; white-space: nowrap; transform: translateX(-50%); opacity: 0; transition: opacity .2s ease; }
.viewpoint-button:hover { transform: translate(-50%, -50%) scale(1.08); background: var(--accent); }
.viewpoint-button:hover span { opacity: 1; }

/* Panels */
.review-panel {
  position: absolute;
  top: calc(var(--safe-top) + 86px);
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 74px);
  width: min(312px, calc(100vw - 32px));
  padding: 18px;
  overflow: auto;
  border-radius: 18px;
}
.panel-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.panel-title-row h2 { margin: 4px 0 0; font-size: 18px; font-weight: 500; }
.panel-kicker { color: rgba(255,255,255,.43); }
.count-pill { display: grid; min-width: 28px; height: 28px; place-items: center; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11px; }
.panel-help { margin: 16px 0; color: rgba(255,255,255,.48); font-size: 12px; line-height: 1.45; }
.notes-list { display: grid; gap: 8px; min-height: 50px; }
.empty-notes { padding: 22px 10px; border: 1px dashed rgba(255,255,255,.15); border-radius: 12px; color: rgba(255,255,255,.35); font-size: 11px; text-align: center; }
.note-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; align-items: start; padding: 10px; border-radius: 11px; background: rgba(255,255,255,.06); }
.note-number { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--accent); font-size: 10px; }
.note-item p { margin: 2px 0 0; font-size: 11px; line-height: 1.4; }
.delete-note { border: 0; background: none; color: rgba(255,255,255,.4); cursor: pointer; }
.secondary-button { width: 100%; margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--white); font-size: 11px; cursor: pointer; }
.secondary-button:disabled { opacity: .35; cursor: default; }
.note-pin { position: absolute; display: grid; width: 30px; height: 30px; place-items: center; border: 2px solid var(--white); border-radius: 50%; background: var(--accent); color: var(--white); font-size: 10px; pointer-events: auto; transform: translate(-50%,-100%); box-shadow: 0 6px 18px rgba(0,0,0,.4); cursor: pointer; }
.note-composer { position: absolute; left: 50%; bottom: calc(var(--safe-bottom) + 76px); width: min(420px, calc(100vw - 32px)); padding: 14px; border-radius: 16px; transform: translateX(-50%); }
.note-composer label { display: block; margin: 0 0 8px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.note-composer textarea { width: 100%; resize: none; padding: 12px; border: 1px solid var(--line); outline: 0; border-radius: 10px; background: rgba(0,0,0,.24); color: var(--white); font-size: 12px; }
.note-composer textarea:focus { border-color: rgba(255,255,255,.45); }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.text-button, .primary-small { padding: 9px 13px; border: 0; border-radius: 999px; cursor: pointer; font-size: 11px; }
.text-button { background: transparent; color: rgba(255,255,255,.58); }
.primary-small { background: var(--white); color: var(--ink); }

.tour-controls {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 76px);
  display: flex;
  width: min(440px, calc(100vw - 32px));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  border-radius: 17px;
  transform: translateX(-50%);
}
.tour-controls strong { display: block; margin-top: 3px; font-size: 13px; font-weight: 500; }
.tour-actions { display: flex; gap: 7px; }

.tour-info {
  position: absolute;
  top: calc(var(--safe-top) + 86px);
  right: var(--safe-right);
  width: min(312px, calc(100vw - 32px));
  max-height: calc(100svh - 180px);
  padding: 18px;
  overflow: auto;
  border-radius: 18px;
}
.tour-info h2 { margin: 5px 0 13px; font-size: 18px; font-weight: 500; }
.tour-info p { margin: 0; color: rgba(255,255,255,.58); font-size: 12px; line-height: 1.6; }
.tour-info ul { display: grid; gap: 8px; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; }
.tour-info li { display: flex; gap: 8px; color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.4; }
.tour-info li::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--accent); }

.bottom-controls {
  position: absolute;
  left: 50%;
  bottom: var(--safe-bottom);
  display: flex;
  min-height: 54px;
  max-width: calc(100vw - 32px);
  align-items: center;
  gap: 12px;
  padding: 7px;
  border-radius: 999px;
  transform: translateX(-50%);
}
.control-button { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 0; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 11px; white-space: nowrap; cursor: pointer; }
.control-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.1); }
.control-divider { width: 1px; height: 22px; background: var(--line); }
.interaction-hint { padding-right: 8px; color: rgba(255,255,255,.48); font-size: 10px; white-space: nowrap; }

.loading-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; padding: 0 16px calc(var(--safe-bottom) + 30px); background: rgba(0,0,0,.3); pointer-events: auto; }
.loading-content { width: min(420px, 100%); }
.loading-top { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 10px; letter-spacing: .06em; }
.loading-track { height: 2px; overflow: hidden; background: rgba(255,255,255,.18); }
.loading-track span { display: block; width: 0; height: 100%; background: var(--white); transition: width .15s linear; }
.fade-overlay { position: fixed; inset: 0; z-index: 80; background: #000; opacity: 0; pointer-events: none; }
.toast { position: absolute; top: calc(var(--safe-top) + 86px); left: 50%; padding: 9px 14px; border-radius: 999px; background: rgba(0,0,0,.74); font-size: 11px; opacity: 0; transform: translate(-50%,-8px); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }

/* 404 */
.error-page { min-height: 100svh; overflow: hidden; padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); background: radial-gradient(circle at 76% 42%, rgba(255,75,35,.18), transparent 28%), #090909; }
.error-content { position: relative; z-index: 2; display: flex; min-height: calc(100svh - 90px); width: min(760px,90vw); flex-direction: column; align-items: flex-start; justify-content: center; margin: auto; }
.error-content h1 { margin: 0; font-family: "Manrope", sans-serif; font-size: clamp(120px,30vw,420px); font-weight: 400; line-height: .78; letter-spacing: -.1em; }
.error-content h1 span { color: var(--accent); }
.error-content > p:not(.eyebrow) { margin: 36px 0 24px; color: rgba(255,255,255,.48); }
.error-orbit { position: fixed; right: -14vw; bottom: -30vw; width: 70vw; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; }
.error-orbit span { position: absolute; inset: 12%; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; }
.error-orbit span:nth-child(2) { inset: 25%; }
.error-orbit span:nth-child(3) { inset: 41%; background: var(--accent); opacity: .75; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto auto; gap: 10px; }
  .project-heading { text-align: left; }
  .topbar > .brand { display: none; }
  .menu-toggle { display: grid !important; }
  .demo-rail { top: 0; bottom: 0; left: 0; z-index: 40; width: min(340px, 88vw); padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px); border-radius: 0 18px 18px 0; transform: translateX(-105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .demo-rail.is-open { transform: translateX(0); }
  .rail-close { display: block; }
  .review-panel { top: auto; right: var(--safe-right); bottom: calc(var(--safe-bottom) + 74px); max-height: min(42svh, 360px); }
  .tour-info { max-height: min(46svh, 390px); }
}

@media (max-width: 640px) {
  .launch-nav .brand { font-size: 9px; }
  .launch-copy { width: 100%; padding-inline: 4px; }
  .launch-copy h1 { font-size: clamp(42px, 13vw, 68px); }
  .launch-meta { grid-template-columns: 1fr; gap: 5px; }
  .launch-meta span, .launch-meta span:nth-child(2), .launch-meta span:last-child { padding: 0; text-align: left; }
  .launch-meta span:first-child { padding-top: 12px; }
  .topbar { min-height: 62px; padding: 9px; border-radius: 15px; }
  .project-heading span { display: none; }
  .segmented-control { order: 2; }
  .segment-button { min-width: 66px; padding: 8px 10px; font-size: 11px; }
  .menu-toggle { width: 34px; height: 34px; }
  .review-panel { left: var(--safe-left); right: var(--safe-right); width: auto; max-height: 32svh; }
  .tour-info { left: var(--safe-left); right: var(--safe-right); width: auto; max-height: 34svh; }
  .bottom-controls { min-height: 48px; }
  .interaction-hint, .control-divider { display: none; }
  .control-button { padding: 6px 9px; }
  .viewpoint-button { width: 42px; height: 42px; }
  .note-composer, .tour-controls { bottom: calc(var(--safe-bottom) + 66px); }
}

@media (max-height: 560px) and (orientation: landscape) {
  .launch-copy { padding-block: 24px; }
  .launch-description { margin: 14px 0; }
  .launch-meta { display: none; }
  .topbar { top: 8px; left: 8px; right: 8px; min-height: 54px; }
  .demo-rail { top: 0; bottom: 0; }
  .review-panel { top: 70px; bottom: 68px; }
  .bottom-controls { bottom: 8px; }
}

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