/* ========================================
   Arden McVie — Sci-Fi Author
   Elegant meets sci-fi
   ======================================== */

:root {
  --bg: #0c0b14;
  --bg-warm: #110f1a;
  --surface: #16141f;
  --surface-hover: #1c1a27;
  --border: rgba(180, 160, 200, 0.1);
  --border-hover: rgba(200, 175, 220, 0.2);
  --text: #e0dae8;
  --text-soft: #9a90a8;
  --text-faint: #6b6278;
  --accent: #c9a0dc;
  --accent-soft: rgba(201, 160, 220, 0.15);
  --accent-glow: rgba(201, 160, 220, 0.25);
  --rose: #e8a0b4;
  --rose-soft: rgba(232, 160, 180, 0.12);
  --gold: #d4b896;
  --mint: #7ee8c7;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---- Starfield ---- */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Scanlines (very subtle) ---- */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.015) 3px,
    rgba(0, 0, 0, 0.015) 6px
  );
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2.5rem;
  background: rgba(12, 11, 20, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s ease;
}

.nav.hidden {
  transform: translateY(-100%);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.3s;
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 1px;
  background: var(--accent);
  transition: 0.3s;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
}

.hero-content {
  max-width: 700px;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s 0.3s ease forwards;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 1.8rem;
  position: relative;
  opacity: 0;
  animation: fadeUp 1s 0.6s ease forwards;
}

/* Subtle glitch — only triggers occasionally */
.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-title::before {
  color: var(--accent);
  animation: glitch-soft-1 8s infinite linear;
  clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);
  opacity: 0.6;
}

.hero-title::after {
  color: var(--rose);
  animation: glitch-soft-2 7s infinite linear;
  clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%);
  opacity: 0.5;
}

@keyframes glitch-soft-1 {
  0%, 94%, 96%, 100% { transform: translate(0); }
  95% { transform: translate(-2px, 1px); }
}

@keyframes glitch-soft-2 {
  0%, 92%, 94%, 100% { transform: translate(0); }
  93% { transform: translate(2px, -1px); }
}

.hero-typewriter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 2.5rem;
  min-height: 1.8em;
  opacity: 0;
  animation: fadeUp 1s 0.9s ease forwards;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.9s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-cta {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.7rem 2rem;
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  transition: all 0.4s ease;
  opacity: 0;
  animation: fadeUp 1s 1.2s ease forwards;
}

.hero-cta:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(201, 160, 220, 0.08);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  display: block;
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 0.8; transform: scaleY(1); }
}

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

/* ---- Sections ---- */
.section {
  position: relative;
  z-index: 1;
  padding: 7rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ---- Book Cards ---- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(201, 160, 220, 0.04);
}

.book-cover {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book-cover-placeholder {
  width: 150px;
  height: 210px;
  border: 1px solid var(--border-hover);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  background: linear-gradient(160deg, rgba(201, 160, 220, 0.06), rgba(232, 160, 180, 0.04));
}

.book-cover-placeholder.alt {
  background: linear-gradient(160deg, rgba(232, 160, 180, 0.06), rgba(212, 184, 150, 0.04));
}

.book-cover-placeholder.dreamy {
  background: linear-gradient(160deg, rgba(201, 160, 220, 0.04), rgba(201, 160, 220, 0.02));
  border-style: dashed;
}

.cover-decoration {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
}

.star-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.star-dot:nth-child(2) {
  opacity: 0.8;
  width: 4px;
  height: 4px;
}

.cover-text {
  text-align: center;
}

.cover-series {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.45rem;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.cover-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.book-info {
  padding: 1.5rem 1.8rem 2rem;
}

.book-series {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.book-desc {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-soft);
}

.book-link {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s;
}

.book-link:hover {
  color: var(--rose);
}

/* ---- Featured Book ---- */
.featured-book {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3.5rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
}

.featured-cover {
  display: flex;
  justify-content: center;
}

.featured-cover .book-cover-placeholder {
  width: 180px;
  height: 260px;
}

.book-cover-img {
  width: 180px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.featured-status {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
  background: rgba(126, 232, 199, 0.08);
  padding: 0.25rem 0.8rem;
  border-radius: 100px;
  border: 1px solid rgba(126, 232, 199, 0.15);
  display: inline-block;
  margin-bottom: 0.8rem;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 1rem;
}

.featured-desc {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.9;
}

.featured-desc p {
  margin-bottom: 0.8rem;
}

.featured-desc em {
  color: var(--accent);
}

.featured-book + .featured-book {
  margin-top: 2rem;
}

.featured-book.halted {
  opacity: 0.55;
}

.featured-status.halted {
  color: var(--text-faint);
  background: rgba(107, 98, 120, 0.1);
  border-color: rgba(107, 98, 120, 0.2);
}

.empty-section-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  padding: 2rem 0;
}

.empty-section-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 160, 220, 0.3);
}

.empty-section-note a:hover {
  border-bottom-color: var(--accent);
}

.progress-bar {
  margin: 1.5rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.progress-pct {
  color: var(--accent);
}

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--rose));
  border-radius: 3px;
  transition: width 1.5s ease;
}

/* ---- Short Stories ---- */
.story-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.8rem 2.2rem;
  transition: border-color 0.3s, transform 0.3s;
  gap: 2rem;
}

.story-item:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.story-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.story-excerpt {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 0.6rem;
}

.story-meta {
  display: flex;
  gap: 0.5rem;
}

a.story-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.story-read {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--accent);
  white-space: nowrap;
  transition: color 0.3s;
  flex-shrink: 0;
}

a.story-item:hover .story-read {
  color: var(--rose);
}

/* ---- About ---- */
.about-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, var(--surface), var(--bg-warm));
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame {
  width: 80%;
  height: 80%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.4;
}

.frame-corner.tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.frame-corner.tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.frame-corner.bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.frame-corner.br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.photo-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-faint);
}

.about-intro {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 1.2rem !important;
}

.about-text p {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
  line-height: 1.9;
}

.about-text em {
  font-style: italic;
  color: var(--accent);
}

.about-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--accent);
  display: block;
  line-height: 1.2;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ---- Journal ---- */
.journal-entries {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.journal-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2.2rem;
  transition: border-color 0.3s, transform 0.3s;
}

.journal-entry:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.journal-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.journal-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.journal-dot {
  color: var(--text-faint);
}

.journal-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

.journal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.journal-excerpt {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0.8rem;
  line-height: 1.8;
}

.journal-readmore {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s;
}

.journal-readmore:hover {
  color: var(--rose);
}

.journal-full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s ease, opacity 0.4s ease;
  opacity: 0;
}

.journal-entry.open .journal-full {
  max-height: 2000px;
  opacity: 1;
}

.journal-entry.open .journal-readmore {
  color: var(--text-faint);
}

.journal-body {
  padding-top: 1.2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.journal-body p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 2;
  margin-bottom: 1rem;
}

.journal-body p em {
  color: var(--accent);
}

/* ---- Connect ---- */
.connect-container {
  max-width: 560px;
}

.connect-blurb {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.newsletter-form {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.newsletter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(201, 160, 220, 0.06);
}

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

.newsletter-btn {
  padding: 0.75rem 1.8rem;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 100px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.newsletter-btn:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 20px rgba(201, 160, 220, 0.1);
}

.connect-also {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.social-link {
  font-size: 0.8rem;
  color: var(--text-soft);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.3s;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 0.3rem;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.footer-signal {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  opacity: 0.5;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(12, 11, 20, 0.95);
    backdrop-filter: blur(16px);
    padding: 1.5rem 2.5rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--border);
  }

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

  .nav-toggle {
    display: flex;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .about-container {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 220px;
  }

  .featured-book {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .featured-cover {
    justify-content: center;
  }

  .book-meta {
    justify-content: center;
  }

  .story-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .about-stats {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

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

@media (max-width: 480px) {
  .section {
    padding: 5rem 1.2rem;
  }

  .nav {
    padding: 1rem 1.5rem;
  }
}
