:root {
  color-scheme: dark;
  --bg: #090605;
  --panel: #15100d;
  --paper: #f2ede6;
  --muted: #a99d96;
  --line: rgba(255, 255, 255, .14);
  --orange: #ff5b00;
  --lime: #b7e36d;
}

* { box-sizing: border-box; }

html,
body { width: 100%; height: 100%; margin: 0; }

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--paper);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button { font: inherit; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.demo-shell { position: relative; display: flex; width: 100%; height: 100vh; height: 100dvh; flex-direction: column; }

.demo-toolbar {
  position: relative;
  z-index: 10;
  display: grid;
  flex: none;
  grid-template-columns: minmax(178px, 1fr) auto minmax(250px, 350px) auto;
  align-items: center;
  gap: 20px;
  min-height: 82px;
  padding: 13px clamp(18px, 2.2vw, 36px);
  border-bottom: 1px solid rgba(255, 91, 0, .42);
  background: #0c0807;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .38);
}

.demo-toolbar::before {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--orange), transparent 58%);
  content: "";
  pointer-events: none;
}

.demo-identity { display: flex; min-width: 0; align-items: center; gap: 13px; }
.demo-logo { display: block; flex: 0 1 165px; min-width: 116px; }
.demo-logo img { display: block; width: 100%; height: auto; }

.demo-badge,
.picker-eyebrow,
.project-menu-heading,
.mode-tab,
.project-option span {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.demo-badge {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 91, 0, .6);
  color: var(--orange);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}

.mode-tabs {
  display: flex;
  min-width: 0;
  padding: 3px;
  border: 1px solid rgba(255, 91, 0, .4);
  background: #130b07;
}

.mode-tab {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 15px;
  color: #c9bbb2;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}

.mode-tab:hover { color: var(--paper); background: rgba(255, 91, 0, .12); }
.mode-tab.is-active,
.mode-tab.is-active:hover { color: #140904; background: var(--orange); }
.mode-tab small { font: inherit; font-size: 10px; opacity: .65; }

.project-actions { display: flex; min-width: 0; align-items: stretch; gap: 8px; }
.project-picker { position: relative; min-width: 0; flex: 1; }
.project-picker summary { display: flex; min-height: 49px; align-items: center; gap: 14px; padding: 7px 13px 7px 16px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; list-style: none; }
.project-picker summary::-webkit-details-marker { display: none; }
.project-picker summary:hover,
.project-picker[open] summary { border-color: var(--orange); }
.picker-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.picker-eyebrow { color: var(--orange); font-size: 9px; }
.picker-copy strong { overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.picker-chevron { width: 15px; height: 15px; flex: none; stroke: var(--orange); stroke-width: 2; transition: transform .2s ease; }
.project-picker[open] .picker-chevron { transform: rotate(180deg); }

.project-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 20;
  width: min(390px, calc(100vw - 32px));
  max-height: min(66vh, 590px);
  max-height: min(66dvh, 590px);
  overflow: auto;
  border: 1px solid rgba(255, 91, 0, .48);
  background: rgba(18, 12, 10, .98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .7);
  scrollbar-color: var(--orange) #1d1410;
  scrollbar-width: thin;
}

.project-menu-heading {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: #1c100b;
  color: var(--orange);
  font-size: 10px;
}

.project-menu-heading span { color: var(--muted); }
.project-menu ul { margin: 0; padding: 0; list-style: none; }
.project-menu li + li { border-top: 1px solid rgba(255, 255, 255, .07); }
.project-option { display: flex; min-height: 65px; flex-direction: column; justify-content: center; gap: 5px; padding: 10px 18px; border-left: 3px solid transparent; text-decoration: none; }
.project-option:hover { background: rgba(255, 91, 0, .11); }
.project-option.is-active { border-left-color: var(--orange); background: rgba(255, 91, 0, .16); }
.project-option strong { font-size: 13px; line-height: 1.3; }
.project-option span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.project-empty { color: var(--muted); font-size: 13px; }

.device-switch { display: flex; align-items: center; padding: 3px; border: 1px solid var(--line); background: var(--panel); }
.device-button { display: grid; width: 38px; height: 42px; place-items: center; padding: 0; border: 0; background: transparent; color: #b8aaa2; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.device-button:hover { color: var(--paper); background: rgba(255, 91, 0, .13); }
.device-button.is-active { color: #160a04; background: var(--orange); }
.device-button svg { width: 19px; height: 19px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.toolbar-toggle {
  z-index: 30;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(255, 91, 0, .5);
  background: #130b07;
  color: var(--orange);
  cursor: pointer;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.toolbar-toggle:hover { background: var(--orange); color: #140904; }
.toolbar-toggle span { margin-left: 5px; font-size: 14px; line-height: 1; }
.toolbar-hide { position: absolute; right: clamp(18px, 2.2vw, 36px); bottom: -28px; width: 32px; padding: 0; }
.toolbar-hide span { margin-left: 0; }
.toolbar-show { position: absolute; top: 0; right: clamp(18px, 2.2vw, 36px); display: none; width: 32px; padding: 0; }
.toolbar-show span { margin-left: 0; }
.toolbar-collapsed .demo-toolbar { display: none; }
.toolbar-collapsed .toolbar-show { display: block; }

.preview-stage {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  overflow: auto;
  background: radial-gradient(ellipse at 50% 85%, #281006 0, #100907 43%, #090605 82%);
}

.preview-stage::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 91, 0, .65) 1px, transparent 1.5px), radial-gradient(circle, rgba(242, 237, 230, .32) 1px, transparent 1.5px);
  background-position: 24px 38px, 136px 91px;
  background-size: 187px 163px, 267px 211px;
  opacity: .38;
  content: "";
  pointer-events: none;
}

.frame-shell { position: relative; z-index: 1; min-width: 0; min-height: 0; overflow: hidden; transition: width .3s ease, height .3s ease, border-radius .3s ease; }
.frame-shell.desktop { width: 100%; flex: 1; background: #fff; }
.frame-shell.tablet,
.frame-shell.mobile { width: min(calc(100% - 32px), 768px); height: min(90%, 860px); flex: none; margin: auto 0; border: 10px solid #211814; border-radius: 26px; background: #fff; box-shadow: 0 18px 70px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 91, 0, .35); }
.frame-shell.mobile { width: min(calc(100% - 32px), 390px); height: min(88%, 780px); border-width: 9px; border-radius: 30px; }
.frame-shell iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.empty-stage { z-index: 1; margin: auto; color: var(--muted); }

@media (max-width: 1120px) {
  .demo-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; }
  .demo-identity { grid-row: 1; grid-column: 1; }
  .device-switch { grid-row: 1; grid-column: 2; }
  .mode-tabs { grid-row: 2; grid-column: 1; justify-self: start; }
  .project-actions,
  .project-empty { grid-row: 2; grid-column: 2; width: min(350px, 38vw); }
}

@media (max-width: 740px) {
  .demo-toolbar { gap: 10px; padding: 10px 16px 12px; }
  .demo-logo { flex-basis: 150px; }
  .demo-badge { display: none; }
  .mode-tabs { grid-row: 2; grid-column: 1 / -1; width: 100%; }
  .mode-tab { flex: 1; min-height: 38px; padding: 0 8px; font-size: 10px; }
  .project-actions,
  .project-empty { grid-row: 3; grid-column: 1 / -1; width: 100%; }
  .device-button { width: 35px; height: 35px; }
  .toolbar-hide, .toolbar-show { right: 16px; }
}

@media (max-width: 430px) {
  .demo-logo { flex-basis: 132px; }
}

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