/* ── Google Sans Code — self-hosted variable font ── */
@font-face {
  font-family: "Google Sans Code";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("Google_Sans_Code/GoogleSansCode-VariableFont_MONO,wght.ttf") format("truetype");
}

@font-face {
  font-family: "Google Sans Code";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("Google_Sans_Code/GoogleSansCode-Italic-VariableFont_MONO,wght.ttf") format("truetype");
}

/* ── Design tokens ── */
:root {
  --bg: #000000;
  --bg2: #080808;
  --panel: #111111;
  --panel2: #181818;
  --line: #1e1e1e;
  --line2: #2a2a2a;
  --fg: #e8e8e8;
  --fg2: #d4d4d4;
  --dim: #999999;
  --accent: #4a9eff;
  --grn: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --mono: "Google Sans Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 6px;
  --section-pad: 80px;
}

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

html, body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--grn);
  color: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s, opacity .15s;
}

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

/* ── Layout ── */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Utility ── */
.cmt {
  color: var(--dim);
  font-style: italic;
}

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

.acc {
  color: var(--accent);
}

.p {
  color: var(--grn);
  user-select: none;
}

.vcap {
  margin: 20px 0 0;
  color: var(--dim);
  font-size: .8rem;
  font-style: italic;
}

.footnote {
  color: var(--dim);
  font-size: .78rem;
  margin-top: 28px;
  line-height: 1.7;
}

code {
  color: var(--fg2);
  background: var(--panel2);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .88em;
  border: 1px solid var(--line2);
}

/* ── Nav bar ── */
.chrome {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.dots i:nth-child(1) {
  background: var(--err);
}

.dots i:nth-child(2) {
  background: var(--warn);
}

.dots i:nth-child(3) {
  background: var(--grn);
}

.chrome .file {
  color: var(--dim);
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-nav {
  display: flex;
  gap: 2px;
  margin-left: 8px;
  overflow: hidden;
}

.chrome-nav a {
  color: var(--dim);
  border: none;
  padding: 4px 11px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  transition: color .15s, background .15s;
  letter-spacing: .01em;
}

.chrome-nav a:hover {
  color: var(--fg);
  background: var(--panel2);
}

.lightbtn {
  margin-left: auto;
  font: inherit;
  font-size: 11px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line2);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: color .15s, border-color .15s;
}

.lightbtn:hover {
  color: var(--warn);
  border-color: var(--warn);
}

/* ── Tooltip bubble ── */
.bubble {
  position: fixed;
  width: max-content;
  max-width: 220px;
  background: var(--panel2);
  color: var(--fg);
  font-size: .79rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: var(--r);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
  z-index: 200;
  border: 1px solid var(--line2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .7);
}

.bubble::before {
  content: "";
  position: absolute;
  border: 6px solid transparent;
}

.bubble.tail-up::before {
  top: -6px;
  right: 20px;
  border-bottom-color: var(--line2);
  border-top: 0;
}

.bubble.show {
  opacity: 1;
}

/* ── Section eyebrow (use sparingly: max 1 per 3 sections) ── */
.label {
  display: block;
  color: var(--grn);
  font-size: .69rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 14px;
  opacity: .65;
}

/* ── Headings ── */
h1, h2 {
  font-weight: 700;
  letter-spacing: -.025em;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  line-height: 1.12;
  margin: 0 0 36px;
  color: var(--fg);
}

/* ─────────────────────────────
   HERO
   ───────────────────────────── */
header {
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
}

/* ASCII canvas row */
.ascii-row {
  width: 100%;
  position: relative;
  overflow: hidden;
  height: clamp(220px, 28vw, 400px);
  background: var(--bg);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1px;
}

.ascii-wrap {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 100%;
}

.ascii-wrap.is-loading::before {
  content: "INITIALISING...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .1em;
  animation: pulse 1.5s infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.ascii-frame {
  position: absolute;
  top: 0;
  height: 100%;
  border: none;
}

#ascii-crop {
  left: 0;
  width: 120%;
}

#ascii-forge {
  right: 0;
  width: 115%;
}

/* hero info panel */
.hero-right {
  padding: 48px 40px 56px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* text column inside hero — inherits old column-flex behavior */
.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

/* logo on the right */
.hero-logo {
  width: clamp(140px, 14vw, 200px);
  height: auto;
  flex-shrink: 0;
  opacity: 0.88;
  filter: drop-shadow(0 0 32px rgba(74, 158, 80, 0.18));
}

@media (max-width: 640px) {
  .hero-logo { display: none; }
  .hero-right { gap: 0; }
}

/* stagger fade-up — hero-text itself is immediately visible so LCP h1 paints instantly */
.hero-right > * {
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards;
}

/* Only the logo (direct child 2 of hero-right) fades in */
.hero-right > *:nth-child(2) {
  opacity: 0;
  animation-delay: .3s;
}

/* Within .hero-text, stagger children except the h1 (child 3 = h1) */
.hero-text > *:not(h1) {
  opacity: 0;
  animation: rise .6s cubic-bezier(.2, .7, .2, 1) forwards;
}

.hero-text > *:nth-child(1) { animation-delay: .05s; }
.hero-text > *:nth-child(2) { animation-delay: .18s; }
.hero-text > *:nth-child(4) { animation-delay: .28s; }
.hero-text > *:nth-child(5) { animation-delay: .38s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* hero terminal */
#hero-term {
  font-size: .82rem;
  line-height: 2;
  margin: 0 0 20px;
  min-height: 110px;
  color: var(--fg2);
}

.t-line {
  display: block;
}

.t-prompt {
  color: var(--grn);
}

.cur {
  color: var(--grn);
  animation: blink 1.1s steps(1) infinite;
}

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

/* tagline */
.tag {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--fg);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}

.sub {
  color: var(--dim);
  font-size: .8rem;
  line-height: 1.7;
  margin: 0 0 28px;
}

/* CTA row */
.cta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* install command */
.install-cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 10px 16px;
  font-size: .8rem;
  color: var(--fg2);
  white-space: nowrap;
  transition: border-color .15s;
}

.install-cmd:hover {
  border-color: var(--accent);
}

.install-cmd .p {
  color: var(--grn);
  margin-right: 2px;
}

/* copy button */
.copy-btn {
  font: inherit;
  font-size: .76rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line2);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: .03em;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.copy-btn::before {
  content: "copy";
}

.copy-btn.copied::before {
  content: "done";
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(74, 158, 255, .06);
}

.copy-btn.copied {
  color: var(--grn);
  border-color: var(--grn);
}

/* primary CTA button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  border-radius: var(--r);
  text-align: center;
  white-space: nowrap;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: background .15s, color .15s, transform .12s, box-shadow .15s;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(74, 158, 255, .22);
}

.btn:active {
  transform: translateY(0);
}

/* ─────────────────────────────
   SECTIONS
   ───────────────────────────── */
section {
  padding: var(--section-pad) 0;
  border-bottom: 1px solid var(--line);
}

section:nth-child(even) {
  background: var(--bg2);
}

/* shared block wrapper */
.term,
.code-block,
.diff {
  border: 1px solid var(--line2);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--panel);
}

/* terminal */
.term {
  padding: 18px 22px;
  font-size: .8rem;
  line-height: 2;
  overflow-x: auto;
  position: relative;
}

.term .p {
  color: var(--grn);
}

.term .c {
  color: var(--dim);
  font-style: italic;
}

.term-sm {
  padding: 10px 16px;
  font-size: .77rem;
  margin-top: 8px;
}

/* package grid */
.pkg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 36px;
  margin-top: 32px;
}

.pkg-grid>div {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.pkg-grid h3 {
  font-size: .68rem;
  color: var(--dim);
  margin: 0 0 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* code block */
.code-block .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line2);
  font-size: .71rem;
  color: var(--dim);
  background: var(--panel2);
}

.code-block pre {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 2;
  tab-size: 4;
}

/* syntax */
.kw {
  color: var(--accent);
}

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

.str {
  color: var(--grn);
}

.num {
  color: #ff8c69;
}

.co {
  color: var(--dim);
  font-style: italic;
}

/* feature list — 2-column grid */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
}

.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--fg2);
}

.feature-list li:nth-child(1),
.feature-list li:nth-child(2) {
  border-top: none;
}

.feature-list .chk {
  color: var(--grn);
  font-weight: 700;
  flex-shrink: 0;
  padding-top: 2px;
}

.feature-list .feat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-list .desc {
  color: var(--dim);
  font-size: .77rem;
}

/* doc cards */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 24px;
}

.doc-card {
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 20px 18px;
  background: var(--panel);
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .15s, background .15s, transform .15s;
}

.doc-card:hover {
  border-color: var(--accent);
  background: var(--panel2);
  transform: translateY(-2px);
}

.doc-card .fname {
  color: var(--dim);
  font-size: .68rem;
  margin: 0;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.doc-card .title {
  font-size: .84rem;
  font-weight: 600;
  color: var(--fg);
}

.doc-card .arrow {
  color: var(--accent);
  font-size: .74rem;
  margin-top: auto;
  padding-top: 10px;
}

/* changelog diff */
.diff .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line2);
  font-size: .71rem;
  color: var(--dim);
  background: var(--panel2);
}

.diff pre {
  margin: 0;
  padding: 16px 0;
  overflow-x: auto;
  font-size: .79rem;
  line-height: 1.9;
}

.diff .ln {
  display: block;
  padding: 0 24px;
  white-space: pre;
}

.diff .ver {
  color: var(--accent);
  font-weight: 700;
  padding-top: 8px;
  padding-bottom: 2px;
}

.diff .add {
  background: rgba(63, 185, 80, .07);
  color: var(--grn);
}

.diff .meta {
  color: var(--dim);
}

/* github stats */
.gh-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 56px;
  align-items: flex-end;
  margin-bottom: 28px;
}

.gh-stat .n {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--grn);
}

.gh-stat.str .n {
  color: var(--warn);
}

.gh-stat.fk .n {
  color: var(--accent);
}

.gh-stat .l {
  color: var(--dim);
  font-size: .72rem;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg2);
  margin-top: 8px;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}

.gh-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(74, 158, 255, .06);
  transform: translateY(-2px);
}

/* philosophy */
.philosophy {
  max-width: 58ch;
}

.philosophy p {
  color: var(--fg2);
  line-height: 1.85;
  margin: 0 0 .9em;
  font-size: .88rem;
}

.philosophy p strong {
  color: var(--fg);
}

.philosophy p:last-child {
  margin: 0;
}

/* community grid — 3 columns */
.comm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 32px;
  margin-top: 24px;
}

.comm-item {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.comm-item h3 {
  font-size: .67rem;
  color: var(--dim);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.comm-item a {
  font-size: .82rem;
  color: var(--fg2);
}

.comm-item a:hover {
  color: var(--accent);
}

/* footer */
footer {
  padding: 64px 0 80px;
}

footer .q {
  color: var(--fg2);
  font-style: italic;
  font-size: .92rem;
  margin: 0 0 8px;
  letter-spacing: -.01em;
}

footer .q::before {
  content: "// ";
  color: var(--dim);
}

footer .prompt {
  color: var(--dim);
  font-size: .82rem;
  margin: 0 0 40px;
}

footer .prompt .p {
  color: var(--grn);
}

footer .meta {
  color: var(--dim);
  font-size: .76rem;
  margin-top: 8px;
  line-height: 1.9;
}

footer .meta a {
  color: var(--dim);
}

footer .meta a:hover {
  color: var(--fg);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .wrap {
    padding: 0 24px;
  }

  .hero-right {
    padding: 36px 24px 48px;
  }

  .chrome-nav {
    display: none;
  }

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

  .feature-list {
    grid-template-columns: 1fr;
  }

  .feature-list li:nth-child(2) {
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 560px) {
  :root {
    --section-pad: 56px;
  }

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

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

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

  .wrap {
    padding: 0 16px;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  /* reduce iframe overshoot so "F" in Forge isn't clipped by overflow:hidden */
  .ascii-row {
    height: clamp(120px, 28vw, 200px);
  }

  #ascii-crop {
    width: 108%;
  }

  #ascii-forge {
    width: 105%;
  }
}

/* <420px — side-by-side row, tuned overshoot so letters fill the frame */
@media (max-width: 419px) {
  .ascii-row {
    height: clamp(130px, 36vw, 200px);
    gap: 0;
    /* eliminate the 1px crack between words */
  }

  #ascii-crop {
    width: 112%;
    left: 0;
    right: auto;
  }

  /* clips right blank */
  #ascii-forge {
    width: 101%;
    right: 0;
    left: auto;
  }

  /* clips ~4px left margin — safe for "F" */
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .hero-right > *, .hero-text > * {
    opacity: 1 !important;
  }

  .cur {
    opacity: 1;
  }
}

/* ── About section ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0 56px;
  align-items: start;
  margin-top: 8px;
}

.about-bio p {
  color: var(--fg2);
  font-size: .88rem;
  line-height: 1.85;
  margin: 0 0 .9em;
}

.about-bio p strong {
  color: var(--fg);
}

.about-bio p:last-child {
  margin: 0;
  color: var(--dim);
  font-size: .8rem;
  font-style: italic;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about-link-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-label {
  font-size: .67rem;
  color: var(--dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.about-link-item a {
  font-size: .84rem;
  color: var(--fg2);
  word-break: break-all;
}

.about-link-item a:hover {
  color: var(--accent);
}

@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px 0;
  }
}