:root {
  --bg: #0b1118;
  --bg-2: #0f1824;
  --panel: rgba(15, 24, 36, 0.9);
  --panel-strong: #121c29;
  --panel-soft: rgba(255, 255, 255, 0.03);
  --ink: #e7edf4;
  --muted: #9fb0c2;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #4ca0ff;
  --accent-2: #74d7b8;
  --accent-soft: rgba(76, 160, 255, 0.16);
  --warn: #d7a245;
  --error: #ff7f7f;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(76, 160, 255, 0.18), transparent 32rem),
    radial-gradient(circle at top right, rgba(116, 215, 184, 0.12), transparent 34rem),
    linear-gradient(180deg, #0c131c 0%, #0a0f15 100%);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
}

img {
  display: block;
  max-width: 100%;
}

code {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 0.92em;
}

.page-shell {
  width: min(1220px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 4rem;
}

.topbar,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: rgba(11, 20, 33, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0.8rem;
  z-index: 20;
}

.brand,
.topnav a,
.button,
.thumb,
.chip,
.copy-button {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: "DIN Alternate", "Avenir Next Condensed", "Franklin Gothic Medium", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.topnav a:hover,
.brand:hover {
  color: var(--ink);
}

.hero,
.panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 1rem;
  padding: 1.4rem;
  margin-top: 1rem;
}

.hero-copy {
  padding: 0.2rem 0.1rem;
}

.eyebrow,
.meta-kicker,
.mini-label,
.hero-label {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: #8fc1ff;
}

h1,
h2,
h3,
.tag,
.hero-row strong {
  font-family: "DIN Alternate", "Avenir Next Condensed", "Franklin Gothic Medium", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  line-height: 0.92;
  max-width: 11ch;
}

.lead {
  margin: 1rem 0 0;
  max-width: 64ch;
  font-size: 1.08rem;
  line-height: 1.74;
  color: rgba(231, 237, 244, 0.9);
}

.hero-note {
  margin: 0.85rem 0 0;
  max-width: 64ch;
  color: rgba(159, 176, 194, 0.9);
  line-height: 1.68;
}

.hero-actions,
.preview-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
}

.button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.button:hover,
.copy-button:hover,
.thumb:hover,
.chip:hover {
  transform: translateY(-1px);
}

.button.primary,
.copy-button {
  background: linear-gradient(135deg, var(--accent) 0%, #72c5ff 100%);
  color: #07111d;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.hero-panel {
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.hero-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.82rem 0;
  border-bottom: 1px solid var(--line);
}

.hero-row:last-child {
  border-bottom: 0;
}

.hero-row strong {
  text-align: right;
  font-size: 0.95rem;
}

main {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.panel {
  padding: 1.35rem;
}

.panel-wide {
  padding: 1.45rem;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 300ms ease, transform 300ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.06;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.principles,
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.principles li,
.plain-list li {
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.principles li:last-child,
.plain-list li:last-child {
  border-bottom: 0;
}

.plain-list.compact li {
  padding: 0.52rem 0;
}

.media-panel .gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 1rem;
}

.gallery-frame,
.app-card img,
.preview-frame {
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #060c12;
}

.gallery-frame img,
.app-card img {
  width: 100%;
}

.gallery-copy h3 {
  margin: 0.3rem 0 0;
  font-size: 1.55rem;
}

.gallery-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.thumb {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
}

.thumb img {
  border-radius: 10px;
  border: 1px solid var(--line);
}

.thumb.is-active {
  border-color: rgba(76, 160, 255, 0.5);
  background: var(--accent-soft);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.chip {
  min-height: 2.4rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chip.is-active {
  border-color: rgba(76, 160, 255, 0.45);
  background: var(--accent-soft);
  color: var(--ink);
}

.status-grid,
.apps-grid,
.build-grid,
.preview-note-grid,
.preview-grid {
  display: grid;
  gap: 1rem;
}

.status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-card,
.cta-card,
.mini-note {
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.status-card h3,
.app-head h3,
.cta-card h3 {
  margin: 0;
}

.status-card p,
.cta-card p,
.mini-note {
  color: var(--muted);
}

.status-card.is-hidden {
  display: none;
}

.stack {
  display: grid;
  gap: 0.6rem;
}

.stack-row {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(76, 160, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: var(--ink);
}

.apps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.app-copy {
  padding: 1rem;
}

.app-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(116, 215, 184, 0.14);
  color: #c9f3e6;
  font-size: 0.8rem;
}

.tag-warn {
  background: rgba(215, 162, 69, 0.14);
  color: #f2d4a0;
}

.preview-cta {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
  gap: 1rem;
}

.build-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.copy-box {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.copy-box textarea {
  width: 100%;
  min-height: 7rem;
  padding: 1rem;
  resize: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #09111b;
  font-family: "SF Mono", "Consolas", monospace;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding: 1.4rem 0 0;
  color: var(--muted);
}

.footer p {
  margin: 0.4rem 0 0;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.preview-body .hero,
.preview-body .topbar {
  margin-top: 0;
}

.preview-body .page-shell {
  width: min(1480px, calc(100vw - 2rem));
}

.preview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  align-items: start;
}

.preview-intro {
  grid-column: 1 / -1;
}

.preview-lead {
  max-width: 70ch;
}

.preview-screen-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.preview-status {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.preview-frame {
  position: relative;
  min-height: clamp(520px, 70vh, 860px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.preview-frame canvas {
  width: min(100%, 1120px);
  max-width: 100%;
  max-height: calc(70vh - 2rem);
  height: auto;
  image-rendering: pixelated;
}

.preview-frame .preview-text-layer {
  display: none;
}

.preview-side {
  min-width: 0;
  max-width: 460px;
}

.mini-note strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink);
}

.serial-box {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.serial-box summary {
  padding: 0.85rem 1rem;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.serial-box pre {
  margin: 0;
  padding: 1rem;
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #09111b;
  color: #b5d5f7;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1024px) {
  .hero,
  .media-panel .gallery,
  .preview-cta,
  .build-grid,
  .preview-grid,
  .two-col,
  .status-grid,
  .apps-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .preview-toolbar,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-frame {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 1rem, 100%);
  }

  .hero,
  .panel,
  .panel-wide {
    padding: 1rem;
  }

  .thumbs {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 100%;
  }
}
