/* ══════════════════════════════════════════════════════════
   RagGo — Base Design System
   ══════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #f2ece0;
  --bg-card:     #e8e1d2;
  --bg-border:   #d0c9b8;
  --text:        #1a1611;
  --text-mid:    #5a5045;
  --text-muted:  #8a7e6e;
  --accent:      #bf4217;
  --accent-h:    #a0371280;
  --navy:        #1b3454;
  --green:       #4caf7d;
  --dark:        #0c0e14;
  --dark-surf:   #13151e;
  --dark-border: #22253280;
  --dark-muted:  #5a5e72;
  --mono-bg:     #0f1117;
  --radius:      4px;
  --radius-md:   8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Archivo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 9999;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(42px, 5.8vw, 84px); font-weight: 600; margin-bottom: 20px; }
h2 { font-size: clamp(32px, 3.5vw, 54px); font-weight: 600; margin-bottom: 16px; }
h3 { font-size: 24px; font-weight: 600; margin-bottom: 10px; }
h4 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }

p { line-height: 1.72; }

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

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}

section { padding: 96px 0; }

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

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  transition: all .2s;
}
.btn-primary   { background: #a33415; color: #fff; font-weight: 700; letter-spacing: 0.03em; }
.btn-primary:hover { background: #8c2d12; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(191,66,23,.3); text-decoration: none; }
.btn-outline   { background: transparent; color: var(--text); border: 1.5px solid var(--bg-border); }
.btn-outline:hover { border-color: var(--text); text-decoration: none; }
.btn-ghost     { background: var(--bg-card); color: var(--text); border: 1.5px solid var(--bg-border); }
.btn-ghost:hover { border-color: var(--text-mid); text-decoration: none; }
.btn-ghost-white { background: white; color: var(--dark); }
.btn-ghost-white:hover { background: rgba(255,255,255,.88); transform: translateY(-1px); text-decoration: none; }
.btn-dark      { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #1a1e2a; text-decoration: none; }
.btn-lg        { font-size: 15px; padding: 13px 32px; }
.btn-sm        { font-size: 12px; padding: 6px 14px; }
.btn-full      { width: 100%; justify-content: center; }
.btn-danger    { background: transparent; color: var(--accent); border: 1.5px solid rgba(191,66,23,.3); }
.btn-danger:hover { background: rgba(191,66,23,.08); border-color: var(--accent); text-decoration: none; }

/* ── Form controls ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.form-input {
  background: var(--bg-card);
  border: 1.5px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(191,66,23,.1);
}
.form-input::placeholder { color: var(--text-muted); }

/* ── Alerts & banners ────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
}
.alert-error   { background: rgba(191,66,23,.1); color: var(--accent); border: 1px solid rgba(191,66,23,.2); }
.alert-success { background: rgba(76,175,125,.1); color: #2e7a58; border: 1px solid rgba(76,175,125,.25); }
.alert-info    { background: rgba(27,52,84,.08); color: var(--navy); border: 1px solid rgba(27,52,84,.18); }

/* ── Section headers ─────────────────────────────────────── */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(36px, 3.5vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}
.section-sub {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.72;
  max-width: 580px;
}
.overline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}

/* ── Tiles ───────────────────────────────────────────────── */
.tile-grid {
  display: grid;
  gap: 2px;
  margin-top: 56px;
  background: var(--bg-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tile {
  background: var(--bg);
  padding: 36px 32px;
  transition: background .2s;
}
.tile:hover { background: var(--bg-card); }
.tile-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.tile h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 23px;
  font-weight: 600;
  margin-bottom: 10px;
}
.tile p { font-size: 14px; font-weight: 300; color: var(--text-mid); line-height: 1.72; }

/* ── Code blocks ─────────────────────────────────────────── */
.code-block {
  background: var(--dark);
  border-radius: 6px;
  padding: 16px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.8;
  overflow-x: auto;
}
.code-block .t-p    { color: #4caf7d; }
.code-block .t-cmd  { color: #e8e2d6; }
.code-block .t-dim  { color: #454960; }
.code-block .t-rank { color: #e8a832; }
.code-block .t-path { color: #6a6878; }
.code-block .t-info { color: #6a9ecf; }

/* ── Badge / tags ────────────────────────────────────────── */
.badge-plan {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.badge-free        { background: var(--bg-card); color: var(--text-muted); }
.badge-individual  { background: rgba(191,66,23,.12); color: var(--accent); }
.badge-team        { background: rgba(27,52,84,.12); color: var(--navy); }
.badge-institution { background: rgba(76,175,125,.12); color: #2e7a58; }

/* ── Scroll reveal ───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s ease; }
.reveal.vis { opacity: 1; transform: translateY(0); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
  section { padding: 72px 0; }
}
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  h1 { font-size: 44px; }
}
