/* Homepage only: the opening photograph and the "one wedding, start to finish" story.
   Everything else on the page uses the site's own styles (style.css): the handwriting,
   doodles, rate cards, steps and the closing ask. Phone first. */

/* Opening: one photograph fills the screen under the header, words over a neutral scrim. */
.day-open { position: relative; height: calc(100svh - 76px); min-height: 560px; max-height: 1100px; display: flex; align-items: flex-end; overflow: hidden; background: var(--night); color: #fff; }
.day-open picture, .day-open img { position: absolute; inset: 0; width: 100%; height: 100%; }
.day-open img { object-fit: cover; object-position: 50% 30%; }
.day-open::after { content: ""; position: absolute; inset: 25% 0 0; background: linear-gradient(to top, rgba(12,13,16,.88) 0%, rgba(12,13,16,.6) 45%, rgba(12,13,16,0) 100%); pointer-events: none; }
.day-open-text { position: relative; z-index: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(28px, 4vw, 56px); }
.day-open h1 { font-size: clamp(2.2rem, 6vw, 4.75rem); line-height: 1.02; max-width: 17ch; }
.day-open .kicker { color: #fff; margin-bottom: 10px; }
.day-open-text > p:not(.hand) { margin: 16px 0 0; max-width: 44ch; font-size: 1.0625rem; line-height: 1.55; color: #fff; }
.day-open .hero-actions { margin-top: 24px; }
.day-open .btn { background: #fff; color: var(--ink); }
.day-open .btn:hover { background: var(--tint-2); }
.day-open .btn.ghost { background: transparent; color: #fff; }
.day-open .btn.ghost:hover { background: rgba(255,255,255,.14); }
.day-open .hand { color: var(--peach); display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0 30px; transform: rotate(-2deg); transform-origin: left; }
.day-open .hand svg { width: 44px; height: 34px; margin-top: -6px; flex: none; }
.day-open-text > * { animation: rise .45s var(--ease) both; }
.day-open-text > :nth-child(2) { animation-delay: .06s; }
.day-open-text > :nth-child(3) { animation-delay: .12s; }
.day-open-text > :nth-child(4) { animation-delay: .18s; }
@media (min-width: 901px) { .day-open { height: calc(100svh - 96px); } .day-open img { object-position: 50% 40%; } }
@media (prefers-reduced-motion: no-preference) {
  .day-open img { animation: day-settle 1.8s var(--ease) both; }
  @keyframes day-settle { from { transform: scale(1.06); } to { transform: none; } }
}

/* The day. Each moment arranges the same parts differently: paired photos keep the site's
   rounded corners, the two wide frames run edge to edge. */
.day .row-head { margin-bottom: 0; }
.moment { margin-top: clamp(40px, 7vw, 110px); }
.day .wrap + .moment { margin-top: clamp(28px, 4vw, 44px); }
.moment figure { margin: 0; }
.moment img { width: 100%; }
.moment .words { padding: 20px var(--gutter) 0; }
.moment h3 { font-size: clamp(1.5rem, 2.8vw, 2.25rem); font-weight: 600; line-height: 1.12; letter-spacing: -0.018em; }
.moment .words > p { margin: 10px 0 0; max-width: 40ch; }
.moment .words > .hand { display: flex; align-items: flex-start; gap: 6px; margin: 14px 0 6px 18px; transform: rotate(-2deg); transform-origin: left; }
.moment .words > .hand svg { width: 40px; height: 31px; margin-top: -4px; flex: none; }
.moment .side { display: flex; flex-direction: column; }
.moment .side figure { margin-top: 28px; }
.moment.duo figure, .moment.last figure { padding: 0 var(--gutter); }
.moment.duo img, .moment.last img { border-radius: var(--r-lg); }

@media (min-width: 901px) {
  .moment.duo, .moment.last { display: grid; gap: clamp(16px, 2vw, 32px); max-width: var(--max); margin-left: auto; margin-right: auto; padding: 0 var(--gutter); }
  .moment.duo figure, .moment.last figure { padding: 0; }
  .moment.duo { grid-template-columns: 5fr 7fr; align-items: stretch; }
  .moment.duo.turn { grid-template-columns: 7fr 5fr; }
  .moment.duo.turn .tall { order: 2; }
  .moment.duo .side { justify-content: space-between; }
  .moment.duo .words { padding: 0 0 40px; }
  .moment.duo .side figure { margin-top: 0; }
  .moment.last { grid-template-columns: 5fr 7fr; align-items: center; }
  .moment.last .tall { max-width: 520px; justify-self: end; }
  .moment.last .words { padding: 0 0 0 clamp(16px, 4vw, 72px); }
  .moment.bleed img { height: min(92svh, 62vw); object-fit: cover; }
  .moment.bleed .words { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 5fr 7fr; gap: clamp(16px, 2vw, 32px); align-items: baseline; }
  .moment.bleed .words > p { margin: 0; }
}

/* The wide frames drift a little as they pass, where the browser can do it without script. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .moment.bleed figure { overflow: hidden; }
    .moment.bleed img { animation: day-drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    @keyframes day-drift { from { transform: scale(1.08) translateY(-2%); } to { transform: scale(1.08) translateY(2%); } }
  }
}

/* End of the day: what that couple booked, and where else I have worked. */
.day-end { margin-top: clamp(28px, 4vw, 48px); }
.day-end > p { margin: 0; max-width: 62ch; }
.day-end .day-venues { margin-top: 28px; color: var(--ash); }
.day-end .day-venues b { color: var(--ink); font-weight: 500; }

/* What every wedding includes, under the rate cards */
.incl { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 8px 32px; }
.incl li { padding-left: 22px; position: relative; }
.incl li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
@media (min-width: 700px) { .incl { grid-template-columns: 1fr 1fr; } }

/* ---- Motion ----
   Everything below is inside "no-preference", and the resting styles are the finished page,
   so with reduced motion, no JavaScript or an old browser nothing is hidden or left half-drawn. */

/* The headline's second line. At rest it simply reads "the next day." with a pencil underline. */
.day-open .next { display: block; position: relative; }
.day-open .now { display: inline-block; position: relative; white-space: nowrap; }
.day-open .now::after {
  content: ""; position: absolute; left: -1%; right: -2%; bottom: -.14em; height: .22em; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9 C 60 3, 120 12, 180 6 S 270 5, 297 8' fill='none' stroke='%23FF8A3D' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.day-open .next::before, .day-open .next::after { content: attr(data-was); position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; pointer-events: none; }
/* The same words again, invisible, so the pencil strike is exactly as wide as the phrase it crosses out */
.day-open .next::after {
  color: transparent;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M2 12 C 50 7, 110 15, 170 9 S 260 8, 298 11' fill='none' stroke='%23FF8A3D' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") 0 58% / 100% .34em no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  /* 1. The usual answer is on screen from the first frame. 2. A pencil line strikes it out, glowing
     for a moment. 3. It is pulled away to the left. 4. The real answer is written in and underlined.
     All done by 2.2s; the photo and the rest of the words are readable throughout. */
  .day-open .next::before { animation: was-go 1.3s var(--ease) both; }
  .day-open .next::after { animation: was-strike 1.3s var(--ease) both; }
  .day-open .now { animation: now-write .5s var(--ease) 1.25s both; }
  .day-open .now::after { animation: now-underline .55s var(--ease) 1.65s both; }
  @keyframes was-go {
    0%, 70% { opacity: 1; clip-path: inset(-20% 0 -20% 0); transform: none; }
    100% { opacity: 0; clip-path: inset(-20% 100% -20% 0); transform: translateX(-.15em); }
  }
  @keyframes was-strike {
    0%, 30% { opacity: 1; clip-path: inset(-40% 100% -40% 0); filter: drop-shadow(0 0 0 rgba(255,138,61,0)); }
    62% { opacity: 1; clip-path: inset(-40% 0 -40% 0); filter: drop-shadow(0 0 10px rgba(255,138,61,.95)); }
    70% { opacity: 1; clip-path: inset(-40% 0 -40% 0); filter: drop-shadow(0 0 4px rgba(255,138,61,.6)); transform: none; }
    100% { opacity: 0; clip-path: inset(-40% 100% -40% 0); transform: translateX(-.15em); }
  }
  @keyframes now-write { from { clip-path: inset(-20% 100% -40% 0); } to { clip-path: inset(-20% -4% -40% 0); } }
  @keyframes now-underline {
    0% { clip-path: inset(-100% 100% -100% 0); filter: drop-shadow(0 0 8px rgba(255,138,61,.95)); }
    70% { clip-path: inset(-100% 0 -100% 0); filter: drop-shadow(0 0 8px rgba(255,138,61,.95)); }
    100% { clip-path: inset(-100% 0 -100% 0); filter: drop-shadow(0 0 0 rgba(255,138,61,0)); }
  }
  /* The headline no longer rises as a block: its second line is the event. */
  .day-open-text > h1 { animation: none; }

  /* Story photos open like a shutter the first time they are scrolled to: paired photos widen
     from the left, the two wide frames from the middle outwards, each settling from a slight zoom.
     They fade up in .3s and are never fully clipped, so a fast scroller never lands on an empty frame.
     The clip sits on the photo, not its figure, because the figure is what the page watches for. */
  .js .moment .develop img { transition: opacity .3s ease var(--d, 0s), clip-path 1s var(--ease) var(--d, 0s), transform 1.4s var(--ease) var(--d, 0s); }
  .js .moment.duo .develop img, .js .moment.last .develop img { clip-path: inset(0 26% 0 0 round var(--r-lg)); transform: scale(1.05); transform-origin: 0 50%; }
  .js .moment.duo .develop.is-in img, .js .moment.last .develop.is-in img { clip-path: inset(0 0 0 0 round var(--r-lg)); transform: none; }
  .js .moment.duo .side .develop img { transition-delay: .15s; }
  .js .moment.bleed .develop img { clip-path: inset(0 14% 0 14%); }
  .js .moment.bleed .develop.is-in img { clip-path: inset(0); }
}

/* ---- Sketch breaks ----
   Between sections a pencil thread runs across the page through three doodles. Where the browser
   supports scroll-driven animation it draws itself as you scroll down and un-draws as you scroll
   back up; everywhere else, and with reduced motion, it is simply there, already drawn. */
.sketch-break { view-timeline: --brk block; overflow: hidden; pointer-events: none; }
.sketch-break svg { display: block; width: 100%; max-width: 1600px; height: clamp(130px, 16vw, 250px); margin: 0 auto; fill: none; stroke: var(--ash); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sketch-break path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.sketch-break .glow { stroke: var(--ember); filter: drop-shadow(0 0 1.6px rgba(242,102,27,.85)); }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .sketch-break path { animation: brk-draw linear both; animation-timeline: --brk; animation-range: cover calc(6% + var(--i) * 2.4%) cover calc(22% + var(--i) * 2.4%); }
    @keyframes brk-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  }
}
