:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: rgba(20, 24, 31, .72);
  --panel-strong: rgba(24, 29, 37, .92);
  --line: rgba(255,255,255,.09);
  --text: #f5f7fb;
  --muted: #9ca6b7;
  --accent: #c5ff55;
  --accent-2: #8be7ff;
  --shadow: 0 24px 80px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(197,255,85,.08), transparent 28%),
    radial-gradient(circle at 86% 22%, rgba(139,231,255,.08), transparent 26%),
    linear-gradient(180deg, #090b10 0%, #0c1017 100%);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.ambient {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(110px);
  pointer-events: none;
  opacity: .18;
  z-index: 0;
}

.ambient-a { background: var(--accent); top: -150px; left: -80px; }
.ambient-b { background: var(--accent-2); right: -150px; bottom: -160px; }

.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.topbar {
  position: relative;
  z-index: 5;
  width: min(1180px, calc(100% - 36px));
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--accent); color: #0a0d10; box-shadow: 0 8px 28px rgba(197,255,85,.25); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions form { margin: 0; }

.shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.hero-shell { padding: 90px 0 70px; }
.hero-panel { padding: clamp(34px, 7vw, 76px); border-radius: 34px; max-width: 920px; }
.hero-panel h1, .auth-card h1, .profile-hero h1, .reader-shell h1, .dashboard-heading h1 {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  letter-spacing: -.035em;
  margin: 8px 0 14px;
}
.hero-panel h1 { font-size: clamp(46px, 8vw, 88px); line-height: .98; max-width: 860px; }
.hero-copy { color: var(--muted); font-size: clamp(16px, 2.1vw, 20px); line-height: 1.8; max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; color: var(--accent); font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-button, .secondary-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.primary-button { background: var(--accent); color: #0a0d10; font-weight: 700; box-shadow: 0 12px 32px rgba(197,255,85,.16); }
.secondary-button { background: rgba(255,255,255,.06); border-color: var(--line); }
.ghost-button { background: transparent; border-color: transparent; color: #d9e0ea; }
.primary-button:hover, .secondary-button:hover, .ghost-button:hover { transform: translateY(-2px); }
.primary-button.compact { padding: 10px 14px; border-radius: 12px; }
.full { width: 100%; }
.domain-demo { margin-top: 36px; display: inline-flex; gap: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.18); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.domain-demo span { color: var(--accent-2); }
.feature-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card { border-radius: 24px; padding: 26px; min-height: 190px; }
.feature-card h2 { margin: 34px 0 8px; font-size: 20px; }
.feature-card p, .muted { color: var(--muted); line-height: 1.7; }
.feature-index { color: var(--accent); font-size: 12px; letter-spacing: .18em; }

.auth-shell { position: relative; z-index: 1; min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 58px 18px; }
.auth-card { width: min(520px, 100%); border-radius: 30px; padding: clamp(28px, 5vw, 44px); }
.auth-card h1 { font-size: clamp(38px, 6vw, 58px); line-height: 1; }
.form-stack { display: grid; gap: 18px; margin-top: 26px; }
.form-stack label { display: grid; gap: 8px; color: #d8deea; font-size: 14px; }
.form-stack input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(6,9,13,.72);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 15px;
  outline: none;
}
.form-stack input:focus { border-color: rgba(197,255,85,.62); box-shadow: 0 0 0 4px rgba(197,255,85,.08); }
.input-suffix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(6,9,13,.72); overflow: hidden; }
.input-suffix input { border: 0; background: transparent; border-radius: 0; }
.input-suffix span { color: var(--muted); padding-right: 14px; white-space: nowrap; }
.alert { margin-top: 18px; border: 1px solid rgba(255,115,115,.25); background: rgba(255,115,115,.08); color: #ffb8b8; padding: 12px 14px; border-radius: 14px; }
.auth-footer { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.auth-footer a { color: var(--accent); }
.center-card { text-align: center; }
.error-code { font-family: "DM Serif Display", serif; font-size: 88px; color: var(--accent); line-height: 1; }

.dashboard-shell { display: grid; grid-template-columns: 250px 1fr; gap: 20px; padding: 60px 0 80px; }
.side-card { border-radius: 26px; padding: 22px; height: fit-content; position: sticky; top: 22px; }
.avatar-placeholder, .profile-avatar { display: grid; place-items: center; border-radius: 24px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #071014; font-family: "DM Serif Display", serif; }
.avatar-placeholder { width: 74px; height: 74px; font-size: 34px; }
.side-card h2 { margin: 16px 0 2px; }
.dashboard-main { min-width: 0; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dashboard-heading h1 { font-size: clamp(42px, 6vw, 66px); line-height: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { border-radius: 22px; padding: 20px; display: grid; gap: 14px; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { font-size: 24px; }
.content-card { margin-top: 14px; border-radius: 24px; padding: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title h2 { margin: 0; }
.section-title span, .section-title a { color: var(--muted); font-size: 13px; }
.note-list { display: grid; gap: 10px; margin-top: 18px; }
.note-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.note-row:last-child { border-bottom: 0; }
.note-row h3 { margin: 0 0 4px; font-size: 15px; }
.note-row p { margin: 0; color: var(--muted); font-size: 12px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 11px; }
.empty-state { display: grid; gap: 6px; margin-top: 18px; padding: 22px; border-radius: 18px; color: var(--muted); }
.empty-state strong { color: var(--text); }

.profile-shell { position: relative; z-index: 1; width: min(980px, calc(100% - 36px)); margin: 0 auto; padding: 50px 0 80px; }
.profile-hero { border-radius: 34px; padding: clamp(30px, 6vw, 58px); text-align: center; }
.profile-brand { justify-content: center; margin-bottom: 34px; }
.profile-avatar { width: 96px; height: 96px; margin: 0 auto 18px; font-size: 46px; }
.profile-hero h1 { font-size: clamp(48px, 7vw, 76px); line-height: 1; }
.profile-hero p { color: var(--muted); max-width: 620px; margin: 0 auto 24px; line-height: 1.8; }
.profile-notes { margin-top: 28px; }
.note-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
.note-card { padding: 22px; border-radius: 22px; transition: transform .18s ease, border-color .18s ease; }
.note-card:hover { transform: translateY(-3px); border-color: rgba(197,255,85,.28); }
.note-card span, .note-card p { color: var(--muted); font-size: 12px; }
.note-card h3 { margin: 28px 0 8px; }

.reader-shell { position: relative; z-index: 1; width: min(820px, calc(100% - 36px)); margin: 0 auto; padding: 72px 0 90px; }
.reader-shell > h1 { font-size: clamp(46px, 7vw, 76px); line-height: 1; margin-bottom: 34px; }
.back-link { display: inline-block; color: var(--muted); margin-bottom: 28px; }
.note-list.large .note-row { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); }
.article-card { border-radius: 28px; padding: clamp(28px, 6vw, 56px); }
.article-card h1 { font-family: "DM Serif Display", serif; font-size: clamp(46px, 7vw, 74px); line-height: 1; margin: 10px 0 16px; }
.article-meta { display: flex; gap: 14px; color: var(--muted); font-size: 12px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.article-content { white-space: pre-wrap; line-height: 1.9; color: #dfe5ee; font-size: 16px; padding-top: 26px; }

@media (max-width: 860px) {
  .feature-grid, .stat-grid { grid-template-columns: 1fr; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .note-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { width: min(100% - 24px, 1180px); }
  .shell, .profile-shell, .reader-shell { width: min(100% - 24px, 1180px); }
  .hero-shell { padding-top: 48px; }
  .nav-actions .ghost-button { display: none; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .article-meta { flex-direction: column; gap: 4px; }
}
