/* ═══════════════════════════════════════════════════════
   THE REST OF YOU · Shared stylesheet (Light edition)
   Cream paper bg · Deep ink text · Gold accents
   ═══════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Playfair Display';
  src: url('assets/fonts/PlayfairDisplay-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('assets/fonts/PlayfairDisplay.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('assets/fonts/EBGaramond.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('assets/fonts/EBGaramond-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg:        #F8F4E8;
  --bg-light:  #F9F5EB;
  --bg-warm:   #EFE9D9;
  --bg-card:   #FAF6EC;
  --text:      #1A1612;
  --text-dim:  #5C544A;
  --text-mute: #8F8675;
  --gold:      #9C7F55;
  --gold-deep: #7A6240;
  --gold-soft: rgba(122, 98, 64, 0.35);
  --rule:      rgba(122, 98, 64, 0.28);
  --hairline:  rgba(26, 22, 18, 0.10);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle paper-grain texture using a layered gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(239, 233, 217, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(220, 210, 190, 0.35) 0%, transparent 50%);
}

body > * { position: relative; z-index: 1; }

/* ───────── NAV ───────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(249, 245, 235, 0.96), rgba(249, 245, 235, 0.65) 70%, transparent);
  backdrop-filter: blur(4px);
}

nav .brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 17px;
  color: var(--text);
  letter-spacing: 0.01em;
  text-decoration: none;
}

nav .links {
  display: flex;
  gap: 36px;
  list-style: none;
}

nav .links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'EB Garamond', serif;
  transition: color 0.3s ease;
  position: relative;
}

nav .links a:hover { color: var(--gold-deep); }
nav .links a.current { color: var(--gold-deep); }

nav .links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--gold-deep);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s ease;
}

nav .links a:hover::after,
nav .links a.current::after {
  transform: scaleX(1);
}

/* ───────── PAGE HEADER (non-home pages) ───────── */
.page-header {
  padding: 180px 32px 80px;
  text-align: center;
  background: radial-gradient(ellipse 60% 50% at 50% 35%, var(--bg-warm) 0%, var(--bg-light) 65%);
}

.page-header .marker {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  color: var(--gold-deep);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 24px;
  display: block;
}

.page-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(48px, 7vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  color: var(--text);
}

.page-header .rule {
  width: 56px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 32px;
}

.page-header .lede {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--text-dim);
  max-width: 44ch;
  margin: 0 auto;
  line-height: 1.55;
}

/* ───────── SECTION ───────── */
section {
  padding: 120px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  color: var(--gold-deep);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 32px;
  display: block;
  text-align: center;
}

/* ───────── DIVIDER ───────── */
.divider {
  width: 64px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto;
  opacity: 0.7;
}

/* ───────── BUTTONS ───────── */
.btn {
  display: inline-block;
  padding: 14px 28px;
  background: transparent;
  border: 1px solid var(--gold-deep);
  color: var(--gold-deep);
  font-family: 'EB Garamond', serif;
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.4s ease, color 0.4s ease;
}

.btn:hover {
  background: var(--gold-deep);
  color: var(--bg-light);
}

.btn-text {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-soft);
  padding-bottom: 4px;
  letter-spacing: 0.04em;
  font-size: 16px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.btn-text:hover {
  color: var(--text);
  border-color: var(--gold-deep);
}

/* ───────── EMAIL SIGNUP ───────── */
.signup-section {
  background: radial-gradient(ellipse 70% 50% at 50% 50%, var(--bg-warm) 0%, var(--bg-light) 70%);
  padding: 140px 32px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.signup {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}

.signup h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 44px);
  margin-bottom: 24px;
  line-height: 1.2;
  color: var(--text);
}

.signup p {
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 40px;
  font-size: 18px;
  line-height: 1.6;
}

.signup form {
  display: flex;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.signup input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--gold-soft);
  color: var(--text);
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  font-style: italic;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.signup input[type="email"]::placeholder {
  color: var(--text-mute);
  font-style: italic;
}

.signup input[type="email"]:focus {
  border-color: var(--gold-deep);
  background: rgba(255, 255, 255, 0.7);
}

.signup button {
  padding: 16px 28px;
  background: transparent;
  border: 1px solid var(--gold-deep);
  color: var(--gold-deep);
  font-family: 'EB Garamond', serif;
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.4s ease, color 0.4s ease;
}

.signup button:hover {
  background: var(--gold-deep);
  color: var(--bg-light);
}

.signup .privacy {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-mute);
  font-style: italic;
}

.signup-status {
  margin-top: 18px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  text-align: center;
  min-height: 1.4em;
  transition: color 0.3s ease;
}

.signup-status.success {
  color: var(--gold-deep);
}

.signup-status.error {
  color: #8a3a3a;
}

/* Honeypot — visually hidden but in DOM for bots to find */
.signup-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ───────── FOOTER ───────── */
footer {
  padding: 64px 32px 48px;
  text-align: center;
  border-top: 1px solid var(--hairline);
  background: var(--bg-light);
}

footer .brand-line {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 12px;
}

footer .meta {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
}

footer .meta a {
  color: var(--text-mute);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
}

footer .meta a:hover {
  color: var(--gold-deep);
  border-color: var(--gold-soft);
}

/* ───────── COVER GRID ───────── */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 28px;
  margin-top: 48px;
}

.cover-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  touch-action: manipulation;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) {
  .cover-card:hover {
    transform: translateY(-6px);
  }
}

.cover-img-wrap {
  position: relative;
  margin-bottom: 22px;
  aspect-ratio: 6 / 9;
  background: var(--bg-card);
  /* The "lifted card" effect: soft drop shadow, subtle warm border */
  box-shadow:
    0 1px 2px rgba(26, 22, 18, 0.08),
    0 8px 24px rgba(26, 22, 18, 0.12),
    0 16px 48px rgba(26, 22, 18, 0.10);
  border: 1px solid rgba(26, 22, 18, 0.06);
  transition: box-shadow 0.5s ease;
}

@media (hover: hover) {
  .cover-card:hover .cover-img-wrap {
    box-shadow:
      0 2px 4px rgba(26, 22, 18, 0.10),
      0 12px 32px rgba(26, 22, 18, 0.16),
      0 24px 64px rgba(26, 22, 18, 0.14);
  }
}

.cover-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.6s ease, opacity 0.6s ease;
}

.cover-card.upcoming .cover-img-wrap img {
  opacity: 0.78;
}

.cover-card.upcoming:hover .cover-img-wrap img {
  opacity: 1;
}

.cover-img-wrap .badge {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FBF7EE;
  background: rgba(20, 16, 12, 0.78);
  padding: 5px 14px;
  border: 1px solid rgba(251, 247, 238, 0.35);
  white-space: nowrap;
  backdrop-filter: blur(2px);
}

.cover-card.live .badge {
  color: #F9F5EB;
  border-color: rgba(249, 245, 235, 0.55);
  background: rgba(122, 98, 64, 0.92);
}

.cover-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 4px;
}

.cover-status {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}

/* ── Flip mechanism for the live (Dad) cover ───────────────────────── */
.cover-flip {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 100%;
  display: block;
  font: inherit;
  color: inherit;
  perspective: 1400px;
  touch-action: manipulation;
  --book-thickness: 14px;
}

.cover-card.live .cover-img-wrap {
  transform-style: preserve-3d;
  transition:
    transform 0.95s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cover-card.live .cover-img-wrap.flipped {
  transform: rotateY(-180deg);
}

.cover-card.live .cover-front,
.cover-card.live .cover-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cover-card.live .cover-front {
  transform: translateZ(calc(var(--book-thickness) / 2));
}

.cover-card.live .cover-back {
  transform: translateZ(calc(var(--book-thickness) / -2)) rotateY(180deg);
}

/* Badge sits on the front face, so translate it forward too */
.cover-card.live .badge {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateX(-50%) translateZ(calc(var(--book-thickness) / 2));
}

/* Side faces of the book block — give the cover thickness mid-flip */
.cover-card.live .page-edge {
  position: absolute;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(180, 158, 116, 0.0) 0px,
      rgba(180, 158, 116, 0.35) 0.5px,
      rgba(180, 158, 116, 0.0) 1.2px
    ),
    linear-gradient(to bottom,
      #efe2c2 0%,
      #e7d6b0 45%,
      #d4be93 100%
    );
}

.cover-card.live .page-edge.top {
  top: 0;
  left: 0;
  right: 0;
  height: var(--book-thickness);
  transform-origin: top;
  transform: rotateX(90deg);
}

.cover-card.live .page-edge.bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--book-thickness);
  transform-origin: bottom;
  transform: rotateX(-90deg);
}

.cover-card.live .page-edge.spine {
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--book-thickness);
  transform-origin: left;
  transform: rotateY(-90deg);
}

.cover-card.live .page-edge.fore {
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--book-thickness);
  transform-origin: right;
  transform: rotateY(90deg);
}

/* Subtle flip prompt below the cover — small italic underlined text */
.cover-card.live .flip-prompt {
  display: inline-block;
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 0;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-mute);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-color: rgba(156, 127, 85, 0.45);
  text-underline-offset: 3px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.cover-flip:hover .flip-prompt,
.cover-flip:focus-visible .flip-prompt {
  color: var(--gold-deep);
  text-decoration-color: var(--gold-deep);
  background: transparent;
  border-color: transparent;
}

/* The meta link below the cover — keep it tappable separately */
.cover-meta {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Override the lift-on-hover for the live card so flip-hover doesn't conflict with shadow */
@media (hover: hover) {
  .cover-card.live:hover {
    transform: translateY(-6px);
  }
}

.cover-card.live .cover-status {
  color: var(--gold-deep);
}

/* ───────── RESPONSIVE ───────── */
@media (max-width: 900px) {
  nav { padding: 18px 24px; }
  nav .links { gap: 22px; }
  nav .links a { font-size: 12px; }
  section { padding: 80px 24px; }
  .cover-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
  .signup-section { padding: 100px 24px; }
  .page-header { padding: 130px 24px 64px; }
}

@media (max-width: 560px) {
  nav { padding: 16px 20px; flex-direction: column; gap: 10px; }
  nav .brand { font-size: 15px; }
  .signup form { flex-direction: column; }
  .signup button { width: 100%; }
}
