/* Celia + Ian — Housewarming + Engagement Party
   Zine moderne. No border radii anywhere; sharp corners and slight rotations. */

:root {
  --red:        #b8352c; /* hankie red — accents, ticker, starbursts, dividers */
  --red-deep:   #7a1f22; /* page background base, link hover */
  --cream:      #f5efdf; /* sheet background, text on red */
  --cream-lit:  #fdf9ee; /* bar-section text */
  --olive:      #5f6b2c; /* main headline */
  --ink:        #2b211d; /* body text */
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--red-deep) url('assets/hankie-tile4.webp') repeat;
  background-size: 440px 340px;
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  color: var(--ink);
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-deep); }

img { max-width: 100%; }

@keyframes marqueeScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes blinker { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes spinSlow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.page  { padding: clamp(10px, 1.8vw, 26px); }

.sheet {
  background: var(--cream);
  min-height: 100vh;
  overflow-x: clip;
  box-shadow: 0 0 0 1px rgba(40,16,14,0.35), 0 10px 50px rgba(30,10,8,0.55);
}

/* ---------- Ticker ---------- */

.ticker {
  border-bottom: 1px solid var(--red);
  overflow: hidden;
  white-space: nowrap;
}

.ticker__track {
  display: inline-block;
  animation: marqueeScroll 26s linear infinite;
  padding: 7px 0;
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--red);
}

/* ---------- Header ---------- */

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(36px, 6vw, 64px) 20px 0;
}

.masthead__mark {
  width: 118px;
  height: 84px;
  object-fit: cover;
  object-position: 50% 45%;
  display: block;
}

/* text-align matters once this wraps on narrow screens — the flex centering
   only centers the block, not the wrapped lines inside it. */
.masthead__line {
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-align: center;
}

/* ---------- Hankie hero ---------- */

.hero {
  padding: clamp(28px, 5vw, 56px) 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__hankie {
  width: min(920px, 94%);
  height: auto;
  display: block;
}

/* ---------- Details ---------- */

.details {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(60px, 9vw, 120px) 24px clamp(54px, 8vw, 100px);
  text-align: center;
}

.details__title,
.details__date,
.details__address {
  position: relative;
  z-index: 1;
}

.details__title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--olive);
  text-wrap: pretty;
}

.details__date {
  margin-top: clamp(24px, 4vw, 40px);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(26px, 3.6vw, 42px);
  font-style: italic;
  color: var(--red);
}

.details__address {
  margin-top: 16px;
  font-family: 'Courier Prime', monospace;
  font-size: 14px;
  letter-spacing: 0.2em;
}

/* The address opens Maps. Inherit ink so it still reads as the address line;
   a thin red rule underneath is the only hint that it is tappable. */
.details__map {
  color: inherit;
  display: inline-block;
  padding: 4px 0 3px;
  border-bottom: 1px solid var(--red);
}
.details__map:hover { color: var(--red); }

.details__cal {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
}
.details__cal a { display: inline-block; padding: 6px 4px; }

.nowrap { white-space: nowrap; }

/* ---------- Watercolor cutouts ---------- */

/* Base rotation lives here; the drift script only writes --dy, matching the
   handoff's behaviour of appending translateY to the base transform.
   z-index 0 keeps the cutouts behind the headline — being absolutely
   positioned, they would otherwise paint over the static text. */
.wc { position: absolute; z-index: 0; --dy: 0px; }

.wc--flower-pink {
  left: clamp(-24px, 1vw, 60px);
  top: 8%;
  width: clamp(76px, 9vw, 116px);
  transform: rotate(4deg) translateY(var(--dy));
  -webkit-mask-image: var(--blob-a);
          mask-image: var(--blob-a);
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}

.wc--flower-blue {
  right: clamp(-20px, 2vw, 80px);
  bottom: 12%;
  width: clamp(70px, 8vw, 104px);
  transform: rotate(-9deg) translateY(var(--dy));
  -webkit-mask-image: var(--blob-a);
          mask-image: var(--blob-a);
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}

/* Sits low-left, beside the RSVP starburst. The handoff's 16%/19vw put the
   rotated bounding box across the date and address lines; dropped and eased
   down slightly so it clears both at every width. */
.wc--hand {
  left: clamp(-40px, 3vw, 50px);
  bottom: 8%;
  width: clamp(140px, 16vw, 220px);
  /* Drift applied before the rotation, so it stays vertical. Rotating first
     (as the other cutouts do) would send this one sideways by ~11px, since
     translateY runs in the rotated frame at 109deg. */
  transform: translateY(var(--dy)) rotate(109deg);
}

.wc--poppy-bud {
  right: clamp(-18px, 1vw, 40px);
  top: 4%;
  width: clamp(90px, 11vw, 140px);
  transform: translateY(var(--dy));
  -webkit-mask-image: var(--blob-b);
          mask-image: var(--blob-b);
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}

.wc--heart {
  left: clamp(-30px, -2vw, 10px);
  bottom: -6%;
  width: clamp(48px, 6vw, 70px);
  -webkit-mask-image: var(--blob-c);
          mask-image: var(--blob-c);
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}

/* Irregular blob masks that soften the cutout edges. */
:root {
  --blob-a: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20100%20100%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20fill=%22%23000%22%20d=%22M47,4%20C60,0%2076,4%2086,14%20C97,25%2092,42%2094,56%20C96,70%2086,84%2073,91%20C59,99%2041,97%2028,90%20C14,82%209,70%204,55%20C-1,40%207,24%2017,14%20C27,4%2036,7%2047,4%20Z%22/%3E%3C/svg%3E');
  --blob-b: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20100%20100%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20fill=%22%23000%22%20d=%22M8,35%20C4,20%2016,7%2033,5%20C48,3%2060,1%2074,6%20C89,11%2098,24%2096,40%20C99,55%2093,72%2080,82%20C66,93%2047,99%2032,94%20C17,89%208,78%206,63%20C2,52%2010,46%208,35%20Z%22/%3E%3C/svg%3E');
  --blob-c: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20100%20100%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20fill=%22%23000%22%20d=%22M50,5%20C66,2%2084,10%2091,25%20C98,40%2091,60%2085,74%20C79,89%2057,97%2041,93%20C25,90%2010,79%206,62%20C2,46%2012,27%2020,15%20C28,4%2039,8%2050,5%20Z%22/%3E%3C/svg%3E');
}

/* ---------- Starbursts ---------- */

.starburst-wrap {
  margin-top: clamp(26px, 4vw, 40px);
  display: flex;
  justify-content: center;
}

.starburst {
  position: relative;
  display: block;
  width: clamp(116px, 15vw, 156px);
  height: clamp(116px, 15vw, 156px);
  transition: transform 0.45s ease;
}

@media (hover: hover) {
  .starburst--a:hover { transform: scale(1.08); }
  .starburst--b:hover { transform: scale(1.08) rotate(-6deg); }
}
.starburst:active { transform: scale(0.94); transition-duration: 0.12s; }

.starburst__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: spinSlow 24s linear infinite;
}

.starburst--b .starburst__svg { animation: spinSlow 34s linear infinite reverse; }

.starburst__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier Prime', monospace;
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cream);
}

/* ---------- The invitation ---------- */

.invitation {
  position: relative;
  padding: clamp(50px, 8vw, 90px) 24px clamp(60px, 9vw, 110px);
  text-align: center;
}

.invitation__wash {
  position: absolute;
  inset: 0;
  background-image: url('assets/wc-wash-bg.webp');
  background-size: cover;
  background-position: center;
  opacity: 0.32;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.invitation__inner { position: relative; }

.invitation__scan {
  width: min(720px, 94%);
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transform: rotate(-0.8deg);
}

/* ---------- Scallop dividers ---------- */

.scallop {
  height: 26px;
  background-size: 52px 26px;
  background-repeat: repeat-x;
}

.scallop--down {
  background-image: radial-gradient(circle at 50% 100%, var(--red) 66%, transparent 68%);
  background-position: 50% 100%;
}

.scallop--up {
  background-image: radial-gradient(circle at 50% 0, var(--red) 66%, transparent 68%);
  background-position: 50% 0;
  background-color: var(--cream);
}

/* ---------- The bar ---------- */

.bar {
  background-color: var(--red);
  background-image: url('assets/pour-pattern-red.webp');
  background-size: 240px 193px;
  background-repeat: repeat;
  padding: clamp(50px, 8vw, 100px) 24px;
}

.bar__inner {
  max-width: 940px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 72px);
  flex-wrap: wrap;
}

.bar__frame {
  background: var(--cream);
  padding: 10px;
  box-shadow: 3px 4px 0 rgba(40,16,14,0.35);
  transform: rotate(-1.4deg);
  width: clamp(190px, 26vw, 270px);
}

.bar__frame img { width: 100%; height: auto; display: block; }

.bar__text {
  max-width: 380px;
  text-align: left;
  color: var(--cream-lit);
  text-shadow: 0 1px 10px rgba(90,20,16,0.55);
}

.bar__title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.bar__copy {
  margin: 18px 0 0;
  font-size: 20px;
  line-height: 1.55;
  font-style: italic;
}

/* ---------- Cellar pattern ---------- */

.cellar {
  background-image: url('assets/bottle-tile-dense2.webp');
  background-size: 150px 177px;
  background-color: var(--cream);
  background-repeat: repeat;
  padding: clamp(40px, 6vw, 70px) 24px;
  display: flex;
  justify-content: center;
}

.cellar__card {
  background: rgba(245,239,223,0.94);
  padding: 16px 26px;
  box-shadow: 1px 2px 8px rgba(60,38,32,0.25);
  transform: rotate(-0.5deg);
  text-align: center;
}

.cellar__note {
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--red);
}

/* ---------- Photo strip ---------- */

.strip { padding: clamp(60px, 9vw, 110px) 0 0; }

.strip__row {
  display: flex;
  width: 100%;
  height: clamp(230px, 36vw, 460px);
}

.strip__img {
  min-width: 0;
  height: 100%;
  object-fit: cover;
  display: block;
}

.strip__img--proposal { flex: 1.2; }
.strip__img--poppies  { flex: 0.9; object-position: 40% 62%; }
.strip__img--dip      { flex: 1.9; }
.strip__img--palms    { flex: 0.9; object-position: 88% 55%; }
.strip__img--postyes  { flex: 1.7; object-position: 50% 40%; }

/* ---------- Collage ---------- */

.collage {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 120px) 24px 0;
}

.collage__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  grid-template-rows: auto auto;
  width: 100%;
}

.collage__grid > img,
.collage__hills-crop > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.collage__catalina    { grid-row: 1 / 3; grid-column: 1; }
.collage__hills-crop  { overflow: hidden; grid-row: 1 / 3; grid-column: 2; }
.collage__hills       { transform: scale(1.22); transform-origin: 50% 62%; }
.collage__ring        { grid-column: 3; }
.collage__beach       { grid-column: 3; aspect-ratio: 4 / 3; }

/* ---------- Embroidery moment ---------- */

.embroidery {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 130px) 24px 0;
  text-align: center;
}

.embroidery__img { width: 100%; height: auto; display: block; }

/* ---------- Splotch divider ---------- */

.splotches {
  margin-top: clamp(60px, 9vw, 110px);
  overflow: hidden;
}

.splotches img {
  width: 100%;
  height: clamp(120px, 16vw, 220px);
  object-fit: cover;
  display: block;
  mix-blend-mode: multiply;
  filter: contrast(1.05);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}

/* ---------- RSVP ---------- */

.rsvp {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 110px) 24px clamp(80px, 11vw, 150px);
  text-align: center;
}

.rsvp__title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(52px, 8.5vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--red);
}

.rsvp__title .i { font-style: italic; }

.rsvp__linkwrap { margin-top: 24px; }

.rsvp__link {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.24em;
  border-bottom: 2px solid var(--red);
  padding-bottom: 3px;
}

.blink {
  animation: blinker 1.1s step-end infinite;
  display: inline-block;
}

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

.footer {
  border-top: 1px solid var(--red);
  padding: 22px 24px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: 'Courier Prime', monospace;
  font-size: 12.5px;
  letter-spacing: 0.16em;
}

.footer__link { letter-spacing: 0.16em; color: var(--ink); }

/* ---------- Narrow screens (phones) ---------- */

@media (max-width: 600px) {
  /* Lines that wrapped into orphans ("... LOS / ANGELES", "3–7 / pm") break at
     the middot instead: hide the separator and stack the second phrase. */
  .masthead__line .sep,
  .details__date .sep,
  .details__map .sep { display: none; }
  .masthead__line .sep + .nowrap,
  .details__date .sep + .nowrap,
  .details__map .sep + .nowrap { display: block; }
  .details__date .sep + .nowrap { font-size: 0.85em; margin-top: 2px; }

  /* The hankie is the invitation. Drop the hero gutters so it runs the full
     width of the sheet instead of sitting at ~80% with margins on both sides. */
  .hero { padding-left: 0; padding-right: 0; }
  .hero__hankie { width: 100%; }

  .details { padding-top: 48px; }
  .details__title { font-size: clamp(46px, 13vw, 56px); }

  /* Pink flower moves up into the section's top padding so it no longer sits
     behind the H of "Housewarming". */
  .wc--flower-pink { top: 0; left: -10px; }

  /* A ~116px centred RSVP button on a 375px screen leaves only ~119px of
     gutter, which the hand at its fluid size overruns. Pull it to the sheet
     edge and scale it down so it reads as a corner element. */
  .wc--hand {
    left: -4px;
    width: 108px;
    bottom: 4%;
  }

  /* Once the bar wraps to a single column, left-aligned copy under a centred
     frame looks misregistered. Centre it. */
  .bar__text { text-align: center; }
  .bar__copy { margin-top: 14px; }

  /* "KINDLY REPLY BY SEPTEMBER 1" wrapped to leave a lone "1". Tighten the
     tracking and card padding so it fits on one line down to 320px. */
  .cellar { padding-left: 14px; padding-right: 14px; }
  .cellar__card { padding: 14px 16px; }
  .cellar__note { letter-spacing: 0.14em; font-size: 12px; white-space: nowrap; }

  /* Five photos across a 390px screen were slivers. On phones the strip
     becomes a swipeable, snap-scrolling film strip: one photo at a time at
     ~78% width, with the next one peeking in from the right. */
  .strip { padding-top: 48px; }
  .strip__row {
    height: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 0 11vw;
    box-sizing: border-box;
  }
  .strip__row::-webkit-scrollbar { display: none; }
  .strip__img {
    flex: 0 0 78vw;
    width: 78vw;
    scroll-snap-align: center;
  }
  .strip__img--poppies,
  .strip__img--palms { object-position: 50% 50%; }

  /* Collage: two columns instead of three. Catalina keeps the tall left slot,
     ring + hills stack on the right, and the beach (a 5:1 panorama that the
     desktop grid crops to 4:3) runs full width along the bottom. */
  .collage { padding-top: 56px; }
  .collage__grid {
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-rows: auto auto auto;
  }
  .collage__catalina   { grid-row: 1 / 3; grid-column: 1; }
  .collage__ring       { grid-row: 1; grid-column: 2; }
  .collage__hills-crop { grid-row: 2; grid-column: 2; aspect-ratio: 800 / 905; }
  .collage__beach      { grid-row: 3; grid-column: 1 / 3; aspect-ratio: 3 / 1; object-position: 50% 60%; }
  .wc--poppy-bud { top: 0; }

  .embroidery { padding-top: 56px; }
  .wc--heart { left: 2px; bottom: -4%; }

  .splotches { margin-top: 48px; }

  .rsvp { padding-top: 48px; }
  .rsvp__link { padding: 8px 4px 5px; }
  .footer { padding: 18px 20px 26px; }
  .footer__link { padding: 8px 0; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .ticker__track,
  .starburst__svg,
  .starburst--b .starburst__svg,
  .blink {
    animation: none;
  }
  .starburst { transition: none; }
}
