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

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

/* ─── Tokens ────────────────────────────────────────────────────── */
:root {
  --parchment:      #F5F0E8;
  --warm-cream:     #EDE7DB;
  --off-white:      #FFFDF8;
  --divider:        #D4C5B2;
  --muted-gold:     #8B6914;
  --secondary-text: #6B5B4E;
  --body-text:      #4A3F35;
  --accent:         #5C3A1E;
  --ink:            #2C2420;

  --font-heading: 'Cormorant Garant', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
}

/* ─── Base ──────────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.85;
}

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

/* ─── Links ─────────────────────────────────────────────────────── */
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

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

/* ─── Entrance animation ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── HOME PAGE ──────────────────────────────────────────────────── */
.home-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--parchment);
  padding: 2rem;
  animation: fadeIn 0.8s ease both;
}

.home-logo {
  width: 72px;
  height: 72px;
  margin-bottom: 1.5rem;
  mix-blend-mode: multiply;
}

.home-brand {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.home-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  color: var(--secondary-text);
  margin-bottom: 2rem;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
}

.home-nav a {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  border-bottom: none;
  padding-bottom: 0;
  transition: color 0.15s ease;
}

.home-nav a:hover {
  color: var(--ink);
  border-bottom: none;
}

.home-nav-dot {
  color: var(--divider);
  font-size: 12px;
  user-select: none;
}

/* ─── NAVIGATION BAR (inner pages) ──────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--parchment);
  border-bottom: 0.5px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}

.site-nav-brand {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
  border-bottom: none;
  padding-bottom: 0;
}

.site-nav-brand:hover {
  border-bottom: none;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.site-nav-links a {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-text);
  letter-spacing: 0.04em;
  border-bottom: none;
  padding-bottom: 0;
  padding: 2px 0 2px;
  transition: color 0.15s ease;
}

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

.site-nav-links a.active {
  border-bottom: 1.5px solid var(--accent);
}

.site-nav-dot {
  color: var(--divider);
  font-size: 12px;
  user-select: none;
}

/* ─── PAGE WRAPPER ───────────────────────────────────────────────── */
.page-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.page-wrapper--narrow {
  max-width: 640px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2rem;
}

/* ─── STORY CARD ─────────────────────────────────────────────────── */
.story-card {
  background: var(--off-white);
  border: 0.5px solid var(--divider);
  border-radius: 8px;
  padding: 1.5rem 2rem;
}

.story-card + .story-card {
  margin-top: 1.5rem;
}

.story-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.story-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.story-meta {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--secondary-text);
  margin-bottom: 0.75rem;
}

.story-description {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--body-text);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.story-link {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--accent);
}

/* ─── COMPLETION BADGE ───────────────────────────────────────────── */
.badge {
  background: var(--warm-cream);
  color: var(--secondary-text);
  font-family: var(--font-body);
  font-size: 11px;
  font-style: italic;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── PROSE ENTRY ────────────────────────────────────────────────── */
.prose-entry {
  padding: 1.25rem 0;
}

.prose-entry + .prose-entry {
  border-top: 0.5px solid var(--divider);
}

.prose-entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.prose-entry-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.prose-entry-year {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--secondary-text);
  white-space: nowrap;
  flex-shrink: 0;
}

.prose-entry-description {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--secondary-text);
  margin-bottom: 0.5rem;
}

/* ─── READING PAGE ───────────────────────────────────────────────── */
.reading-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.reading-back {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--secondary-text);
  border-bottom: none;
  margin-bottom: 2.5rem;
}

.reading-back:hover {
  color: var(--accent);
  border-bottom: none;
}

.reading-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: 0.5rem;
}

.reading-meta {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--secondary-text);
  text-align: center;
  margin-bottom: 1.5rem;
}

.reading-divider {
  width: 40px;
  height: 0.5px;
  background: var(--divider);
  margin: 0 auto 2rem;
  border: none;
}

.reading-chapter {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  margin: 2rem 0 1rem;
}

.reading-body p {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.reading-break {
  text-align: center;
  color: var(--divider);
  letter-spacing: 0.5em;
  margin: 2rem 0;
  font-size: 14px;
}

/* ─── STORY AUTHOR (card) ────────────────────────────────────────── */
.story-author {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--secondary-text);
  margin: 0.15rem 0 0.25rem;
}

/* ─── READING PAGE ADDITIONS ─────────────────────────────────────── */
.reading-author {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--secondary-text);
  text-align: center;
  margin-bottom: 0.35rem;
}

.reading-part-header {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-text);
  text-align: center;
  margin: 4rem 0 0;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.reading-part-header + .reading-chapter {
  margin-top: 0.75rem;
}

.reading-royal-road {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--secondary-text);
  margin-top: 0.75rem;
}

.reading-royal-road a {
  font-size: 12px;
  color: var(--secondary-text);
}

/* ─── SECTION DIVIDER ────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 0.5px solid var(--divider);
  margin: 1.5rem 0;
}

/* ─── CONTACT PAGE ───────────────────────────────────────────────── */
.contact-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.contact-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.8s ease both;
}

.contact-logo {
  width: 48px;
  height: 48px;
  margin-bottom: 1.5rem;
  mix-blend-mode: multiply;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.contact-links a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--accent);
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1px;
  transition: border-color 0.15s ease;
}

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

/* ─── UNDER CONSTRUCTION ─────────────────────────────────────────── */
.uc-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.uc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1rem;
}

.uc-logo {
  width: 48px;
  height: 48px;
  mix-blend-mode: multiply;
  opacity: 0.65;
}

.uc-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: var(--secondary-text);
}

/* ─── MOBILE ─────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .home-brand {
    font-size: 26px;
  }

  .home-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .home-nav-dot {
    display: none;
  }

  .site-nav-links {
    display: none;
  }

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

  .site-nav-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--ink);
  }

  .mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--parchment);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .mobile-menu.open {
    opacity: 1;
    pointer-events: all;
  }

  .mobile-menu a {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 500;
    color: var(--accent);
    border-bottom: none;
  }

  .mobile-menu-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--secondary-text);
    cursor: pointer;
    line-height: 1;
  }

  .story-card {
    padding: 1rem;
  }

  .reading-page {
    padding: 1.5rem 1rem 3rem;
  }

  .prose-entry-header {
    flex-direction: column;
    gap: 0.15rem;
  }

  .page-wrapper {
    padding: 1.5rem 1rem 3rem;
  }
}

@media (min-width: 768px) {
  .site-nav-hamburger,
  .mobile-menu {
    display: none;
  }
}
