/* noodge.dev
   Colours come from the tool itself (internal/tui/styles.go): accent is ANSI 39,
   muted is 244, warn is 203. The site and the terminal agree on purpose. */

:root {
  --bg:        #0B0D10;
  --panel:     #12151A;
  --panel-2:   #0F1216;
  --line:      #222831;
  --line-soft: #1A1E25;
  --fg:        #E6E9EC;
  --fg-dim:    #B9C0C7;
  --muted:     #8A9199;
  --faint:     #6B747D;
  --accent:    #5FAFFF;
  --accent-dim:#2E6EA6;
  --warn:      #FF5F5F;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --w: 1120px;
  --r: 10px;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

p code, li code, td code, dd code, .aside code, .note code, .quote code {
  font-size: .88em;
  color: var(--fg-dim);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: .08em .32em;
  white-space: nowrap;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: #07111C; font-weight: 600;
  padding: .5rem .9rem; border-radius: 7px; transition: top .15s;
}
.skip:focus { top: 1rem; text-decoration: none; }

.wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 1.5rem; }

/* ---------------------------------------------------------------- nav ---- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 16, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 60px;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 1.0625rem;
  color: var(--fg); letter-spacing: -.02em; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; font-size: .9375rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--fg); }
.ver {
  font-family: var(--mono); font-size: .75rem; color: var(--accent);
  border: 1px solid rgba(95, 175, 255, .3); background: rgba(95, 175, 255, .08);
  border-radius: 999px; padding: .15rem .6rem;
}
.ver:hover { text-decoration: none; border-color: var(--accent); }
@media (max-width: 640px) {
  .nav-links { gap: 1rem; font-size: .875rem; }
  .nav-links .hide-s { display: none; }
}

/* ------------------------------------------------------------ sections --- */

section { padding: 5.5rem 0; border-top: 1px solid var(--line-soft); }
section:first-of-type { border-top: 0; }
@media (max-width: 720px) { section { padding: 3.5rem 0; } }

.kicker {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 .9rem;
}
.kicker.warn { color: var(--warn); }

h1, h2, h3 { letter-spacing: -.028em; font-weight: 600; margin: 0 0 .75rem; }
h1 { font-size: clamp(2.25rem, 5.4vw, 3.5rem); line-height: 1.08; max-width: 17ch; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.125rem); line-height: 1.16; max-width: 20ch; }
h3 { font-size: 1.0625rem; letter-spacing: -.015em; }
h1 em, h2 em { font-style: normal; color: var(--accent); }

.lede { font-size: 1.0625rem; color: var(--muted); max-width: 62ch; margin: 0 0 2rem; }
.note { font-size: .9375rem; color: var(--muted); max-width: 68ch; margin: 1.5rem 0 0; }
.note strong { color: var(--fg); font-weight: 600; }

.quote {
  border-left: 2px solid var(--accent);
  padding: .2rem 0 .2rem 1.25rem;
  margin: 2.5rem 0 1rem;
  font-size: 1.1875rem; line-height: 1.55; color: var(--fg-dim);
  max-width: 54ch;
}

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.arrow { text-align: center; color: var(--accent); font-family: var(--mono); font-size: 1.5rem; line-height: 1; margin: 1rem 0; }

/* ------------------------------------------------------------ terminal --- */

.term {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  position: relative;
}
.term-bar {
  display: flex; align-items: center; gap: .4rem;
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2B323B; flex: none; }
.term-bar b {
  font-family: var(--mono); font-size: .75rem; font-weight: 400;
  color: var(--faint); margin-left: .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.term pre {
  margin: 0; padding: 1rem 1.1rem;
  font-size: .8125rem; line-height: 1.7;
  overflow-x: auto; color: var(--fg-dim);
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 720px) { .term pre { font-size: .75rem; padding: .85rem .9rem; } }

.term pre::-webkit-scrollbar { height: 8px; }
.term pre::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ANSI-equivalent roles */
.a  { color: var(--accent); }
.m  { color: var(--muted); }
.w  { color: var(--warn); }
.f  { color: var(--fg); }
.d  { color: var(--faint); }
.k  { color: var(--accent); }
.v  { color: var(--fg-dim); }

.cur {
  background: var(--accent); color: var(--bg);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .cur { animation: none; } }

/* ---------------------------------------------------------------- copy --- */

.copy {
  position: absolute; top: .5rem; right: .5rem;
  font-family: var(--mono); font-size: .6875rem;
  color: var(--faint); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 5px;
  padding: .2rem .5rem; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.copy:hover { color: var(--accent); border-color: var(--accent-dim); }
.copy[data-done] { color: var(--accent); }

/* ---------------------------------------------------------------- tabs --- */

.tabs { display: flex; gap: .15rem; flex-wrap: wrap; }
.tab {
  font-family: var(--mono); font-size: .75rem;
  padding: .4rem .8rem; color: var(--faint);
  background: none; border: 1px solid transparent; border-bottom: 0;
  border-radius: 7px 7px 0 0; cursor: pointer;
}
.tab:hover { color: var(--fg-dim); }
.tab[aria-selected="true"] {
  color: var(--accent); background: var(--panel);
  border-color: var(--line); position: relative; z-index: 1;
}
.tabpanels { margin-top: -1px; }
.tabpanels .term { border-radius: 0 var(--r) var(--r) var(--r); }
.tabpanels .term pre { padding: .9rem 4rem .9rem 1.1rem; }

/* --------------------------------------------------------------- tiles --- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: .85rem; }
.tile {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.15rem 1.25rem;
}
.tile h3 { margin: 0 0 .4rem; }
.tile p { font-size: .9375rem; color: var(--muted); margin: 0 0 .9rem; line-height: 1.55; }
.tile pre {
  margin: 0; font-size: .75rem; color: var(--accent);
  border-top: 1px solid var(--line-soft); padding-top: .75rem;
  overflow-x: auto; line-height: 1.6;
}

/* --------------------------------------------------------------- chips --- */

.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1.75rem; }
.chip {
  font-family: var(--mono); font-size: .75rem; color: var(--fg-dim);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: .25rem .6rem;
}
.chip.req { color: var(--warn); border-color: #3A2529; }

/* --------------------------------------------------------------- table --- */

table { width: 100%; border-collapse: collapse; font-size: .9375rem; margin: 1.25rem 0 0; }
th {
  text-align: left; font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  font-weight: 400; padding: .5rem .75rem; border-bottom: 1px solid var(--line);
}
td { padding: .55rem .75rem; border-bottom: 1px solid var(--line-soft); color: var(--muted); vertical-align: top; }
td.mono { font-family: var(--mono); font-size: .8125rem; color: var(--accent); white-space: nowrap; }
td.out  { font-family: var(--mono); font-size: .8125rem; color: var(--fg-dim); }
td.nil  { color: var(--faint); font-style: italic; }
.scroll-x { overflow-x: auto; }

/* --------------------------------------------------------------- steps --- */

.steps { display: grid; gap: .9rem; margin: 2rem 0 0; max-width: 62ch; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.step > b {
  font-family: var(--mono); font-size: .8125rem; font-weight: 400; color: var(--accent);
  border: 1px solid var(--line); border-radius: 50%;
  width: 28px; height: 28px; display: grid; place-items: center; flex: none;
}
.step > div { font-size: .9375rem; color: var(--muted); padding-top: .2rem; }
.step strong { color: var(--fg); font-weight: 500; }

/* ---------------------------------------------------------------- hero --- */

.hero { padding: 5rem 0 4.5rem; }
.hero .cta { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0 0 2rem; }
.btn {
  display: inline-block; font-size: .9375rem; font-weight: 500;
  padding: .65rem 1.3rem; border-radius: 8px;
  background: var(--accent); color: #07111C; border: 1px solid var(--accent);
}
.btn:hover { background: #7CBEFF; text-decoration: none; }
.btn.ghost { background: none; color: var(--fg-dim); border-color: #2B323B; }
.btn.ghost:hover { background: var(--panel); color: var(--fg); }
@media (max-width: 720px) { .hero { padding: 3rem 0; } }

/* ------------------------------------------------------------ contrast --- */

.ba-label {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em;
  text-transform: uppercase; margin: 0 0 .75rem;
}
.ba-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ba-label.bad { color: var(--warn); }
.ba-label.good { color: var(--accent); }
.aside {
  font-size: .9375rem; color: var(--muted); font-style: italic;
  margin: 1rem 0 2.5rem; max-width: 62ch; line-height: 1.6;
}
.aside code { font-style: normal; }

/* -------------------------------------------------------------- footer --- */

footer { border-top: 1px solid var(--line-soft); padding: 3rem 0 3.5rem; }
.foot-top { display: flex; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap; }
.foot-top > div:first-child { max-width: 30ch; }
.foot-tag { font-size: .9375rem; color: var(--muted); margin: .6rem 0 0; }
.foot-cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.foot-col { display: grid; gap: .45rem; align-content: start; font-size: .9375rem; }
.foot-col b {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); font-weight: 400; margin-bottom: .2rem;
}
.foot-col a { color: var(--muted); }
.foot-col a:hover { color: var(--fg); }
.fine { margin: 2.5rem 0 0; font-size: .875rem; color: var(--faint); line-height: 1.7; }
.fine .status { color: var(--accent); }

/* ---------------------------------------------------------------- docs --- */

.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3.5rem; padding: 3rem 0 5rem; }
.toc { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 7rem); overflow-y: auto; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.toc a {
  display: block; font-size: .875rem; color: var(--muted);
  padding: .3rem .7rem; border-left: 1px solid var(--line-soft);
}
.toc a:hover { color: var(--fg); text-decoration: none; }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }
.doc h1 { max-width: none; margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 2.75rem); }
.doc section { padding: 2.75rem 0 0; border-top: 0; }
.doc section + section { border-top: 1px solid var(--line-soft); padding-top: 2.75rem; }
.doc h2 { max-width: none; font-size: 1.5rem; margin-bottom: .9rem; scroll-margin-top: 5rem; }
.doc h3 { margin: 1.75rem 0 .6rem; color: var(--fg); }
.doc p { color: var(--muted); max-width: 66ch; }
.doc p strong { color: var(--fg); font-weight: 600; }
.doc ul { color: var(--muted); max-width: 66ch; padding-left: 1.1rem; }
.doc li { margin: .3rem 0; }
.doc .term { margin: 1.25rem 0; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; max-height: none; border-bottom: 1px solid var(--line-soft); padding-bottom: 1rem; }
  /* A wrapping row, not a grid: fixed columns clip the longer entries. */
  .toc ol { display: flex; flex-wrap: wrap; gap: .35rem .1rem; }
  .toc a { border-left: 0; border-bottom: 1px solid var(--line-soft); padding: .25rem .6rem; }
  .toc a.on { border-left: 0; border-bottom-color: var(--accent); }
}
