/* ============================================
   Design System & CSS Variables
   ============================================ */

:root {
  /* Colors - Midnight & Dusty Rose */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1f242c;
  --bg-elevated: #252b35;

  --text-primary: #f5f1e8;
  --text-secondary: #d4cfc4;
  --text-muted: #a39d92;
  --text-dim: #6e6960;

  --accent-primary: #6dcdc9;
  --accent-primary-hover: #7eddd9;
  --accent-primary-subtle: rgba(109, 205, 201, 0.08);
  --accent-primary-glow: rgba(109, 205, 201, 0.12);

  --accent-secondary: #3a8f8f;
  --accent-secondary-hover: #4aa3a3;

  --accent-tertiary: #8bb8a0;

  --divider: #2d3440;
  --divider-subtle: rgba(109, 205, 201, 0.1);
  --overlay: rgba(13, 17, 23, 0.92);
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-colored: rgba(58, 143, 143, 0.2);

  --overlay-subtle: rgba(109, 205, 201, 0.02);
  --overlay-light: rgba(109, 205, 201, 0.04);
  --overlay-medium: rgba(109, 205, 201, 0.06);
  --overlay-strong: rgba(109, 205, 201, 0.08);

  /* Typography */
  --font-display: 'EB Garamond', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-ui: 'Montserrat', -apple-system, sans-serif;

  --text-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --text-sm: clamp(0.875rem, 2vw, 1rem);
  --text-base: clamp(1rem, 2.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 3vw, 1.25rem);
  --text-xl: clamp(1.5rem, 4vw, 2rem);
  --text-2xl: clamp(2rem, 6vw, 3rem);
  --text-3xl: clamp(2.5rem, 8vw, 4rem);
  --text-4xl: clamp(3.5rem, 10vw, 6.5rem);

  /* Spacing */
  --space-xs: clamp(0.5rem, 2vw, 1rem);
  --space-sm: clamp(1rem, 3vw, 1.5rem);
  --space-md: clamp(2rem, 5vw, 3rem);
  --space-lg: clamp(3rem, 8vw, 5rem);
  --space-xl: clamp(4rem, 12vw, 8rem);

  /* Layout */
  --content-width: 68rem;
  --narrow-width: 42rem;
  --wide-width: 90rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base Styles
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

p {
  margin-bottom: 1.25em;
}

p:last-child {
  margin-bottom: 0;
}

em {
  font-style: italic;
  color: var(--accent-primary);
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
  border-radius: 2px;
}

ul, ol {
  list-style: none;
}

/* ============================================
   Utilities
   ============================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  transition: all var(--transition-fast);
}

.text-link:hover {
  color: var(--accent-primary-hover);
  gap: 0.75rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
  box-shadow: 0 4px 16px var(--shadow-colored);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--shadow-colored);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
  background: var(--accent-primary-subtle);
  border-color: var(--accent-primary-hover);
  color: var(--accent-primary-hover);
}

/* ============================================
   Header
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--overlay);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider-subtle);
  animation: slideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header-container {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 1.5rem var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.main-nav ul {
  display: flex;
  gap: 2.5rem;
}

.main-nav a {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-base);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent-primary);
}

.main-nav a.active::after,
.main-nav a:hover::after {
  width: 100%;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  position: relative;
  padding: var(--space-xl) var(--space-md);
  min-height: 85vh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 20% 30%, var(--accent-primary-subtle) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(58, 143, 143, 0.06) 0%, transparent 50%),
    var(--bg-primary);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(135deg, transparent 0%, var(--bg-secondary) 100%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-container {
  position: relative;
  max-width: var(--content-width);
  margin: 0 auto;
  z-index: 1;
}

.hero-content {
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-label {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.1s backwards;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 500;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  max-width: 38rem;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

.hero-description {
  max-width: 42rem;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

.hero-description p {
  margin-bottom: 1rem;
}

.hero-cta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

.hero-decoration {
  position: absolute;
  top: 50%;
  right: -10%;
  width: 40%;
  height: 60%;
  transform: translateY(-50%);
  opacity: 0.05;
  pointer-events: none;
}

.decorative-line {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(45deg, transparent 48%, var(--accent-primary) 48%, var(--accent-primary) 52%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, var(--accent-secondary) 48%, var(--accent-secondary) 52%, transparent 52%);
  background-size: 80px 80px;
  animation: slidePattern 20s linear infinite;
}

@keyframes slidePattern {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 80px 80px;
  }
}

/* ============================================
   About Novel Section
   ============================================ */

.about-novel {
  padding: var(--space-xl) var(--space-md);
  background: var(--bg-secondary);
  position: relative;
}

.about-novel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.about-novel-container {
  max-width: var(--content-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.section-header h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

.about-novel-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .about-novel-content {
    grid-template-columns: 2fr 1fr;
  }
}

.about-novel-main {
  font-size: var(--text-lg);
}

.lead {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.content-note {
  margin-top: var(--space-md);
  padding: 1.5rem;
  background: var(--overlay-light);
  border-left: 3px solid var(--accent-secondary);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.about-novel-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.comp-titles,
.themes {
  padding: 2rem;
  background: var(--overlay-light);
  border: 1px solid var(--divider-subtle);
}

.comp-titles h3,
.themes h3 {
  font-size: var(--text-base);
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.comp-titles ul,
.themes ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comp-titles li,
.themes li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-left: 1.5rem;
  position: relative;
}

.comp-titles li::before,
.themes li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

/* ============================================
   About Author Section
   ============================================ */

.about-author {
  padding: var(--space-xl) var(--space-md);
  background:
    radial-gradient(circle at 70% 50%, rgba(139, 184, 160, 0.03) 0%, transparent 50%),
    var(--bg-primary);
}

.about-author-container {
  max-width: var(--narrow-width);
  margin: 0 auto;
}

.about-author-content h2 {
  margin-bottom: var(--space-md);
  text-align: center;
}

.author-statement {
  font-size: var(--text-lg);
}

.author-statement p {
  margin-bottom: 1.5rem;
}

.author-statement .text-link {
  margin-top: var(--space-sm);
}

/* ============================================
   Newsletter Section
   ============================================ */

.newsletter {
  padding: var(--space-xl) var(--space-md);
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.newsletter::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 120%;
  height: 200%;
  background: radial-gradient(circle, var(--accent-primary-subtle) 0%, transparent 70%);
  opacity: 0.3;
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}

.newsletter-container {
  position: relative;
  max-width: var(--narrow-width);
  margin: 0 auto;
  text-align: center;
  z-index: 1;
}

.newsletter-content h2 {
  margin-bottom: 1rem;
}

.newsletter-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  max-width: 36rem;
  margin: 0 auto var(--space-sm);
}

.form-group {
  flex: 1;
}

.newsletter-form input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--overlay-light);
  border: 1px solid var(--divider);
  transition: all var(--transition-base);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--overlay-medium);
  box-shadow: 0 0 0 3px var(--accent-primary-subtle);
}

.newsletter-form input::placeholder {
  color: var(--text-dim);
}

.newsletter-privacy {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-ui);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  padding: var(--space-xl) var(--space-md) var(--space-md);
  background: var(--bg-secondary);
  border-top: 1px solid var(--divider);
}

.footer-container {
  max-width: var(--content-width);
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: 2fr 1fr;
  }
}

.footer-brand {
  max-width: 28rem;
}

.footer-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: var(--text-base);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
}

.footer-nav-group h3 {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.footer-nav-group ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav-group a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-nav-group a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  padding-top: var(--space-md);
  border-top: 1px solid var(--divider-subtle);
  text-align: center;
}

.footer-bottom p {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-dim);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
  .main-nav ul {
    gap: 1.25rem;
  }

  .main-nav a {
    font-size: 0.8rem;
  }

  .hero {
    min-height: auto;
    padding: var(--space-lg) var(--space-sm);
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
