/* ============================================================
   aibverse — design tokens
   Day theme is default. Night theme via [data-theme="night"].
   Display: Space Grotesk · Body: Instrument Sans · Utility: IBM Plex Mono
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --ink: #15171c;
  --muted: #5a6170;
  --line: #e3e6ec;
  --accent: #5b4dff;
  --accent-soft: rgba(91, 77, 255, 0.08);
  --accent-ink: #ffffff;
  --star: #f0a41c;
  --danger: #d6455d;
  --ok: #1f9d6b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(21, 23, 28, 0.04), 0 8px 28px rgba(21, 23, 28, 0.06);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1140px;
}

[data-theme="night"] {
  --bg: #0c0e14;
  --surface: #131722;
  --surface-2: #1a1f2e;
  --ink: #edeef3;
  --muted: #99a1b3;
  --line: #232838;
  --accent: #8c7dff;
  --accent-soft: rgba(140, 125, 255, 0.12);
  --accent-ink: #0c0e14;
  --star: #ffc55c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 32px rgba(0, 0, 0, 0.45);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: -0.02em; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { font-size: 0.95rem; color: var(--muted); padding: 6px 2px; border-bottom: 2px solid transparent; transition: color 0.15s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  border: 1px solid var(--line); background: var(--surface);
  width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center;
  color: var(--ink); font-size: 1rem; transition: border-color 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  border-radius: 999px; padding: 10px 22px; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.12s ease, background 0.15s, border-color 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-block { width: 100%; }

/* mobile nav */
.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .menu-btn {
    display: grid; place-items: center; width: 38px; height: 38px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1.1rem;
  }
  .nav-actions .btn { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 84px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero .lede { font-size: 1.18rem; color: var(--muted); max-width: 34em; }
.hero-cta { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-note { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); margin-top: 18px; }
#constellation { width: 100%; aspect-ratio: 1 / 0.92; display: block; }
@media (max-width: 860px) {
  .hero { padding: 48px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  #constellation { max-width: 440px; margin: 0 auto; }
}

/* ---------- sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }

.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 980px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-cards { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card-media {
  aspect-ratio: 16 / 9; background: var(--surface-2);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 2.2rem; color: var(--muted);
  position: relative;
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { margin: 0; font-size: 0.93rem; color: var(--muted); flex: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

.tag {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.tag-free { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.tag-premium { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }

.lock-badge {
  position: absolute; top: 10px; right: 10px;
  background: color-mix(in srgb, var(--ink) 75%, transparent); color: var(--bg);
  font-size: 0.7rem; font-family: var(--font-mono);
  padding: 4px 10px; border-radius: 999px;
}

/* module tiles on home */
.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 980px) { .modules { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .modules { grid-template-columns: 1fr; } }
.module-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.module-tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.module-tile .glyph { font-size: 1.6rem; }
.module-tile .go { margin-top: auto; font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent); }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
@media (max-width: 920px) { .plans { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }
.plan.featured::before {
  content: "Most popular"; position: absolute; top: -12px; left: 28px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}
.plan .price { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; }
.plan .price span { font-size: 0.95rem; font-weight: 400; color: var(--muted); font-family: var(--font-body); }
.plan ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; font-size: 0.94rem; color: var(--muted); }
.plan ul li::before { content: "—"; color: var(--accent); margin-right: 9px; }

/* ---------- forms ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; max-width: 440px; margin: 0 auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 0.95rem;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form-msg { font-size: 0.88rem; margin-top: 12px; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.form-switch { text-align: center; font-size: 0.88rem; color: var(--muted); margin-top: 18px; }
.form-switch a { color: var(--accent); font-weight: 600; }

/* password show/hide (eye icon inside the field) */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 36px; height: 36px;
  background: none; border: none; border-radius: 8px;
  color: var(--muted); cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-toggle svg { pointer-events: none; }
/* slash drawn over the eye when password is visible */
.pw-toggle.showing { color: var(--accent); }
.pw-toggle.showing::after {
  content: ""; position: absolute;
  width: 22px; height: 2px; background: currentColor;
  transform: rotate(-45deg); border-radius: 2px;
}

/* ---------- community ---------- */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; }
.post-head { display: flex; gap: 10px; align-items: baseline; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); margin-bottom: 8px; }
.post-head .author { color: var(--accent); }
.post p { margin: 0; font-size: 0.96rem; }
.composer textarea { min-height: 90px; resize: vertical; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 56px; margin-top: 72px; color: var(--muted); font-size: 0.9rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-grid nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-grid nav a:hover { color: var(--ink); }

/* ---------- misc ---------- */
.banner-free {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: var(--radius); padding: 16px 22px; margin: 26px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.94rem;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: var(--radius-sm); }

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