/* ============ OFFEED — TINTE AUF PAPIER ============ */

:root {
  --paper: #f1e7d0;
  --paper-light: #f7efd9;
  --paper-warm: #e8dcc0;
  --paper-shadow: #d8c9a8;
  --ink: #1f3b66;
  --ink-deep: #142747;
  --ink-faded: #3d5a85;
  --ink-watery: #5a7aa3;
  --pencil: #5a554a;
  --pencil-light: #8a8170;
  --wax: #7a2e2a;
  --wax-light: #9c3d36;
  --slate: #566268;
  --green-paper: #d4dcc1;
  --yellow-paper: #ebe2a8;
  --blue-paper: #c7d4e0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'EasyPrint', cursive;
  font-size: 22px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

html { overflow-x: clip; scroll-behavior: smooth; }
body { overflow-x: clip; }

/* Paper texture overlay — fibers + warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(218, 195, 145, 0.25), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(180, 150, 100, 0.18), transparent 55%),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(120, 90, 50, 0.10));
  mix-blend-mode: multiply;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 0 0.15 0 0 0 0.18 0'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.35;
  mix-blend-mode: multiply;
}

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

.handwritten {
  font-family: 'EasyPrint', cursive;
  font-weight: 500;
}

.scrawl {
  font-family: 'EasyPrint', cursive;
  letter-spacing: 0.01em;
}

.typed {
  font-family: 'Special Elite', monospace;
  letter-spacing: 0.02em;
  font-size: 0.7em;
  text-transform: uppercase;
}

.signed {
  font-family: 'EasyPrint', cursive;
  font-weight: 700;
  font-style: italic;
}

h1, h2, h3 {
  font-family: 'EasyPrint', cursive;
  font-weight: 700;
  margin: 0;
  line-height: 1.05;
  color: var(--ink-deep);
}

h1 { font-size: clamp(56px, 14vw, 168px); }
h2 { font-size: clamp(44px, 9vw, 96px); }
h3 { font-size: clamp(32px, 6vw, 56px); }

p { margin: 0 0 0.6em 0; }

/* ============ INK EFFECTS ============ */

/* Strikethrough — looks like ink scratched it out */
.crossed {
  position: relative;
  color: var(--ink);
  display: inline-block;
  opacity: 0.70;
}
.crossed::after {
  content: '';
  position: absolute;
  left: -8%;
  right: -8%;
  top: 48%;
  height: 4px;
  background: var(--ink);
  border-radius: 50%;
  transform: rotate(-3deg);
  box-shadow:
    0 1px 0 rgba(31, 59, 102, 0.35),
    0 -3px 0 -1px rgba(31, 59, 102, 0.4);
}
.crossed::before {
  content: '';
  position: absolute;
  left: -6%;
  right: -10%;
  top: 58%;
  height: 3px;
  background: var(--ink);
  border-radius: 50%;
  transform: rotate(-1deg);
  opacity: 0.7;
}

/* Schoolbook scratch-out — multiple crossing lines */
.scratched {
  position: relative;
  display: inline-block;
  color: var(--ink);
  opacity: 0.70;
}
.scratched svg {
  position: absolute;
  inset: -10% -8%;
  width: 116%;
  height: 120%;
  pointer-events: none;
  overflow: visible;
}

.scratched-group {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.2em;
}

/* Inserted-correction with caret-above (stronger) */
.caret-above {
  position: relative;
  display: inline-block;
}
.caret-above::before {
  content: attr(data-insert);
  position: absolute;
  bottom: 92%;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  font-family: 'EasyPrint', cursive;
  font-size: 0.65em;
  color: var(--wax);
  white-space: nowrap;
  line-height: 1;
  font-weight: 400;
}
.caret-above::after {
  content: '∧';
  position: absolute;
  bottom: 78%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7em;
  color: var(--wax);
  font-weight: 400;
  line-height: 1;
}

/* Underline like ruler-drawn pen line */
.underlined {
  background-image: linear-gradient(transparent 85%, rgba(31, 59, 102, 0.5) 85%, rgba(31, 59, 102, 0.5) 98%, transparent 98%);
  padding: 0 0.05em;
}

.wavy-underline {
  text-decoration: underline wavy var(--ink);
  text-decoration-skip-ink: none;
  text-underline-offset: 0.2em;
}

/* Ink blot — drop it via .blot wherever */
.blot {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  vertical-align: -0.15em;
  position: relative;
}
.blot svg { width: 100%; height: 100%; display: block; }

/* Wobbly slightly-rotated lines */
.wobble-1 { transform: rotate(-1.3deg); display: inline-block; }
.wobble-2 { transform: rotate(0.8deg); display: inline-block; }
.wobble-3 { transform: rotate(-0.5deg); display: inline-block; }

/* Headline ink: deeper saturation, slight bleed */
.ink-bleed {
  color: var(--ink-deep);
  text-shadow:
    0.4px 0 0 rgba(20, 39, 71, 0.55),
    -0.4px 0 0 rgba(20, 39, 71, 0.55),
    0 0 1.5px rgba(31, 59, 102, 0.3);
}

/* ============ PAPER ELEMENTS ============ */

.notepaper {
  background: var(--paper-light);
  background-image:
    repeating-linear-gradient(transparent, transparent 38px, rgba(31, 59, 102, 0.18) 38px, rgba(31, 59, 102, 0.18) 39px);
  border-radius: 2px;
  position: relative;
}

.torn-edge-bottom {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='10' preserveAspectRatio='none'><path d='M0 0 L200 0 L200 6 Q190 9 180 7 Q170 5 160 8 Q150 10 140 6 Q130 4 120 8 Q110 10 100 7 Q90 4 80 8 Q70 10 60 7 Q50 5 40 8 Q30 10 20 6 Q10 4 0 7 Z' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='10' preserveAspectRatio='none'><path d='M0 0 L200 0 L200 6 Q190 9 180 7 Q170 5 160 8 Q150 10 140 6 Q130 4 120 8 Q110 10 100 7 Q90 4 80 8 Q70 10 60 7 Q50 5 40 8 Q30 10 20 6 Q10 4 0 7 Z' fill='black'/></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* ============ SECTIONS ============ */

section {
  position: relative;
  z-index: 2;
  padding: clamp(60px, 12vw, 140px) clamp(20px, 5vw, 60px);
  max-width: 100%;
  overflow: hidden;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
}

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

.btn {
  display: inline-block;
  background: var(--ink-deep);
  color: var(--paper-light);
  padding: 14px 28px;
  border: none;
  font-family: 'EasyPrint', cursive;
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transform: rotate(-0.8deg);
  transition: transform 0.15s ease;
  position: relative;
  text-decoration: none;
  box-shadow: 2px 3px 0 rgba(20, 39, 71, 0.3);
}

.btn:hover {
  transform: rotate(-0.4deg) translateY(-2px);
}

.btn:active {
  transform: rotate(-0.8deg) translateY(1px);
  box-shadow: 1px 1px 0 rgba(20, 39, 71, 0.3);
}

.btn-stamp {
  background: var(--wax);
  color: var(--paper-light);
  font-family: 'Special Elite', monospace;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.1em;
  padding: 10px 22px;
  transform: rotate(-2deg);
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

/* ============ STAMP ============ */

.stamp {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--wax);
  color: var(--wax);
  font-family: 'Special Elite', monospace;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.15em;
  transform: rotate(-3deg);
  border-radius: 2px;
}

/* ============ UTILS ============ */

.tilt-1 { transform: rotate(-1.5deg); }
.tilt-2 { transform: rotate(1deg); }
.tilt-3 { transform: rotate(-0.6deg); }

.no-select { user-select: none; -webkit-user-select: none; }

/* Touch target minimum sizing */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Subtle scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'EasyPrint', cursive;
  color: var(--ink-faded);
  font-size: 18px;
  opacity: 0.7;
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* Highlight (yellow marker) */
.highlight {
  background: linear-gradient(120deg, transparent 2%, rgba(235, 226, 168, 0.85) 2%, rgba(235, 226, 168, 0.85) 98%, transparent 98%);
  padding: 0 0.1em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Numbered margin annotation */
.margin-note {
  font-family: 'EasyPrint', cursive;
  font-size: 0.55em;
  color: var(--wax);
  position: absolute;
  white-space: nowrap;
  transform: rotate(-4deg);
}

/* Ink-drawn arrow */
.arrow {
  display: inline-block;
  width: 60px;
  height: 30px;
}

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

/* Tablet */
@media (max-width: 768px) {
  body { font-size: 21px; }

  h1 { font-size: clamp(42px, 10vw, 80px); }
  h2 { font-size: clamp(36px, 7vw, 64px); }
  h3 { font-size: clamp(28px, 5vw, 44px); }

  section {
    padding: clamp(48px, 10vw, 100px) clamp(18px, 4vw, 40px);
  }

  .container { max-width: 100%; }
  .container-wide { max-width: 100%; }

  .stamp {
    font-size: 10px;
    padding: 3px 10px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 24px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  body { font-size: 20px; }

  h1 { font-size: clamp(34px, 9vw, 56px); }
  h2 { font-size: clamp(30px, 7vw, 48px); }
  h3 { font-size: clamp(24px, 5vw, 36px); }

  section {
    padding: clamp(40px, 8vw, 80px) 16px;
  }

  .btn {
    padding: 12px 22px;
    font-size: 22px;
    width: 100%;
    text-align: center;
  }

  .btn-stamp {
    width: auto;
    font-size: 12px;
    padding: 8px 18px;
  }

  .stamp {
    font-size: 9px;
    padding: 3px 8px;
    letter-spacing: 0.1em;
  }

  .margin-note {
    font-size: 0.45em;
    position: relative;
    transform: none;
    display: block;
    margin-top: 8px;
  }

  .notepaper {
    background-image:
      repeating-linear-gradient(transparent, transparent 30px, rgba(31, 59, 102, 0.15) 30px, rgba(31, 59, 102, 0.15) 31px);
  }

  .scroll-hint {
    font-size: 16px;
    bottom: 16px;
  }
}

/* Hide expensive body pseudo-elements on mobile */
@media (max-width: 760px) {
  body::before, body::after {
    display: none;
  }
}

/* ============ MOBILE NAV ============ */

/* Burger icon lines */
.burger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: absolute;
}
.burger-line-1 { top: 13px; }
.burger-line-2 { top: 21px; }
.burger-line-3 { top: 29px; }

.burger-line-1.open {
  transform: rotate(45deg);
  top: 21px;
}
.burger-line-2.open {
  opacity: 0;
}
.burger-line-3.open {
  transform: rotate(-45deg);
  top: 21px;
}

/* Overlay slide-in */
.mobile-nav-overlay {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.mobile-nav-overlay.open {
  opacity: 1;
  transform: translateY(0);
}

/* Nav links staggered fade-in */
.mobile-nav-link {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.mobile-nav-link.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Keep btn rotate override on mobile nav CTA */
.mobile-nav-overlay .btn.mobile-nav-link {
  transform: translateY(16px) rotate(-0.8deg);
}
.mobile-nav-overlay .btn.mobile-nav-link.visible {
  transform: translateY(0) rotate(-0.8deg);
}

/* ============ HERO — Cinematic Animations ============ */

/* Phase 2B: Typewriter cursor blink */
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Phase 6: Wax seal breathing */
@keyframes seal-breathe {
  0%, 100% { transform: translate(-50%, 50%) scale(1.0); }
  50% { transform: translate(-50%, 50%) scale(1.015); }
}

/* Phase 6: Ink blot pulse */
@keyframes ink-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1.0; }
}

.ink-blot-pulse {
  animation: ink-pulse 6s ease-in-out infinite;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-up-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Phase 6: Letter sheet saturation on hover (desktop only) */
@media (hover: hover) {
  .letter-sheet:hover {
    filter: saturate(1.15);
    transition: filter 0.3s ease;
  }
}

/* Phase 7: Custom pen cursor on hero section */
.hero-section {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M2 14 L4 6 L12 2 L14 4 L6 12 Z' fill='%231f3b66' opacity='0.8'/><path d='M2 14 L4 12 L3 11 Z' fill='%235a554a'/><circle cx='13' cy='3' r='1' fill='%23142747'/></svg>") 1 15, auto;
}

/* Phase 7: Stamp cursor on interactive elements within hero */
.hero-section a,
.hero-section button,
.hero-section [role="button"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><rect x='2' y='2' width='12' height='12' rx='1' fill='%237a2e2a' opacity='0.7'/><rect x='4' y='4' width='8' height='8' rx='0.5' fill='none' stroke='%23f7efd9' stroke-width='0.5' stroke-dasharray='1.5 1'/><text x='8' y='10.5' text-anchor='middle' font-size='5' fill='%23f7efd9' font-family='sans-serif'>OK</text></svg>") 8 8, pointer;
}

/* Phase 8: Reduced motion — disable all animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-section {
    cursor: auto;
  }
  .hero-section a,
  .hero-section button,
  .hero-section [role="button"] {
    cursor: pointer;
  }
}

/* Small Mobile */
@media (max-width: 380px) {
  body { font-size: 18px; }

  h1 { font-size: clamp(28px, 8vw, 42px); }
  h2 { font-size: clamp(26px, 7vw, 38px); }
  h3 { font-size: clamp(22px, 5vw, 32px); }

  section {
    padding: 32px 12px;
  }

  .btn {
    font-size: 20px;
    padding: 10px 18px;
  }
}

/* ============ PRICING SLIDER ============ */

/* Custom range slider styling */
.pricing-slider {
  -webkit-appearance: none;
  appearance: none;
}

/* Slider thumb - all browsers */
.pricing-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wax);
  cursor: pointer;
  border: 2px solid var(--paper-light);
  box-shadow: 0 2px 6px rgba(122, 46, 42, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pricing-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wax);
  cursor: pointer;
  border: 2px solid var(--paper-light);
  box-shadow: 0 2px 6px rgba(122, 46, 42, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Hover effects */
.pricing-slider:hover::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(122, 46, 42, 0.5);
}

.pricing-slider:hover::-moz-range-thumb {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(122, 46, 42, 0.5);
}

/* Focus states for accessibility */
.pricing-slider:focus {
  outline: none;
}

.pricing-slider:focus::-webkit-slider-thumb {
  outline: 2px solid var(--wax);
  outline-offset: 2px;
}

.pricing-slider:focus::-moz-range-thumb {
  outline: 2px solid var(--wax);
  outline-offset: 2px;
}

/* Active state */
.pricing-slider:active::-webkit-slider-thumb {
  transform: scale(1.05);
}

.pricing-slider:active::-moz-range-thumb {
  transform: scale(1.05);
}

/* Mobile touch target sizing */
@media (pointer: coarse) {
  .pricing-slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  .pricing-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }
}
