/* ============================================================
   Sailor Helga — Homepage Styles
   Dark mode by default. Light mode via [data-theme="light"].
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ---- Color Tokens ---- */
:root {
  --bg:          #0c0c18;
  --bg-section:  #101024;
  --bg-card:     #14142a;
  --text:        #e8d5f5;
  --text-muted:  #9a8ab0;
  --accent:      #ff7eb3;
  --accent-dark: #e0558e;
  --purple:      #c084fc;
  --nav-bg:      #08081a;
  --nav-border:  #2a2a4a;
  --border:      #2a2a4a;
  --link:        #ff7eb3;
  --link-vis:    #c084fc;
  --link-hover:  #ff4d94;
  --btn-bg:      #1e1e3a;
  --btn-text:    #c084fc;
  --btn-primary: #ff7eb3;
  --btn-primary-text: #0c0c18;
}

[data-theme="light"] {
  --bg:          #fdf0f7;
  --bg-section:  #f7e4f4;
  --bg-card:     #ffffff;
  --text:        #1a0a2e;
  --text-muted:  #6a4a7a;
  --accent:      #c8006a;
  --accent-dark: #a00055;
  --purple:      #6d28d9;
  --nav-bg:      #f0cce4;
  --nav-border:  #dbaed0;
  --border:      #ddbbd0;
  --link:        #c8006a;
  --link-vis:    #6d28d9;
  --link-hover:  #a00055;
  --btn-bg:      #ecddf5;
  --btn-text:    #6d28d9;
  --btn-primary: #c8006a;
  --btn-primary-text: #ffffff;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background-color 0.25s, color 0.25s;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-vis); }
a:hover { color: var(--link-hover); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ================================================================
   NAV
   ================================================================ */

.site-nav {
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.25rem;
  gap: 1rem;
}

.nav-logo {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.5;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent-dark); text-decoration: none; }

/* Hamburger button (mobile only) */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  color: var(--text);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s;
}
.nav-hamburger:hover { background: var(--bg-card); }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 0.3rem;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--bg-card); color: var(--accent); text-decoration: none; }

/* Theme toggle in nav */
.nav-theme-btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.nav-theme-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* Mobile nav */
@media (max-width: 640px) {
  .nav-hamburger { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 3.25rem;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    padding: 0.5rem 0;
    gap: 0;
    z-index: 199;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    border-bottom: 1px solid var(--nav-border);
    font-size: 1rem;
  }

  .nav-links li:last-child a { border-bottom: none; }
}

/* ================================================================
   HERO
   ================================================================ */

.hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--bg) 100%);
}

.hero-title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(0.8rem, 3vw, 1.3rem);
  color: var(--accent);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-style: italic;
}

.hero-art {
  width: min(340px, 80vw);
  margin: 0 auto 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 0 40px rgba(255, 126, 179, 0.25);
}

.hero-art img { border-radius: 1rem; width: 100%; }

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: var(--btn-primary);
  color: var(--btn-primary-text);
  padding: 0.7rem 1.75rem;
  border-radius: 2rem;
  font-size: 0.95rem;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-dark); color: var(--btn-primary-text); transform: translateY(-1px); text-decoration: none; }

.btn-secondary {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--border);
  padding: 0.7rem 1.75rem;
  border-radius: 2rem;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--purple); color: white; border-color: var(--purple); text-decoration: none; }

/* ================================================================
   SECTIONS (shared)
   ================================================================ */

.section {
  padding: 3.5rem 1.5rem;
}

.section:nth-child(even) { background-color: var(--bg-section); }

.section-inner {
  max-width: 860px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(0.6rem, 2.5vw, 0.9rem);
  color: var(--accent);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* ================================================================
   ABOUT
   ================================================================ */

.about-text p { margin-bottom: 1rem; font-size: 1rem; }

/* ================================================================
   CHAPTERS LIST
   ================================================================ */

.acts { display: flex; flex-direction: column; gap: 2.5rem; }

.act-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  color: var(--purple);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
}

.chapter-link {
  display: block;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.chapter-link:hover { background: var(--accent); color: white; border-color: var(--accent); text-decoration: none; }
.chapter-link:visited { color: var(--text); }
.chapter-link:visited:hover { color: white; }
.chapter-link.external::after { content: " ↗"; font-size: 0.75em; }

/* ================================================================
   PLATFORM LINKS
   ================================================================ */

.platform-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.platform-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.platform-link:hover { background: var(--bg-section); border-color: var(--accent); color: var(--accent); text-decoration: none; }
.platform-link:visited { color: var(--text); }
.platform-link .link-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
  background-color: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer p + p { margin-top: 0.5rem; }

/* ================================================================
   MOBILE HELPERS
   ================================================================ */

@media (max-width: 500px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .section { padding: 2.5rem 1rem; }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
  .platform-links { grid-template-columns: 1fr; }
}
