:root {
  --bg-top: #081019;
  --bg-mid: #101a29;
  --bg-bottom: #060b12;
  --window: rgba(11, 18, 28, 0.9);
  --panel: rgba(18, 27, 40, 0.8);
  --panel-strong: rgba(10, 16, 25, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --ink: #edf2f7;
  --muted: #90a0b8;
  --glow: 0 38px 90px rgba(0, 0, 0, 0.52);
  --accent: #d26a4c;
  --accent-glow: rgba(210, 106, 76, 0.28);
  --accent-haze: rgba(210, 106, 76, 0.16);
  --band-padding-y: 16px;
  --band-padding-x: 20px;
  --band-min-height: 76px;
  --center-side: clamp(560px, 48vw, 860px);
  --lateral-width: clamp(180px, calc(var(--center-side) * 0.28), 240px);
  --dvara-gap: clamp(12px, calc(var(--center-side) * 0.022), 18px);
  --corner-size: clamp(136px, calc(var(--lateral-width) * 0.88), 196px);
  --font-ui: "Avenir Next", "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-mono: "SF Mono", "Fira Code", monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 22%, var(--accent-haze), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(126, 170, 255, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
  font-family: var(--font-ui);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.018) 50%, transparent 100%);
  opacity: 0.55;
  mask: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

body::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.05;
}

.finder-window {
  width: min(1740px, calc(100vw - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
  padding: 18px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(15, 23, 36, 0.94), rgba(9, 15, 24, 0.98));
  box-shadow: var(--glow);
  overflow: hidden;
  backdrop-filter: blur(24px);
}

.finder-window::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  pointer-events: none;
}

.finder-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.02), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.015));
  pointer-events: none;
}

.finder-stage {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 60px);
  display: grid;
  gap: var(--dvara-gap);
  grid-template-columns: var(--lateral-width) minmax(0, var(--center-side)) var(--lateral-width);
  grid-template-rows: auto minmax(500px, 1fr) auto;
  grid-template-areas:
    "nw north ne"
    "west center east"
    "sw south se";
  justify-content: center;
  align-content: center;
}

.zone-northwest { grid-area: nw; }
.zone-north { grid-area: north; }
.zone-northeast { grid-area: ne; }
.zone-west { grid-area: west; }
.zone-center { grid-area: center; }
.zone-east { grid-area: east; }
.zone-southwest { grid-area: sw; }
.zone-south { grid-area: south; }
.zone-southeast { grid-area: se; }

.corner-card,
.window-chrome,
.sidebar,
.browser,
.preview,
.status-bar {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
}

.corner-card {
  position: relative;
  justify-self: center;
  width: min(100%, var(--corner-size));
  min-height: var(--corner-size);
  padding: 18px 18px 16px;
  display: grid;
  align-content: start;
  gap: 10px;
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.corner-card::before {
  content: "";
  position: absolute;
  inset: auto -12% -24% auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--accent-haze), transparent 72%);
  opacity: 0.7;
}

.zone-northwest,
.zone-southwest {
  border-color: color-mix(in srgb, var(--accent) 42%, rgba(255, 255, 255, 0.08));
}

.zone-northeast,
.zone-southeast {
  border-color: rgba(255, 255, 255, 0.12);
}

.window-chrome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: var(--band-min-height);
  padding: var(--band-padding-y) var(--band-padding-x);
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

.traffic-lights { display: flex; gap: 8px; }

.light {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.light-red { background: #ff5f57; }
.light-amber { background: #ffbd2e; }
.light-green { background: #28c840; }

.window-title { min-width: 0; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1, h2, p, ol, article { margin: 0; }

h1 {
  font-family: var(--font-display);
  font-size: clamp(27px, 2.8vw, 38px);
  line-height: 0.98;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 18px;
  line-height: 1.08;
}

#frameGlyph {
  color: var(--accent);
  transition: color 420ms ease;
}

.corner-copy {
  max-width: 22ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.58;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 240ms, transform 240ms, box-shadow 240ms;
}

button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar,
.preview,
.browser {
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.sidebar { padding: 22px 18px; }

.sidebar-section { display: grid; gap: 14px; }

.sidebar-section h2,
.preview-head h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.sequence-list {
  padding-left: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.sequence-item { display: block; }

.sequence-button {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  line-height: 1.45;
}

.sequence-button.is-active {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 58%, rgba(255, 255, 255, 0.1));
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 18px var(--accent-glow);
}

.browser {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(9, 15, 23, 0.88), rgba(8, 13, 20, 0.92));
}

.quote-shell {
  height: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}

.quote-shell-inner {
  width: min(100%, 780px);
  display: grid;
  gap: 20px;
}

.slide-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.slide-kicker {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: opacity 420ms ease, transform 420ms ease;
}

.tone-pill,
.preview-accent {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 56%, rgba(255, 255, 255, 0.1));
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
}

.quote-frame {
  position: relative;
  min-height: 420px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, rgba(255, 255, 255, 0.09));
  border-radius: 30px;
  background:
    radial-gradient(circle at 24% 18%, var(--accent-haze), transparent 34%),
    linear-gradient(180deg, rgba(9, 14, 22, 0.94), rgba(6, 10, 17, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 24px 70px var(--accent-glow),
    inset 0 0 60px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  transition: border-color 420ms ease, box-shadow 420ms ease;
}

.quote-frame::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  pointer-events: none;
}

.quote-frame::after {
  content: "";
  position: absolute;
  inset: auto auto 18px 18px;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--accent-haze), transparent 72%);
  filter: blur(2px);
  opacity: 0.85;
  pointer-events: none;
}

.quote-frame-inner {
  position: relative;
  z-index: 1;
  min-height: 420px;
  padding: 54px 62px;
  display: grid;
  place-items: center;
}

.frame-ambient {
  position: absolute;
  inset: 24px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.06), transparent 26%),
    linear-gradient(135deg, transparent 0 38%, rgba(255, 255, 255, 0.03) 50%, transparent 62% 100%);
  opacity: 0.72;
  pointer-events: none;
}

.slide-text {
  position: relative;
  width: 100%;
  max-width: 26ch;
  display: grid;
  gap: 7px;
  text-align: center;
  transition: opacity 420ms ease, transform 420ms ease;
}

.text-line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(31px, 4vw, 58px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.slide-note {
  min-height: 46px;
  max-width: 62ch;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  transition: opacity 420ms ease, transform 420ms ease;
}

.slide-kicker.is-fading,
.slide-text.is-fading,
.slide-note.is-fading {
  opacity: 0;
  transform: translateY(12px);
}

.preview {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  padding: 22px 18px;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.preview-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.preview-body {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}

.preview-body p + p { margin-top: 10px; }

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 20px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

.status-sig { opacity: 0.68; }

@media (max-width: 1120px) {
  .finder-stage {
    grid-template-columns: 1fr;
    grid-template-areas:
      "north"
      "center"
      "west"
      "east"
      "south"
      "nw"
      "ne"
      "sw"
      "se";
  }

  .corner-card { width: 100%; }
}

@media (max-width: 720px) {
  .finder-window {
    width: calc(100vw - 16px);
    min-height: calc(100vh - 16px);
    margin: 8px auto;
    padding: 12px;
    border-radius: 24px;
  }

  .window-chrome {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .toolbar-actions { justify-content: start; }

  .slide-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .quote-frame,
  .quote-frame-inner {
    min-height: 320px;
  }

  .quote-frame-inner { padding: 36px 24px; }

  .text-line { font-size: clamp(28px, 9vw, 42px); }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
