/* ================================
   STORY EXPERIENCE
   Paper book narrative with handwritten annotations
   ================================ */

/*
 * Design tokens are loaded globally via application.css
 * This file contains only story-specific styles
 */

/* Experience-specific color aliases */
:root {
  --ronin-red: var(--color-ronin-red);
}

/* Base styles - black by default to prevent flash during transitions */
html {
  background: var(--color-black);
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-black);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Ensure invitation page allows scrolling */
body.narrative-mockup-body {
  overflow-y: auto !important;
  overflow-x: hidden;
  background: var(--color-black);
}

html.morphing-complete,
body.morphing-complete {
  background: var(--color-black);
}

.narrative-container.morphing-complete {
  background: var(--color-black);
}

/* Invitation stage - hidden initially, revealed after zoom */
.invitation-stage {
  display: none;
  position: relative;
  z-index: 100;
}

.invitation-stage.visible {
  display: block;
}

/* Narrative content visible when invitation stage is shown */
.invitation-stage.visible .narrative-content {
  opacity: 1;
}

/* Header starts half visible, fades in */
.invitation-stage .shokuna-header {
  opacity: 0.5;
  transition: opacity 0.8s ease;
  text-align: left;
  margin-bottom: 3.5em;
}

.narrative-mockup-body {
  background: var(--color-white); /* Start white, match html background */
  color: var(--color-black);
  font-family: var(--font-editorial);
  font-weight: 400;
  line-height: 1.6;
  font-feature-settings: "liga" 1, "calt" 1;
  opacity: 1; /* Always visible */
}

.narrative-mockup-body.loaded {
  opacity: 1;
}

.narrative-container {
  min-height: 100vh;
  position: relative;
  background: transparent; /* Let the extension show through */
  padding-top: 27px;
  z-index: 1;
  transition: background-color 0.8s ease;
}

/* Book visual - fixed position for scroll morphing */
.book-visual {
  position: fixed;
  top: 0; /* Start at top for entry animation */
  /* Positioning handled by JS for animation - left: 50%, transform: translateX(-50%) */
  /* Use CSS variable that JS can animate - adapts to viewport changes even when cached */
  width: var(--book-width, 100vw); /* Start full width for entry animation */
  max-width: 100vw; /* Prevent overflow */
  height: auto;
  z-index: 50; /* Above scrolling texture (2), below content (100) */
  pointer-events: none;
  /* No transition by default - Chrome handles via requestAnimationFrame */
  transition: none;
}

/* On invitation page, book visual is always visible */
/* Only apply to narrative-mockup-body (actual invitation page), not threshold */
.narrative-mockup-body .book-visual {
  opacity: 1 !important;
}

/* Final black background */
.final-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #000000;
  z-index: 5;
  opacity: 0;
}

.final-background.visible {
  opacity: 1;
}

/* Safari desktop only: smooth CSS transitions for width expansion */
/* DISABLED - no width transitions on Safari desktop, static scrolling */
.safari-no-animation .book-visual {
  transition: none !important;
  width: calc(min(100vw - 50px, 1200px)) !important; /* Responsive with margins, max 1200px */
  left: 50% !important;
  transform: translateX(-50%) !important;
}

.safari-no-animation .book-extension-static {
  width: 100% !important; /* Match book width */
}

.book-page {
  width: 100%;
  height: auto;
  display: block;
}

/* On invitation page (black background), don't use multiply blend mode */
.morphing-complete .book-page,
.morphing-complete .logo-book {
  mix-blend-mode: normal;
}

/* Remove scrolling duplicate - not needed */

/* Static extension - extends below the book SVG on initial load */
.book-extension-static {
  position: absolute;
  top: 95%;
  left: 0;
  width: 100%;
  min-height: 200vh; /* Extend well below the viewport */
  background: var(--color-white);
  pointer-events: none;
}

/* Scrolling texture attempts - not working, hidden for now */
.scrolling-paper-texture,
.scrolling-paper-background {
  display: none;
}

/* Narrative content - sits within book bounds */
.narrative-content {
  position: relative;
  z-index: 100;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  /* Use vw-based padding that scales with book width */
  padding: 350px clamp(20px, 3vw, 50px) 0;
  /* Half visible initially - entry animation will fade in fully */
  opacity: 0.5;
  transition: opacity 0.5s ease;
}

/* Scroll reveal section - starts partially visible, fades in on scroll */
.scroll-reveal {
  opacity: 0.3;
  transition: opacity 0.8s ease;
}

/* Header - dramatic, centered */
.narrative-header {
  font-family: var(--font-editorial);
  font-size: var(--text-3xl);
  font-weight: 400;
  font-style: italic;
  text-align: center;
  margin-bottom: clamp(60px, 8vh, 80px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-black);
  font-feature-settings: "liga" 1, "calt" 1;
  mix-blend-mode: multiply;
}

/* Story section */
.narrative-story {
  margin-bottom: 0;
  font-size: var(--text-md);
  line-height: 2.1; /* Increased to make room for inline annotations */
  color: var(--color-black);
  position: relative;
}

.narrative-story p {
  margin-bottom: 3.5em;
  color: var(--color-black);
  mix-blend-mode: multiply;
}

.narrative-story p:last-of-type {
  margin-bottom: 0;
}

/* Handwritten Annotation System - State-based with CSS choreography */
.markup {
  position: relative;
  display: inline;
  padding-bottom: 6px;
  /* Underline - wavy for handwritten feel */
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='3' viewBox='0 0 100 3' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,1.5 Q5,0.8 10,1.5 T20,1.5 T30,1.5 T40,1.5 T50,1.5 T60,1.5 T70,1.5 T80,1.5 T90,1.5 T100,1.5' stroke='%23d32f2f' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: left bottom 3px;
  background-size: 0% 3px;
  background-repeat: repeat-x;
  transition: background-size 0.4s ease-out;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.markup.visible {
  background-size: 100% 3px;
}

/* Annotation - positioned directly above markup within line spacing */
.markup-annotation {
  position: absolute;
  font-family: var(--font-handwriting);
  font-size: var(--text-md);
  line-height: 2.1;
  color: var(--ronin-red);
  max-width: 400px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out; /* Match underline duration */
  z-index: 100;
  text-align: right;
}

.markup-annotation.active {
  opacity: 1;
  transform: translateY(0);
}

/* Why this matters section - bounded box */
.narrative-matters {
  border: 2px solid var(--color-black);
  padding: clamp(24px, 3vw, 32px);
  margin-bottom: clamp(60px, 8vh, 80px);
  background: rgba(0, 0, 0, 0.02);
  color: var(--color-black);
}

.narrative-matters h3 {
  font-family: var(--font-signifier);
  font-size: clamp(24px, 3vw, 28px);
  font-weight: 600;
  margin-bottom: 16px;
  margin-top: 0;
  color: var(--color-black);
}

.narrative-matters p {
  font-size: clamp(16px, 1.8vw, 18px);
  margin-bottom: 16px;
  color: var(--color-black);
}

.narrative-matters ul {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.narrative-matters li {
  font-size: clamp(16px, 1.8vw, 18px);
  margin-bottom: 12px;
  padding-left: 0;
  color: var(--color-black);
}

/* Print Ad - static component */
.print-ad-container {
  margin-bottom: clamp(60px, 8vh, 80px);
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.print-ad-container.visible {
  opacity: 1;
  transform: translateX(0);
}

.print-ad {
  position: relative;
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  background: var(--color-white);
  padding: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  transform: rotate(-1deg);
}

.print-ad-inner {
  width: 100%;
  height: 100%;
  padding: clamp(28px, 4vw, 40px);
  background: var(--color-gray-800);
  position: relative;
}

.print-ad-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.15;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Folded newspaper shadow effect - flat gray overlay on top half */
.print-ad::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 10;
}

.print-ad-content {
  position: relative;
  z-index: 2;
}

.print-ad-content h3 {
  font-family: var(--font-editorial);
  font-size: clamp(48px, 7vw, 72px);
  font-weight: 700;
  font-style: normal;
  margin-bottom: 32px;
  color: var(--color-white);
  line-height: 1.1;
  letter-spacing: -0.01em;
  mix-blend-mode: multiply;
}

.print-ad-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 32px);
  position: relative;
  margin-bottom: clamp(32px, 4vh, 48px);
}


.print-ad-column {
  padding: 0;
}

.print-ad-column p {
  font-size: clamp(16px, 1.6vw, 16px);
  line-height: 1.7;
  margin-bottom: 0;
  color: var(--color-white);
}

/* Centered Shokuna logo at bottom of print ad */
.print-ad-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.print-ad-logo svg {
  width: 20px;
  height: auto;
  color: var(--color-white);
  opacity: 1;
}

.print-ad-content .print-ad-hint {
  font-family: var(--font-editorial);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  font-style: normal;
  line-height: 1.2;
  color: var(--color-white);
  margin-top: 40px;
  margin-bottom: 0;
}

/* Handwritten Letter */
.handwritten-letter {
  max-width: 650px;
  margin: 0 auto;
  margin-bottom: clamp(60px, 8vh, 80px);
  position: relative;
  overflow: visible;
}

/* Stamp overlay */
.letter-stamp {
  position: absolute;
  bottom: 0;
  left: 0;
  width: clamp(80px, 12vw, 120px);
  height: auto;
  mix-blend-mode: multiply;
  opacity: 0.5;
  pointer-events: none;
  transform: rotate(-8deg);
}

.letter-greeting {
  font-family: var(--font-handwriting);
  font-size: clamp(24px, 2.5vw, 28px);
  line-height: 1.4;
  margin-bottom: 30px;
  color: var(--color-black);
}

.handwritten-letter p {
  font-family: var(--font-handwriting);
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--color-black);
  mix-blend-mode: multiply;
}

.letter-signature {
  font-family: var(--font-handwriting);
  margin-top: 32px;
  font-size: var(--text-lg);
  color: var(--color-black);
  line-height: 1.6;
  padding-bottom: 60px;
  position: relative;
}

.letter-signature strong {
  font-weight: 400;
  display: inline-block;
  margin-top: 8px;
}

.signature-name {
  position: relative;
}

.hanko-stamp {
  position: absolute;
  bottom: 0;
  left: 0;
  width: clamp(60px, 10vw, 80px);
  height: auto;
  mix-blend-mode: multiply;
  opacity: 0.6;
  pointer-events: none;
  transform: translateY(25%) rotate(-5deg);
  z-index: 10;
}

/* Dark variant for letter card */
.handwritten-letter.dark {
  background: #0D0D0D;
  color: var(--color-white);
  padding: 8% 10%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: rotate(-1deg);
}

.handwritten-letter.dark .letter-greeting,
.handwritten-letter.dark p,
.handwritten-letter.dark .letter-signature {
  color: var(--color-white);
  mix-blend-mode: normal;
}

.handwritten-letter.dark .letter-signature {
  color: rgba(255, 255, 255, 0.8);
  padding-bottom: 0;
}

.handwritten-letter.dark .signature-name {
  color: var(--color-white);
}

.handwritten-letter.dark .letter-logo {
  margin-bottom: 30px;
}

.handwritten-letter.dark .letter-logo img {
  width: 50px;
  height: auto;
  filter: brightness(0) invert(1);
}

/* Full-width Invitation Section (new design) */
.invitation-section {
  background: #0D0D0D;
  margin-top: clamp(60px, 10vh, 100px);
  position: relative;
  z-index: 100;
}

/* Mobile: Full bleed */
@media (max-width: 768px) {
  .invitation-section {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    padding: clamp(60px, 10vh, 100px) clamp(25px, 6vw, 50px) clamp(80px, 12vh, 120px);
  }

  /* Bigger text on mobile */
  .invitation-section .letter-greeting,
  .invitation-section .letter-paragraphs p,
  .invitation-section .letter-signature {
    font-size: var(--text-lg);
  }

  /* Bigger CTA button on mobile */
  .invitation-section .letter-cta .btn {
    font-size: clamp(20px, 5vw, 26px);
    padding: 18px 32px;
  }

  /* Bigger booking note on mobile */
  .invitation-section .letter-ps {
    font-size: clamp(18px, 4.5vw, 22px);
    margin-top: 32px;
  }
}

/* Desktop: Card style, not tilted */
@media (min-width: 769px) {
  .invitation-section {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(50px, 6vh, 70px) clamp(40px, 5vw, 60px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
}

.invitation-section .invitation-content {
  max-width: 600px;
  margin: 0 auto;
}

.invitation-section .letter-logo {
  margin-bottom: 30px;
}

.invitation-section .letter-logo img {
  width: 50px;
  height: auto;
  filter: brightness(0) invert(1);
  /* Safari: Force GPU acceleration for filter */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.invitation-section .letter-greeting {
  font-family: var(--font-handwriting);
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-white);
  margin-bottom: 30px;
}

.invitation-section .letter-paragraphs {
  margin-bottom: 30px;
}

.invitation-section .letter-paragraphs p {
  font-family: var(--font-handwriting);
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-white);
  margin-bottom: 20px;
}

.invitation-section .letter-signature {
  font-family: var(--font-handwriting);
  font-size: var(--text-lg);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.invitation-section .letter-signature .signature-name {
  font-weight: 600;
  color: var(--color-white);
}

.invitation-section .letter-ps {
  font-family: var(--font-editorial);
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.6);
  margin-top: 40px;
}

.invitation-section .letter-ps a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

.invitation-section .letter-ps a:hover {
  color: var(--color-white);
}

/* Dark footer for invitation section */
.invitation-section .page-footer,
.invitation-section .mobile-only .page-footer {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 40px;
  border-top: none !important;
  border: none !important;
  padding-top: 0;
}

.invitation-section .page-footer a,
.invitation-section .mobile-only .page-footer a,
.invitation-section .page-footer .footer-link,
.invitation-section .mobile-only .page-footer .footer-link {
  color: rgba(255, 255, 255, 0.6) !important;
}

.invitation-section .page-footer a:hover,
.invitation-section .mobile-only .page-footer a:hover,
.invitation-section .page-footer .footer-link:hover,
.invitation-section .mobile-only .page-footer .footer-link:hover {
  color: var(--color-white) !important;
}

.invitation-section .page-footer .footer-separator,
.invitation-section .mobile-only .page-footer .footer-separator {
  color: rgba(255, 255, 255, 0.3) !important;
}

.invitation-section .page-footer .footer-copyright,
.invitation-section .mobile-only .page-footer .footer-copyright {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Desktop invitation footer - outside the card, on black background */
.invitation-footer {
  margin-top: clamp(40px, 6vh, 60px);
}

.invitation-footer .page-footer {
  background: transparent;
  border: none;
}

/* Footer on invitation page (narrative-mockup-body) - needs dark styling */
/* The footer sits at the bottom where the background is black */
.narrative-mockup-body .narrative-content .page-footer {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: none;
  margin-top: clamp(60px, 10vh, 100px);
}

.narrative-mockup-body .narrative-content .page-footer a,
.narrative-mockup-body .narrative-content .page-footer .footer-link {
  color: rgba(255, 255, 255, 0.6);
}

.narrative-mockup-body .narrative-content .page-footer a:hover,
.narrative-mockup-body .narrative-content .page-footer .footer-link:hover {
  color: var(--color-white);
}

.narrative-mockup-body .narrative-content .page-footer .footer-separator {
  color: rgba(255, 255, 255, 0.3);
}

.narrative-mockup-body .narrative-content .page-footer .footer-copyright {
  color: rgba(255, 255, 255, 0.5);
}

/* Invitation Card Flip Animation (legacy) */
.invitation-card-container {
  perspective: 1000px;
  margin-bottom: clamp(60px, 8vh, 80px);
}

.invitation-card-flipper {
  position: relative;
  width: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.invitation-card-flipper.flipped {
  transform: rotateY(180deg);
}

.invitation-card-front,
.invitation-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #0D0D0D;
  padding: 8% 10%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: rotate(-1deg);
  min-height: 500px;
  box-sizing: border-box;
}

.invitation-card-front {
  position: relative;
}

.invitation-card-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: rotateY(180deg) rotate(-1deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.invitation-card-front .letter-logo {
  margin-bottom: 30px;
}

.invitation-card-front .letter-logo img {
  width: 50px;
  height: auto;
  filter: brightness(0) invert(1);
}

.invitation-card-front .letter-greeting,
.invitation-card-front p {
  font-family: var(--font-handwriting);
  color: var(--color-white);
  mix-blend-mode: normal;
}

.invitation-card-front .letter-greeting {
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: 30px;
}

.invitation-card-front .letter-paragraphs p {
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: 20px;
}

.invitation-card-front .letter-signature {
  font-family: var(--font-handwriting);
  margin-top: 32px;
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.invitation-card-front .signature-name {
  color: var(--color-white);
  font-weight: 400;
}

/* Back side styles */
.invitation-card-back .inline-label,
.invitation-card-back .checkbox-label {
  color: var(--color-white);
}

.invitation-card-back .dotted-input.dark {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.5);
  color: var(--color-white);
}

.invitation-card-back .reply-option.dark {
  color: var(--color-white);
}

.invitation-card-back .reply-option.dark.selected {
  background: rgba(255, 255, 255, 0.1);
}

/* Checkbox options for dark background */
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  color: var(--color-white);
  padding: 8px 0;
}

.checkbox-option .checkbox-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-white);
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s ease;
}

.checkbox-option.selected .checkbox-box {
  background: var(--color-white);
}

.checkbox-option.selected .checkbox-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #0D0D0D;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-option .checkbox-label {
  color: var(--color-white);
}

/* Perforated reply section */
.reply-section {
  margin-top: 60px;
  margin-bottom: 80px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Perforation line with 3D shadow on each hole */
.perforation {
  position: relative;
  text-align: center;
  margin-bottom: 40px;
  overflow: visible;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perforation::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.08) 0%, transparent 50%) 0 0,
    radial-gradient(circle, rgba(0, 0, 0, 0.15) 30%, transparent 70%) 0 1px;
  background-size: 12px 3px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.perforation-text {
  display: inline-block;
  background: var(--color-white);
  padding: 8px 24px;
  font-family: var(--font-editorial);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--color-black);
  position: relative;
  z-index: 2;
  font-feature-settings: "liga" 1, "calt" 1;
}

/* Reply form */
.reply-form {
  background: var(--color-white);
  padding: 0;
  border: none;
}

.reply-form p {
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  line-height: 1.6;
  margin-bottom: 28px;
  color: var(--color-black);
  font-weight: 400;
}

.reply-form a:not(.btn) {
  color: var(--color-black);
  text-decoration: underline;
  font-weight: 500;
}

/* Reply header - "To: Shokuna" */
.reply-header {
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--color-black);
  margin-bottom: 24px;
  font-feature-settings: "liga" 1, "calt" 1;
}

.reply-header div {
  margin-bottom: 4px;
}

/* Handwritten fill-in text */
.handwritten-fill {
  font-family: var(--font-handwriting);
  font-size: 22px;
}

/* Inline handwritten input - for name field in Share the Love */
.inline-handwritten-input {
  border: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  background: transparent;
  padding: 0 4px;
  font-family: var(--font-handwriting);
  font-size: 22px;
  color: var(--color-black);
  outline: none;
  width: auto;
  min-width: 150px;
}

.inline-handwritten-input:focus {
  border-bottom-color: rgba(0, 0, 0, 0.6);
}

/* Share note intro - appears before perforation in Share the Love */
.share-note-intro {
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: clamp(24px, 4vh, 32px);
  margin-top: 0;
  font-weight: 400;
}

/* Postcard note - the main writing area */
.postcard-note {
  margin: clamp(24px, 4vh, 32px) 0;
  padding: clamp(20px, 3vh, 28px);
  background: rgba(0, 0, 0, 0.015);
  border-radius: clamp(6px, 1vw, 8px);
}

.note-salutation {
  margin-bottom: clamp(16px, 2.5vh, 20px);
  font-family: var(--font-handwriting);
  font-size: 26px;
  line-height: 1.4;
}

.note-body {
  margin-bottom: clamp(20px, 3vh, 28px);
}

.postcard-textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-handwriting);
  font-size: clamp(23px, 2.9vw, 27px);
  line-height: 1.8;
  color: var(--color-black);
  outline: none;
  resize: vertical;
  min-height: clamp(120px, 18vh, 160px);
  font-weight: 400;
  /* Add subtle lines like paper */
  background-image: repeating-linear-gradient(
    transparent,
    transparent calc(1.8em - 1px),
    rgba(0, 0, 0, 0.08) calc(1.8em - 1px),
    rgba(0, 0, 0, 0.08) 1.8em
  );
  background-size: 100% 1.8em;
  background-position: 0 0;
  line-height: 1.8em;
}

.note-signature {
  margin-top: clamp(24px, 4vh, 32px);
  font-family: var(--font-handwriting);
  font-size: 26px;
  line-height: 1.4;
}

.note-signature .handwritten-fill {
  display: block;
  margin-bottom: 4px;
}

.note-signature .signature-date {
  font-size: 22px;
  margin-top: 4px;
}

.postcard-textarea::placeholder {
  color: rgba(0, 0, 0, 0.3);
  font-style: italic;
}

/* Checkboxes */
.reply-options {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reply-option {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--color-black);
  font-feature-settings: "liga" 1, "calt" 1;
  mix-blend-mode: multiply;
}

.reply-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-black);
  background: var(--color-white);
  margin-right: 14px;
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.reply-option input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: bold;
  color: var(--color-black);
}

.checkbox-label {
  flex: 1;
  line-height: 1.6;
}

/* Inline form fields with dotted underlines */
.reply-field-inline {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.inline-label {
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--color-black);
  white-space: nowrap;
}

.dotted-input {
  flex: 1;
  border: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  background: transparent;
  padding: 4px 0;
  font-family: var(--font-handwriting);
  font-size: clamp(23px, 2.9vw, 27px);
  font-weight: 400;
  color: var(--color-black);
  outline: none;
}

.dotted-input:focus {
  border-bottom-color: rgba(0, 0, 0, 0.6);
}

.handwriting-input {
  font-family: var(--font-handwriting);
  font-size: 18px;
}

.handwriting-input::placeholder {
  font-family: var(--font-handwriting);
  font-style: italic;
  color: rgba(0, 0, 0, 0.3);
}

/* Simple send button */
.reply-submit {
  text-align: left;
  margin-top: 32px;
}

.simple-send-button {
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--color-white);
  background: var(--color-black);
  border: 1px solid var(--color-black);
  padding: 12px 32px;
  cursor: pointer;
  transition: all 200ms ease;
  font-feature-settings: "liga" 1, "calt" 1;
}

.simple-send-button:hover {
  background: var(--color-gray-800);
}

/* Unified Button System */
.btn {
  font-family: var(--font-editorial);
  font-size: clamp(16px, 1.8vw, 18px);
  font-weight: 400;
  padding: 10px 24px;
  margin: 0.5rem 0;
  cursor: pointer;
  transition: all 200ms ease;
  font-feature-settings: "liga" 1, "calt" 1;
  text-decoration: none;
  display: inline-block;
  border: 1px solid var(--color-black);
}

.btn-primary {
  color: var(--color-white);
  background: var(--color-black);
  border: 1px solid var(--color-black);
}

.btn-primary:hover {
  color: var(--color-white);
  background: var(--color-gray-800);
  border-color: var(--color-gray-800);
}

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

.btn-secondary:hover {
  color: var(--color-black);
  background: var(--color-gray-100);
}

.btn-small {
  padding: 8px 20px;
  font-size: 14px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Postcard styles */
/* Container - responsive layout */
.postcard-container {
  border: 2px solid #ccc;
  background: #fffef9;
  max-width: 700px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
  display: grid;
}

/* Desktop: horizontal layout (5" x 3.5" ratio) */
@media (min-width: 640px) {
  .postcard-container {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 10/7;
  }

  .postcard-message-side {
    padding: 2rem;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
  }

  .postcard-address-side {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .postcard-header {
    text-align: center;
    font-family: var(--font-editorial);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #999;
    margin-bottom: 1rem;
  }

  .postcard-stamp {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 60px;
    height: auto;
  }
}

/* Mobile: vertical layout (can expand as needed) */
@media (max-width: 639px) {
  .postcard-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
    min-height: 600px;
  }

  .postcard-message-side {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
  }

  .postcard-address-side {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .postcard-header {
    display: none; /* Hide "POSTCARD" header on mobile */
  }

  .postcard-stamp {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: auto;
  }

  .postcard-message {
    font-size: 16px;
  }

  .postcard-message-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .postcard-edit-hint {
    display: none; /* Hide hint on mobile to save space */
  }

  .postcard-dear,
  .postcard-comma {
    font-size: 16px;
  }

  .postcard-name-input {
    font-size: 16px;
  }

  .postcard-name-field {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .postcard-field-label {
    font-size: 14px;
  }

  .postcard-field-input {
    font-size: 16px;
  }

  .postcard-field-readonly {
    font-size: 16px;
  }
}

.postcard-input::placeholder {
  font-family: var(--font-editorial);
  color: #999;
  opacity: 1;
  font-style: italic;
}

.postcard-input::-webkit-input-placeholder {
  font-family: var(--font-editorial);
  color: #999;
  font-style: italic;
}

.postcard-input::-moz-placeholder {
  font-family: var(--font-editorial);
  color: #999;
  font-style: italic;
}

.postcard-input:-ms-input-placeholder {
  font-family: var(--font-editorial);
  color: #999;
  font-style: italic;
}

.postcard-message-wrapper {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.postcard-message {
  width: 100%;
  font-family: var(--font-handwriting);
  font-size: 20px;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  line-height: 1.6;
  min-height: 100px;
  overflow: hidden; /* Hide scrollbar, auto-resize instead */
}

.postcard-edit-hint {
  font-family: var(--font-editorial);
  font-size: 12px;
  color: #999;
  font-style: italic;
  text-align: right;
  margin-top: 0.5rem;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.postcard-bottom-section {
  margin-top: auto;
}

.postcard-field-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.postcard-field-label {
  font-family: var(--font-handwriting);
  font-size: 16px;
  white-space: nowrap;
}

.postcard-field-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 0.25rem 0;
  font-family: var(--font-handwriting);
  font-size: 18px;
  background: transparent;
  outline: none;
}

.postcard-field-input:focus {
  outline: none;
  border-bottom: 1px solid #ccc;
}

.postcard-field-readonly {
  flex: 1;
  font-family: var(--font-handwriting);
  font-size: 18px;
  color: #666;
  border-bottom: 1px solid #ccc;
  padding: 0.25rem 0;
}

.postcard-name-field {
  margin-bottom: 1rem;
}

.postcard-dear,
.postcard-comma {
  font-family: var(--font-handwriting);
  font-size: 20px;
}

.postcard-name-input {
  border: none;
  border-bottom: 1px dotted #ccc;
  padding: 0;
  width: auto;
  min-width: 100px;
  max-width: 180px;
  font-family: var(--font-handwriting);
  font-size: 20px;
  background: transparent;
  outline: none;
}

.postcard-name-input:focus {
  outline: none;
  border-bottom: 1px dotted #ccc;
}

.postcard-send-button {
  text-align: right;
  margin-top: 1rem;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .reply-form {
    padding: 0;
  }

  .perforation::before {
    right: calc(50% + 120px);
  }

  .perforation::after {
    left: calc(50% + 120px);
  }

  /* Remove max-width constraints on mobile to ensure full alignment */
  .reply-section {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .handwritten-letter {
    max-width: none;
  }


  .letter-greeting {
    font-size: 26px;
  }

  .reply-header {
    font-size: 20px;
  }

  .reply-option {
    font-size: 20px;
  }

  .inline-label {
    font-size: 20px;
  }

  .dotted-input {
    font-size: 26px;
  }

  .simple-send-button {
    font-size: 20px;
  }

  .note-salutation {
    font-size: 28px;
  }

  .postcard-textarea {
    font-size: 26px;
    min-height: 150px;
  }

  .note-signature {
    font-size: 28px;
  }

  .note-signature .signature-date {
    font-size: 24px;
  }
}

@media (max-width: 640px) {
  .print-ad-inner {
    padding: 24px;
  }

  .print-ad-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }


  .print-ad-column {
    padding: 0;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .book-visual {
    /* Use CSS variable with mobile-appropriate fallback */
    width: var(--book-width, calc(100vw - 30px));
  }

  .narrative-content {
    /* Use vw-based padding that scales with book width on mobile */
    padding-top: 200px;
    padding-left: clamp(30px, 6vw, 50px);
    padding-right: clamp(30px, 6vw, 50px);
    padding-bottom: 0;
    width: 100%;
    max-width: none;
  }

  .narrative-header {
    text-align: center;
  }

  .narrative-story,
  .narrative-matters,
  .narrative-flyer {
    text-align: left;
  }

  /* Make invitation card wider on mobile - bleed into margins */
  .invitation-card-container {
    margin-left: -15px;
    margin-right: -15px;
    width: calc(100% + 30px);
    margin-bottom: clamp(80px, 15vh, 120px);
  }

  .invitation-card-front,
  .invitation-card-back {
    padding: 8% 8%;
    min-height: 450px;
  }

  /* Make print ad break out and reach screen edges on mobile */
  .print-ad-container {
    margin-left: -20px;
    margin-right: -20px;
  }

  .print-ad {
    transform: rotate(-1deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    max-width: none;
    padding: 16px; /* Keep thick white border */
  }

  .print-ad-inner {
    padding: 20px !important; /* Override default padding */
  }
}

/* Story Continuation Card - Styled like a form card */
.story-continuation-card {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(32px, 5vh, 48px) clamp(24px, 4vw, 40px);
  box-shadow: none;
  margin-top: clamp(48px, 8vh, 64px);
  margin-bottom: clamp(64px, 10vh, 80px);
}

/* Continuation Header */
.continuation-header {
  margin-bottom: clamp(24px, 4vh, 32px);
}

/* Share note - appears above title in share section */
.share-note {
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: clamp(16px, 3vh, 20px);
  margin-top: 0;
  font-weight: 400;
}

.continuation-title {
  font-family: var(--font-editorial);
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.3;
  font-weight: 400;
  font-style: italic;
  color: var(--color-black);
  margin: 0;
}

/* Continuation Form */
.continuation-form {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vh, 24px);
}

/* Addressing Lines - To/From/Date */
.continuation-addressing {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 12px);
  padding: clamp(16px, 3vh, 20px);
  background: rgba(0, 0, 0, 0.02);
  border-radius: clamp(6px, 1vw, 8px);
  border-left: 3px solid rgba(0, 0, 0, 0.1);
}

.addressing-line {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  line-height: 1.5;
}

.addressing-label {
  font-weight: 400;
  color: rgba(0, 0, 0, 0.6);
  min-width: clamp(40px, 8vw, 60px);
}

.addressing-value {
  color: var(--color-black);
  font-weight: 400;
}

.addressing-value.handwritten {
  font-family: var(--font-handwriting);
  font-size: clamp(23px, 2.6vw, 29px);
  color: rgba(0, 0, 0, 0.8);
}

.addressing-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  font-family: var(--font-handwriting);
  font-size: clamp(23px, 2.6vw, 29px);
  color: var(--color-black);
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s ease;
}

.addressing-input:focus {
  border-bottom-color: rgba(0, 0, 0, 0.6);
}

.addressing-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
}

/* Continuation Options - Checkboxes */
.continuation-options {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 16px);
  padding: clamp(16px, 3vh, 20px);
  background: rgba(0, 0, 0, 0.02);
  border-radius: clamp(6px, 1vw, 8px);
}

.continuation-checkbox {
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 2vw, 12px);
  cursor: pointer;
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--color-black);
  font-weight: 400;
}

.continuation-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-black);
  background: var(--color-white);
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.continuation-checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: bold;
  color: var(--color-black);
}

.checkbox-label {
  flex: 1;
}

/* Continuation Fields */
.continuation-field {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 10px);
}

.field-label {
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  font-weight: 400;
  color: rgba(0, 0, 0, 0.8);
}

.continuation-input {
  flex: 1;
  border: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  background: transparent;
  padding: 4px 0;
  font-family: var(--font-handwriting);
  font-size: clamp(23px, 2.9vw, 27px);
  font-weight: 400;
  color: var(--color-black);
  outline: none;
}

.continuation-input:focus {
  border-bottom-color: rgba(0, 0, 0, 0.6);
}

.continuation-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
}

.continuation-textarea {
  width: 100%;
  border: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  background: transparent;
  padding: 4px 0;
  font-family: var(--font-handwriting);
  font-size: clamp(23px, 2.9vw, 27px);
  line-height: 1.6;
  color: var(--color-black);
  outline: none;
  resize: vertical;
  min-height: clamp(80px, 15vh, 120px);
  font-weight: 400;
}

.continuation-textarea:focus {
  border-bottom-color: rgba(0, 0, 0, 0.6);
}

.continuation-textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
}

/* Continuation Submit */
.continuation-submit {
  display: flex;
  justify-content: flex-start;
  margin-top: clamp(8px, 2vh, 12px);
}

.continuation-button {
  font-family: var(--font-editorial);
  padding: clamp(12px, 2.5vh, 16px) clamp(24px, 4vw, 32px);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--color-white);
  background: var(--color-black);
  border: 1px solid var(--color-black);
  border-radius: clamp(6px, 1vw, 8px);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  letter-spacing: 0;
}

.continuation-button:hover {
  background: rgba(0, 0, 0, 0.85);
}

.continuation-button:active {
  transform: translateY(1px);
}

/* Share Success Message */
.share-success {
  padding: clamp(24px, 4vh, 32px);
  text-align: center;
  font-family: var(--font-editorial);
  font-size: var(--text-md);
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.8);
  font-weight: 400;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .share-note {
    font-size: 20px;
  }

  .story-continuation-card {
    padding: clamp(24px, 4vh, 32px) clamp(20px, 3vw, 24px);
    margin-top: clamp(32px, 6vh, 48px);
    margin-bottom: clamp(48px, 8vh, 64px);
  }

  .addressing-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .addressing-label {
    min-width: auto;
  }

  .addressing-input {
    width: 100%;
  }

  .continuation-title {
    font-size: 26px;
  }

  .addressing-line {
    font-size: 20px;
  }

  .addressing-value.handwritten {
    font-size: 26px;
  }

  .addressing-input {
    font-size: 26px;
  }

  .field-label {
    font-size: 20px;
  }

  .continuation-input {
    font-size: 26px;
  }

  .continuation-textarea {
    font-size: 26px;
    min-height: 100px;
  }

  .continuation-button {
    font-size: 20px;
  }

  .continuation-checkbox {
    font-size: 20px;
  }
}

/* ====================================
   NEW STYLES FOR TEACHER'S NOTE DESIGN
   ==================================== */

/* Grading container - expandable tier system */
.grading-container {
  position: relative;
  margin: clamp(40px, 6vh, 60px) 0 clamp(30px, 5vh, 40px) 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 200;
}

/* Individual grade tier */
.grade-tier {
  position: relative;
  transition: opacity 0.3s ease;
}

.grade-tier.current {
  opacity: 1;
}

.grade-tier.other {
  opacity: 1;
}

/* Tier content - stamp + message in horizontal layout */
.tier-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

/* Stamp wrapper */
.stamp-wrapper {
  flex-shrink: 0;
  pointer-events: auto;
}

.grade-stamp {
  display: block;
  width: clamp(70px, 10vw, 100px);
  height: auto;
  transition: filter 0.3s ease;
}

/* Desaturate stamps in non-current tiers */
.grade-tier.other .grade-stamp {
  filter: grayscale(100%);
  opacity: 0.5;
}

/* Tier message container */
.tier-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}

/* Tier label - main message (for current tier only) */
.tier-label {
  font-family: var(--font-handwriting);
  font-size: var(--text-md);
  line-height: 1.4;
  transition: color 0.3s ease;
}

/* Current tier - red handwriting */
.grade-tier.current .tier-label {
  color: var(--ronin-red);
}

/* Tier explanation - appears inline in parentheses, smaller */
.tier-explanation {
  font-family: var(--font-handwriting);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--ronin-red);
  opacity: 0.7;
}

/* Tier description - shown for non-current tiers */
.tier-description {
  font-family: var(--font-handwriting);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: #999;
}

.deeper-questions {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.deeper-questions li {
  font-family: var(--font-handwriting);
  font-size: var(--text-md);
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--color-black);
  padding-left: 30px;
  position: relative;
}

.deeper-questions li::before {
  content: '•';
  position: absolute;
  left: 10px;
  color: var(--color-black);
}


/* Horizontal Bookmark - Similar to print ad but narrower */
.horizontal-bookmark {
  margin-bottom: clamp(60px, 8vh, 80px);
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.horizontal-bookmark.visible {
  opacity: 1;
  transform: translateX(0);
}

.bookmark-inner {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: var(--color-gray-800);
  padding: clamp(16px, 2vw, 20px) clamp(24px, 3vw, 32px);
  border: 4px solid var(--color-gray-800);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: rotate(-1deg);
}

.bookmark-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.15;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.bookmark-inner h3 {
  font-family: var(--font-editorial);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  font-style: normal;
  margin: 0 0 20px 0;
  color: var(--color-white);
  line-height: 1.15;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 2;
}

/* Newspaper body text - smaller pitch text */
.newspaper-body {
  position: relative;
  z-index: 2;
}

.newspaper-body p {
  font-family: var(--font-editorial);
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.6;
  color: var(--color-white);
  margin-bottom: 12px;
}

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

/* Mobile adjustments for grading */
@media (max-width: 768px) {
  .grade-stamp {
    width: clamp(60px, 15vw, 80px);
  }


  .grading-container {
    gap: 16px;
  }

  .tier-content {
    gap: 12px;
  }
}

/* ====================================
   BUSINESS CARD FLIP ANIMATION
   ==================================== */

/* Business Card Container */
.business-card-container {
  margin-bottom: clamp(60px, 8vh, 80px);
  opacity: 0;
  transform: translateX(-200px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  perspective: 1000px;
  cursor: pointer;
  overflow: visible;
}

.business-card-container.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Card Flipper - handles 3D transform */
.business-card-flipper {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
  aspect-ratio: 1.65 / 1; /* Japanese business card standard (91mm x 55mm) */
  overflow: visible;
}

.business-card-flipper.flipped {
  transform: rotateY(180deg);
}

/* Shared styles for front and back */
.business-card-front,
.business-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Front Side - Background image */
.business-card-front {
  background-image: url("/assets/business-card-desktop-0f3ef549.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 12% 10%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: rotate(-1deg);
  container-type: size;
}

.front-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 12%;
}

.business-card-front h3 {
  font-family: var(--font-editorial);
  font-size: 7cqw;
  font-weight: 400;
  font-style: italic;
  margin: 0;
  color: var(--color-white);
  line-height: 1.1;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 2;
}

.front-body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  flex: 1;
}

.front-body p {
  font-family: var(--font-editorial);
  font-size: 4cqw;
  line-height: 1.4;
  color: var(--color-white);
  margin-bottom: 0;
}

.flip-indicator {
  font-family: var(--font-handwriting);
  font-size: var(--text-md);
  line-height: 1.4;
  color: var(--color-black);
  text-align: center;
  margin-top: 40px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.6s ease 0.4s;
}

.business-card-container.visible .flip-indicator {
  opacity: 1;
}

.front-contact {
  position: relative;
  z-index: 2;
}

.front-contact p {
  font-family: var(--font-editorial);
  font-size: 3.5cqw;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0;
}

/* Back Side - Dark background */
.business-card-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #0D0D0D;
  padding: 8% 10% 8% 10%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: rotateY(180deg) rotate(-1deg);
  display: flex;
  flex-direction: column;
  container-type: size;
}

.back-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6%;
  flex: 1;
  justify-content: space-between;
}

.back-content > p {
  font-family: var(--font-editorial);
  font-size: 3.5cqw;
  line-height: 1.4;
  color: var(--color-white);
  margin-bottom: 0;
}

.back-contact {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 4%;
  padding-bottom: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.back-contact p {
  font-family: var(--font-editorial);
  font-size: 3.5cqw;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0;
}

.card-logo {
  position: relative;
  z-index: 3;
}

.card-logo img,
.card-logo svg {
  width: 8cqw;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.3;
}

.contact-divider {
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.3);
}

/* Learn More Link Below Card */
.card-learn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-handwriting);
  font-size: var(--text-md);
  line-height: 1.4;
  color: var(--color-black);
  text-decoration: none;
  margin-top: 40px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease 0.4s, color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.business-card-container.visible .card-learn-more {
  opacity: 1;
}

.card-learn-more:hover {
  color: rgba(0, 0, 0, 0.7);
  transform: translateX(4px);
}

.learn-more-arrow {
  width: 24px;
  height: 24px;
  color: var(--color-black);
  transition: transform 0.2s ease;
}

.card-learn-more:hover .learn-more-arrow {
  transform: translateX(4px);
}

/* Mobile adjustments for business card */
@media (max-width: 768px) {
  .business-card-container {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    overflow: visible;
  }

  .business-card-flipper {
    max-width: 100%;
    height: 70vh;
    width: auto;
    aspect-ratio: 1 / 1.65 !important; /* Vertical Japanese business card on mobile */
    margin: 0 auto;
  }

  .business-card-front {
    background-image: url("/assets/business-card-mobile-f930d8c9.png");
  }

  /* Scale up text significantly for mobile since container is narrow */
  .business-card-front h3 {
    font-size: 14cqw;
  }

  .front-body p {
    font-size: 7cqw;
  }

  .front-contact p {
    font-size: 6cqw;
  }

  .back-content > p {
    font-size: 6.5cqw;
  }

  .back-contact p {
    font-size: 6cqw;
  }

  .card-logo img,
  .card-logo svg {
    width: 12cqw;
  }

  .business-card-back {
    padding: 12% 10% 12% 10%;
  }

  .back-content {
    gap: 8%;
  }

  .back-contact {
    padding-top: 10%;
    padding-bottom: 10%;
  }

  .card-learn-more {
    font-size: clamp(20px, 3vw, 24px);
  }

  .learn-more-arrow {
    width: 28px;
    height: 28px;
  }
}

/* ===== Book Page Styles ===== */

.book-container {
  background: white;
  min-height: 100vh;
}

.book-narrative-content {
  background: white;
  opacity: 1;
  padding-top: 4rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

.book-header {
  text-align: left;
  font-size: clamp(32px, 4.5vw, 48px);
}

.book-intro {
  margin-bottom: 3rem;
}

.book-intro p {
  margin-bottom: 1.5rem;
}

.book-cta-buttons {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.guest-book-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

.guest-book-label {
  margin-bottom: 2rem;
  font-style: italic;
  color: #666;
}

.guest-book-notes {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.guest-book-note p {
  font-family: var(--font-handwriting);
  font-size: 20px;
  line-height: 1.5;
  color: #333;
  margin: 0;
}
