/* Shared styles for every Tale Print Company page.
   Chapter-specific imagery lives in each page's own <style> block. */

/* ── Chapter palette ──
   Defaults are Chapter I. A chapter page overrides these in its own <style> block. */
:root {
  --focus:           #A67C5B;
  --btn-bg:          #2C2C2C;
  --btn-fg:          #FFFFFF;
  --btn-bg-hover:    #777777;
  --btn-bg-active:   #5c5c5c;
  --card-bg:         #FFFFFF;
  --card-img-bg:     #D1D1D1;
  --card-rule:       #D1D1D1;
  --card-title:      #2C2C2C;
  --card-desc:       #777777;
  --card-price:      #2C2C2C;
  --card-link:       #593E2E;
  --card-link-hover: #777777;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background-color: #2C2C2C;
  color: #2C2C2C;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  margin: 0;
}

/* ── Grain texture overlay ── */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* ── Typography ── */
.heading-display {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.heading-section {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.body-text {
  font-family: 'Nunito', sans-serif;
  font-weight: 300;
  line-height: 1.7;
}

/* ── Navigation ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 102;
  padding: 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}
#nav.scrolled {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 48px;
  box-shadow: 0 1px 0 rgba(44,44,44,0.08), 0 4px 24px rgba(44,44,44,0.06);
}
.nav-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: inherit;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.nav-link:hover { opacity: 1; }
.nav-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(44, 44, 44, 0.25), 0 8px 24px rgba(44, 44, 44, 0.12);
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  background-color: var(--btn-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(44, 44, 44, 0.35), 0 12px 32px rgba(44, 44, 44, 0.16);
}
.btn-primary:active {
  background-color: var(--btn-bg-active);
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(44, 44, 44, 0.2);
}
.btn-primary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background-color: transparent;
  color: #2C2C2C;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: 1.5px solid rgba(44,44,44,0.25);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}
.btn-outline:hover {
  border-color: #777777;
  background-color: rgba(119, 119, 119, 0.06);
  transform: translateY(-1px);
}
.btn-outline:active { transform: translateY(0); }
.btn-outline:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.btn-ghost-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background-color: rgba(255,255,255,0.12);
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 15px;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn-ghost-white:hover {
  background-color: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.7);
  transform: translateY(-1px);
}
.btn-ghost-white:active { transform: translateY(0); }
.btn-ghost-white:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* ── Hero ── */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}
#hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 768px) {
  #hero-video { display: none; }
  #hero { background-size: cover; background-position: center; }
}
#hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 12, 8, 0.28) 0%,
    rgba(15, 12, 8, 0.48) 50%,
    rgba(15, 12, 8, 0.72) 100%
  );
}
#hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

/* ── Cards ── */
.product-card {
  background: var(--card-bg);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
  box-shadow:
    0 1px 2px rgba(44, 44, 44, 0.06),
    0 4px 12px rgba(44, 44, 44, 0.06),
    0 12px 32px rgba(44, 44, 44, 0.04);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 2px 4px rgba(44, 44, 44, 0.08),
    0 8px 24px rgba(44, 44, 44, 0.10),
    0 24px 48px rgba(44, 44, 44, 0.08);
}
.product-card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--card-img-bg);
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,12,8,0.45) 0%, transparent 55%);
  pointer-events: none;
}
.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2C2C2C;
  border-radius: 1px;
}
.product-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.product-card-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--card-title);
  letter-spacing: -0.01em;
}
.product-card-desc {
  font-family: 'Nunito', sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: var(--card-desc);
  line-height: 1.65;
  flex: 1;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--card-rule);
}
.product-card-price {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--card-price);
}
.product-card-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--card-link);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease, gap 0.2s ease;
}
.product-card-link:hover { color: var(--card-link-hover); gap: 8px; }
.product-card-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }
/* Archived products: replaces the Etsy link */
.product-card-status {
  margin-left: auto;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--card-desc);
}

/* ── Process steps ── */
.process-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.process-step.reverse { direction: rtl; }
@media (max-width: 768px) {
  .process-step { grid-template-columns: 1fr !important; gap: 32px !important; direction: ltr !important; }
}

/* ── Scroll fade-in ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }

/* ── Subscribe ── */
.subscribe-input {
  flex: 1;
  padding: 14px 20px;
  background: rgba(255,255,255,0.14);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 2px;
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.subscribe-input::placeholder { color: rgba(255,255,255,0.55); }
.subscribe-input:focus { border-color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.2); }

/* ── Divider ornament ── */
.ornament {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #593E2E;
}
.ornament::before, .ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #593E2E, transparent);
  opacity: 0.5;
}

/* ── Footer ── */
.footer-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-link:hover { color: #777777; }
.footer-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
  position: relative;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #FFFFFF;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
  transform-origin: center;
}
#nav.scrolled .nav-hamburger span { background: #2C2C2C; }
.nav-hamburger.open span { background: #2C2C2C; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile menu overlay ── */
#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#mobile-menu.open {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}
.mobile-nav-link {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #2C2C2C;
  text-decoration: none;
  padding: 10px 0;
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.mobile-nav-link:hover { color: #777777; opacity: 1; }

/* ── Mobile nav ── */
@media (max-width: 768px) {
  #nav { padding: 20px 24px; }
  #nav.scrolled { padding: 14px 24px; }
  #nav-links { display: none !important; }
  .nav-hamburger { display: flex; }
}

/* ── Mobile product grid ── */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr !important; }
}

/* ── Mobile story section ── */
@media (max-width: 768px) {
  .story-grid {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  .story-text {
    padding: 56px 24px 48px !important;
  }
  .story-text h2 { font-size: 36px !important; }
  .story-carousel-col {
    height: 360px;
    min-height: 360px;
  }
}

/* ── Mobile section padding ── */
@media (max-width: 768px) {
  #products { padding: 80px 24px !important; }
  .products-header { margin-bottom: 56px !important; }
  #process { padding: 80px 24px !important; }
  .process-header { margin-bottom: 64px !important; }
}

/* ── Mobile footer ── */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }
  .footer-right { text-align: left !important; }
  .footer-right nav { align-items: flex-start !important; }
}

/* ── Mobile subscribe ── */
@media (max-width: 560px) {
  .subscribe-form { flex-direction: column; }
  .subscribe-form .subscribe-input,
  .subscribe-form .btn-primary { width: 100%; }
}

/* ── Scroll indicator ── */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.6;
}
.scroll-indicator span {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
}
.scroll-mouse {
  width: 22px;
  height: 34px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 11px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-dot {
  width: 3px;
  height: 6px;
  background: #ffffff;
  border-radius: 2px;
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 1; }
  60%  { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
.scroll-indicator-mobile { display: none; }
@keyframes chevronBounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%       { transform: translateY(6px); opacity: 1; }
}
.scroll-chevron { animation: chevronBounce 1.8s ease-in-out infinite; }
@media (max-width: 768px) {
  .scroll-indicator-desktop { display: none; }
  .scroll-indicator-mobile  { display: flex; }
}
