/* Self-hosted fonts (from @fontsource, OFL-1.1), like sudev.cz: no third-party requests.
   latin + latin-ext subsets cover Czech. */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext-400-normal-W4wTykz.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-400-normal-UaRjChW.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext-500-normal-g4T8njv.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-500-normal-vzQeC3q.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext-600-normal-pKGEzK2.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-600-normal-958umbo.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext-700-normal-QbNPQ2q.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal-SNsywT4.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-mono-latin-ext-400-normal-vLJF9cz.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-mono-latin-400-normal-xm00kPj.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-mono-latin-ext-700-normal-n7qapca.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-mono-latin-700-normal-z51TX-8.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

/* Layout: full-bleed woven hero canvas, then a 1040px column (like sudev.cz) with info, time card and factory footer.
   Deliberately a single dark look: the party happens after dark. */
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --ink: #f4f4f4;
  --muted: #9a9ea4;
  --hair: #2a2e33;
  --blue: #5cb8f5;
  --orange: #ff6b1a;
  --paper: #e9edf0;
  --paper-ink: #101418;
  --print: #0b6cb3;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1040px;
  --beat: 0.4839s; /* 124 BPM */
  --pulse: 0;
}

html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 17px; line-height: 1.55; overflow-x: hidden; }
a { color: inherit; text-decoration-color: var(--orange); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Hero ---------- */
.hero { position: relative; height: clamp(400px, 76vh, 880px); }
.hero canvas { display: block; width: 100%; height: 100%; }
.topbar {
  position: absolute; inset: 0 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-top: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
  z-index: 2;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
  background: var(--bg); padding: 4px 8px; border: 1px solid var(--hair);
}
.clock {
  font-family: var(--mono); text-align: right;
  background: var(--bg); padding: 4px 8px; border: 1px solid var(--hair);
}
.clock__label { display: block; font-size: 10px; letter-spacing: 0.14em; color: var(--muted); }
.clock__value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock__colon { opacity: calc(0.35 + var(--pulse) * 0.65); color: var(--orange); }

/* ---------- Info ---------- */
.info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
.info__item { padding-block: 34px 38px; padding-right: 24px; border-right: 1px solid var(--hair); display: grid; gap: 10px; align-content: start; }
.info__item + .info__item { padding-left: 24px; }
.info__item:last-child { border-right: 0; }
.info__big { margin: 0; font-weight: 700; font-size: clamp(26px, 3.4vw, 38px); line-height: 1; letter-spacing: -0.035em; text-transform: uppercase; text-wrap: balance; }
.info__small { margin: 0; color: var(--muted); font-size: 16px; text-wrap: pretty; }
.info__small strong { color: var(--ink); font-weight: 500; }

/* Twill band: a woven 2/2 twill that steps one thread per beat */
.twill {
  height: 26px;
  background:
    repeating-linear-gradient(45deg, var(--blue) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(-45deg, var(--hair) 0 6px, var(--bg) 6px 12px);
  background-size: 17px 17px, 17px 17px;
  animation: twill calc(var(--beat) * 8) steps(8) infinite;
  border-block: 1px solid var(--hair);
}
@keyframes twill { to { background-position: 136px 0, 0 0; } }

/* ---------- RSVP ---------- */
.rsvp { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; padding-block: 72px 80px; align-items: start; }
.rsvp__head { display: grid; gap: 18px; position: sticky; top: 24px; }
.rsvp__title {
  margin: 0; font-family: var(--mono); font-weight: 700; text-transform: uppercase;
  font-size: clamp(44px, 7vw, 84px); line-height: 0.92; letter-spacing: -0.05em;
}
.rsvp__title span { color: var(--orange); }
.lede { margin: 0; color: var(--muted); max-width: 40ch; text-wrap: pretty; }
.contact { margin: 0; font-size: 15px; color: var(--muted); }
.contact a { color: var(--ink); white-space: nowrap; }
.note { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.card {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 18px 22px 26px;
  display: grid; gap: 18px;
  box-shadow: 0 0 0 1px #c9d0d6 inset, 0 30px 80px -30px rgba(92, 184, 245, 0.35);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); /* clipped corner, like a real time card */
  transition: transform 0.25s cubic-bezier(.2,1.6,.4,1);
}
.card.is-clunk { transform: translateY(6px); }
.card__meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--print); border-bottom: 1px solid var(--print); padding-bottom: 8px; }

.holes { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px 3px; }
.hole { position: relative; aspect-ratio: 1 / 1.5; max-width: 100%; border: 1px dashed rgba(11, 108, 179, 0.45); border-radius: 2px; }
.hole.is-marked { border: 1.5px solid var(--orange); background: rgba(255, 107, 26, 0.12); }
.hole.is-punched { border: 0; background: var(--bg); box-shadow: inset 0 2px 2px rgba(0,0,0,0.6); }
.chad { position: absolute; inset: 0; background: var(--paper); border-radius: 2px; animation: chad 0.7s ease-in forwards; pointer-events: none; }
@keyframes chad { to { transform: translate(var(--dx), 70px) rotate(var(--rot)); opacity: 0; } }

.card__body { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
.field__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--print); padding: 0; }
.field__label small { font-size: inherit; opacity: 0.75; text-transform: none; letter-spacing: 0.02em; }
.field input {
  font: 500 24px/1.2 var(--sans); letter-spacing: -0.02em;
  color: var(--paper-ink); background: transparent;
  border: 0; border-bottom: 2px solid var(--paper-ink); padding: 6px 0; border-radius: 0; width: 100%;
}
.field input::placeholder { color: #8d969e; }
.field input:focus-visible { outline: none; border-bottom-color: var(--orange); }
.field__error { margin: -12px 0 0; color: #c2410c; font-size: 14px; font-weight: 500; }

.choice { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice legend { margin-bottom: 6px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label {
  display: block; text-align: center; cursor: pointer;
  font: 700 clamp(18px, 3vw, 24px)/1 var(--mono); text-transform: uppercase; letter-spacing: -0.03em;
  padding: 16px 8px; border: 2px solid var(--paper-ink);
}
.choice input:checked + label { background: var(--paper-ink); color: var(--paper); }
.choice input:focus-visible + label { outline: 2px solid var(--orange); outline-offset: 3px; }

.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stepper { display: grid; gap: 6px; align-content: end; }
.stepper__ctl { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; border: 2px solid var(--paper-ink); }
.stepper__ctl button {
  height: 44px; border: 0; background: transparent; color: var(--paper-ink);
  font: 700 20px/1 var(--mono); cursor: pointer;
}
.stepper__ctl button:hover { background: rgba(16,20,24,0.08); }
.stepper__ctl button:disabled { opacity: 0.25; cursor: default; }
.stepper__ctl output { text-align: center; font: 700 26px/1 var(--mono); font-variant-numeric: tabular-nums; }

.punch {
  justify-self: start; display: inline-flex; gap: 14px; align-items: center;
  font: 700 22px/1 var(--mono); text-transform: uppercase; letter-spacing: -0.02em;
  color: var(--paper-ink); background: var(--orange); border: 0; padding: 18px 26px; cursor: pointer;
  box-shadow: 4px 4px 0 var(--paper-ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.punch:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--paper-ink); }
.punch:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--paper-ink); }
.punch:disabled { opacity: 0.5; cursor: progress; }

.stamp {
  position: absolute; right: 18px; bottom: 26px;
  transform: rotate(-7deg);
  border: 3px solid var(--orange); color: var(--orange);
  font: 700 13px/1.35 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 12px; text-align: center; mix-blend-mode: multiply;
  animation: stamp 0.22s cubic-bezier(.2,1.8,.4,1);
}
.stamp strong { display: block; font-size: 24px; letter-spacing: -0.02em; }
@keyframes stamp { from { transform: rotate(-7deg) scale(1.8); opacity: 0; } }

.done { display: grid; gap: 12px; border-left: 3px solid var(--orange); padding: 4px 0 4px 18px; }
.done__title { margin: 0; font-family: var(--mono); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: -0.02em; }
.done p { margin: 0; text-wrap: pretty; }
.done__again { justify-self: start; font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); background: transparent; border: 1px solid var(--ink); padding: 10px 14px; cursor: pointer; }
.rsvp__side { display: grid; gap: 22px; min-width: 0; }

/* ---------- Footer / factory ---------- */
.factory { position: relative; border-top: 1px solid var(--hair); }
.factory canvas { display: block; width: 100%; height: 190px; }
.foot { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 18px 28px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Errors from the server, shown on the card */
.card__error { margin: 0; color: #c2410c; font-size: 15px; font-weight: 500; }

/* Honeypot: invisible to people, still in the DOM for bots */
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 860px) {
  .rsvp { grid-template-columns: 1fr; gap: 32px; padding-block: 56px 64px; }
  .rsvp__head { position: static; }
}
@media (max-width: 640px) {
  .info { grid-template-columns: 1fr; }
  .info__item, .info__item + .info__item { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--hair); }
  .info__item:last-child { border-bottom: 0; }
  .counts { grid-template-columns: 1fr; }
  .stepper__ctl { grid-template-columns: 48px 1fr 48px; }
  .card { padding: 14px 14px 22px; }
  .holes { gap: 3px 2px; }
  .stamp { position: static; justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
