:root {
  --bg: #0a0c10;
  --bg-elev: #12151c;
  --bg-card: #171b23;
  --bg-card-hover: #1d222c;
  --text: #eceae4;
  --muted: #9aa09a;
  --line: #2a303a;
  --accent: #14b8a6;
  --accent-hot: #2ee6c0;
  --green: #3dff6e;
  --blue: #4a8fd4;
  --blue-deep: #0a246a;
  --steel: #7a8494;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "Courier New", Courier, monospace;
  --radius: 16px;
  --header-h: 6.25rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
}

body {
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(10, 36, 106, 0.45), transparent 55%),
    radial-gradient(700px 420px at 90% 8%, rgba(20, 184, 166, 0.12), transparent 50%),
    radial-gradient(600px 400px at 70% 90%, rgba(61, 255, 110, 0.05), transparent 55%);
  animation: drift 22s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.05); }
}

a { color: var(--accent-hot); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

code, pre, kbd {
  font-family: var(--mono);
  font-size: 0.86em;
}

code, kbd {
  background: #0e1116;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.12em 0.4em;
}

pre {
  background: #07090c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  color: #9df0b0;
  line-height: 1.45;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

.site {
  position: relative;
  z-index: 1;
}

.wrap {
  width: min(72rem, calc(100% - 2.5rem));
  margin: 0 auto;
}

/* —— header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-h);
  height: auto;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(10, 12, 16, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(10, 12, 16, 0.9);
}

.site-header .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

pre.brand-wordmark {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  overflow: visible;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text);
  white-space: pre;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

nav a[aria-current="page"] {
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.35);
}

.nav-toggle {
  display: none;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font: inherit;
  cursor: pointer;
}

/* —— hero —— */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
  padding: 4.5rem 0 3.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent-hot);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1rem;
}

.eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 1.75rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(180deg, #1fd4bf, #0f8f82);
  color: #041210;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.28);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--accent); }

.cylinder-stage {
  width: min(26rem, 100%);
  margin: 0 auto;
}

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  animation: spin 36s linear infinite;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.55));
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* —— sections —— */
section { padding: 3.25rem 0; }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.section-lead {
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.75rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0 1rem;
}

.pill {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* —— cards / chambers —— */
.grid-3, .grid-2, .shots {
  display: grid;
  gap: 1rem;
}

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

.card pre {
  margin: 0.75rem 0 0;
}

.card, .chamber, .shot, .os-card, .path-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}

.chamber:hover, .os-card:hover, .path-card:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 184, 166, 0.4);
  background: var(--bg-card-hover);
}

.chamber h3, .card h2, .os-card h2, .path-card h2, .shot figcaption strong {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.chamber p, .card p, .os-card p, .path-card p {
  color: var(--muted);
  margin: 0;
}

.os-card {
  display: flex;
  flex-direction: column;
}

.os-card .steps { margin-bottom: 1.1rem; }

.os-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.chamber .n {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-hot);
  letter-spacing: 0.08em;
}

/* —— screenshots —— */
.shots { grid-template-columns: repeat(2, 1fr); }

.shot {
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
}

.shot .chrome {
  height: 1.15rem;
  background: linear-gradient(180deg, #3d7ec8, var(--blue-deep));
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.55rem;
}

.shot .chrome span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 2489 / 1336;
  object-fit: cover;
  object-position: top left;
  background: #d4d0c8;
  transition: transform 0.5s;
}

.shot:hover img { transform: scale(1.03); }

.shot figcaption {
  padding: 0.75rem 1rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— steps / tables —— */
.steps {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.steps li { margin: 0.35rem 0; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
td { color: var(--text); }

.note, .site-footer {
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1.75rem 0 2.5rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem 2rem;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0 0 0.35rem;
  color: var(--muted);
}

.site-footer p:last-child { margin-bottom: 0; }

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

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

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.7s ease forwards;
}

.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.24s; }
.reveal:nth-child(5) { animation-delay: 0.32s; }
.reveal:nth-child(6) { animation-delay: 0.4s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

.js-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* —— lightbox —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 6, 9, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: min(1200px, 94vw);
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.lightbox button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

/* —— page hero compact —— */
.page-hero { padding: 3rem 0 1.25rem; }
.page-hero h1 { margin-bottom: 0.6rem; }

/* —— dev log —— */
.log {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 1rem 0 3rem;
}

.log-entry {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 1.7rem;
  box-shadow: var(--shadow);
}

.log-entry header {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.log-entry time {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.log-entry header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
}

.log-body > p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.log-body > p:last-child { margin-bottom: 0; }

.log-body h3 {
  font-size: 1.02rem;
  margin: 1.5rem 0 0.5rem;
}

.log-body .grid-2,
.log-body .table-wrap,
.log-body .shots,
.log-body .card,
.log-body pre {
  margin: 1rem 0 0;
}

@media (max-width: 900px) {
  .hero, .grid-3, .grid-2, .shots { grid-template-columns: 1fr; }
  .hero { padding-top: 2.5rem; gap: 2rem; }
  pre.brand-wordmark { font-size: 7px; }
  .brand img { width: 52px; height: 52px; }
}

@media (max-width: 640px) {
  pre.brand-wordmark { display: none; }
  .brand img { width: 48px; height: 48px; }
  .site-header { min-height: 4.5rem; }
  .nav-toggle { display: inline-flex; }
  nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    right: 1.25rem;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 10rem;
  }
  .site-header.is-open nav { display: flex; }
  .cta-row { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js-reveal, .reveal {
    opacity: 1;
    transform: none;
  }
}
