:root {
  color-scheme: dark;
  --ink: #eee9d8;
  --muted: #aaa897;
  --paper: #11120f;
  --panel: #181a16;
  --line: #383a31;
  --acid: #d8ff3e;
  --orange: #ff7848;
  --cyan: #71e5dc;
  --shadow: #050604;
  font-family: "SFMono-Regular", "Cascadia Mono", "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .12; background: repeating-linear-gradient(0deg, transparent 0 3px, #000 4px); }
a { color: inherit; text-decoration-color: var(--acid); text-underline-offset: .22em; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; z-index: 99; top: -5rem; left: 1rem; background: var(--acid); color: #111; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 10; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0 clamp(1rem, 4vw, 4.5rem); border-bottom: 1px solid var(--line); background: rgba(17,18,15,.94); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 800; letter-spacing: .14em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; }
.brand-mark::before { content: ""; width: 28px; height: 28px; background: url("/keynope-logo.png") center / contain no-repeat; }
.site-nav { display: flex; align-items: center; gap: clamp(.8rem, 2.2vw, 2rem); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--acid); }
.nav-store { padding: .55rem .8rem; border: 1px solid var(--acid); color: var(--acid); }
.nav-editor { color: var(--cyan); }
.nav-editor span, .button-badge { margin-left: .35em; color: var(--orange); font-size: .72em; letter-spacing: .08em; }
.nav-toggle { display: none; color: var(--ink); background: transparent; border: 1px solid var(--line); padding: .5rem .7rem; }

main { overflow: hidden; }
.section-grid, .ruled-section { width: min(1480px, 100%); margin: 0 auto; padding-inline: clamp(1rem, 5vw, 5.5rem); }
.hero { min-height: min(790px, calc(100vh - 72px)); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); align-items: center; gap: clamp(3rem, 6vw, 6.5rem); padding-block: clamp(5rem, 12vh, 9rem); background-image: linear-gradient(90deg, transparent 49.85%, rgba(216,255,62,.055) 50%, transparent 50.15%); }
.hero-copy { min-width: 0; container-type: inline-size; }
.eyebrow { margin: 0 0 1.3rem; color: var(--acid); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.status-dot { display: inline-block; width: .65rem; height: .65rem; margin-right: .55rem; border-radius: 50%; background: var(--acid); box-shadow: 0 0 16px var(--acid); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 920px; margin-bottom: 1.8rem; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(4rem, 10vw, 9.5rem); font-weight: 900; letter-spacing: -.045em; line-height: .83; text-transform: uppercase; }
.hero-copy h1 { font-size: clamp(3.25rem, 14cqi, 7rem); }
h1 em { color: var(--acid); font-style: normal; text-shadow: 6px 6px 0 #263000; }
.lede { max-width: 670px; color: var(--muted); font-family: system-ui, sans-serif; font-size: clamp(1.08rem, 1.8vw, 1.4rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.15rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; cursor: pointer; box-shadow: 4px 4px 0 var(--shadow); }
.button:hover { transform: translate(-1px,-1px); border-color: var(--ink); box-shadow: 6px 6px 0 var(--shadow); }
.button-primary { border-color: var(--acid); background: var(--acid); color: #12140e; }
.install-card { transform: rotate(1.1deg); border: 1px solid var(--line); background: #090a08; box-shadow: 14px 14px 0 #080906, 14px 14px 0 1px var(--line); }
.window-bar, .deck-topbar, .panel-bar { display: flex; align-items: center; gap: .45rem; min-height: 42px; padding: .65rem .8rem; border-bottom: 1px solid var(--line); background: #20221d; color: var(--muted); font-size: .7rem; letter-spacing: .08em; }
.window-bar span, .traffic-lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.window-bar span:nth-child(2), .traffic-lights i:nth-child(2) { background: #ffc857; }
.window-bar span:nth-child(3), .traffic-lights i:nth-child(3) { background: var(--acid); }
.install-tabs { display: flex; align-self: stretch; flex: 1; margin: -.65rem -.8rem -.65rem .45rem; }
.install-tab { position: relative; min-width: 0; flex: 1; padding: 0 .65rem; border: 0; border-right: 1px solid #090a08; border-left: 1px solid var(--line); background: #171914; color: #77796d; font-size: .62rem; letter-spacing: .06em; cursor: pointer; }
.install-tab:hover { color: var(--ink); background: #1b1d18; }
.install-tab.active { background: #090a08; color: var(--ink); }
.install-tab.active::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--acid); }
.install-tab:focus-visible { z-index: 1; outline: 2px solid var(--cyan); outline-offset: -2px; }
.install-panel { height: 320px; }
.app-store-panel { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 1.25rem; padding: 1.8rem 1.6rem 1.5rem; }
.app-store-icon { width: 84px; height: 84px; border-radius: 19px; box-shadow: 0 0 0 1px #4f5146, 8px 8px 0 #050604; }
.app-store-panel h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); line-height: .92; }
.store-status { margin-bottom: .4rem; color: var(--acid); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.store-copy { margin: .75rem 0 0; color: var(--muted); font-family: system-ui, sans-serif; font-size: .9rem; }
.app-store-button { grid-column: 1 / -1; width: 100%; min-height: 56px; }
.store-footnote { grid-column: 1 / -1; margin: -.35rem 0 0; color: var(--muted); font-size: .64rem; letter-spacing: .05em; text-align: center; text-transform: uppercase; }
.terminal-lines { position: relative; padding: 2rem 1.6rem 1.4rem; font-size: clamp(.72rem, 1.15vw, .92rem); }
.install-panel[hidden] { display: none; }
.terminal-lines p { white-space: nowrap; }
.terminal-lines p span { color: var(--acid); }
.terminal-lines .success { margin: 1.8rem 0 0; color: var(--cyan); }
.copy-command { position: absolute; right: .8rem; bottom: .7rem; border: 0; background: none; color: var(--muted); font-size: .65rem; cursor: pointer; }
.requirements { margin: 0; padding: .75rem 1.6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; text-transform: uppercase; }

.ruled-section { padding-block: clamp(5rem, 10vw, 9rem); border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .55fr); align-items: end; gap: 3rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.section-heading.compact { grid-template-columns: 1fr; }
h2 { margin-bottom: 0; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(3rem, 6.6vw, 7rem); letter-spacing: -.025em; line-height: .92; text-transform: uppercase; }
.section-heading > p { color: var(--muted); font-family: system-ui, sans-serif; font-size: 1.05rem; }
.deck-shell { border: 1px solid #555849; background: #080907; box-shadow: 18px 18px 0 #080906; }
.deck-topbar { justify-content: center; position: relative; }
.traffic-lights { position: absolute; left: .9rem; display: flex; gap: .4rem; }
.deck-topbar a { position: absolute; right: .9rem; color: var(--acid); text-decoration: none; }
.deck-frame { display: block; width: 100%; aspect-ratio: 147 / 56; min-height: 0; border: 0; background: #000; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feature-grid article { min-height: 270px; padding: clamp(1.5rem, 3vw, 2.8rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-grid article > span { color: var(--orange); font-size: .72rem; }
.feature-grid h3 { margin: 3.7rem 0 .8rem; font-size: 1.25rem; text-transform: uppercase; }
.feature-grid p { color: var(--muted); font-family: system-ui, sans-serif; }

.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2vw, 2rem); }
.gallery-grid figure { margin: 0; border: 1px solid var(--line); background: var(--panel); }
.gallery-wide { grid-column: 1 / -1; }
.gallery-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; filter: saturate(.87) contrast(1.03); }
.gallery-wide img { aspect-ratio: 16 / 8; }
.gallery-grid figcaption { display: grid; grid-template-columns: .65fr 1fr; gap: 1rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.gallery-grid figcaption b { text-transform: uppercase; }
.gallery-grid figcaption span { color: var(--muted); font-family: system-ui, sans-serif; }

.playground-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); border: 1px solid var(--line); box-shadow: 16px 16px 0 var(--shadow); }
.editor-panel, .result-panel { display: flex; min-width: 0; flex-direction: column; background: #0a0b09; }
.editor-panel { border-right: 1px solid var(--line); }
.panel-bar { justify-content: space-between; }
.panel-bar button, .file-button { border: 0; background: none; color: var(--acid); font-size: .68rem; cursor: pointer; }
.panel-bar button:disabled { color: #64665b; cursor: default; }
.file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
#markdown-input { width: 100%; min-height: 360px; flex: 1; resize: vertical; border: 0; outline: 0; padding: 1.4rem; background: #0a0b09; color: var(--ink); line-height: 1.7; tab-size: 2; }
.editor-actions { display: flex; align-items: center; justify-content: space-between; padding: .8rem; border-top: 1px solid var(--line); }
#render-status { color: var(--muted); font-size: .68rem; }
#result-frame { display: none; width: 100%; height: 0; min-height: 360px; flex: 1 1 0; border: 0; background: #000; }
.result-empty { display: grid; min-height: 420px; place-content: center; text-align: center; color: var(--muted); }
.result-empty span { color: var(--acid); font-size: 3rem; animation: blink 1s step-end infinite; }
.api-note { margin-top: 1.6rem; color: var(--muted); font-size: .72rem; }
code { color: var(--cyan); }
.community { text-align: center; }
.community > p:not(.eyebrow) { max-width: 690px; margin: 1.6rem auto 0; color: var(--muted); font-family: system-ui, sans-serif; font-size: 1.1rem; }
.centered { justify-content: center; }

footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; padding: 2.5rem clamp(1rem, 5vw, 5.5rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
footer p { margin: 0; }
footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1.2rem; }

/* Documentation */
.site-nav .active { color: var(--acid); }
.docs-hero { width: min(1480px, 100%); margin: 0 auto; padding: clamp(5rem, 10vw, 9rem) clamp(1rem, 5vw, 5.5rem) clamp(3rem, 6vw, 5rem); border-bottom: 1px solid var(--line); }
.docs-hero h1 { margin-bottom: 1.5rem; font-size: clamp(3.8rem, 10vw, 9rem); }
.docs-hero > p:last-child { max-width: 780px; color: var(--muted); font-family: system-ui, sans-serif; font-size: 1.2rem; }
.cursor-block { color: var(--acid); animation: blink 1s step-end infinite; }
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(2rem, 6vw, 7rem); width: min(1480px, 100%); margin: 0 auto; padding: 0 clamp(1rem, 5vw, 5.5rem) 8rem; }
.docs-sidebar { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; padding: 2.5rem 0; }
.docs-sidebar > p { color: var(--orange); font-size: .68rem; letter-spacing: .15em; }
.docs-sidebar nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.docs-sidebar a { padding: .6rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; text-decoration: none; }
.docs-sidebar a:hover { color: var(--acid); padding-left: .35rem; }
.docs-content { min-width: 0; }
.doc-section { position: relative; padding: clamp(4rem, 8vw, 7rem) 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.doc-section:last-child { border-bottom: 0; }
.doc-number { position: absolute; top: clamp(4rem, 8vw, 7rem); right: 0; color: var(--line); font-family: Impact, sans-serif; font-size: clamp(3rem, 7vw, 6rem); line-height: 1; }
.doc-section h2 { max-width: 80%; margin-bottom: 2.5rem; font-size: clamp(2.8rem, 5.5vw, 5rem); }
.doc-section h3 { margin: 2.7rem 0 .8rem; color: var(--acid); font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.doc-section > p, .doc-section li { max-width: 850px; color: #c8c5b5; font-family: system-ui, sans-serif; font-size: 1rem; }
.doc-section li { margin-bottom: .7rem; }
.doc-section pre { max-width: 900px; overflow: auto; margin: 1.5rem 0 2rem; padding: 1.3rem 1.5rem; border: 1px solid var(--line); border-left: 4px solid var(--acid); background: #080907; box-shadow: 7px 7px 0 var(--shadow); }
.doc-section pre code { color: var(--ink); }
kbd { display: inline-block; min-width: 1.8em; padding: .08rem .35rem; border: 1px solid #57594e; border-bottom-width: 3px; border-radius: 3px; background: #23251f; color: var(--ink); font-family: inherit; font-size: .78em; text-align: center; }
.doc-callout { max-width: 900px; margin: 2rem 0; padding: 1.3rem 1.5rem; border: 1px solid var(--orange); background: rgba(255,120,72,.06); }
.doc-callout b { color: var(--orange); text-transform: uppercase; }
.doc-callout p { margin: .55rem 0 0; color: var(--muted); font-family: system-ui, sans-serif; }
.doc-steps, .doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1000px; margin: 2rem 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.doc-steps > div, .doc-grid article { min-height: 170px; padding: 1.3rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.doc-steps span { color: var(--orange); }
.doc-steps b { display: block; margin-top: 2rem; text-transform: uppercase; }
.doc-steps p, .doc-grid p { color: var(--muted); font-family: system-ui, sans-serif; }
.doc-grid { grid-template-columns: repeat(2, 1fr); }
.doc-grid h3 { margin-top: 0; }
.token-list { display: flex; flex-wrap: wrap; gap: .55rem; max-width: 900px; }
.token-list code { padding: .35rem .55rem; border: 1px solid var(--line); background: var(--panel); }
.doc-section table { width: min(900px, 100%); margin: 1.5rem 0 2rem; border-collapse: collapse; }
.doc-section th, .doc-section td { padding: .8rem 1rem; border: 1px solid var(--line); text-align: left; }
.doc-section th { color: var(--acid); font-size: .75rem; text-transform: uppercase; }
.doc-section td { color: #c8c5b5; font-family: system-ui, sans-serif; }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 900px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.shortcut-grid div { display: grid; grid-template-columns: minmax(130px, .6fr) 1fr; gap: 1rem; padding: .75rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shortcut-grid span { color: var(--muted); }

/* Privacy policy */
.legal-content { width: min(1120px, 100%); margin: 0 auto; padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 5vw, 5.5rem) clamp(5rem, 10vw, 9rem); }
.legal-updated { margin-bottom: 3rem; color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.legal-content section { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: clamp(1rem, 4vw, 3rem); padding: clamp(2rem, 5vw, 4rem) 0; border-top: 1px solid var(--line); }
.legal-content section > span { color: var(--orange); font-size: .75rem; letter-spacing: .12em; }
.legal-content section h2 { margin-bottom: 1.3rem; font-size: clamp(2rem, 4.5vw, 4rem); }
.legal-content section p { max-width: 800px; margin-bottom: 0; color: #c8c5b5; font-family: system-ui, sans-serif; font-size: 1.05rem; }

@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .install-card { max-width: 680px; transform: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 71px; right: 0; left: 0; align-items: stretch; flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--line); background: var(--paper); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .7rem; }
  .section-heading { grid-template-columns: 1fr; align-items: start; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .playground-grid { grid-template-columns: 1fr; }
  .editor-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-panel { min-height: 0; }
  footer { grid-template-columns: 1fr; }
  footer nav { justify-content: flex-start; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; max-height: none; padding-bottom: 0; }
  .docs-sidebar nav { display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .site-header { height: 62px; }
  .site-nav { top: 61px; }
  .hero-copy h1 { font-size: clamp(3.25rem, 14cqi, 4.8rem); }
  .install-panel { height: 350px; }
  .terminal-lines { padding-inline: .8rem; overflow: auto; }
  .feature-grid, .gallery-grid { grid-template-columns: 1fr; }
  .gallery-wide { grid-column: auto; }
  .feature-grid article { min-height: 220px; }
  .gallery-grid figcaption { grid-template-columns: 1fr; }
  .deck-topbar > span:nth-child(2) { display: none; }
  .doc-steps, .doc-grid, .shortcut-grid { grid-template-columns: 1fr; }
  .docs-sidebar nav { grid-template-columns: 1fr; }
  .doc-number { opacity: .6; }
  .legal-content section { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
