/* contorch.com — ember-dark, terminal-first.
   Palette: warm coal (not flat black), cream text, brand flame amber. */

:root {
  --coal: #16110c;
  --soot: #211913;
  --pit: #0e0a07;           /* terminal / code wells */
  --line: rgba(244, 235, 223, 0.10);
  --cream: #f4ebdf;
  --ash: #a5937f;
  --flame: #ff6b35;
  --gold: #ffb454;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--coal);
  color: var(--cream);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--flame); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 3px;
  border-radius: 2px;
}

code { font-family: var(--mono); font-size: 0.92em; color: var(--gold); }

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

nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--cream);
  letter-spacing: 0.01em;
}
.brand img { display: block; }
.nav-links { display: flex; gap: 1.75rem; font-family: var(--mono); font-size: 0.85rem; }
.nav-links a { color: var(--ash); }
.nav-links a:hover { color: var(--cream); }

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

.hero {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5.5rem;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3.5rem;
  align-items: center;
  overflow: visible;
}
.ember {
  position: absolute;
  inset: auto 0 -18rem 0;
  height: 30rem;
  background:
    radial-gradient(55% 70% at 50% 100%, rgba(255, 107, 53, 0.16), transparent 70%),
    radial-gradient(30% 45% at 58% 100%, rgba(255, 180, 84, 0.10), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  animation: breathe 7s ease-in-out infinite;
  z-index: -1;
}
@keyframes breathe {
  0%, 100% { opacity: 0.65; transform: scaleX(1); }
  50%      { opacity: 1;    transform: scaleX(1.06); }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--flame);
  margin-bottom: 1.1rem;
}
h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 5.2vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 1.3rem;
}
.sub { color: var(--ash); max-width: 34rem; margin-bottom: 2.1rem; }
.sub strong { color: var(--cream); font-weight: 500; }

.install-cta {
  display: flex;
  align-items: stretch;
  max-width: 34rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--pit);
  overflow: hidden;
}
.install-cta code {
  flex: 1;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  color: var(--cream);
  white-space: nowrap;
  overflow-x: auto;
}
.install-cta .prompt { color: var(--flame); user-select: none; }
#copy-btn {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--soot);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0 1.1rem;
  cursor: pointer;
}
#copy-btn:hover { color: var(--cream); background: #2a2016; }
.cta-note {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ash);
}

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

.terminal {
  background: var(--pit);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(255, 107, 53, 0.07);
  min-height: 22rem;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}
.term-bar i {
  width: 0.65rem; height: 0.65rem;
  border-radius: 50%;
  background: var(--line);
}
.term-bar i:first-child { background: rgba(255, 107, 53, 0.55); }
.term-bar span {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ash);
}
.term-body {
  padding: 1.1rem 1.25rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--cream);
}
.term-body div { white-space: pre-wrap; min-height: 1.4em; }
.term-static { white-space: pre-wrap; font-family: inherit; }
.tl-dim     { color: var(--ash); }
.tl-comment { color: #6f6152; }
.tl-query   { color: var(--gold); }
.tl-agent   { color: var(--flame); }
.tl-answer  { color: var(--cream); }
.tl-cite    { color: var(--ash); }
.cursor::after {
  content: "▌";
  color: var(--flame);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

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

main { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

section { padding: 4.5rem 0; }
h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
}
.hash { color: var(--flame); font-family: var(--mono); font-weight: 400; margin-right: 0.3rem; }
.section-sub { color: var(--ash); margin-bottom: 2.75rem; }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.step-k {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--flame);
  margin-bottom: 0.8rem;
}
.steps h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 0.7rem;
}
.steps p:not(.step-k) { color: var(--ash); font-size: 0.98rem; }
.steps em { color: var(--cream); font-style: italic; }

/* ---------- thesis interstitial ---------- */

.thesis {
  padding: 5.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.thesis p {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.35;
  color: var(--cream);
}
.thesis span { color: var(--gold); }

/* ---------- install ---------- */

.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--soot);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.6rem 1.5rem;
}
.card p { color: var(--ash); font-size: 0.95rem; margin-bottom: 0.9rem; }
.card p:last-child { margin-bottom: 0; }
.card strong { color: var(--cream); font-weight: 500; }
.card pre {
  background: var(--pit);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.9rem;
  overflow-x: auto;
}
.card pre code { color: var(--cream); font-size: 0.82rem; line-height: 1.7; display: block; }
.card .prompt { color: var(--flame); }
.card .ok { color: #7fbf7f; }
.quiet { font-family: var(--mono); font-size: 0.8rem; }

/* ---------- trust ---------- */

.trust { border-top: 1px solid var(--line); }
.trust ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 3rem;
}
.trust li { color: var(--ash); font-size: 0.95rem; }
.trust strong { color: var(--cream); font-weight: 500; }

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

footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 3rem 1.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
}
footer p { font-family: var(--display); font-weight: 600; }
footer .quiet { color: var(--ash); font-weight: 400; }
.foot-links { display: flex; gap: 1.75rem; font-family: var(--mono); font-size: 0.8rem; flex-wrap: wrap; justify-content: center; }
.foot-links a { color: var(--ash); }
.foot-links a:hover { color: var(--cream); }

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

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 2.75rem; padding-top: 2.5rem; }
  .steps, .install-grid { grid-template-columns: 1fr; }
  .trust ul { grid-template-columns: 1fr; }
  .nav-links { gap: 1.1rem; }
}
