/* Loveboard — analog paper design system (web) */

:root {
  --paper: #f6f1e5;
  --sheet: #fcfaf4;
  --ink: #2c2620;
  --ink-soft: rgba(44, 38, 32, 0.58);
  --ink-faint: rgba(44, 38, 32, 0.14);
  --stamp: #c94f3e;
  --postal: #5b799a;
  --sage: #7d8e6f;
  --tape: rgba(241, 222, 159, 0.65);
  --serif: "Instrument Serif", Georgia, serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --body: "Newsreader", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: 999;
}

/* Soft vignette like a lit desk */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 35%, transparent 55%, rgba(44, 38, 32, 0.07));
  pointer-events: none;
  z-index: 998;
}

::selection { background: rgba(201, 79, 62, 0.25); }

/* ---------- Nav ---------- */

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem clamp(1.4rem, 5vw, 4rem);
  position: relative;
  z-index: 10;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.55rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.wordmark .heart { color: var(--stamp); font-style: normal; }

.nav-cta {
  font-family: var(--body);
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--sheet);
  background: var(--ink);
  padding: 0.6rem 1.4rem;
  border-radius: 99px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  box-shadow: 0 4px 14px rgba(44, 38, 32, 0.25);
}

.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(44, 38, 32, 0.3); }

/* ---------- Shared paper pieces ---------- */

.tape {
  position: absolute;
  width: 92px;
  height: 27px;
  background: var(--tape);
  box-shadow: 0 1px 3px rgba(44, 38, 32, 0.12);
  top: -13px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
}

.tape::after {
  content: "";
  position: absolute;
  inset: 6px 0 auto 0;
  height: 7px;
  background: rgba(255, 255, 255, 0.28);
}

.paper-card {
  background: var(--sheet);
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(44, 38, 32, 0.08), 0 18px 40px -12px rgba(44, 38, 32, 0.28);
  position: relative;
}

.btn-stamp {
  display: inline-block;
  font-family: var(--body);
  font-size: 1.05rem;
  color: var(--sheet);
  background: var(--stamp);
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 0.95rem 2.2rem;
  border-radius: 99px;
  box-shadow: 0 6px 18px rgba(201, 79, 62, 0.4);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.btn-stamp:hover { transform: translateY(-2px) rotate(-0.5deg); box-shadow: 0 10px 26px rgba(201, 79, 62, 0.45); }
.btn-stamp:active { transform: translateY(1px); }

.hand { font-family: var(--hand); color: var(--ink-soft); }

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(42px);
  filter: blur(6px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
}

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

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(2rem, 6vh, 5rem) clamp(1.4rem, 5vw, 4rem) clamp(4rem, 9vh, 7rem);
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 6.5vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.hero h1 em {
  color: var(--stamp);
  font-style: italic;
}

.hero .lede {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 30rem;
}

.hero .hand-note {
  font-size: 1.5rem;
  margin-top: 2.2rem;
  transform: rotate(-1.5deg);
  display: inline-block;
}

.hero-ctas { margin-top: 1.2rem; display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }

.hero-ctas .secondary {
  color: var(--ink-soft);
  font-size: 0.98rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--ink-faint);
}

/* Widget polaroid */

.widget-stack { position: relative; min-height: 460px; }

.widget-polaroid {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(340px, 82%);
  padding: 14px 14px 18px;
  transform: rotate(1.6deg);
  animation: floaty 7s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: rotate(1.6deg) translateY(0); }
  50% { transform: rotate(1.2deg) translateY(-9px); }
}

.widget-screen {
  background: var(--paper);
  border-radius: 4px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.widget-screen svg { width: 62%; height: auto; }

.widget-screen .draw-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawHeart 2.4s var(--ease) 0.7s forwards;
}

@keyframes drawHeart { to { stroke-dashoffset: 0; } }

.widget-caption-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.widget-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
}

.widget-meta .from { font-family: var(--hand); font-size: 1.35rem; color: var(--ink-soft); }
.widget-meta .when { font-family: ui-monospace, monospace; font-size: 0.72rem; color: var(--ink-soft); opacity: 0.7; }

.badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--stamp);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  transform: rotate(-4deg);
}

/* Scattered mini doodle cards behind */
.mini-card {
  position: absolute;
  width: 110px;
  height: 128px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.mini-card.one { top: 1%; left: -4%; transform: rotate(-8deg); }
.mini-card.two { bottom: 3%; right: -2%; transform: rotate(6deg); }

/* ---------- Try-it section (the memorable moment) ---------- */

.try {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) clamp(1.4rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

.section-label {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stamp);
}

.try h2, .chapter h2, .plus h2, .final h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.1;
  margin-top: 0.7rem;
}

.try p { color: var(--ink-soft); margin-top: 1rem; max-width: 26rem; }

.doodle-desk { position: relative; }

.doodle-pad {
  padding: 16px;
  transform: rotate(-1.2deg);
}

#doodle-canvas {
  width: 100%;
  aspect-ratio: 1;
  background: var(--paper);
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
  display: block;
}

.doodle-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-top: 14px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}

.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--sheet); outline: 2px solid var(--ink); }

.doodle-tools .clear {
  margin-left: auto;
  background: none;
  border: none;
  font-family: var(--body);
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.9rem;
}

.doodle-send { margin-top: 1.3rem; width: 100%; }

.sent-stamp {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg) scale(2.6);
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--stamp);
  border: 4px solid var(--stamp);
  border-radius: 8px;
  padding: 0.3rem 1.4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.sent-stamp.show { opacity: 0.9; transform: translate(-50%, -50%) rotate(-10deg) scale(1); }

/* ---------- Story chapters ---------- */

.chapters { max-width: 1100px; margin: 0 auto; padding: 0 clamp(1.4rem, 5vw, 4rem); }

.chapter {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: clamp(1.2rem, 4vw, 3rem);
  padding: clamp(3.4rem, 9vh, 6.5rem) 0;
  border-top: 1px dashed var(--ink-faint);
  align-items: start;
}

.chapter .num {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--stamp);
}

.chapter p { color: var(--ink-soft); margin-top: 1rem; max-width: 34rem; }

.chapter .hand-tag { font-size: 1.45rem; display: inline-block; transform: rotate(-1.4deg); margin-top: 1rem; }

.polaroid-row {
  display: flex;
  gap: 1.4rem;
  margin-top: 2.2rem;
  flex-wrap: wrap;
}

.polaroid {
  width: 130px;
  padding: 8px 8px 10px;
  text-align: center;
}

.polaroid .art {
  aspect-ratio: 1;
  background: var(--paper);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}

.polaroid .cap { font-family: var(--hand); font-size: 1.05rem; color: var(--ink-soft); padding-top: 6px; }

/* ---------- Quote ---------- */

.quote {
  text-align: center;
  padding: clamp(4.5rem, 12vh, 8rem) clamp(1.4rem, 6vw, 4rem);
  position: relative;
}

.quote blockquote {
  font-family: var(--hand);
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.35;
  color: var(--ink);
  max-width: 36rem;
  margin: 0 auto;
  transform: rotate(-0.8deg);
}

.quote .heart-doodle { font-size: 1.6rem; color: var(--stamp); display: block; margin-top: 1.4rem; }

/* ---------- Plus ---------- */

.plus { max-width: 1100px; margin: 0 auto; padding: clamp(2rem, 6vh, 4rem) clamp(1.4rem, 5vw, 4rem) clamp(4rem, 9vh, 6rem); }

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.6rem;
  margin-top: 2.6rem;
  align-items: stretch;
}

.plan { padding: 1.8rem 1.7rem; }
.plan.free { transform: rotate(-0.7deg); }
.plan.paid { transform: rotate(0.6deg); outline: 2px solid var(--stamp); }

.plan h3 { font-family: var(--serif); font-weight: 400; font-size: 1.55rem; }
.plan .price { font-family: var(--serif); font-size: 1.1rem; color: var(--ink-soft); margin-top: 0.2rem; }
.plan ul { list-style: none; margin-top: 1.2rem; }
.plan li { padding: 0.34rem 0; color: var(--ink-soft); font-size: 0.98rem; }
.plan li::before { content: "✿ "; color: var(--sage); }
.plan.paid li::before { content: "♥ "; color: var(--stamp); }

.plan .plan-badge {
  font-family: var(--hand);
  color: var(--stamp);
  font-size: 1.2rem;
  position: absolute;
  top: 0.9rem;
  right: 1.1rem;
  transform: rotate(3deg);
}

.plus .fine { margin-top: 1.6rem; font-size: 0.85rem; color: var(--ink-soft); opacity: 0.85; max-width: 40rem; }

/* ---------- Final CTA ---------- */

.final {
  text-align: center;
  padding: clamp(4rem, 11vh, 7rem) clamp(1.4rem, 6vw, 4rem) clamp(5rem, 12vh, 8rem);
}

.final .hand-note { font-size: 1.5rem; display: block; margin-bottom: 0.8rem; transform: rotate(-1.2deg); }
.final .btn-stamp { margin-top: 2rem; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px dashed var(--ink-faint);
  padding: 2.2rem clamp(1.4rem, 5vw, 4rem) 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

footer .links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
footer a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-faint); }
footer a:hover { color: var(--ink); }

/* ---------- Legal / document pages ---------- */

.doc {
  max-width: 720px;
  margin: clamp(1rem, 4vh, 3rem) auto clamp(4rem, 9vh, 6rem);
  padding: clamp(2rem, 5vw, 3.4rem);
}

.doc h1 { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; line-height: 1.1; }
.doc .updated { font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.5rem; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; margin: 2.2rem 0 0.6rem; }
.doc p, .doc li { color: rgba(44, 38, 32, 0.78); }
.doc ul { padding-left: 1.3rem; margin-top: 0.5rem; }
.doc li { margin: 0.3rem 0; }
.doc a { color: var(--postal); }
.doc .hand { font-size: 1.35rem; }

/* ---------- Responsive ---------- */

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; padding-top: 1rem; }
  .widget-stack { min-height: 420px; margin-top: 1rem; }
  .try { grid-template-columns: 1fr; }
  .chapter { grid-template-columns: 1fr; gap: 0.6rem; }
}
