:root {
  --bg: oklch(0.09 0 0);
  --surface: oklch(0.16 0 0);
  --surface-app: oklch(0.22 0.03 250);
  --ink: oklch(0.96 0.01 230);
  --muted: oklch(0.74 0.02 230);
  --primary: oklch(0.5 0.12 230);
  --primary-hover: oklch(0.44 0.11 230);
  --on-primary: oklch(0.99 0 0);
  --tide: oklch(0.78 0.11 195);
  --on-tide: oklch(0.14 0.02 230);
  --steel: oklch(0.72 0.04 230);
  --border: oklch(0.32 0.02 240);
  --focus: oklch(0.78 0.12 220);
  --success: oklch(0.48 0.1 160);
  --dirty: oklch(0.72 0.14 75);
  --insert: oklch(0.55 0.1 160);
  --danger: oklch(0.48 0.16 25);
  --font: "Bricolage Grotesque", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", Menlo, monospace;
  --radius: 8px;
  --z-nav: 20;
  --measure: 68ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.25rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100dvh;
}

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

a {
  color: var(--tide);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.4rem 0.7rem;
  z-index: 40;
}

.skip:focus {
  top: 0.75rem;
}

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  display: block;
}

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

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

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

.lang {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.lang[aria-pressed="true"] {
  border-color: var(--primary);
  color: var(--tide);
}

.hero {
  display: grid;
  grid-template-columns: minmax(18rem, 0.82fr) minmax(0, 1.28fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  max-width: 92rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3.75rem) 3rem;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0 0 1rem;
  max-width: 14ch;
}

.lede {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 1.5rem;
}

.mark {
  margin: 0 0 1.1rem;
}

.mark img {
  width: 88px;
  height: 88px;
  display: block;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn.primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn.primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}

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

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

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.hero-stage {
  min-width: 0;
}

.capture-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--insert);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--insert) 18%, transparent);
}

.shot-frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-app);
  color: var(--ink);
  cursor: zoom-in;
  text-align: left;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.shot-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in oklch, white 5%, transparent);
}

.shot-frame:hover {
  border-color: var(--steel);
  transform: translateY(-1px);
  box-shadow: 0 20px 42px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px color-mix(in oklch, var(--tide) 30%, transparent);
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-shot {
  max-height: none;
}

.hero-shot img {
  height: auto;
}

.zoom-hint {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  backdrop-filter: blur(8px);
}

.window {
  background: var(--surface-app);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.dots {
  width: 42px;
  height: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 6px 5px, oklch(0.62 0.16 25) 4px, transparent 4.5px),
    radial-gradient(circle at 20px 5px, oklch(0.78 0.14 90) 4px, transparent 4.5px),
    radial-gradient(circle at 34px 5px, oklch(0.7 0.14 150) 4px, transparent 4.5px);
}

.ping {
  color: var(--tide);
}

.window-body {
  display: grid;
  grid-template-columns: 10.25rem minmax(0, 1fr);
  min-height: 16rem;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 0.85rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.side-label {
  margin: 0.7rem 0 0.25rem;
  color: var(--steel);
}

.side-label:first-child {
  margin-top: 0;
}

.side-item {
  margin: 0.15rem 0;
}

.side-item.on {
  color: var(--ink);
}

.console {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow: auto;
}

.console pre,
.sql,
.history code {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
}

.kw {
  color: var(--tide);
}

.fn {
  color: var(--steel);
}

.str {
  color: oklch(0.82 0.08 90);
}

.num {
  color: oklch(0.8 0.08 40);
}

.caret {
  display: inline-block;
  width: 0.5ch;
  height: 1em;
  background: var(--focus);
  margin-left: 1px;
  vertical-align: -0.1em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.waterline {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary) 18%,
    var(--tide) 50%,
    var(--primary) 82%,
    transparent
  );
}

.engines {
  padding: 1.4rem clamp(1rem, 4vw, 2.5rem) 0.4rem;
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: 1rem;
  align-items: start;
}

.engines p {
  margin: 0;
  color: var(--muted);
}

.engines ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem 1.4rem;
}

.engines li {
  margin: 0;
}

.engines strong {
  display: block;
  font-size: 1.02rem;
}

.engines span {
  color: var(--muted);
  font-size: 0.9rem;
}

.workbench,
.native,
.download,
.source {
  width: min(100%, 92rem);
  margin-inline: auto;
  padding: clamp(2.4rem, 6vw, 4.2rem) clamp(1rem, 4vw, 3.75rem) 0;
}

.section-head h2,
.native h2,
.download h2,
.source h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 0.6rem;
}

.section-head p,
.native p,
.download > p,
.source > p {
  max-width: var(--measure);
  color: var(--muted);
  margin: 0 0 1.4rem;
}

.tour-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.tour-tabs button {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.tour-tabs button[aria-selected="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.real-tour {
  margin-top: 1.8rem;
}

.real-tour .tour-tabs {
  margin-bottom: 0;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.real-tour .tour-tabs::-webkit-scrollbar {
  display: none;
}

.real-tour .tour-tabs button {
  position: relative;
  padding: 0.75rem 1.15rem;
  border: 0;
  border-radius: 0;
  white-space: nowrap;
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.real-tour .tour-tabs button:hover {
  color: var(--ink);
}

.real-tour .tour-tabs button[aria-selected="true"] {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.real-tour .tour-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  bottom: -1px;
  left: 1.15rem;
  height: 2px;
  background: var(--tide);
}

.tour-stage {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: color-mix(in oklch, var(--surface) 70%, var(--bg));
}

.panel {
  padding: clamp(1rem, 3vw, 1.8rem);
}

.panel[hidden] {
  display: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr);
  gap: 1.2rem;
  align-items: start;
}

.shot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(15rem, 0.64fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.shot-layout .shot-frame {
  max-height: none;
}

.shot-layout .shot-frame img {
  height: auto;
}

.shot-layout .copy {
  position: sticky;
  top: 6rem;
  padding-top: 0.35rem;
}

.capture-kicker {
  margin: 0 0 0.65rem !important;
  color: var(--tide) !important;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.copy h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.copy p {
  margin: 0;
  color: var(--muted);
}

.lightbox {
  width: min(94vw, 76rem);
  max-width: none;
  max-height: 92vh;
  margin: auto;
  padding: 0.75rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}

.lightbox::backdrop {
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px);
}

.lightbox form {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 0;
  display: flex;
  justify-content: flex-end;
}

.lightbox-close {
  width: 2.35rem;
  height: 2.35rem;
  margin: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in oklch, var(--bg) 84%, transparent);
  color: var(--ink);
  font: 1.4rem/1 var(--font);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.lightbox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.lightbox p {
  margin: 0.65rem 0 0.1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}

.grid {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.grid th,
.grid td {
  text-align: left;
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--border);
}

.grid th {
  color: var(--steel);
  font-weight: 500;
}

.dirty {
  color: var(--dirty);
}

.strike td {
  text-decoration: line-through;
  color: var(--danger);
}

.insert td {
  color: var(--insert);
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.history li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.history time {
  font-family: var(--mono);
  color: var(--steel);
}

.native {
  width: min(100%, 92rem);
  margin-inline: auto;
}

.native-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: 1.8rem;
}

.native-card {
  padding: clamp(1.2rem, 2.5vw, 1.6rem);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklch, var(--surface) 65%, var(--bg));
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.native-card:hover {
  border-color: var(--steel);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.45);
}

.native-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.9rem;
}

.native-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.native-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.download table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.download th,
.download td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.download th {
  color: var(--muted);
  font-weight: 500;
}

.download code,
.source a {
  font-family: var(--mono);
  font-size: 0.85em;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: var(--measure);
}

.repos {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.repos li {
  display: grid;
  gap: 0.15rem;
}

.repos span {
  color: var(--muted);
  font-size: 0.92rem;
}

footer {
  margin-top: 4rem;
  padding: 1.4rem clamp(1rem, 4vw, 2.5rem) 2.2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

footer p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

footer img {
  width: 28px;
  height: 28px;
}

@media (max-width: 900px) {
  .hero,
  .engines,
  .window-body,
  .split,
  .shot-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .engines ul {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
  }

  .side-label {
    width: 100%;
    margin-top: 0.2rem;
  }

  .shot-layout .copy {
    position: static;
    max-width: var(--measure);
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .nav nav a:not([href*="github"]) {
    display: none;
  }

  .hero {
    padding-top: 1.8rem;
  }

  .shot-layout .shot-frame {
    overflow-x: auto;
  }

  .shot-layout .shot-frame img {
    min-width: 42rem;
    height: auto;
  }

  .real-tour .tour-tabs {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .real-tour .tour-tabs button {
    flex: initial;
    padding-inline: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .caret {
    animation: none;
  }
}
