/* ============================================================
   AppReagent — site styles
   Palette derived from the logo:
     bg-0   #07111B  page background (deepest)
     bg-1   #0b1723  panel / raised surface
     bg-2   #132235  card / hover
     border #1d2e44  hairline borders
     text-0 #F5F3EE  primary text (logo off-white)
     text-1 #B8C3D1  secondary text
     text-2 #7A8797  tertiary / captions
     green  #38D39F  primary accent (logo flask outline)
     green2 #0BAE7C  darker green (logo fill)
     red    #D94750  danger accent (logo liquid, brightened)
     red2   #A62C34  darker red (logo liquid)
   ============================================================ */

:root {
  --bg-0: #07111B;
  --bg-1: #0b1825;
  --bg-2: #132235;
  --bg-3: #1a2d44;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-0: #F5F3EE;
  --text-1: #B8C3D1;
  --text-2: #7A8797;
  --text-3: #556478;
  --green: #38D39F;
  --green-dim: #0BAE7C;
  --green-glow: rgba(56, 211, 159, 0.18);
  --red: #D94750;
  --red-dim: #A62C34;

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

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;

  --container-max: 1180px;
  --container-pad: clamp(20px, 4vw, 40px);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(ellipse 1100px 700px at 85% -10%, rgba(56, 211, 159, 0.08), transparent 60%),
    radial-gradient(ellipse 800px 500px at 5% 20%, rgba(11, 174, 124, 0.05), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- typography ---------- */

h1, h2, h3, h4 {
  color: var(--text-0);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

a:hover { color: var(--green); }

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-feature-settings: "liga" 0;
}

:not(pre) > code {
  font-size: 0.88em;
  padding: 0.12em 0.42em;
  background: rgba(56, 211, 159, 0.10);
  color: var(--green);
  border-radius: 4px;
  border: 1px solid rgba(56, 211, 159, 0.18);
  white-space: nowrap;
}

::selection {
  background: rgba(56, 211, 159, 0.3);
  color: var(--text-0);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: var(--green);
  color: var(--bg-0);
  border-radius: 8px;
  z-index: 100;
  font-weight: 600;
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(7, 17, 27, 0.72);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-0);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand:hover { color: var(--text-0); }

.brand-logo { display: block; }

.brand-name {
  font-size: 17px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--text-1);
  font-weight: 500;
}

.site-nav a { color: var(--text-1); }
.site-nav a:hover { color: var(--text-0); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-0);
  font-weight: 500;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-cta:hover {
  background: var(--bg-3);
  border-color: rgba(56, 211, 159, 0.4);
  color: var(--text-0);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--green);
  color: #052418;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 10px 30px -12px rgba(56, 211, 159, 0.6);
}

.btn-primary:hover {
  background: #4ee3ae;
  color: #042117;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 14px 34px -10px rgba(56, 211, 159, 0.7);
}

.btn-ghost {
  background: transparent;
  color: var(--text-0);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--bg-2);
  border-color: rgba(56, 211, 159, 0.45);
  color: var(--text-0);
}

.btn .arrow {
  transition: transform 160ms ease;
}

.btn:hover .arrow {
  transform: translateX(3px);
}

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

.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 10vw, 120px);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  position: relative;
  z-index: 2;
}

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}

.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle 420px at 85% 40%, rgba(56, 211, 159, 0.12), transparent 70%),
    radial-gradient(circle 340px at 15% 70%, rgba(217, 71, 80, 0.07), transparent 70%);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(56, 211, 159, 0.08);
  border: 1px solid rgba(56, 211, 159, 0.22);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(56, 211, 159, 0.18);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 4px rgba(56, 211, 159, 0.18); }
  50%      { opacity: 0.75; box-shadow: 0 0 0 7px rgba(56, 211, 159, 0.06); }
}

.hero-title {
  margin-top: 22px;
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero-title .accent {
  position: relative;
  color: var(--red);
  white-space: nowrap;
}

.hero-title .accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 0.16em;
  background: rgba(217, 71, 80, 0.22);
  z-index: -1;
  border-radius: 3px;
}

.hero-sub {
  margin-top: 22px;
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--text-1);
  max-width: 560px;
  line-height: 1.65;
}

.hero-cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-quote {
  margin: 40px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-style: italic;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
  max-width: 520px;
}

.hero-quote .quote-open,
.hero-quote .quote-close {
  color: var(--green);
  font-style: normal;
  opacity: 0.8;
}

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

.hero-terminal {
  background: #050d15;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 30px 60px -20px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(56, 211, 159, 0.05);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.62;
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #0d1a28, #0a1520);
  border-bottom: 1px solid var(--border);
}

.terminal-chrome .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #2a3a4d;
}
.terminal-chrome .dot.red    { background: #ff5f56; }
.terminal-chrome .dot.yellow { background: #ffbd2e; }
.terminal-chrome .dot.green  { background: #27c93f; }

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}

.terminal-body {
  margin: 0;
  padding: 20px 22px 24px;
  white-space: pre;
  overflow-x: auto;
  color: var(--text-1);
}

.t-prompt { color: var(--green); }
.t-cmd    { color: var(--text-0); font-weight: 500; }
.t-muted  { color: var(--text-3); }
.t-ok     { color: var(--green); }
.t-tag    { color: #8ab4f8; font-weight: 600; }
.t-arg    { color: var(--text-2); }
.t-str    { color: #e8b86d; }
.t-bad    { color: var(--red); font-weight: 700; }
.t-warn   { color: #ffbd6d; font-weight: 600; }
.t-caret  { color: var(--green); animation: blink 1.05s step-end infinite; }

@keyframes blink {
  50% { opacity: 0; }
}

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

section { padding: clamp(72px, 9vw, 120px) 0; }

.section-head {
  max-width: 780px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.section-sub {
  margin-top: 18px;
  font-size: 17px;
  color: var(--text-1);
  max-width: 640px;
  line-height: 1.65;
}

/* ---------- feature grid (what) ---------- */

.what {
  border-top: 1px solid var(--border);
  position: relative;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature-card {
  padding: 28px;
  background: linear-gradient(180deg, rgba(19, 34, 53, 0.55), rgba(11, 24, 37, 0.55));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 211, 159, 0.45), transparent);
  opacity: 0;
  transition: opacity 240ms ease;
}

.feature-card:hover {
  border-color: rgba(56, 211, 159, 0.28);
  transform: translateY(-2px);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(56, 211, 159, 0.10);
  color: var(--green);
  border: 1px solid rgba(56, 211, 159, 0.2);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.feature-card p {
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- playbook (how) ---------- */

.how { border-top: 1px solid var(--border); }

.playbook {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 24, 37, 0.5), rgba(7, 17, 27, 0.3));
}

.playbook-step {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 32px;
  padding: 32px clamp(24px, 4vw, 44px);
  border-bottom: 1px solid var(--border);
  transition: background 200ms ease;
}

.playbook-step:last-child {
  border-bottom: 0;
}

.playbook-step:hover {
  background: rgba(56, 211, 159, 0.03);
}

@media (max-width: 700px) {
  .playbook-step {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 20px;
  }
}

.step-num {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
  line-height: 1;
  opacity: 0.9;
}

@media (max-width: 700px) {
  .step-num { font-size: 28px; }
}

.step-body h3 {
  font-size: 22px;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}

.step-body p {
  color: var(--text-1);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 680px;
}

.step-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-tags code {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--bg-2);
  color: var(--green);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- tools ---------- */

.tools { border-top: 1px solid var(--border); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.tool {
  padding: 18px 20px;
  background: rgba(11, 24, 37, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool:hover {
  border-color: rgba(56, 211, 159, 0.3);
  background: rgba(19, 34, 53, 0.7);
  transform: translateY(-1px);
}

.tool-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--green);
}

.tool-desc {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- principles ---------- */

.principles { border-top: 1px solid var(--border); }

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) { .principle-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .principle-grid { grid-template-columns: 1fr; } }

.principle {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(11, 24, 37, 0.4);
  position: relative;
}

.principle h3 {
  font-size: 17px;
  margin-bottom: 10px;
  color: var(--green);
  letter-spacing: -0.01em;
}

.principle p {
  color: var(--text-1);
  font-size: 14.5px;
  line-height: 1.6;
}

.principle code {
  background: rgba(217, 71, 80, 0.12);
  color: var(--red);
  border-color: rgba(217, 71, 80, 0.2);
}

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

.install { border-top: 1px solid var(--border); }

.install-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}

@media (max-width: 820px) {
  .install-steps { grid-template-columns: 1fr; }
}

.install-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

.install-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(56, 211, 159, 0.14);
  border: 1px solid rgba(56, 211, 159, 0.3);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.code-block {
  margin: 0;
  padding: 18px 20px;
  background: #050d15;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-0);
  overflow-x: auto;
  white-space: pre;
}

.code-block .c-prompt {
  color: var(--green);
  user-select: none;
  margin-right: 10px;
}

.install-note {
  max-width: 720px;
  margin: 36px auto 0;
  padding: 20px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.install-note a {
  color: var(--green);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(56, 211, 159, 0.35);
  text-underline-offset: 3px;
}

.install-note a:hover { color: #4ee3ae; }

/* ---------- cta banner ---------- */

.cta-banner {
  border-top: 1px solid var(--border);
  padding: clamp(48px, 6vw, 80px) 0;
}

.cta-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
  padding: clamp(32px, 4vw, 48px);
  background:
    radial-gradient(ellipse 600px 300px at 85% 50%, rgba(56, 211, 159, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(19, 34, 53, 0.7), rgba(11, 24, 37, 0.7));
  border: 1px solid rgba(56, 211, 159, 0.2);
  border-radius: var(--radius-lg);
}

@media (max-width: 800px) {
  .cta-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.cta-inner h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.cta-inner p {
  color: var(--text-1);
  font-size: 15.5px;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

@media (max-width: 800px) {
  .cta-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
  color: var(--text-2);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-tagline {
  color: var(--text-2);
  font-size: 14px;
  max-width: 320px;
  line-height: 1.55;
}

.footer-col h4 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 14px;
  font-family: var(--font-mono);
}

.footer-col a {
  display: block;
  margin-bottom: 8px;
  color: var(--text-1);
  font-size: 14px;
}

.footer-col a:hover { color: var(--green); }

.footer-legal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
}

.footer-legal .dot { opacity: 0.5; }

/* ---------- small screen tweaks ---------- */

@media (max-width: 560px) {
  .header-inner { height: 60px; }
  .hero { padding-top: 32px; }
  .feature-card, .principle { padding: 22px; }
  .cta-inner { padding: 28px; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
