/* wyd.sh — dark-first, technical, one cyan accent sampled from the TUI (#70e0e0) */

:root {
  color-scheme: dark;
  --bg: #0a0d10;
  --bg-raise: #0e1216;
  --bg-panel: #10151b;
  --border: #1c232c;
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #e7eaee;
  --text-2: #98a1ab;
  --text-3: #727d88;
  --accent: #70e0e0;
  --accent-dim: rgba(112, 224, 224, 0.1);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 72rem;
  --wrap-wide: 78rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #06201f; }

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

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

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

code { font-size: 0.92em; color: var(--accent); }

kbd {
  font-size: 0.78em;
  padding: 0.1em 0.45em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-raise);
  color: var(--text);
}

.dim { color: var(--text-3); }
.accent { color: var(--accent); }
.warn { color: var(--accent); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #06201f;
  z-index: 100;
}
.skip:focus { left: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.wrap-wide {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 16, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 1.1em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-raise);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.btn-small { padding: 0.4em 0.95em; }

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

.hero { padding: clamp(4.5rem, 10vw, 8rem) 0 0; }

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 1.6rem;
}

h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 680;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}

.hero-sub {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 1.1rem;
}
.hero-sub code {
  font-size: 0.92em;
  color: var(--accent);
  font-weight: 600;
  padding: 0.08em 0.42em;
  border: 1px solid rgba(112, 224, 224, 0.35);
  border-radius: 5px;
  background: rgba(112, 224, 224, 0.08);
  white-space: nowrap;
}
.hero-sub em { font-style: normal; color: var(--accent); }

.hero-desc {
  max-width: 38rem;
  color: var(--text-2);
  font-size: 1.02rem;
  margin: 0 0 2.2rem;
  text-wrap: balance;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* command box */

.cmd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9em;
  padding: 0.62em 0.5em 0.62em 1em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-panel);
  font-family: var(--mono);
  font-size: 0.88rem;
}
.cmd code { color: var(--text); }
.cmd-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7em;
  min-width: 0;
}

/* the hero command is the page's one primary action — let it win */
.hero-cta .cmd {
  font-size: 0.95rem;
  border-color: #2c3742;
  background: #12181f;
}
.prompt { color: var(--accent); user-select: none; }

.copy {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.35em 0.8em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.copied { color: var(--accent); border-color: var(--accent); }

/* hero product visual */

.hero-visual { margin-top: clamp(3rem, 7vw, 5.5rem); }

.termshot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel);
  overflow: hidden;
}

.termshot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
}
.termshot-title { color: var(--accent); }
.termshot-title::before { content: "● "; font-size: 0.6rem; vertical-align: 0.15em; }

.termshot img { display: block; width: 100%; height: auto; filter: contrast(1.06) brightness(1.05) saturate(1.05); }

.fig-label {
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

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

.section {
  scroll-margin-top: 4.5rem;
  padding: clamp(5rem, 11vw, 9rem) 0 0;
}

.label {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.label-num { color: var(--accent); }
.label-fig { margin-left: auto; color: var(--text-3); opacity: 0.7; }

h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 660;
  margin: 0 0 1.1rem;
  max-width: 34rem;
  text-wrap: balance;
}

.section-desc {
  max-width: 37rem;
  color: var(--text-2);
  margin: 0 0 2.8rem;
  text-wrap: pretty;
}

/* terminal panels */

.term {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  overflow: hidden;
}

.term-bar {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
}
.term-bar span::before { content: "● "; color: var(--border); font-size: 0.6rem; vertical-align: 0.15em; }

.term-body {
  margin: 0;
  padding: 1.1rem 1.2rem 1.3rem;
  font-size: 0.85rem;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.35em;
  vertical-align: -0.18em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* problem section */

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.2rem;
  align-items: stretch;
}

.statement {
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 3.4rem 0 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent);
}
.statement-small { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 560; }
.statement-small .dim { font-size: 0.85em; font-weight: 400; color: var(--text-2); }

/* lineage diagram */

.lineage {
  max-width: 46rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    var(--bg-panel);
  background-size: 22px 22px, auto;
  padding: clamp(1.4rem, 4vw, 2.6rem);
}

.lineage-tree {
  font-family: var(--mono);
  font-size: clamp(0.78rem, 2.6vw, 0.95rem);
  line-height: 1.6;
}

.ln-row {
  display: flex;
  align-items: baseline;
  gap: 0.7em;
  white-space: nowrap;
  overflow: hidden;
  color: var(--text-2);
  transition: color 0.4s;
}

.ln-branch { color: var(--border); user-select: none; transition: color 0.4s; }
.ln-c1 .ln-branch { color: #2b3540; }

.ln-dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
  align-self: center;
  transition: background 0.4s, box-shadow 0.4s;
}

.ln-row.lit { color: var(--text); }
.ln-row.lit .ln-dot { background: var(--accent); box-shadow: 0 0 10px rgba(112, 224, 224, 0.45); }
.ln-row.lit .ln-branch { color: var(--accent); }

.ln-name { font-weight: 500; }
.ln-meta { color: var(--text-3); }

.ln-badge {
  font-size: 0.72em;
  padding: 0.15em 0.6em;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  transition: border-color 0.4s, color 0.4s, background-color 0.4s;
}
.ln-badge.ended { border-color: var(--border); color: var(--text-3); }

.ln-leftover {
  font-size: 0.78em;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.4s, transform 0.4s;
}
.ln-leftover.on { opacity: 1; transform: none; }

.ln-row.stale { color: var(--text-3); }
.ln-row.stale .ln-dot { background: transparent; border: 1px solid var(--text-3); box-shadow: none; }

.ln-foot { margin-top: 0.6em; color: var(--text-3); font-size: 0.85em; }

/* leftovers */

.leftover-list {
  border-top: 1px solid var(--border);
  margin-bottom: 2rem;
}

.lo-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2.5rem;
  flex-wrap: wrap;
  padding: 1.05rem 0.2rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
}

.lo-main { display: flex; align-items: baseline; gap: 0.8em; font-size: 0.95rem; }
.lo-flag { color: var(--accent); font-size: 0.85em; }
.lo-name { color: var(--text); }
.lo-size { color: var(--text-2); font-size: 0.85em; }

.lo-meta {
  display: flex;
  gap: 0.6em 1.8em;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-3);
}
.lo-reason { color: var(--accent); opacity: 0.85; }

.cmd-inline { font-size: 0.85rem; }

/* registry */

.registry {
  margin: 0;
  border-top: 1px solid var(--border);
}

.reg-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.5rem;
  padding: 1rem 0.2rem;
  border-bottom: 1px solid var(--border);
}

.reg-row dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 0.25em;
}

.reg-row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--text-2);
}
.reg-row dd b { color: var(--text); font-weight: 500; }
.reg-row dd code { font-size: 0.95em; }

.reg-foot {
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: var(--text-3);
}

/* principles */

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.principle {
  padding: 1.8rem 1.6rem 2rem;
  background: var(--bg-panel);
}
.principle + .principle { border-left: 1px solid var(--border); }

.principle-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin: 0 0 1.6rem;
  letter-spacing: 0.12em;
}

.principle h3 {
  font-size: 1.06rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
}

.principle-kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-2);
  margin: 0 0 1.1rem;
}

.principle p:last-child {
  font-size: 0.92rem;
  color: var(--text-2);
  margin: 0;
}
.principle p:last-child em { font-style: normal; color: var(--text); }

/* sessions */

.session-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  overflow: hidden;
  margin-bottom: 2rem;
  font-family: var(--mono);
  font-size: 0.88rem;
}

.st-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1fr 0.5fr;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  align-items: baseline;
}
.st-row:last-child { border-bottom: 0; }

.st-head {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  margin-right: 0.6em;
}
.dot-on { background: var(--accent); box-shadow: 0 0 8px rgba(112, 224, 224, 0.5); }
.dot-off { background: transparent; border: 1px solid var(--text-3); }

/* install */

.section-install { padding-bottom: clamp(5rem, 11vw, 9rem); }

.install-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 40rem;
  margin-bottom: 1.8rem;
}

.install-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  align-items: center;
  gap: 1rem;
}

.install-via {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.install-row .cmd { justify-self: start; width: auto; }

.install-meta { color: var(--text-3); font-size: 0.9rem; }
.install-meta a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.install-meta a:hover { color: var(--accent); }


/* provenance: session table + mcp dialogue side by side */

.prov-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.2rem;
  align-items: start;
}

.prov-col { display: flex; flex-direction: column; gap: 1.2rem; }

/* quiet secondary link — used beside the primary command */

.icon-gh { width: 0.9em; height: 0.9em; vertical-align: -0.15em; margin-right: 0.35em; }
.link-quiet {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--border);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.link-quiet:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* footer */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 2.2rem 0 2.6rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-3);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.footer-copy { margin-left: auto; font-family: var(--mono); font-size: 0.75rem; }

/* reveal */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- motion ---------- */

:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

/* hero load choreography: eyebrow → headline → sub → desc → CTA → product */

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.hero .eyebrow { animation: hero-rise 0.7s var(--ease-out) both; }
.hero h1 { animation: hero-rise 0.7s 0.08s var(--ease-out) both; }
.hero .hero-sub { animation: hero-rise 0.7s 0.16s var(--ease-out) both; }
.hero .hero-desc { animation: hero-rise 0.7s 0.24s var(--ease-out) both; }
.hero .hero-cta { animation: hero-rise 0.7s 0.32s var(--ease-out) both; }
.hero .hero-visual { animation: hero-rise 0.8s 0.44s var(--ease-out) both; }

/* terminal line print — one-shot when the container enters view */

.t-line, .t-cmd, .t-out { display: block; }

@keyframes line-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

.in .t-line { animation: line-in 0.45s var(--ease-out) both; }

/* ps soup drips fast, wyd tree resolves after it */
.dim-soup .t-line { animation-delay: calc(0.1s + var(--i, 0) * 38ms); }
.problem-grid .term-body:not(.dim-soup) .t-line { animation-delay: calc(0.56s + var(--i, 0) * 75ms); }

/* conversational pace for the mcp exchange */
.term .t-line { animation-delay: calc(0.15s + var(--i, 0) * 130ms); }

/* explain terminal: focused width, not an empty full-width bar */
.explain-term { max-width: 46rem; }

/* `wyd why` — typed command, then output lines */

.term.typing .t-out { opacity: 0; }
.term.done .t-out { animation: line-in 0.45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

/* copy feedback: box flashes accent */

.cmd { transition: border-color 0.2s, background-color 0.2s; }
.cmd:hover { border-color: #2c3742; }
.cmd:focus-within { border-color: var(--accent); }

@keyframes cmd-flash {
  0% { border-color: var(--accent); background-color: var(--accent-dim); }
  100% { border-color: var(--border); background-color: var(--bg-panel); }
}
.cmd.flash { animation: cmd-flash 0.5s var(--ease-out); }

/* rows acknowledge the pointer */

.lo-row, .st-row { transition: background-color 0.18s; }
.lo-row:hover, .st-row:hover { background-color: rgba(112, 224, 224, 0.035); }

/* live session dot breathes */

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(112, 224, 224, 0); }
  50% { box-shadow: 0 0 9px rgba(112, 224, 224, 0.55); }
}
.dot-on { animation: dot-pulse 3s ease-in-out infinite; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr; }
  .principle + .principle { border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 760px) {
  .problem-grid { grid-template-columns: 1fr; }
  .prov-grid { grid-template-columns: 1fr; }
  .reg-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .st-row { grid-template-columns: 1fr 1.4fr 0.9fr 0.4fr; gap: 0.6rem; font-size: 0.78rem; }
  .hero-cta { flex-direction: column; align-items: stretch; width: 100%; max-width: 26rem; }
  .hero-cta .btn { justify-content: center; }
  .cmd { width: 100%; }
  .cmd code { overflow-x: auto; }
  .install-row { grid-template-columns: 1fr; gap: 0.45rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.1rem; }
  .footer-copy { margin-left: 0; }
}

@media (max-width: 480px) {
  /* session rows wrap 2×2 instead of squeezing four columns */
  .st-row { grid-template-columns: 1.1fr 0.9fr; gap: 0.3rem 0.6rem; font-size: 0.78rem; }
  .term-body { font-size: 0.78rem; }
}

@media (pointer: coarse) {
  /* tap targets: copy buttons and header links clear 44px hit areas */
  .copy { padding: 0.7em 1.1em; font-size: 0.78rem; }
  .header-nav a { padding: 0.75rem 0; }
}

/* ---------- reduced motion ---------- */

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