/* ============ TOKENS ============ */
:root {
  --bg: #0d0c11;
  --bg-2: #14131a;
  --surface: #1a1922;
  --surface-2: #22212c;
  --border: #2b2a37;
  --border-2: #3a3849;
  --text: #ececf1;
  --text-dim: #a5a4b4;
  --text-mute: #6d6c7d;
  --accent: #8b5cf6;      /* violet */
  --accent-2: #c084fc;
  --accent-glow: rgba(139, 92, 246, 0.35);
  --success: #22c55e;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
}

/* ============ RESET ============ */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139,92,246,0.15), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(192,132,252,0.08), transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  font-size: 16px;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h1,h2,h3,h4,h5 { margin: 0; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }

/* subtle film grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: overlay;
  opacity: 0.5;
}

/* ============ LAYOUT ============ */
.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* ============ HEADER ============ */
.header {
  position: sticky; top: 0;
  z-index: 50;
  background: rgba(13, 12, 17, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--text);
}
.logo svg { color: var(--accent); }
.nav {
  display: flex; gap: 28px; align-items: center;
  font-size: 14px; color: var(--text-dim);
}
.nav a:hover { color: var(--text); }
.nav__cta {
  background: var(--accent);
  color: white !important;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 500;
}
.nav__cta:hover { background: var(--accent-2); }
@media (max-width: 700px) {
  .nav a:not(.nav__cta) { display: none; }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: clamp(60px, 12vw, 140px) 0 clamp(50px, 10vw, 100px);
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  top: -100px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  text-align: center;
  max-width: 820px;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 6px 12px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: rgba(139,92,246,0.06);
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 82px);
  font-weight: 600;
  line-height: 1.02;
  margin: 24px 0 20px;
  letter-spacing: -0.03em;
}
.hero__title em {
  font-style: italic;
  color: var(--accent-2);
  font-weight: 600;
}
.hero__sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto;
}
.hero__cta {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 34px;
  flex-wrap: wrap;
}
.hero__meta {
  margin-top: 26px;
  font-size: 13px;
  color: var(--text-mute);
  display: inline-flex; align-items: center; gap: 8px;
}
.hero__meta strong { color: var(--text-dim); font-weight: 500; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 6px 20px -6px var(--accent);
}
.btn--primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn--ghost {
  border-color: var(--border-2);
  color: var(--text-dim);
}
.btn--ghost:hover { border-color: var(--text-dim); color: var(--text); }
.btn--full { width: 100%; padding: 14px; font-size: 16px; margin-top: 8px; }
.btn--tiny {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  color: var(--text-dim);
}
.btn--tiny:hover { color: var(--text); border-color: var(--text-mute); }
.btn--accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn--accent:hover { background: var(--accent-2); }

/* ============ SECTIONS ============ */
section { padding: clamp(60px, 10vw, 110px) 0; }
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 50px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 46px);
  font-weight: 600;
  margin: 16px 0 12px;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.section-sub {
  color: var(--text-dim);
  font-size: 16px;
}

/* ============ FORGE ============ */
.forge {
  background: linear-gradient(180deg, transparent, rgba(139,92,246,0.03));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.forge__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1100px; margin: 0 auto;
}
@media (max-width: 900px) {
  .forge__grid { grid-template-columns: 1fr; }
}
.forge__panel, .forge__output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.field--row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 500px) { .field--row { grid-template-columns: 1fr; } }
.field--flex { margin-bottom: 0; }
.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.input--area { resize: vertical; min-height: 110px; line-height: 1.55; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23a5a4b4' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  font-size: 13px;
  color: var(--text-dim);
  transition: all 0.15s;
}
.chip:hover { color: var(--text); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Output */
.forge__output { display: flex; flex-direction: column; }
.output__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.output__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.output__actions { display: flex; gap: 8px; }
.output__body {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  overflow-y: auto;
  min-height: 340px;
  max-height: 500px;
  margin: 0;
}
.output__foot {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-mute);
}
.link { color: var(--accent-2); border-bottom: 1px dashed var(--accent-2); }
.link:hover { color: white; }

/* ============ TOOLS ============ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.tool-card__mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--mark) 20%, transparent);
  border: 1px solid color-mix(in oklab, var(--mark) 40%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--mark);
  margin-bottom: 16px;
}
.tool-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}
.tool-card p {
  font-size: 14.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.5;
}
.tool-card__cta {
  font-size: 14px;
  color: var(--accent-2);
  font-weight: 500;
}
.disclosure {
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 32px;
}

/* ============ LIBRARY ============ */
.library { background: linear-gradient(180deg, transparent, rgba(139,92,246,0.02)); }
.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .lib-grid { grid-template-columns: 1fr; } }
.lib-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.15s;
  display: block;
  width: 100%;
}
.lib-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.lib-card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(139,92,246,0.1);
  margin-bottom: 12px;
}
.lib-card h4 {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 6px;
}
.lib-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ============ NEWSLETTER ============ */
.news { border-top: 1px solid var(--border); }
.news__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(192,132,252,0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
}
@media (max-width: 800px) {
  .news__inner { grid-template-columns: 1fr; padding: 32px; }
}
.news h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 38px);
  margin-bottom: 12px;
}
.news h2 em { color: var(--accent-2); font-style: italic; }
.news__form { display: flex; flex-direction: column; gap: 10px; }
.news__note { font-size: 12px; color: var(--text-mute); margin: 4px 0 0; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
  background: var(--bg-2);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 40px;
  padding-bottom: 40px;
}
@media (max-width: 700px) {
  .footer__inner { grid-template-columns: 1fr; }
}
.footer__brand p {
  color: var(--text-mute);
  font-size: 14px;
  margin-top: 12px;
  max-width: 300px;
}
.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.footer__cols h5 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 14px;
}
.footer__cols a {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  padding: 4px 0;
}
.footer__cols a:hover { color: var(--text); }
.footer__base {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
