/* ============================================
   LYN GARDNER — HOMEPAGE STYLES
   Mobile-first, semantic, accessible
   ============================================ */

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Warm neutrals */
  --color-bg: #faf8f5;
  --color-bg-alt: #f3efe9;
  --color-bg-warm: #ede7dd;
  --color-text: #2c2825;
  --color-text-muted: #6b6560;
  --color-text-light: #8a8480;
  --color-accent: #8b6e4e;
  --color-accent-hover: #6f5639;
  --color-accent-light: #c9b99a;
  --color-border: #ddd6cc;
  --color-white: #ffffff;
  --color-shadow: rgba(44, 40, 37, 0.08);
  --color-shadow-lg: rgba(44, 40, 37, 0.14);

  /* Typography */
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-normal: 0.35s var(--ease-out);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- UTILITIES --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

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

.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.section-intro {
  color: var(--color-text-muted);
  max-width: 580px;
  margin-bottom: var(--space-lg);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-white);
  box-shadow: 0 4px 12px var(--color-shadow);
}

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

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

.text-link {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

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

/* --- HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

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

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-list {
  list-style: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100dvh;
  background: var(--color-bg);
  padding: calc(var(--header-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  box-shadow: -8px 0 24px var(--color-shadow);
}

.nav-list.open {
  transform: translateX(0);
}

.nav-list a {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* --- HERO --- */
.hero {
  position: relative;
  padding: var(--space-xl) 0 var(--space-2xl);
  overflow: hidden;
  min-height: 80vh;
  min-height: 80dvh;
  display: flex;
  align-items: center;
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-text {
  max-width: 600px;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: var(--space-md);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  max-width: 520px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.hero-covers {
  display: none;
}

/* --- BOOKS CAROUSEL --- */
.books {
  padding: var(--space-2xl) 0;
  background: var(--color-bg-alt);
}

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: var(--space-md);
}

.carousel-track-container {
  overflow: hidden;
  width: 100%;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.carousel-track-container:active {
  cursor: grabbing;
}

.carousel-track {
  display: flex;
  gap: 1.25rem;
  transition: transform 0.45s var(--ease-out);
  padding: var(--space-sm) 1.25rem;
}

.book-card {
  flex: 0 0 auto;
  width: 180px;
  position: relative;
  list-style: none;
}

.book-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.book-cover-wrapper {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--color-shadow), 0 1px 3px var(--color-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  aspect-ratio: 2 / 3;
  background: var(--color-bg-warm);
}

.book-card:hover .book-cover-wrapper,
.book-card:focus-within .book-cover-wrapper {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px var(--color-shadow-lg), 0 2px 6px var(--color-shadow);
}

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

/* Book overlay on hover/focus */
.book-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(44,40,37,0.88) 0%, rgba(44,40,37,0.55) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--transition-normal);
  min-height: 50%;
}

.book-card:hover .book-overlay,
.book-card:focus-within .book-overlay {
  opacity: 1;
}

.book-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.book-rating .stars {
  color: #e8c55a;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.book-rating .rating-text {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  font-weight: 400;
}

.book-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.book-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 3px;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
  line-height: 1.3;
  backdrop-filter: blur(4px);
}

.book-badge.gold {
  background: rgba(232, 197, 90, 0.3);
  color: #fde68a;
}

.book-badge.winner {
  background: rgba(139, 110, 78, 0.35);
  color: #f5e6d3;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.65rem;
  text-align: center;
  color: var(--color-text);
}

/* Carousel buttons */
.carousel-btn {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.carousel-btn:hover {
  background: var(--color-bg-warm);
  border-color: var(--color-accent-light);
}

.carousel-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.carousel-btn-prev {
  left: 0.5rem;
}

.carousel-btn-next {
  right: 0.5rem;
}

/* --- ABOUT --- */
.about {
  padding: var(--space-2xl) 0;
}

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

.about-photo-wrapper {
  flex-shrink: 0;
}

.about-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 20px var(--color-shadow);
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  font-size: 1.05rem;
  line-height: 1.7;
}

.about-text .text-link {
  display: inline-block;
  margin-top: var(--space-xs);
}

/* --- WHAT I'M WORKING ON --- */
.working-on {
  padding: var(--space-2xl) 0;
  background: var(--color-bg-alt);
}

.working-on-inner {
  max-width: 560px;
}

.working-on-inner p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

/* Signup form */
.signup-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.signup-input {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.signup-input::placeholder {
  color: var(--color-text-light);
}

.signup-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(139, 110, 78, 0.1);
  outline: none;
}

.signup-btn {
  align-self: flex-start;
}

.signup-note {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* --- AWARDS --- */
.awards {
  padding: var(--space-2xl) 0;
}

.awards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.award-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-white);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.award-card:hover {
  box-shadow: 0 4px 16px var(--color-shadow);
  transform: translateY(-2px);
}

.award-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.award-icon.gold {
  background: #fef3c7;
  color: #b45309;
}

.award-icon.silver {
  background: #f1f0ee;
  color: #6b6560;
}

.award-icon.winner {
  background: #ede7dd;
  color: #8b6e4e;
}

.award-card-content {
  flex: 1;
  min-width: 0;
}

.award-card-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.award-card-detail {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* --- BOOKING --- */
.booking {
  padding: var(--space-2xl) 0;
  background: var(--color-bg-alt);
}

.booking-inner {
  max-width: 520px;
  text-align: center;
  margin: 0 auto;
}

.booking-inner p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

/* --- FOOTER --- */
.site-footer {
  padding: var(--space-xl) 0 var(--space-lg);
  background: var(--color-text);
  color: rgba(250, 248, 245, 0.75);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: center;
  text-align: center;
}

.footer-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(250, 248, 245, 0.9);
}

.footer-signup h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(250, 248, 245, 0.9);
  margin-bottom: var(--space-sm);
}

.signup-form-footer {
  align-items: center;
}

.signup-form-footer .signup-input {
  background: rgba(250, 248, 245, 0.08);
  border-color: rgba(250, 248, 245, 0.2);
  color: rgba(250, 248, 245, 0.95);
}

.signup-form-footer .signup-input::placeholder {
  color: rgba(250, 248, 245, 0.4);
}

.signup-form-footer .signup-input:focus {
  border-color: var(--color-accent-light);
  box-shadow: 0 0 0 3px rgba(201, 185, 154, 0.15);
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(250, 248, 245, 0.08);
  color: rgba(250, 248, 245, 0.7);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.social-link:hover {
  background: rgba(250, 248, 245, 0.15);
  color: rgba(250, 248, 245, 0.95);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(250, 248, 245, 0.4);
}

/* --- SCROLL REVEAL --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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


/* ============================================
   RESPONSIVE — TABLET (640px+)
   ============================================ */
@media (min-width: 640px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .signup-form {
    flex-direction: row;
    align-items: center;
  }

  .signup-input {
    flex: 1;
  }

  .signup-btn {
    align-self: auto;
  }

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

  .book-card {
    width: 200px;
  }

  .carousel-btn {
    display: flex;
  }

  .carousel-track {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}


/* ============================================
   RESPONSIVE — DESKTOP (960px+)
   ============================================ */
@media (min-width: 960px) {
  :root {
    --header-height: 72px;
  }

  .nav-toggle {
    display: none;
  }

  .nav-list {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    padding: 0;
    flex-direction: row;
    gap: var(--space-lg);
    transform: none;
    box-shadow: none;
  }

  .nav-list a {
    font-size: 0.9rem;
  }

  .hero {
    padding: var(--space-2xl) 0;
    min-height: 85vh;
    min-height: 85dvh;
  }

  .hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
  }

  .hero-text {
    flex: 1;
  }

  .hero-covers {
    display: flex;
    flex-shrink: 0;
    position: relative;
    width: 400px;
    height: 400px;
    align-items: center;
    justify-content: center;
  }

  .hero-cover {
    position: absolute;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--color-shadow-lg);
    transition: transform 0.8s var(--ease-out);
  }

  .hero-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-cover-1 {
    width: 170px;
    height: 255px;
    top: 10%;
    left: 0;
    transform: rotate(-6deg);
    z-index: 1;
  }

  .hero-cover-2 {
    width: 180px;
    height: 270px;
    top: 5%;
    left: 110px;
    transform: rotate(2deg);
    z-index: 3;
  }

  .hero-cover-3 {
    width: 160px;
    height: 240px;
    top: 20%;
    right: 0;
    transform: rotate(7deg);
    z-index: 2;
  }

  .hero:hover .hero-cover-1 {
    transform: rotate(-8deg) translateY(-4px);
  }

  .hero:hover .hero-cover-2 {
    transform: rotate(0deg) translateY(-8px);
  }

  .hero:hover .hero-cover-3 {
    transform: rotate(5deg) translateY(-4px);
  }

  .about-inner {
    flex-direction: row;
    align-items: center;
    gap: var(--space-xl);
  }

  .about-photo {
    width: 280px;
    height: 280px;
  }

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

  .book-card {
    width: 210px;
  }
}


/* ============================================
   RESPONSIVE — WIDE (1200px+)
   ============================================ */
@media (min-width: 1200px) {
  .hero-covers {
    width: 480px;
    height: 440px;
  }

  .hero-cover-1 {
    width: 190px;
    height: 285px;
  }

  .hero-cover-2 {
    width: 200px;
    height: 300px;
    left: 130px;
  }

  .hero-cover-3 {
    width: 180px;
    height: 270px;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .carousel-track {
    transition-duration: 0.01ms !important;
  }
}
