/* TUNTUNRE — ROAD TO 50 · upcycled denim, made by hand */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --black: #121212;
  --white: #ffffff;
  --cotton: #f6f3ec;          /* unbleached cotton */
  --denim: #2c4a74;
  --denim-deep: #1c2f4d;
  --thread: #efe6d2;          /* cream topstitch thread */
  --chalk: #cfc6b4;           /* tailor's chalk */
  --grey: #6f6b64;
  --line: #e3ddd0;
  --pad: clamp(22px, 5.5vw, 96px);
  --section: clamp(88px, 12vw, 180px);
  --ease: cubic-bezier(0.25, 1, 0.3, 1);
  --denim-dark: url("/assets/denim-dark.jpg");
  --denim-mid: url("/assets/denim-mid.jpg");
  --denim-light: url("/assets/denim-light.jpg");
  --twill: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  color: var(--black);
  background: var(--cotton);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
em { font-style: italic; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--black); color: var(--white); padding: 8px 12px; }
:focus-visible { outline: 1px dashed var(--denim); outline-offset: 4px; }

/* ---------- TYPE ---------- */
.kicker { font-size: 13px; font-style: italic; color: var(--grey); margin-bottom: 18px; }
.h2 {
  font-size: clamp(44px, 6.5vw, 104px);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1;
}
.h2 em { color: var(--denim); }
.body { font-size: clamp(16px, 1.25vw, 18px); font-weight: 300; max-width: 44ch; color: #3a3833; margin-top: 28px; }
.label { font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.label--muted { color: var(--grey); }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--pad);
  background: rgba(246, 243, 236, 0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.5s;
}
.nav.is-scrolled { border-color: var(--line); }
.wordmark { font-weight: 600; letter-spacing: 0.38em; font-size: 14px; text-decoration: none; }
.wordmark--sm { font-size: 12px; }
.nav__meta { font-size: 13px; font-style: italic; color: var(--grey); }
.nav__actions { justify-self: end; display: flex; align-items: center; gap: 24px; }
.nav__link { font-size: 13px; text-decoration: none; }
.nav__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav__btn {
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  padding: 10px 18px; background: var(--black); color: var(--white); border-radius: 999px;
  transition: background 0.4s;
}
.nav__btn:hover { background: var(--denim); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--black); background: transparent; border-radius: 999px;
  padding: 16px 28px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn:hover { background: var(--black); color: var(--white); }
.btn--dark { background: var(--black); color: var(--white); }
.btn--dark:hover { background: var(--denim); border-color: var(--denim); }
.text-link {
  background: none; border: 0; padding: 0;
  font-size: 14px; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; cursor: pointer;
}
.text-link:hover { color: var(--denim); }

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 104px);
  align-items: center;
  padding: clamp(24px, 4vw, 56px) var(--pad) var(--section);
}
.hero__photo {
  position: relative;
  background: var(--white);
  padding: 12px;
  box-shadow: 0 30px 60px -30px rgba(60, 50, 30, 0.25);
}
.hero__photo::after { /* topstitch frame */
  content: ""; position: absolute; inset: 5px; border: 1.5px dashed var(--chalk); pointer-events: none;
}
.hero__photo img { display: block; width: 100%; height: auto; max-height: 82svh; object-fit: cover; object-position: 50% 30%; }
.hero__text { display: flex; flex-direction: column; justify-content: center; max-width: 620px; }
.hero__title {
  font-size: clamp(60px, 8vw, 136px);
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-left: -0.03em;
}
.letter { margin: 36px 0 40px; display: flex; flex-direction: column; gap: 18px; font-size: clamp(17px, 1.45vw, 21px); font-weight: 300; line-height: 1.6; color: #2f2d29; max-width: 40ch; }
.letter strong { font-weight: 500; color: var(--black); }
.hl { font-style: italic; color: var(--denim); font-weight: 400; white-space: nowrap; }
.sign { font-style: italic; font-size: clamp(20px, 1.8vw, 26px); color: var(--black); margin-top: 4px; }
.hero__ctas { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

/* leather patch with the live count, stitched onto the photo */
.patch {
  position: absolute; right: -18px; bottom: 56px;
  width: clamp(124px, 12vw, 168px); aspect-ratio: 1.15;
  transform: rotate(-4deg);
  background: radial-gradient(120% 80% at 30% 20%, rgba(255, 255, 255, 0.08), transparent 60%), #1a1714;
  color: var(--thread);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.patch::before { content: ""; position: absolute; inset: 6px; border: 1.5px dashed rgba(239, 230, 210, 0.6); }
.patch__brand { font-size: 9px; letter-spacing: 0.34em; font-weight: 600; }
.patch__num { font-size: clamp(42px, 4vw, 60px); font-weight: 300; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.patch__of { font-size: 11px; font-style: italic; opacity: 0.8; }

/* ---------- PATCHWORK ---------- */
.patchwork { padding: var(--section) var(--pad); background: var(--white); }
.patchwork__head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.patchwork__intro { display: flex; flex-direction: column; gap: 16px; font-weight: 300; font-size: 17px; max-width: 46ch; justify-self: end; }
.tally { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.tally__num { font-size: clamp(64px, 7vw, 112px); font-weight: 300; letter-spacing: -0.05em; line-height: 1; color: var(--denim); font-variant-numeric: tabular-nums; }
.tally__txt { font-size: 15px; color: var(--grey); }
.status { font-style: italic; font-size: 20px; letter-spacing: -0.01em; }

/* the quilt */
.quilt {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--cotton);
}
.sq {
  aspect-ratio: 1;
  position: relative;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: clamp(7px, 0.9vw, 14px);
  font-size: clamp(10px, 0.85vw, 12px);
  font-style: italic;
  color: #b4ab99;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  background: var(--cotton);
}
/* empty: a chalk outline waiting to be sewn */
.sq::after {
  content: ""; position: absolute; inset: 6px;
  border: 1.5px dashed var(--chalk);
  transition: border-color 0.8s;
}
/* the denim patch */
.sq::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--wash, var(--denim-mid));
  background-size: 320px;
  background-position: var(--bx, 0) var(--by, 0);
  opacity: 0;
  transform: scale(0.94) rotate(var(--r, 0deg));
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
  transition-delay: var(--d, 0s);
}
.sq span { position: relative; z-index: 1; transition: color 1s var(--d, 0s); }
.sq.is-filled::before { opacity: 1; transform: none; }
.sq.is-filled::after { border-color: rgba(239, 230, 210, 0.75); }
.sq.is-filled span { color: var(--thread); }
.sq.is-next::after { border-color: var(--denim); }
.sq.is-next span { color: var(--denim); }
.sq.w-dark { --wash: var(--denim-dark); }
.sq.w-mid { --wash: var(--denim-mid); }
.sq.w-light { --wash: var(--denim-light); }

/* stitched seam progress */
.seam { margin-top: clamp(36px, 5vw, 56px); }
.seam__line { position: relative; height: 0; border-top: 2px dashed var(--chalk); }
.seam__done {
  position: absolute; left: 0; top: -2px; height: 0; width: 0%;
  border-top: 2px dashed var(--denim);
  transition: width 2s var(--ease);
}
.seam__done::after { /* the needle */
  content: ""; position: absolute; right: -1px; top: -9px; width: 2px; height: 14px; background: var(--black); transform: rotate(25deg);
}
.seam__labels { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; font-style: italic; color: var(--grey); }
.fineprint { margin-top: 18px; font-size: 13px; color: var(--grey); font-style: italic; min-height: 1em; }

/* ---------- RSVP + SWING TAG ---------- */
.rsvp {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(40px, 6vw, 96px); align-items: center;
  padding: var(--section) var(--pad);
}
.tag-wrap { position: relative; justify-self: center; padding-top: 64px; }
.tag-string {
  position: absolute; top: 0; left: 50%; width: 1.5px; height: 92px;
  background: repeating-linear-gradient(180deg, #9c8f78 0 3px, #b9ad96 3px 6px);
  transform: rotate(8deg); transform-origin: top;
}
.tag {
  position: relative;
  width: min(80vw, 300px);
  background: var(--white);
  padding: 72px 32px 34px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  clip-path: polygon(22% 0, 78% 0, 100% 12%, 100% 100%, 0 100%, 0 12%);
  transform: rotate(-3deg);
  filter: drop-shadow(0 14px 22px rgba(60, 50, 30, 0.14));
  animation: sway 7s ease-in-out infinite;
  transform-origin: 50% -40px;
}
@keyframes sway { 50% { transform: rotate(-1deg); } }
.tag::before { content: ""; position: absolute; inset: 10px; top: 14px; border: 1px dashed var(--line); clip-path: inherit; pointer-events: none; }
.tag__hole { position: absolute; top: 24px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--cotton); box-shadow: inset 0 0 0 3px #e9e2d3; }
.tag__brand { font-size: 10px; letter-spacing: 0.34em; font-weight: 600; }
.tag__big { font-size: 64px; font-weight: 300; letter-spacing: -0.05em; line-height: 1.05; color: var(--denim); margin: 6px 0 4px; }
.tag__line { font-size: 14px; font-style: italic; color: var(--grey); }
.tag__btn { margin-top: 22px; width: 100%; }

/* ---------- MANIFESTO ---------- */
.manifesto {
  background: var(--denim-mid) center / 380px;
  color: var(--white);
  padding: var(--section) var(--pad);
  position: relative;
}
.manifesto::before { content: ""; position: absolute; inset: 14px; border: 1.5px dashed rgba(239, 230, 210, 0.45); pointer-events: none; }
.manifesto__title {
  font-size: clamp(52px, 9vw, 150px); font-weight: 300; letter-spacing: -0.05em; line-height: 1;
  margin-bottom: clamp(64px, 8vw, 120px);
}
.manifesto__title em { color: var(--thread); }
.manifesto__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 5vw, 72px); }
.manifesto__cols > div { border-top: 1.5px dashed rgba(239, 230, 210, 0.55); padding-top: 22px; }
.manifesto__cols h3 { font-size: 20px; font-weight: 400; font-style: italic; margin-bottom: 10px; color: var(--thread); }
.manifesto__cols p { color: rgba(255, 255, 255, 0.82); font-weight: 300; max-width: 34ch; }

/* ---------- EVENT ---------- */
.event { padding: var(--section) var(--pad); }
.event__title { font-size: clamp(60px, 11vw, 190px); font-weight: 300; letter-spacing: -0.055em; line-height: 0.95; margin-bottom: clamp(48px, 6vw, 88px); }
.event__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.event__facts > div { border-top: 1.5px dashed var(--chalk); padding-top: 18px; }
.event__facts dt { font-size: 13px; font-style: italic; color: var(--grey); margin-bottom: 6px; }
.event__facts dd { font-size: clamp(18px, 1.6vw, 22px); font-weight: 300; }
.event__ctas { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: clamp(44px, 5vw, 72px); }

/* ---------- SHARE ---------- */
.share {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(48px, 7vw, 120px); align-items: center;
  padding: var(--section) var(--pad); background: var(--white);
}
.share__actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.share__links { display: flex; gap: 24px; margin-top: 28px; flex-wrap: wrap; }
.share__links a { font-size: 14px; color: var(--grey); text-decoration: none; cursor: pointer; }
.share__links a:hover { color: var(--black); text-decoration: underline; text-underline-offset: 4px; }
.qr { justify-self: end; text-align: center; width: min(100%, 300px); }
.qr__frame { padding: 26px; background: var(--white); position: relative; }
.qr__frame::before { content: ""; position: absolute; inset: 0; border: 1.5px dashed var(--chalk); }
.qr__code svg { display: block; width: 100%; height: auto; }
.qr figcaption { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.qr__url { font-size: 13px; color: var(--grey); font-style: italic; word-break: break-all; }

/* ---------- FOOTER ---------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 32px var(--pad) calc(32px + env(safe-area-inset-bottom));
  font-size: 13px; color: var(--grey);
  border-top: 1.5px dashed var(--chalk);
}
.footer .wordmark { color: var(--black); }
.footer__tag { font-style: italic; }

/* ---------- TOAST + CONFETTI ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: var(--white); color: var(--black);
  padding: 14px 24px; font-size: 14px; font-style: italic; border-radius: 999px;
  box-shadow: 0 12px 40px rgba(60, 50, 30, 0.12);
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; width: 100%; height: 100%; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__meta { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero__photo { max-width: 560px; }
  .hero__photo img { max-height: 70svh; }
  .patchwork__head, .rsvp, .share { grid-template-columns: 1fr; }
  .patchwork__intro { justify-self: start; }
  .manifesto__cols, .event__facts { grid-template-columns: 1fr; }
  .qr { justify-self: start; }
  .tag-wrap { justify-self: center; }
}
@media (max-width: 560px) {
  .nav__link { display: none; }
  .hero__title { font-size: 17vw; }
  .patch { right: -8px; bottom: 28px; width: 118px; }
  .quilt { grid-template-columns: repeat(5, 1fr); }
  .sq { font-size: 11px; }
  .hero__ctas .btn, .event__ctas .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
