/* paper-writer landing — self-contained, system fonts only */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: var(--navy); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100;
}
.skip-link:focus { left: 0; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  display: flex; align-items: center; gap: 20px;
  padding-top: 12px; padding-bottom: 12px;
}
.wordmark {
  font-family: var(--serif); font-weight: 700; font-size: 18px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.wordmark .tld { color: var(--navy); }
.site-nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 14.5px;
}
.site-nav a:hover { color: var(--navy); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #0f1f52; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.star-btn { white-space: nowrap; }

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

#hero { padding: 64px 0 48px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-kicker {
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--navy); font-weight: 700; margin: 0 0 14px;
}
h1 {
  font-family: var(--serif); font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12; margin: 0 0 20px; letter-spacing: -0.01em;
}
h1 em { font-style: normal; color: var(--navy); }
.lede { font-size: 18.5px; color: var(--ink-soft); margin: 0 0 26px; max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.hero-sub { font-size: 14px; color: var(--ink-faint); margin: 0; }
.hero-sub code {
  background: var(--tint); padding: 2px 7px; border-radius: 5px;
  color: var(--navy); font-size: 13px;
}

/* ---------- terminal / chat demo ---------- */

.term {
  background: var(--term-bg); color: var(--term-ink);
  border-radius: 12px; padding: 16px 16px 14px;
  box-shadow: var(--shadow-card);
}
.term-bar {
  display: flex; gap: 6px; margin-bottom: 14px; align-items: center;
}
.term-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
}
.term-title {
  margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--term-dim);
}
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 280px; }
.chat-msg { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.45s ease; }
.js .chat-msg { opacity: 0; transform: translateY(6px); }
.js .chat-msg.is-on { opacity: 1; transform: none; }
.chat-who {
  display: block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px;
}
.chat-msg-user .chat-who { color: var(--term-amber); }
.chat-msg-agent .chat-who { color: var(--term-green); }
.chat-bubble {
  background: rgba(255, 255, 255, 0.055); border-radius: 8px;
  padding: 11px 14px; line-height: 1.55; white-space: pre-wrap;
  font-size: 13.5px;
}
.chat-msg-user .chat-bubble { border-left: 2px solid var(--term-amber); }
.chat-msg-agent .chat-bubble { border-left: 2px solid var(--term-green); }
.chat-bubble .g { color: var(--term-green); }
.chat-bubble .a { color: var(--term-amber); }
.chat-bubble .d { color: var(--term-dim); }
.chat-caret {
  display: inline-block; width: 8px; height: 15px; vertical-align: -2px;
  background: var(--term-amber); animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.chat-replay {
  background: none; border: 1px solid rgba(255, 255, 255, 0.2); color: var(--term-dim);
  font-family: var(--mono); font-size: 12px; border-radius: 6px;
  padding: 5px 12px; cursor: pointer; margin-top: 4px;
}
.chat-replay:hover { color: var(--term-ink); border-color: var(--term-dim); }
.term-caption { text-align: center; font-size: 13px; color: var(--ink-faint); margin: 12px 0 0; }

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

section { padding: 64px 0; }
section.band {
  background: var(--paper-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.kicker {
  display: block; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--navy); font-weight: 700; margin-bottom: 10px;
}
h2 {
  font-family: var(--serif); font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.2; margin: 0 0 14px;
}
.section-lede { color: var(--ink-soft); max-width: 44em; margin: 0 0 34px; }

/* ---------- sovereignty cards ---------- */

.sov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 8px; }
@media (max-width: 720px) { .sov-grid { grid-template-columns: 1fr; } }
.sov-card {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-top: 3px solid var(--gate); border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.sov-card h3 { margin: 0 0 8px; font-size: 19px; }
.sov-card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* ---------- pipeline ---------- */

.pipe { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pipe-step {
  display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: baseline;
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: 8px; padding: 13px 18px;
}
.pipe-step.is-gate { border-left: 3px solid var(--gate); background: var(--gate-soft); }
.pipe-step.is-new { border-left: 3px solid var(--navy); }
.pipe-num { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.pipe-label { font-weight: 600; font-size: 15.5px; }
.pipe-label small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.pipe-note { font-size: 14px; color: var(--ink-faint); margin-top: 18px; }
.pipe-note .kill { color: var(--risk); font-weight: 600; }

/* ---------- humanizer before/after ---------- */

.hum-grid { display: grid; gap: 16px; margin-top: 8px; }
.hum-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--paper-raised);
}
@media (max-width: 720px) { .hum-row { grid-template-columns: 1fr; } }
.hum-cell { padding: 16px 20px; font-size: 14.5px; line-height: 1.6; }
.hum-before { background: #fbf3f2; }
.hum-after { background: var(--tint); border-left: 1px solid var(--line); }
@media (max-width: 720px) { .hum-after { border-left: 0; border-top: 1px solid var(--line); } }
.hum-tag {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 20px; margin-bottom: 8px;
}
.hum-before .hum-tag { background: #f3d9d6; color: var(--risk); }
.hum-after .hum-tag { background: #d9e4f7; color: var(--navy); }
.hum-cell del { color: var(--risk); text-decoration-color: rgba(185, 28, 28, 0.55); }
.hum-cell ins { color: var(--navy); text-decoration: none; font-weight: 600; }
.hum-pattern { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; }

/* ---------- why starred ---------- */

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .why-grid { grid-template-columns: 1fr; } }
.why-card {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-card);
}
.why-card h3 { margin: 0 0 6px; font-size: 17px; }
.why-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.why-card p code {
  font-size: 13px; background: var(--tint); padding: 1px 6px; border-radius: 4px;
}

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

.install-shell { position: relative; margin: 0 0 22px; }
.install-term {
  background: var(--term-bg); color: var(--term-ink);
  border-radius: var(--radius); padding: 20px 22px; overflow-x: auto;
  font-size: 14px; line-height: 1.8; margin: 0;
}
.install-term .c { color: var(--term-dim); }
.install-term .p { color: var(--term-green); user-select: none; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255, 255, 255, 0.1); color: var(--term-ink);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px;
  font-family: var(--mono); font-size: 12px; padding: 5px 12px; cursor: pointer;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }
.trigger-box {
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--paper-raised); padding: 18px 22px;
}
.trigger-box p { margin: 0 0 6px; font-size: 14px; color: var(--ink-faint); }
.trigger-box blockquote {
  margin: 0; font-family: var(--serif); font-size: 17px; font-style: italic;
}

/* ---------- case study ---------- */

.case-card {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-left: 4px solid var(--navy); border-radius: var(--radius);
  padding: 28px 30px; box-shadow: var(--shadow-card);
}
.case-card h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 10px; }
.case-card p { color: var(--ink-soft); margin: 0 0 18px; max-width: 44em; }
.case-flow {
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
  margin: 0 0 20px; word-break: break-word;
}
.case-flow b { color: var(--navy); font-weight: 600; }

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

.site-footer { background: var(--term-bg); color: var(--term-ink); padding: 56px 0 40px; }
.ft-cta { font-family: var(--serif); font-size: clamp(20px, 2.6vw, 27px); line-height: 1.4; margin: 0 0 22px; max-width: 30em; }
.ft-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 34px; }
.ft-actions .btn-ghost { border-color: var(--term-dim); color: var(--term-ink); }
.ft-actions .btn-ghost:hover { background: var(--term-ink); color: var(--term-bg); }
.ft-divider { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 0 0 22px; }
.ft-small { font-size: 13.5px; color: var(--term-dim); }
.ft-small p { margin: 0 0 8px; }
.ft-links { list-style: none; display: flex; gap: 18px; flex-wrap: wrap; padding: 0; margin: 14px 0 0; }
.ft-links a { color: var(--term-dim); }
.ft-links a:hover { color: var(--term-ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chat-msg { transition: none; }
  .chat-caret { animation: none; }
}
