:root {
  --background:    hsl(0 0% 100%);
  --surface:       hsl(240 5% 98%);
  --surface-2:     hsl(240 5% 96%);
  --elevated:      hsl(240 5% 94%);
  --border:        hsl(240 4% 88%);
  --border-strong: hsl(240 4% 78%);
  --ring:          hsl(240 6% 10%);

  --foreground:    hsl(240 10% 4%);
  --muted:         hsl(240 4% 40%);
  --muted-2:       hsl(240 4% 54%);

  --primary:       hsl(240 6% 10%);
  --primary-fg:    hsl(0 0% 100%);
  --accent:        hsl(213 94% 50%);
  --neg:           hsl(0 84% 50%);

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 8px;

  --font-sans: "Geist", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html, body {
  height: 100%;
}

body {
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero";
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent); }

/* ─── Top status bar ──────────────────────────────────────────────────── */
.topbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.topbar-cell { display: inline-flex; align-items: center; gap: 8px; }
.topbar-center { justify-self: center; }
.topbar-right { justify-self: end; }
.topbar a {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  color: var(--foreground);
}

.rec {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neg);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.55);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink {
  0%, 65%, 100% { opacity: 1; }
  75%, 92%      { opacity: 0.3; }
}

/* ─── Stage ───────────────────────────────────────────────────────────── */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vh, 28px) 24px;
  overflow: hidden;
}

.hero {
  width: 100%;
  max-width: 920px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.4vh, 16px);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  min-height: 0;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kicker {
  flex: 0 0 auto;
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0;
  letter-spacing: 0.18em;
  position: relative;
  padding: 0 18px;
}
.kicker::before,
.kicker::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 1px;
  background: var(--border-strong);
}
.kicker::before { right: 100%; }
.kicker::after  { left: 100%; }

.wordmark {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 76px);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 0;
  color: var(--foreground);
  display: inline-flex;
  align-items: baseline;
  gap: 0.04em;
}
.wordmark .slash {
  font-weight: 500;
  font-size: 0.45em;
  color: var(--muted-2);
  letter-spacing: -0.06em;
  transform: translateY(-0.18em);
  display: inline-block;
}

.tagline {
  flex: 0 0 auto;
  font-size: clamp(13px, 1.2vw, 15.5px);
  color: var(--muted);
  max-width: 540px;
  margin: 0;
  line-height: 1.5;
  text-align: center;
}
.tagline strong {
  color: var(--foreground);
  font-weight: 600;
}

/* ─── Framed screenshot — the only flex-grow child ────────────────────── */
.frame {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  margin: 0;
  padding: 12px;
  width: min(100%, 880px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.frame img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
}

.bracket {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1.25px solid var(--foreground);
  pointer-events: none;
}
.bracket-tl { top: 0;       left: 0;       border-right: 0; border-bottom: 0; }
.bracket-tr { top: 0;       right: 0;      border-left: 0;  border-bottom: 0; }
.bracket-bl { bottom: 22px; left: 0;       border-right: 0; border-top: 0;    }
.bracket-br { bottom: 22px; right: 0;      border-left: 0;  border-top: 0;    }

.frame-cap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.15em;
  padding: 0 2px;
}
.frame-cap .cap-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.frame-cap .cap-dim { color: var(--muted-2); }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.actions {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.btn-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.btn-glyph {
  display: inline-block;
  font-size: 13px;
  color: inherit;
  transition: transform 0.16s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.btn-primary:hover { background: hsl(240 6% 20%); border-color: hsl(240 6% 20%); }
.btn-primary:hover .btn-glyph { transform: translateY(2px); }

.btn-ghost { border-color: var(--border-strong); }
.btn-ghost:hover {
  border-color: var(--foreground);
  background: var(--surface);
}
.btn-ghost:hover .btn-glyph { transform: translateX(3px); }

/* ─── Brew snippet ────────────────────────────────────────────────────── */
.brew-line {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 100%;
  overflow-x: auto;
}
.brew-prompt { color: var(--accent); font-weight: 600; user-select: none; }
.brew {
  font-family: var(--font-mono);
  user-select: all;
  white-space: nowrap;
  color: var(--foreground);
  background: none;
  padding: 0;
}

/* ─── Bottom ticker ───────────────────────────────────────────────────── */
.ticker {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  overflow: hidden;
  padding: 7px 0;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted-2);
  letter-spacing: 0.22em;
  background: var(--surface);
}
.ticker-track {
  display: inline-flex;
  gap: 26px;
  white-space: nowrap;
  animation: marquee 60s linear infinite;
  padding-left: 26px;
}
.ticker .dot { color: var(--border-strong); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  body { overflow: auto; height: auto; min-height: 100svh; }
  .topbar {
    grid-template-columns: 1fr 1fr;
    padding: 9px 14px;
    font-size: 10px;
  }
  .topbar-center { display: none; }
  .stage {
    padding: 14px 14px;
    overflow: visible;
  }
  .hero {
    height: auto;
    gap: 12px;
  }
  .wordmark { font-size: clamp(44px, 14vw, 64px); }
  .tagline { font-size: 13.5px; }
  .kicker::before, .kicker::after { width: 14px; }
  .frame { flex: 0 0 auto; padding: 10px; }
  .frame img { max-height: 42vh; height: auto; flex: 0 0 auto; }
  .bracket-bl, .bracket-br { bottom: 20px; }
  .actions { width: 100%; }
  .btn { flex: 1; justify-content: center; padding: 0 12px; }
  .brew-line { font-size: 11px; padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .rec, .ticker-track, .hero { animation: none !important; }
}
