/* ABOUTME: Main stylesheet for the Mandatory Fun Hugo theme. */
/* ABOUTME: Bold geometric playfulness with midnight purple, coral, and confetti accents. */

/* ============================================================
   DESIGN TOKENS
   Palette: "Purple People Pleaser"
   Collision: Corporate memo + birthday party
   ============================================================ */

:root {
  /* Colors */
  --color-primary: #1b1340;
  --color-secondary: #7c5cfc;
  --color-background: #fffdf7;
  --color-surface: #f3f0ff;
  --color-text: #1b1340;
  --color-text-muted: #6b6494;
  --color-accent: #ff5252;
  --color-highlight: #ffcf4a;
  --color-border: #e0daf0;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing (8px base unit) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Layout */
  --measure: 70ch;
  --container-wide: 90ch;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 100px;

  /* Animation */
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration: 0.6s;
}


/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.2s var(--ease-smooth);
}

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

a:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--measure);
}

.page-wrapper {
  min-height: calc(100vh - 200px);
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

.page-title {
  margin-bottom: var(--space-lg);
  position: relative;
  display: inline-block;
}

/* Accent underline on page titles */
.page-title::after {
  content: '';
  display: block;
  width: 60%;
  height: 4px;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  margin-top: var(--space-xs);
}

.prose {
  max-width: var(--measure);
}

.prose p {
  margin-bottom: 1.5em;
}

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

.prose blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-sm);
  margin: var(--space-md) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--color-secondary);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.prose a:hover {
  text-decoration-color: var(--color-accent);
}

.empty-state {
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-lg) 0;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  padding: var(--space-sm) 0;
  border-bottom: 3px solid var(--color-primary);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

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

.site-title:hover {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.site-nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) 0;
  position: relative;
  text-decoration: none;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  transition: width 0.3s var(--ease-pop);
}

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


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

.hero {
  padding: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
}

/* Geometric confetti accent — the wildcard */
.hero::before {
  content: '';
  position: absolute;
  top: 15%;
  right: 8%;
  width: 80px;
  height: 80px;
  background: var(--color-highlight);
  border-radius: 50%;
  opacity: 0.25;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 20%;
  left: 5%;
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0.2;
  z-index: 0;
}

.hero__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.hero__photo-wrapper {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-accent);
  box-shadow: 8px 8px 0 var(--color-highlight);
  flex-shrink: 0;
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__photo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-surface);
}

.hero__text {
  max-width: 600px;
}

.hero__name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-xs);
}

.hero__tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.4;
}


/* ============================================================
   FEATURED BOOK
   ============================================================ */

.featured-book {
  padding: var(--space-xl) 0;
  background: var(--color-surface);
  text-align: center;
  position: relative;
}

/* Confetti dot on featured section */
.featured-book::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 12%;
  width: 24px;
  height: 24px;
  background: var(--color-secondary);
  border-radius: 50%;
  opacity: 0.2;
}

.featured-book__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.featured-book__cover-wrapper {
  max-width: 280px;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--color-primary);
  transition: transform 0.3s var(--ease-pop), box-shadow 0.3s var(--ease-smooth);
}

.featured-book__cover-wrapper:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--color-primary);
}

.featured-book__cover-wrapper img {
  width: 100%;
  display: block;
}

.featured-book__cover-placeholder {
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  padding: var(--space-md);
}

.featured-book__title {
  margin-bottom: var(--space-xs);
}

.featured-book__tagline {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

.featured-book__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-background);
  text-decoration: none;
  transition: transform 0.2s var(--ease-pop),
              box-shadow 0.2s var(--ease-smooth),
              background 0.2s var(--ease-smooth);
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 19, 64, 0.25);
  color: var(--color-background);
  background: var(--color-secondary);
}

.btn--small {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
}

.btn--accent {
  background: var(--color-accent);
}

.btn--accent:hover {
  background: #e04545;
}


/* ============================================================
   BOOK GRID & CARDS
   ============================================================ */

.book-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.book-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--color-border);
  transition: transform 0.3s var(--ease-pop), border-color 0.3s var(--ease-smooth);
}

.book-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-secondary);
}

.book-card--featured {
  border-color: var(--color-accent);
  border-width: 3px;
}

.book-card__cover {
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--color-surface);
}

.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-weight: 700;
  padding: var(--space-md);
  text-align: center;
}

.book-card__info {
  padding: var(--space-sm) var(--space-sm) var(--space-md);
}

.book-card__title {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-bottom: var(--space-xs);
  overflow-wrap: break-word;
  word-break: break-word;
}

.book-card__tagline {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
}

.book-card__year {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.book-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}


/* ============================================================
   BLOG POST LIST
   ============================================================ */

.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.post-list__item {
  padding: var(--space-sm) 0;
  border-bottom: 2px solid var(--color-border);
  transition: border-color 0.2s var(--ease-smooth);
}

.post-list__item:hover {
  border-color: var(--color-accent);
}

.post-list__date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 0.25rem;
}

.post-list__title {
  font-size: 1.25rem;
}

.post-list__title a {
  color: var(--color-text);
  text-decoration: none;
}

.post-list__title a:hover {
  color: var(--color-secondary);
}

.post-list__summary {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}


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

.about__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.about__photo-wrapper {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid var(--color-secondary);
  box-shadow: 6px 6px 0 var(--color-highlight);
  flex-shrink: 0;
}

.about__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__photo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-surface);
}

.about__content {
  max-width: var(--measure);
}


/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.contact__email-card {
  background: var(--color-surface);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-accent);
}

.contact__email {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-secondary);
}

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


/* ============================================================
   SOCIAL LINKS
   ============================================================ */

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.social-links__item {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.2s var(--ease-pop);
}

.social-links__item:hover {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  color: white;
  transform: translateY(-2px);
}


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

.site-footer {
  padding: var(--space-md) 0;
  margin-top: var(--space-xl);
  border-top: 3px solid var(--color-primary);
  background: var(--color-surface);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.site-footer__newsletter {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border);
  text-align: center;
}

.site-footer__newsletter-heading {
  font-size: 1.4rem;
  margin-bottom: var(--space-xs);
}

.site-footer__newsletter-text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.site-footer__copy {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Newsletter form — shared between footer and contact page */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: 420px;
  margin: 0 auto;
}

.newsletter-form__input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: white;
  color: var(--color-text);
  transition: border-color 0.2s var(--ease-smooth);
}

.newsletter-form__input:focus {
  border-color: var(--color-secondary);
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.newsletter-form__btn {
  /* Inherits .btn styles in mandatory-fun, just needs overrides */
}

.newsletter-cta {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  text-align: center;
}

.newsletter-cta__heading {
  font-size: 1.4rem;
  margin-bottom: var(--space-xs);
}

.newsletter-cta__text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 480px) {
  .newsletter-form {
    flex-direction: row;
  }

  .newsletter-form__input {
    flex: 1;
  }
}


/* ============================================================
   ANIMATIONS
   Pop-in: slides up with slight overshoot for playful energy
   ============================================================ */

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pop-in {
  animation: pop-in var(--duration) var(--ease-pop) both;
}

.pop-in-delayed {
  animation: pop-in var(--duration) var(--ease-pop) 0.15s both;
}

.pop-in-late {
  animation: pop-in var(--duration) var(--ease-pop) 0.3s both;
}


/* ============================================================
   ARTICLE / SINGLE POST
   ============================================================ */

.article-header {
  margin-bottom: var(--space-lg);
}

.article-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  display: block;
  margin-top: var(--space-xs);
}


/* ============================================================
   PAGE CONTENT SPACING
   ============================================================ */

.page-content {
  padding: var(--space-lg) 0;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 768px) {
  .hero__layout {
    flex-direction: row;
    text-align: left;
    gap: var(--space-lg);
  }

  .hero__photo-wrapper {
    width: 220px;
    height: 220px;
  }

  .hero__name {
    font-size: clamp(3rem, 6vw, 4.5rem);
  }

  .about__layout {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .about__photo-wrapper {
    width: 240px;
    height: 240px;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: var(--space-xl) 0 calc(var(--space-xl) * 1.25);
  }

  .hero__photo-wrapper {
    width: 260px;
    height: 260px;
  }

  .book-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .featured-book__cover-wrapper {
    max-width: 320px;
  }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pop-in,
  .pop-in-delayed,
  .pop-in-late {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .book-card:hover,
  .featured-book__cover-wrapper:hover,
  .social-links__item:hover {
    transform: none;
  }
}
