/* Sammy & Kade wedding website: shared styles for every page.
   Cream paper, brown line ink, spaced serif caps (matches the Classic save the date). */
:root {
  --paper: #F9E9D9;   /* matches the cartwheel artwork background */
  --paper-deep: #F1DCC6;
  --ink: #4E3726;
  --soft: #8A6A50;
  --line: rgba(138, 106, 80, .55);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--paper); }
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif; font-variant-numeric: lining-nums;
  font-size: 19px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* Header + navigation. Add a new page by adding one <a> to .nav on each page. */
.site-header { padding: 22px 16px 0; text-align: center; }
.monogram { font-weight: 500; font-size: 14px; letter-spacing: .42em; padding-left: .42em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; margin-top: 14px;
  padding: 10px 0; border-top: .5px solid var(--line); border-bottom: .5px solid var(--line);
  max-width: 560px; margin-left: auto; margin-right: auto; }
.nav a { font-weight: 500; font-size: 12px; letter-spacing: .32em; padding-left: .32em; text-decoration: none; color: var(--soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: .5px; }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Framed panel, echoing the double border on the card */
.panel { position: relative; margin: 32px auto 0; padding: 56px 40px 48px; text-align: center; border: .7px solid var(--soft); }
.panel::after { content: ''; position: absolute; inset: 5px; border: .5px solid var(--soft); opacity: .5; pointer-events: none; }
@media (max-width: 560px) { .panel { padding: 40px 18px 36px; margin-top: 20px; } }

.eyebrow { font-weight: 500; font-size: 14px; letter-spacing: .42em; padding-left: .42em; }
.rule { width: 34px; border-top: .7px solid var(--soft); margin: 14px auto; }
.art { width: 100%; max-width: 560px; margin: 8px auto 0; }
.date { margin-top: 18px; font-weight: 300; font-size: clamp(34px, 7vw, 52px); line-height: 1.15; letter-spacing: .06em; }
.label { font-weight: 500; font-size: 11px; letter-spacing: .38em; padding-left: .38em; color: var(--soft); }
.place { margin-top: 20px; font-weight: 500; font-size: clamp(12px, 2.6vw, 15px); letter-spacing: .32em; padding-left: .32em; }
.town { font-style: italic; font-size: 19px; color: var(--soft); margin-top: 2px; }
.tagline { margin-top: 30px; font-style: italic; font-size: 21px; line-height: 1.4; }
.follow { margin-top: 6px; font-style: italic; }
.tag { margin-top: 14px; font-weight: 500; font-size: 10px; letter-spacing: .45em; padding-left: .45em; color: var(--soft); }

/* Countdown */
.countdown { display: flex; justify-content: center; gap: clamp(18px, 6vw, 44px); margin-top: 34px; }
.countdown div { min-width: 56px; }
.countdown b { display: block; font-weight: 300; font-size: clamp(30px, 6vw, 40px); line-height: 1.1; }

/* Buttons */
.button { display: inline-block; margin-top: 30px; padding: 15px 52px; background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 14px; letter-spacing: .38em; padding-right: calc(52px - .38em); text-decoration: none;
  border-radius: 2px; transition: background .2s; }
.button:hover { background: #3a281b; }
.button.ghost { background: transparent; color: var(--ink); border: .7px solid var(--soft); }
.button.ghost:hover { background: var(--paper-deep); }

/* Text pages */
.intro { max-width: 520px; margin: 0 auto; }
.intro p + p { margin-top: 12px; }
.small { font-size: 16px; color: var(--soft); }

/* RSVP form: underlined fields and small spaced labels, in the save the date colours */
.rsvp { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 28px; margin: 36px auto 0; max-width: 580px; text-align: left; }
.rsvp .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .rsvp { grid-template-columns: 1fr; gap: 26px; } }
.field { min-width: 0; border: 0; }
.field[hidden] { display: none; }
.field > label, .field > legend { display: block; font-weight: 500; font-size: 11px; letter-spacing: .3em; color: var(--soft); margin-bottom: 6px; line-height: 1.5; }
.field input[type=text], .field textarea {
  width: 100%; padding: 6px 0 8px; background: transparent; border: 0; border-bottom: .8px solid var(--soft); border-radius: 0;
  font: inherit; font-size: 19px; color: var(--ink); resize: vertical; outline: none; transition: border-color .2s; }
.field textarea { line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--soft); opacity: .6; font-style: italic; }
.field input[type=text]:focus, .field textarea:focus { border-bottom: 1.4px solid var(--ink); }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.choices.days { flex-direction: row; flex-wrap: wrap; }
.choice { display: inline-flex; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 9px 18px; border: .7px solid var(--soft); border-radius: 999px; font-size: 18px; line-height: 1.2; transition: background .2s, color .2s; }
.choice:hover span { background: var(--paper-deep); }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.choice input:focus-visible + span, .button:focus-visible, .field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--soft); outline-offset: 3px; }
.actions { text-align: center; }
.actions .button { margin-top: 4px; border: 0; cursor: pointer; font-family: inherit; }
.button[disabled] { opacity: .6; cursor: wait; }
.form-error { grid-column: 1 / -1; text-align: center; font-style: italic; color: #9a3b22; }
.thanks { margin-top: 30px; outline: none; }
.thanks .tagline { margin-top: 0; font-size: 26px; }

.site-footer { padding: 40px 16px 30px; text-align: center; font-size: 11px; letter-spacing: .3em; color: var(--soft); }
.site-footer a { letter-spacing: .04em; font-size: 14px; }

/* Animated cartwheel artwork (landing page).
   Positions are the figures' places in the 1254 x 820 artwork, as percentages,
   so the layers line up at any screen size. */
.scene { position: relative; width: 100%; max-width: 560px; margin: 8px auto 0; aspect-ratio: 1254 / 820;
  cursor: pointer; -webkit-tap-highlight-color: transparent; }
.scene img { position: absolute; }
.scene > img:first-child { inset: 0; width: 100%; height: 100%; }
.figure { transform-origin: 50% 55%; z-index: 2; }
.sammy { left: 24.80%; top: 30.98%; width: 21.45%; }
.kade  { left: 51.44%; top: 32.07%; width: 22.01%; }

@media (prefers-reduced-motion: no-preference) {
  .sammy { animation: roll-from-left 3s cubic-bezier(.25,.75,.3,1) .4s both; }
  .kade  { animation: roll-from-right 3s cubic-bezier(.25,.75,.3,1) .55s both; }
  .scene.play .sammy { animation-name: roll-from-left-again; }
  .scene.play .kade  { animation-name: roll-from-right-again; }
}
/* Sammy rolls in from the left turning clockwise, Kade from the right turning anticlockwise,
   two full turns each, landing in their pose from the save the date. */
@keyframes roll-from-left  { from { transform: translateX(-100vw) rotate(-1080deg); } to { transform: none; } }
@keyframes roll-from-right { from { transform: translateX(100vw) rotate(1080deg); } to { transform: none; } }
/* identical copies so a tap can restart the animation */
@keyframes roll-from-left-again  { from { transform: translateX(-100vw) rotate(-1080deg); } to { transform: none; } }
@keyframes roll-from-right-again { from { transform: translateX(100vw) rotate(1080deg); } to { transform: none; } }

/* Aeroplane whizzing across the top of the RSVP page */
.panel.has-sky { padding-top: 90px; }
@media (max-width: 560px) { .panel.has-sky { padding-top: 84px; } }
.sky { position: absolute; top: 8px; left: calc(50% - 50vw); width: 100vw; height: 74px; pointer-events: none; z-index: 3; }
.plane { position: absolute; top: 18px; left: 0; transform: translateX(-300px); display: flex; align-items: center; color: var(--ink); }
.plane svg { width: 84px; height: auto; flex: none; }
.trail { width: 170px; margin-right: -4px; margin-top: 4px; border-top: 1.2px dashed var(--soft);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 70%); mask-image: linear-gradient(to right, transparent, #000 70%); }
@media (prefers-reduced-motion: no-preference) {
  .plane { animation: whizz 3.8s linear .4s both; /* steady speed all the way across */ }
  .sky.again .plane { animation-name: whizz-again; animation-delay: 0s; }
}
@keyframes whizz {
  0%   { transform: translate(-300px, 24px) rotate(-6deg); }
  25%  { transform: translate(calc(25vw - 225px), 8px) rotate(-3deg); }
  50%  { transform: translate(calc(50vw - 150px), -2px) rotate(0deg); }
  75%  { transform: translate(calc(75vw - 75px), -8px) rotate(-2deg); }
  100% { transform: translate(100vw, -16px) rotate(-5deg); }
}
@keyframes whizz-again {
  0%   { transform: translate(-300px, 24px) rotate(-6deg); }
  25%  { transform: translate(calc(25vw - 225px), 8px) rotate(-3deg); }
  50%  { transform: translate(calc(50vw - 150px), -2px) rotate(0deg); }
  75%  { transform: translate(calc(75vw - 75px), -8px) rotate(-2deg); }
  100% { transform: translate(100vw, -16px) rotate(-5deg); }
}
