/* =========================================================
   Til I Do — scrapbook edges, calm centre
   Headlines: Newsreader Light (free stand-in for Joy's Austin News Deck)
   Body: Inter
   ========================================================= */

:root {
  --ink: #141414;
  --paper: #FFFFFF;
  --bg: #FFFFFF;
  --grey: #5E5E5E;
  --blush: #F4C4CF;
  --rose: #C8436F;
  --rose-deep: #A8325A;

  --serif: "Newsreader", "Austin News Deck", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: none; }
[hidden] { display: none !important; }
h1, p, figure { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
::selection { background: var(--blush); color: var(--ink); }

/* ---------- One screen ---------- */
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* =========================================================
   Scrapbook: four taped clusters (photo on stacked paper,
   sellotape, a keepsake and a doodle) plus a few loose bits.
   Inside a cluster every piece is placed in % of the cluster,
   so a cluster scales as one unit.
   ========================================================= */
.scraps { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

.cl {
  position: absolute;
  aspect-ratio: var(--ar);
  animation:
    scrap-in .9s var(--spring) backwards var(--d, .2s),
    float var(--fd, 11s) ease-in-out calc(var(--d, .2s) + 1s) infinite alternate;
}
.cl--b { --fd: 13s; --fy: 7px; }
.cl--c { --fd: 12s; --fy: -8px; }
.cl--d { --fd: 14s; }

/* keepsakes drift a little on their own, out of step with their cluster */
.cl > .f {
  filter: drop-shadow(0 6px 9px rgb(0 0 0 / .2));
  animation: drift-sm var(--kd, 8s) ease-in-out infinite alternate;
}
.cl > .f:nth-child(2n)   { --kd: 9.5s;  animation-delay: -3s; --kx: -4px; }
.cl > .f:nth-child(3n)   { --kd: 7s;    animation-delay: -5s; --ky: 6px; }
.cl > .f:nth-child(5n)   { --kd: 10.5s; animation-delay: -1.5s; }
.cl > img { position: absolute; height: auto; transform: rotate(var(--r, 0deg)); }
.cl > .p { filter: drop-shadow(0 2px 3px rgb(0 0 0 / .12)); }
.cl > .o { filter: drop-shadow(0 6px 9px rgb(0 0 0 / .2)); }
.cl > .t { filter: drop-shadow(0 1px 1px rgb(0 0 0 / .08)); }
.cl > .d { opacity: .9; }

.s {
  position: absolute;
  height: auto;
  transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 5px 7px rgb(0 0 0 / .16));
  animation:
    scrap-in .9s var(--spring) backwards var(--d, .2s),
    drift-sm var(--kd, 9s) ease-in-out calc(var(--d, .2s) + 1s) infinite alternate;
}
.s:nth-of-type(2n) { --kd: 11s; --kx: -3px; }
.s:nth-of-type(3n) { --kd: 8s; --ky: 5px; }
.s.petal { filter: drop-shadow(0 3px 4px rgb(0 0 0 / .12)); animation: scrap-in .9s var(--spring) backwards var(--d, .2s), drift 9s ease-in-out 1.6s infinite alternate; }
.s.d { display: none; }

/* phones: two clusters up top, two along the bottom */
.cl--a { left: -5vw;  top: -1svh;   width: min(53vw, 25svh); }
.cl--c { right: -4vw; top: .5svh;   width: min(50vw, 24svh); }
.cl--b { left: -6vw;  bottom: -4svh; width: min(56vw, 27svh); }
.cl--d { right: -5vw; bottom: -4svh; width: min(50vw, 25svh); }


/* =========================================================
   Centre
   ========================================================= */
.center {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 28svh 24px 21svh;
  text-align: center;
}

.logo {
  font: 400 1.5rem/1 var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -.01em;
  animation: rise .8s var(--ease) backwards;
}
.logo em { font-style: italic; color: var(--rose); }

h1 {
  margin: clamp(14px, 2.6svh, 24px) auto 0;
  font-family: var(--serif);
  font-weight: 300;
  font-optical-sizing: auto;
  font-size: clamp(1.85rem, min(8.4vw, 4.6svh), 2.6rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  text-wrap: balance;
  animation: rise .9s var(--ease) .08s backwards;
}
h1 em { display: block; font-style: italic; color: var(--rose); }

.deck {
  margin: .8rem auto 0;
  max-width: 32ch;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--grey);
  text-wrap: balance;
  animation: rise .9s var(--ease) .16s backwards;
}

/* sign-up */
.signup {
  margin: clamp(16px, 2.8svh, 26px) auto 0;
  max-width: 440px;
  animation: rise .9s var(--ease) .24s backwards;
}
.signup__row {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid #D6D6D6;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 8px 24px -14px rgb(0 0 0 / .3);
  transition: border-color .2s, box-shadow .3s var(--ease);
}
.signup__row:focus-within { border-color: var(--ink); box-shadow: 0 10px 28px -14px rgb(0 0 0 / .4); }
.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  background: transparent;
  padding: 0 .4rem 0 1.1rem;
  font-size: 1rem;
  outline: none;
}
.signup input::placeholder { color: #9A9A9A; opacity: 1; }
.signup__btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0 1.4rem;
  background: var(--ink);
  color: var(--paper);
  font: 600 .95rem/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.signup__btn:hover { background: var(--rose); }
.signup__btn:active { transform: scale(.97); }

.signup__fine {
  margin-top: .8rem;
  font-size: .82rem;
  color: var(--grey);
  text-wrap: balance;
}
.signup__status:empty { display: none; }
.signup__status { margin-top: .4rem; font-size: .85rem; font-weight: 500; color: var(--rose-deep); }
.signup.is-error .signup__row { border-color: var(--rose); animation: shake .45s; }
.signup.is-loading .signup__btn { opacity: .6; pointer-events: none; }

.signup__done { display: none; outline: none; }
.signup.is-done .signup__row,
.signup.is-done .signup__fine { display: none; }
.signup.is-done .signup__done {
  display: block;
  padding: .9rem 1.2rem 1rem;
  border-radius: 20px;
  background: #FDF1F4;
  animation: rise .6s var(--ease);
}
.signup__done-title { font: 400 1.6rem/1.1 var(--serif); margin-bottom: .2rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* short phones (iPhone SE etc.) */
@media (max-height: 700px) and (max-width: 899px) {
  .center { padding: 25svh 20px 18svh; }
  .deck { margin-top: .6rem; font-size: .9rem; }
  .signup__fine { margin-top: .6rem; }
  .cl--b { width: min(52vw, 24svh); bottom: -5svh; }
  .cl--d { width: min(46vw, 22svh); bottom: -5svh; }
}

/* =========================================================
   Laptops: scrapbook down both sides
   ========================================================= */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .s.d { display: block; }

  .cl--a { left: -1vw; top: -2svh;    width: min(33vw, 54svh); }
  .cl--b { left: 0;    bottom: -3svh; width: min(30vw, 46svh); }
  .cl--c { right: 0;   top: 0;        width: min(31vw, 50svh); }
  .cl--d { right: 0;   bottom: -4svh; width: min(28vw, 44svh); }

  .camera  { left: 35vw;  top: 4svh;    width: 9vw;  --r: -8deg; }
  .matches { right: 34vw; top: 5svh;    width: 4.6vw; --r: 12deg; }
  .heels   { left: 34vw;  bottom: -3svh; width: 6.5vw; --r: -10deg; }
  .spool   { left: 43vw;  bottom: 3svh;  width: 12vw; --r: 3deg; }
  .amalfi  { left: 55vw;  bottom: -1svh; width: 9vw;  --r: -5deg; }
  .bust    { left: 46vw;  top: 2svh;    width: 7.5vw; --r: 4deg; }
  .pressed { right: 28vw; bottom: 20svh; width: 4.5vw; --r: 14deg; }


  .center { max-width: none; width: min(46vw, 680px); padding: 0; }
  .logo { font-size: 2rem; }
  h1 {
    margin-top: clamp(20px, 4svh, 40px);
    font-size: clamp(2.6rem, min(3.9vw, 7.2svh), 4.4rem);
    line-height: 1.02;
  }
  .deck { max-width: 38ch; margin-top: clamp(14px, 2.4svh, 22px); font-size: clamp(1rem, .8rem + .3vw, 1.15rem); }
  .signup { margin-top: clamp(22px, 4svh, 36px); }
  .signup input[type="email"] { height: 50px; }
}

/* ---------- Confetti ---------- */
.confetti { position: fixed; z-index: 100; width: 7px; height: 12px; pointer-events: none; }

/* ---------- Keyframes ---------- */
@keyframes scrap-in { from { opacity: 0; transform: translateY(24px) rotate(calc(var(--r, 0deg) - 8deg)) scale(.9); } }
@keyframes paper-in { from { opacity: 0; transform: rotate(var(--r, 0deg)) scale(1.04); } }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -6px; } }
@keyframes drift { from { translate: 0 0; } to { translate: 6px -10px; } }
/* slow, small and out of phase: reads as paper in a light breeze, not a bounce */
@keyframes float {
  0%   { translate: 0 0; rotate: 0deg; }
  50%  { translate: 2px calc(var(--fy, -6px) * .6); rotate: .4deg; }
  100% { translate: -2px var(--fy, -6px); rotate: -.3deg; }
}
@keyframes drift-sm {
  from { translate: 0 0; rotate: 0deg; }
  to   { translate: var(--kx, 3px) var(--ky, -5px); rotate: 1.2deg; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
