/* ============================================================
   WRYTER — MAIN STYLESHEET
   Modern dark theme with glass morphism and sharp accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Lora:ital,wght@0,400;0,500;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --bg:         #0a0a0f;
  --bg-2:       #111118;
  --bg-3:       #18181f;
  --bg-4:       #1e1e28;
  --surface:    rgba(255,255,255,0.04);
  --surface-h:  rgba(255,255,255,0.07);
  --border:     rgba(255,255,255,0.08);
  --border-h:   rgba(255,255,255,0.16);

  --text:       #f0eeff;
  --text-2:     #a09ab8;
  --text-3:     #5e5875;

  --accent:     #7c5cfc;
  --accent-2:   #a07aff;
  --accent-glow:rgba(124,92,252,0.35);
  --accent-bg:  rgba(124,92,252,0.1);

  --gold:       #e8a838;
  --gold-bg:    rgba(232,168,56,0.1);

  --green:      #34d399;
  --red:        #f87171;

  --serif:      'Lora', Georgia, serif;
  --sans:       'Syne', system-ui, sans-serif;
  --mono:       'JetBrains Mono', monospace;

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.6);
  --glow:       0 0 40px var(--accent-glow);
}

/* ── BASE ──────────────────────────────────────────────── */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(124,92,252,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── TYPOGRAPHY ────────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--sans); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }

.display {
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.0;
}

.label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.label::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
}

/* ── LAYOUT ────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

/* ── GLASS CARD ────────────────────────────────────────── */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.glass:hover {
  background: var(--surface-h);
  border-color: var(--border-h);
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: all 0.2s;
  border: none;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-accent:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 30px var(--accent-glow);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

/* ── BADGE ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}
.badge-accent  { background: var(--accent-bg);  color: var(--accent-2); border: 1px solid rgba(124,92,252,0.25); }
.badge-gold    { background: var(--gold-bg);    color: var(--gold);    border: 1px solid rgba(232,168,56,0.25); }
.badge-green   { background: rgba(52,211,153,0.1); color: var(--green); border: 1px solid rgba(52,211,153,0.25); }
.badge-new     { background: var(--accent); color: #fff; font-size: 0.6rem; padding: 0.2rem 0.6rem; }

/* ── COLOR MAP (novels) ────────────────────────────────── */
.color-red    { --c: #ef4444; --cbg: rgba(239,68,68,0.08); }
.color-blue   { --c: #3b82f6; --cbg: rgba(59,130,246,0.08); }
.color-green  { --c: #22c55e; --cbg: rgba(34,197,94,0.08); }
.color-purple { --c: #a855f7; --cbg: rgba(168,85,247,0.08); }
.color-teal   { --c: #14b8a6; --cbg: rgba(20,184,166,0.08); }
.color-amber  { --c: #f59e0b; --cbg: rgba(245,158,11,0.08); }

/* ── NAV ───────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-color: var(--border);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.04em;
  color: var(--text);
}
.nav-logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── HERO ──────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-eyebrow { margin-bottom: 1.5rem; }

.hero-title {
  font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.0;
  margin-bottom: 1.5rem;
}
.hero-title .accent { color: var(--accent-2); display: block; }

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 480px;
  font-family: var(--serif);
  font-style: italic;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }

.hero-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hero visual — floating book cards */
.hero-visual {
  position: relative;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-card {
  position: absolute;
  width: 200px;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
  will-change: transform;
}
.floating-card:hover { transform: scale(1.05) !important; box-shadow: var(--shadow-lg), 0 0 40px var(--cbg) !important; }

.fc-1 { top: 10%; left: 5%;  transform: rotate(-6deg); background: linear-gradient(145deg, #1a0f1f, #2d1a40); border: 1px solid rgba(168,85,247,0.2); }
.fc-2 { top: 20%; right: 0%; transform: rotate(4deg);  background: linear-gradient(145deg, #0f1a28, #1a2d40); border: 1px solid rgba(59,130,246,0.2); }
.fc-3 { bottom: 10%; left: 15%; transform: rotate(2deg);  background: linear-gradient(145deg, #1a0f10, #401a1a); border: 1px solid rgba(239,68,68,0.2); }

.fc-emoji { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.fc-genre {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}
.fc-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

/* ── NOVELS ────────────────────────────────────────────── */
#novels { background: var(--bg-2); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title { font-size: clamp(1.8rem, 3vw, 2.8rem); margin-top: 0.75rem; }

.novels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.novel-card {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-3);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.novel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: opacity 0.25s;
}
.novel-card:hover { transform: translateY(-6px); border-color: var(--c); box-shadow: 0 16px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--c); }
.novel-card:hover::before { opacity: 1; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.card-emoji { font-size: 2.5rem; line-height: 1; }

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.75rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-family: var(--serif);
  font-style: italic;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
}
.card-chapters { color: var(--text-2); font-weight: 500; }

/* ── CHAPTERS ──────────────────────────────────────────── */
#chapters { background: var(--bg); }

.chapters-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chapter-row {
  display: grid;
  grid-template-columns: 80px 1fr 160px 60px;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.chapter-row:last-child { border-bottom: none; }
.chapter-row:hover { background: var(--surface); }

.ch-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
}
.ch-novel {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.25rem;
}
.ch-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.ch-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: right;
}
.ch-badge { text-align: right; }

/* ── READING PAGE ──────────────────────────────────────── */
.reading-header {
  padding: 8rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent-2); }
.back-link::before { content: '←'; }

.reading-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.2;
  color: var(--text);
  margin: 0.75rem 0;
}

.reading-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.reading-body {
  max-width: 680px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.reading-body p {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.9;
  color: rgba(240,238,255,0.85);
  margin-bottom: 1.5em;
}

.reading-nav {
  display: flex;
  justify-content: space-between;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ── ABOUT ─────────────────────────────────────────────── */
#about { background: var(--bg-2); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.about-text {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.85;
  white-space: pre-line;
}

.about-quote {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-left: 2px solid var(--accent);
  margin: 2rem 0;
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.genre-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.about-visual-box {
  position: sticky;
  top: 8rem;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  background: var(--bg-3);
  border: 1px solid var(--border);
  text-align: center;
}
.about-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 30px var(--accent-glow);
}
.about-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.about-tagline {
  font-size: 0.85rem;
  color: var(--text-2);
  font-family: var(--serif);
  font-style: italic;
  line-height: 1.6;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.social-link {
  text-decoration: none;
  font-size: 0.75rem;
  font-family: var(--mono);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: border-color 0.2s, color 0.2s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent-2); }

/* ── NEWSLETTER ────────────────────────────────────────── */
#newsletter {
  background: var(--bg);
  text-align: center;
}

.newsletter-box {
  max-width: 520px;
  margin: 0 auto;
}
.newsletter-form {
  display: flex;
  gap: 0;
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  transition: border-color 0.2s;
}
.newsletter-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.newsletter-input {
  flex: 1;
  padding: 0.9rem 1.2rem;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text);
}
.newsletter-input::placeholder { color: var(--text-3); }
.newsletter-btn {
  padding: 0.9rem 1.5rem;
  background: var(--accent);
  border: none;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}
.newsletter-btn:hover { background: var(--accent-2); }
.newsletter-note { font-size: 0.78rem; color: var(--text-3); margin-top: 1rem; font-family: var(--mono); }

/* ── FOOTER ────────────────────────────────────────────── */
#footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.04em; }
.footer-logo .dot { color: var(--accent); }
.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent-2); }
.footer-copy { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }

/* ── ANIMATIONS ────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%,100% { transform: translateY(0px) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-12px) rotate(var(--r, 0deg)); }
}

.anim { opacity: 0; }
.anim.visible { animation: fadeInUp 0.6s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.45s; }
.delay-5 { animation-delay: 0.6s; }

.fc-1 { animation: float 6s ease-in-out infinite; --r: -6deg; }
.fc-2 { animation: float 7s ease-in-out infinite 1s; --r: 4deg; }
.fc-3 { animation: float 5.5s ease-in-out infinite 0.5s; --r: 2deg; }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero-grid   { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .about-grid  { grid-template-columns: 1fr; }
  .about-visual-box { position: static; }
  .chapter-row { grid-template-columns: 60px 1fr 80px; }
  .ch-badge    { display: none; }
}
@media (max-width: 768px) {
  .hamburger   { display: flex; }
  .nav-links   {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: rgba(10,10,15,0.98);
    backdrop-filter: blur(20px);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  #nav { padding: 1rem 1.5rem; }
  .container { padding: 0 1.25rem; }
  .section { padding: 4rem 0; }
  .chapter-row { grid-template-columns: 50px 1fr; }
  .ch-date, .ch-badge { display: none; }
  .reading-body { padding: 0 1rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .hero-stats { gap: 1.5rem; }
}
