/* ─────────────────────────────────────────────────────────
   happy-birthday.co.uk — landing
   ───────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/albert-sans.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/fraunces.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/fraunces-italic.woff2') format('woff2');
}

:root {
  --cream: #fdf6ec;
  --cream-deep: #f7eadd;
  --ink: #2a1f1a;
  --ink-soft: #7a5a48;
  --ink-mute: #a48b78;
  --rose: #f4a4a8;
  --rose-deep: #de8189;
  --peach: #f9c89b;
  --peach-deep: #ef9d6c;
  --mustard: #d4a04a;
  --mint: #d4e4d2;
  --line: rgba(42, 31, 26, 0.14);
  --paper-shadow: 0 24px 60px -28px rgba(120, 60, 50, 0.35),
                  0 8px 22px -12px rgba(120, 60, 50, 0.18);
}

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

html {
  height: 100%;
  background: var(--cream);
}

body {
  min-height: 100vh;
  font-family: 'Albert Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 88% 8%, rgba(244, 164, 168, 0.32), transparent 60%),
    radial-gradient(ellipse 70% 55% at 4% 92%, rgba(249, 200, 155, 0.28), transparent 65%),
    radial-gradient(ellipse 50% 40% at 50% 110%, rgba(212, 160, 74, 0.10), transparent 60%),
    var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper-grain noise overlay (inline SVG, no external request) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ── frame ─────────────────────────────────────────────── */

.frame {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 40px 32px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── top bar ───────────────────────────────────────────── */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 6vh;
}

.brand-mark {
  font-family: 'Albert Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose-deep);
  box-shadow: 0 0 0 3px rgba(244, 164, 168, 0.35);
  flex: none;
}

.pill {
  font-family: 'Albert Sans', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 8px 14px 8px 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
}
.pill::before {
  content: '';
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mustard);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 160, 74, 0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(212, 160, 74, 0); }
}

/* ── hero ──────────────────────────────────────────────── */

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 56px;
  padding: 6vh 0 4vh;
  position: relative;
}

.copy {
  position: relative;
  z-index: 3;
  max-width: 620px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 22px;
}
.eyebrow::before,
.eyebrow::after {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--ink-mute);
}

h1.display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: clamp(64px, 11vw, 156px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 28px;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 0;
}
h1.display .ital {
  font-style: italic;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  display: inline-block;
  position: relative;
}
h1.display .ital::after {
  content: '';
  position: absolute;
  left: 6%;
  right: -2%;
  bottom: 0.08em;
  height: 0.07em;
  background: var(--rose);
  border-radius: 999px;
  z-index: -1;
  opacity: 0.55;
  transform: skewX(-6deg);
}
h1.display .punct {
  color: var(--rose-deep);
}

.lede {
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 480px;
  margin: 0 0 32px;
  font-weight: 400;
}

.tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: 'Albert Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.tags span { display: inline-block; }
.tags .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--peach-deep);
  display: inline-block;
}

/* ── image ─────────────────────────────────────────────── */

.image-wrap {
  position: relative;
  z-index: 2;
  justify-self: end;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
}

.image-wrap::before {
  /* paper offset shadow, evokes a printed photo card */
  content: '';
  position: absolute;
  inset: 12px -14px -16px 14px;
  background: linear-gradient(135deg, var(--rose) 0%, var(--peach) 100%);
  border-radius: 10px;
  transform: rotate(2.5deg);
  z-index: -1;
  opacity: 0.85;
}

.image-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream-deep);
  box-shadow: var(--paper-shadow);
  transform: rotate(-1.2deg);
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}
.image-frame:hover { transform: rotate(-0.4deg) translateY(-3px); }

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* tiny editorial caption beneath the photo (like a print number) */
.caption {
  position: absolute;
  right: 8px;
  bottom: -24px;
  font-family: 'Albert Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 8px;
}
.caption::before {
  content: '';
  width: 16px; height: 1px;
  background: var(--ink-mute);
  display: inline-block;
}

/* ── decorative paper shapes (static, in the corners) ─── */

.deco {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}
.deco svg { display: block; width: 100%; height: 100%; }

.deco-1 { top: 18%;  left: 41%; width: 48px; transform: rotate(-12deg); }
.deco-2 { top: 8%;   right: 6%; width: 38px; transform: rotate(22deg); }
.deco-3 { bottom: 18%; left: 6%;  width: 56px; transform: rotate(-30deg); }
.deco-4 { bottom: 6%;  right: 28%; width: 30px; transform: rotate(8deg); }

/* gentle drift on decorations */
@keyframes drift-a {
  0%,100% { transform: translateY(0) rotate(-12deg); }
  50%     { transform: translateY(-10px) rotate(-9deg); }
}
@keyframes drift-b {
  0%,100% { transform: translateY(0) rotate(22deg); }
  50%     { transform: translateY(-8px)  rotate(26deg); }
}
@keyframes drift-c {
  0%,100% { transform: translateY(0) rotate(-30deg); }
  50%     { transform: translateY(-12px) rotate(-26deg); }
}
@keyframes drift-d {
  0%,100% { transform: translateY(0) rotate(8deg); }
  50%     { transform: translateY(-6px)  rotate(12deg); }
}
.deco-1 { animation: drift-a 7s ease-in-out infinite; }
.deco-2 { animation: drift-b 8s ease-in-out infinite; }
.deco-3 { animation: drift-c 9s ease-in-out infinite; }
.deco-4 { animation: drift-d 6.5s ease-in-out infinite; }

/* ── footer ────────────────────────────────────────────── */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
footer .pages {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-soft);
}

/* ── confetti (JS-spawned, one-shot on load) ───────────── */

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 9px;
  height: 14px;
  pointer-events: none;
  z-index: 50;
  will-change: transform, opacity;
}

/* ── load-in stagger ───────────────────────────────────── */

.fx-up {
  opacity: 0;
  transform: translateY(18px);
  animation: fxUp 900ms cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes fxUp {
  to { opacity: 1; transform: translateY(0); }
}
.d1 { animation-delay: 60ms; }
.d2 { animation-delay: 200ms; }
.d3 { animation-delay: 360ms; }
.d4 { animation-delay: 500ms; }
.d5 { animation-delay: 640ms; }
.d6 { animation-delay: 760ms; }

/* image gets a slightly different intro */
.fx-card {
  opacity: 0;
  transform: translateY(28px) rotate(2deg) scale(0.97);
  animation: fxCard 1100ms cubic-bezier(.2,.7,.2,1) 360ms forwards;
}
@keyframes fxCard {
  to { opacity: 1; transform: translateY(0) rotate(-1.2deg) scale(1); }
}

/* ── responsive ────────────────────────────────────────── */

@media (max-width: 980px) {
  .frame { padding: 22px 24px 28px; }
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 3vh 0 6vh;
  }
  .image-wrap {
    justify-self: center;
    max-width: 420px;
  }
  .deco-1 { top: 4%; left: 6%; width: 40px; }
  .deco-2 { top: 4%; right: 6%; width: 32px; }
  .deco-3 { bottom: 32%; left: 6%; width: 44px; }
  .deco-4 { bottom: 14%; right: 6%; width: 26px; }
}

@media (max-width: 640px) {
  .frame { padding: 18px 16px 24px; }
  .top { margin-bottom: 4vh; gap: 10px; }
  .brand-mark { font-size: 10px; letter-spacing: 0.08em; gap: 8px; }
  .brand-mark::before { width: 7px; height: 7px; box-shadow: 0 0 0 2px rgba(244, 164, 168, 0.35); }
  .pill { font-size: 9px; letter-spacing: 0.14em; padding: 6px 10px 6px 22px; white-space: nowrap; }
  .pill::before { left: 9px; width: 6px; height: 6px; }
  h1.display { font-size: clamp(54px, 14vw, 96px); }
  .lede { font-size: 16px; }
  .tags { font-size: 11px; gap: 4px 10px; }
  .image-wrap { max-width: 100%; }
  footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    text-align: left;
  }
}

/* ── reduced motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .fx-up, .fx-card { opacity: 1; transform: none; }
  .pill::before { animation: none; }
}
