/* rhow — site styles. Dark-first, terminal-native. */

:root {
  --bg: #0b0c0e;
  --bg-2: #101215;
  --bg-3: #15181c;
  --term: #08090b;
  --line: #22262c;
  --line-2: #2c3138;
  --fg: #f2efe8;
  --fg-2: #b7b3aa;
  --fg-3: #7d7a73;
  --accent: #ffb454;
  --accent-2: #ffcb7f;
  --accent-ink: #1a1206;
  --cmd: #6fd6e6;
  --green: #7fd18a;
  --yel: #ffc857;
  --red: #ff6b6b;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  /* fine grid, barely there: a nod to graph paper, not a gradient */
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 20%, transparent 100%);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }
code, pre, kbd { font-family: var(--mono); }
p code, li code, .tabs__desc code {
  font-size: .88em; color: var(--fg); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 5px; padding: .1em .38em;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; font-weight: 700; line-height: 1.05; }
h3 { letter-spacing: .01em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Icon sprite: hidden here rather than inline, because the CSP in _headers forbids style attributes. */
.sprite { display: none; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- type scale ---------- */
.display {
  font-size: clamp(2.5rem, 5.6vw, 4.1rem);
  font-weight: 800; letter-spacing: -.012em; line-height: 1; text-wrap: balance;
}
.display em { font-style: normal; color: var(--accent); }
.display--sm { font-size: clamp(2.2rem, 4.8vw, 3.6rem); }
.h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); text-wrap: balance; }
.sub {
  color: var(--fg-2); font-size: clamp(1.05rem, 1.5vw, 1.2rem); max-width: 60ch; margin: 16px 0 0; text-wrap: pretty;
}
.sub--wide { max-width: 68ch; }
.sub--tight { max-width: 48ch; }
.lede { color: var(--fg-2); font-size: clamp(1.1rem, 1.6vw, 1.25rem); max-width: 52ch; margin: 22px 0 0; text-wrap: pretty; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px;
  font-family: var(--mono); font-size: .8rem; color: var(--fg-2); letter-spacing: .02em;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 10px; background: rgba(255,255,255,.02);
}
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.note { color: var(--fg-3); font-size: .95rem; max-width: 72ch; margin: 28px 0 0; }
.note a, .install__more a { color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; }
.note a:hover, .install__more a:hover { color: var(--accent-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 8px; font-weight: 600; font-size: 1rem;
  border: 1px solid transparent; transition: transform .15s var(--ease), background .15s, border-color .15s, color .15s;
  font-family: var(--mono); letter-spacing: -.01em;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn--ghost { border-color: var(--line-2); color: var(--fg); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--fg-3); color: var(--fg); background: rgba(255,255,255,.05); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.wordmark {
  font-family: var(--mono); font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; color: var(--fg);
  display: inline-flex; align-items: center;
}
.wordmark:hover { color: var(--fg); }
.wordmark__prompt { color: var(--accent); margin-right: .35em; font-weight: 500; }
.wordmark__cursor {
  display: inline-block; width: .55em; height: 1.05em; margin-left: .18em; background: var(--accent);
  transform: translateY(.12em); animation: blink 1.1s steps(1) infinite;
}
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 6px;
  font-size: .95rem; color: var(--fg-2); font-weight: 500;
}
.nav__links a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.nav__gh { border: 1px solid var(--line-2); margin-left: 6px; color: var(--fg) !important; }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 96px); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 4vw, 56px); align-items: center;
}
.hero__hint { margin: 22px 0 0; font-size: .9rem; color: var(--fg-3); }
.hero__hint code { color: var(--fg-2); }
.hero__term { position: relative; min-width: 0; }
.hero__term::before {
  /* one warm glow behind the terminal; the only glow on the page */
  content: ""; position: absolute; inset: -12% -8%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 60% at 60% 40%, rgba(255,180,84,.14), transparent 70%);
  filter: blur(8px);
}

/* ---------- terminal ---------- */
.term {
  background: var(--term); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 80px -30px rgba(0,0,0,.8);
  overflow: hidden; min-width: 0;
}
.term__bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.term__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.term__title { margin-left: auto; font-family: var(--mono); font-size: .75rem; color: var(--fg-3); }
.term__screen {
  padding: 18px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.term__pre { margin: 0; font: inherit; white-space: pre; tab-size: 2; }
.term--mini .term__screen { padding: 14px 16px; font-size: 13px; }
.term--hero .term__screen { height: 420px; font-size: 13px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }

.t-ps { color: var(--accent); }
.t-cmd { color: var(--cmd); }
.t-title { color: var(--fg); font-weight: 700; }
.t-dim { color: var(--fg-3); }
.t-yel { color: var(--yel); }
.t-red { color: var(--red); }
.t-grn { color: var(--green); }
.t-key { color: var(--fg-2); }
.t-str { color: var(--green); }
.t-num { color: var(--yel); }

/* interactive output: rows are flex so descriptions can wrap on phones */
.term__out { white-space: pre-wrap; word-break: break-word; }
.term__out .row { display: block; white-space: pre; }
.term__out .line { display: block; white-space: pre-wrap; opacity: 0; animation: rise .28s var(--ease) forwards; }
.term__out .line--cmd { display: flex; flex-wrap: wrap; column-gap: 1.6ch; padding-left: 2ch; text-indent: 0; }
.term__out .line--cmd .c { color: var(--cmd); white-space: pre; flex: 0 0 auto; }
.term__out .line--cmd .d { color: var(--fg-2); white-space: pre-wrap; flex: 1 1 22ch; min-width: 0; }
.term__out .line--cmd .d .t-dim, .term__out .line--cmd .d .t-yel, .term__out .line--cmd .d .t-red { white-space: nowrap; }
.term__out .blank { display: block; height: 1.6em; }

.term__prompt { display: flex; align-items: baseline; gap: .8ch; position: relative; margin-top: 2px; min-height: 1.6em; }
.term__ps { color: var(--accent); }
.term__mirror { color: var(--fg); white-space: pre; }
.term__typed { white-space: pre; }
.term__cursor {
  display: inline-block; width: .6em; height: 1.15em; vertical-align: text-bottom; background: var(--fg);
  animation: blink 1.05s steps(1) infinite; opacity: .9;
}
.term:not(:focus-within) .term__cursor { background: transparent; box-shadow: inset 0 0 0 1px var(--fg-3); animation: none; }
.term__input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; font: inherit; border: 0; padding: 0; margin: 0; background: transparent; color: transparent; caret-color: transparent;
}
.term__screen[data-typing] .term__input { pointer-events: none; }

/* ---------- problem ---------- */
.problem { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.chaos { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-top: 48px; }
.chaos__files { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; }
.chaos__files li {
  font-family: var(--mono); font-size: .82rem; color: var(--fg-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; background: var(--bg-2); transform: rotate(var(--r, 0deg)); transition: transform .3s var(--ease);
}
.chaos__files li:nth-child(3n) { --r: -1.4deg; } .chaos__files li:nth-child(3n+1) { --r: 1deg; } .chaos__files li:nth-child(5n) { --r: 1.8deg; }
.chaos:hover .chaos__files li { transform: none; }
.chaos .term { width: min(100%, 760px); }
.chaos .term__screen { font-size: 12.5px; }
.chaos__arrow { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--fg-3); }
.chaos__cmd { font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.statement { margin: 48px 0 0; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 700; letter-spacing: -.02em; text-align: center; }

/* ---------- how ---------- */
.how { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); background: linear-gradient(to bottom, var(--bg-2), var(--bg)); }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.steps .step--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); grid-template-rows: auto auto auto; gap: 10px 32px; align-items: start; align-content: center; }
.step--wide .step__n, .step--wide .step__t, .step--wide .step__p { grid-column: 1; }
.steps .step--wide .term { grid-column: 2; grid-row: 1 / span 3; margin: 0; align-self: center; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: rgba(255,255,255,.015); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.step__n { font-family: var(--mono); color: var(--accent); font-weight: 700; letter-spacing: .05em; }
.step__t { font-size: 1.25rem; }
.step__p { margin: 0 0 8px; color: var(--fg-2); font-size: .98rem; }
.step .term { margin-top: auto; }

/* ---------- use cases ---------- */
.when { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; margin-top: 40px; counter-reset: c; }
.cases li { counter-increment: c; border-top: 1px solid var(--line); padding-top: 18px; }
.cases li::before { content: counter(c, decimal-leading-zero); display: block; font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: .85rem; letter-spacing: .05em; margin-bottom: 10px; }
.cases h3 { font-size: 1.15rem; margin-bottom: 8px; }
.cases p { margin: 0; color: var(--fg-2); font-size: .97rem; }

/* ---------- faq ---------- */
.faq { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); background: var(--bg-2); }
.faq__list { margin-top: 32px; border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 600; font-size: 1.08rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-family: var(--mono); color: var(--accent); font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { color: var(--accent-2); }
.faq details p { margin: 0 0 20px; color: var(--fg-2); max-width: 70ch; }

/* ---------- stack ---------- */
.stack { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 40px; background: var(--bg); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 18px 16px; display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: start; transition: background .2s; }
.grid li:hover { background: var(--bg-2); }
.grid .ico { width: 20px; height: 20px; fill: currentColor; color: var(--fg-3); grid-row: 1 / span 2; margin-top: 2px; transition: color .2s; }
.grid li:hover .ico { color: var(--fg); }
.grid b { font-family: var(--mono); font-weight: 700; font-size: .95rem; grid-column: 2; }
.grid span { color: var(--fg-3); font-size: .86rem; line-height: 1.45; grid-column: 2; }

/* ---------- philosophy ---------- */
.philosophy { padding: clamp(64px, 10vw, 140px) 0; border-top: 1px solid var(--line); background: var(--bg-2); }
.tenets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 44px; }
.tenets li { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; display: flex; flex-direction: column; gap: 2px; }
.tenets b { font-family: var(--mono); font-size: 1.05rem; }
.tenets span { color: var(--fg-2); font-size: .95rem; }

/* ---------- examples / tabs ---------- */
.examples { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.tabs { margin-top: 36px; }
.tabs__list { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 20px; overflow-x: auto; }
.tabs__list [role="tab"] {
  appearance: none; background: none; border: 1px solid transparent; color: var(--fg-2); cursor: pointer;
  font: 600 .92rem var(--mono); padding: 8px 14px; border-radius: 6px; transition: background .15s, color .15s;
}
.tabs__list [role="tab"]:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.tabs__list [role="tab"][aria-selected="true"] { color: var(--accent-ink); background: var(--accent); }
.tabs__desc { margin: 0 0 14px; color: var(--fg-2); max-width: 72ch; }
.tabs__panel .term__screen { max-height: 520px; overflow: auto; }
.flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 28px; margin-top: 28px; }
.flags li { display: flex; flex-direction: column; gap: 2px; font-size: .95rem; color: var(--fg-2); }
.flags li > code { color: var(--fg); background: none; border: 0; padding: 0; font-size: .95rem; }

/* ---------- install ---------- */
.install { padding: clamp(64px, 10vw, 140px) 0; border-top: 1px solid var(--line); background: var(--bg-2); }
.cmdbox { position: relative; display: flex; align-items: center; background: var(--term); border: 1px solid var(--line-2); border-radius: 8px; min-width: 0; }
.cmdbox pre { margin: 0; padding: 12px 14px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; color: var(--fg); }
.cmdbox code { white-space: pre; }
.cmdbox--hero { margin-top: 32px; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,180,84,.08); }
.cmdbox--hero pre { padding: 20px 22px; font-size: clamp(.9rem, 1.4vw, 1.05rem); }
.cmdbox--hero pre::before { content: "$ "; color: var(--accent); }
.copy {
  flex: 0 0 auto; margin: 0 8px; appearance: none; cursor: pointer;
  background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--line-2); border-radius: 6px;
  font: 600 .78rem var(--mono); padding: 6px 10px; transition: background .15s, color .15s, border-color .15s;
}
.copy:hover { color: var(--fg); border-color: var(--fg-3); }
.copy[data-done] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 24px; margin-top: 32px; }
.channels li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.channels__k { font-family: var(--mono); font-size: .78rem; color: var(--fg-3); letter-spacing: .04em; text-transform: uppercase; }
.install__more { margin: 32px 0 0; color: var(--fg-2); max-width: 72ch; font-size: .98rem; }
.arrow { display: inline-block; margin-top: 6px; color: var(--fg) !important; text-decoration: none !important; font-weight: 600; }
.arrow:hover { color: var(--accent-2) !important; }

/* ---------- open ---------- */
.open { padding: clamp(64px, 10vw, 140px) 0; border-top: 1px solid var(--line); }
.open__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.open__repo { font-size: 1.05rem; margin: 24px 0 20px; }
.open__repo code { background: none; border: 0; padding: 0; color: var(--fg-2); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; background: var(--bg-2); }
.footer__in { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.wordmark--footer { margin: 0; }
.footer__tag { margin: 6px 0 0; color: var(--fg-3); font-size: .95rem; }
.footer__by { margin: 14px 0 0; color: var(--fg-3); font-size: .9rem; }
.footer__by a { color: var(--fg-2); }
.footer__by a:hover { color: var(--fg); }
.footer__links { display: flex; gap: 22px; }
.footer__links a { color: var(--fg-2); font-size: .95rem; }
.footer__links a:hover { color: var(--fg); }

/* ---------- motion ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.steps .step:nth-child(2) { transition-delay: .08s; } .steps .step:nth-child(3) { transition-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .wordmark__cursor, .term__cursor { animation: none; }
  .term__out .line { animation: none; opacity: 1; }
  .chaos__files li { transform: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy { max-width: 640px; }
  .steps { grid-template-columns: 1fr; }
  .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps .step--wide { grid-template-columns: 1fr; }
  .steps .step--wide .term { grid-column: 1; grid-row: auto; }
  .tenets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .open__in { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav__links li:not(:last-child) { display: none; }
  .nav__links a { padding: 7px 10px; font-size: .9rem; }
  .term__screen { padding: 14px 14px; font-size: 12.5px; }
  .term--hero .term__screen { height: 340px; }
  .term__out .line--cmd { margin-top: 4px; }
  .term__out .line--cmd .d { padding-left: 1ch; }
  .cmdbox--hero pre { padding: 16px; }
  .cmdbox--hero pre code { white-space: pre-wrap; word-break: break-all; }
  .tenets { grid-template-columns: 1fr; }
  .cases { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__in { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}
