@charset "utf-8";

/* ==========================================================================
   IP NATIONAL DAY 2026 — "IP and Sports"
   Design system. Palette, typography and rhythm are lifted directly from the
   Save-the-Date poster: burgundy #8A2432, signal red #BD1F24, charcoal
   #58585B on a near-white field.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand — measured off the poster artwork */
  --burgundy:      oklch(0.4271 0.1364 17.61);   /* #8A2432 */
  --burgundy-deep: oklch(0.3450 0.1190 17.61);
  --burgundy-dark: oklch(0.2720 0.0930 17.61);
  --burgundy-lift: oklch(0.4900 0.1480 17.61);
  --red:           oklch(0.5155 0.1916 26.08);   /* #BD1F24 */
  --red-bright:    oklch(0.5750 0.2080 27.50);
  --cedar:         oklch(0.4200 0.1020 150.00);  /* Lebanese flag green */

  /* Ink — neutrals carry a whisper of the brand hue, never a warm cream cast */
  --ink:      oklch(0.2200 0.0060 17.61);
  --ink-2:    oklch(0.3600 0.0060 17.61);
  --muted:    oklch(0.4614 0.0050 17.61);        /* 6.86:1 on panel */
  --bg:       oklch(0.9760 0.0030 17.61);
  --panel:    oklch(0.9950 0.0015 17.61);
  --surface:  oklch(1 0 0);
  --field:    oklch(0.9835 0.0035 17.61);
  --line:     oklch(0.9060 0.0055 17.61);
  --line-soft:oklch(0.9430 0.0040 17.61);

  /* On-burgundy ink — verified ≥4.5:1 against --burgundy */
  --on-burgundy:       oklch(1 0 0);
  --on-burgundy-soft:  oklch(0.9080 0.0250 17.61);   /* 7.3:1 */
  --on-burgundy-muted: oklch(0.8080 0.0430 17.61);   /* 4.8:1 */
  --on-burgundy-rule:  oklch(1 0 0 / 0.18);

  /* State */
  --danger:   oklch(0.5155 0.1916 26.08);
  --danger-bg:oklch(0.9640 0.0210 26.08);
  --success:  oklch(0.4900 0.1100 155.00);
  --success-bg:oklch(0.9640 0.0290 155.00);

  /* Type */
  --font: "Archivo", "Archivo Fallback", -apple-system, BlinkMacSystemFont,
          "Segoe UI", system-ui, sans-serif;

  /* Fluid scale — 1.25 ratio minimum between steps */
  --t-xs:   clamp(0.6875rem, 0.66rem + 0.13vw, 0.75rem);
  --t-sm:   clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --t-base: clamp(0.9375rem, 0.91rem + 0.14vw, 1rem);
  --t-md:   clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem);
  --t-lg:   clamp(1.375rem, 1.28rem + 0.48vw, 1.75rem);
  --t-xl:   clamp(1.875rem, 1.68rem + 0.98vw, 2.625rem);
  --t-2xl:  clamp(2.5rem, 2.16rem + 1.70vw, 3.75rem);

  /* Space */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 2.75rem;  --s-8: 4rem;
  --gutter: clamp(1.25rem, 0.75rem + 2.4vw, 3.5rem);

  /* Form */
  --radius:    4px;
  --radius-lg: 8px;
  --control-h: 3.125rem;

  /* Elevation — burgundy-tinted shadows, never neutral gray */
  --shadow-sm: 0 1px 2px oklch(0.2720 0.0930 17.61 / 0.07);
  --shadow-md: 0 2px 4px oklch(0.2720 0.0930 17.61 / 0.06),
               0 8px 20px -6px oklch(0.2720 0.0930 17.61 / 0.10);
  --shadow-lg: 0 4px 10px oklch(0.2720 0.0930 17.61 / 0.10),
               0 24px 48px -12px oklch(0.2720 0.0930 17.61 / 0.22);
  --shadow-poster: 0 2px 6px oklch(0.2000 0.0600 17.61 / 0.28),
                   0 18px 40px -10px oklch(0.1600 0.0500 17.61 / 0.42),
                   0 48px 90px -30px oklch(0.1400 0.0400 17.61 / 0.50);

  /* Motion */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur:      240ms;
  --dur-slow: 560ms;

  /* Semantic stacking order */
  --z-rail: 10;
  --z-sticky: 20;
  --z-backdrop: 40;
  --z-modal: 50;
  --z-toast: 60;
}

/* Metric-matched fallback so the swap doesn't shift layout */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Segoe UI"), local("Helvetica Neue"), local("Arial");
  size-adjust: 97%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--t-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

input, button, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--burgundy); text-underline-offset: 3px; }

h1, h2, h3 { text-wrap: balance; line-height: 1.08; }

p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--s-2); left: var(--s-2);
  z-index: var(--z-toast);
  padding: var(--s-2) var(--s-4);
  background: var(--burgundy);
  color: var(--on-burgundy);
  font-weight: 600;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out-quart);
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   3. Type utilities — one family, committed weight + width contrast
   -------------------------------------------------------------------------- */

/* Condensed & heavy: the poster's "IP NATIONAL DAY" / "IP AND SPORTS" voice */
.display {
  font-weight: 800;
  font-stretch: 79%;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 0.94;
}

/* Wide & light: the poster's "OCTOBER 22, 2026" voice */
.datum {
  font-weight: 300;
  font-stretch: 118%;
  letter-spacing: 0.015em;
  font-variant-numeric: lining-nums tabular-nums;
}

.label {
  font-size: var(--t-xs);
  font-weight: 600;
  font-stretch: 104%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   4. Flag rail — the poster's top bar, rebuilt
   -------------------------------------------------------------------------- */

.rail {
  position: relative;
  z-index: var(--z-rail);
  display: flex;
  height: 6px;
  flex: 0 0 auto;
}
.rail span { display: block; height: 100%; }
.rail .rail-cedar  { width: 26px; background: var(--cedar); }
.rail .rail-burg   { width: 12px; background: var(--burgundy); }
.rail .rail-sweep  { flex: 1; background: linear-gradient(90deg, var(--burgundy) 0%, var(--red) 62%, var(--red-bright) 100%); }

/* --------------------------------------------------------------------------
   5. Split shell
   -------------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  min-height: calc(100dvh - 6px);
}

/* ---- 5a. Left: the poster stage ---- */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding: clamp(1.5rem, 1rem + 2vw, 3rem) var(--gutter);
  background:
    radial-gradient(120% 90% at 18% 8%, oklch(0.4900 0.1480 17.61) 0%, transparent 58%),
    linear-gradient(168deg, var(--burgundy) 0%, var(--burgundy-deep) 62%, var(--burgundy-dark) 100%);
  color: var(--on-burgundy);
  overflow: hidden;
  isolation: isolate;
}

/* The poster's diagonal speed streaks */
.stage::before {
  content: "";
  position: absolute;
  inset: -20% -40%;
  z-index: -2;
  background: repeating-linear-gradient(
    114deg,
    transparent 0 62px,
    oklch(1 0 0 / 0.045) 62px 66px,
    transparent 66px 96px,
    oklch(1 0 0 / 0.028) 96px 99px
  );
  transform: translate3d(0, 0, 0);
  pointer-events: none;
}

/* The poster's dot field */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(oklch(1 0 0 / 0.10) 1px, transparent 1.4px);
  background-size: 15px 15px;
  mask-image: radial-gradient(75% 60% at 78% 88%, #000 0%, transparent 72%);
  pointer-events: none;
}

.stage-head {
  --org-gap: 1.5rem;
  overflow: hidden;   /* clips the separator dot that lands at the start of a wrapped line */
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.045em;
  color: var(--on-burgundy-soft);
}
.orgs {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  row-gap: var(--s-2);
  margin-left: calc(-1 * var(--org-gap));
}
.orgs li {
  position: relative;
  padding-left: var(--org-gap);
}
.orgs li::before {
  content: "";
  position: absolute;
  left: calc(var(--org-gap) / 2 - 1.5px);
  top: calc(50% - 1.5px);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--on-burgundy-muted);
  opacity: 0.8;
}

.poster-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  position: relative;
}

/* Hugs the poster so the frame is exactly the image's size */
.poster-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.poster {
  position: relative;
  display: block;
  max-height: min(70dvh, 47.5rem);
  width: auto;
  max-width: 100%;
  border-radius: 2px;
  box-shadow: var(--shadow-poster);
  outline: 1px solid oklch(1 0 0 / 0.14);
  outline-offset: 0;
  transition: transform var(--dur-slow) var(--ease-out-expo),
              box-shadow var(--dur-slow) var(--ease-out-expo);
}

a.poster-link {
  display: block;
  line-height: 0;
  border-radius: 2px;
  max-height: 100%;
}
a.poster-link:hover .poster { transform: translateY(-4px) scale(1.006); }

/* Event meta strip along the stage floor */
.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-4) var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--on-burgundy-rule);
}
.meta dt {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-burgundy-muted);
  margin-bottom: var(--s-1);
}
.meta dd {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--on-burgundy);
  line-height: 1.45;
}

/* ---- 5b. Right: the registration panel ---- */

.panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-6);
  padding: clamp(2rem, 1.2rem + 3vw, 4.25rem) var(--gutter);
  background: var(--panel);
  position: relative;
}

/* Faint dot field, mirrored from the stage, to tie the halves together */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(oklch(0.4271 0.1364 17.61 / 0.09) 1px, transparent 1.4px);
  background-size: 17px 17px;
  mask-image: radial-gradient(70% 50% at 92% 4%, #000 0%, transparent 70%);
  pointer-events: none;
}

.panel > * { position: relative; }

.panel-inner {
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
}

.masthead { margin-bottom: var(--s-6); }

/* The date, in the poster's own expanded-light voice. One deliberate kicker. */
.masthead .kicker {
  display: block;
  font-size: var(--t-md);
  color: var(--muted);
  margin-bottom: var(--s-3);
}
.masthead .kicker .sep { color: var(--red); padding-inline: 0.15em; }

.masthead h1 {
  font-size: var(--t-xl);
  color: var(--burgundy);
  margin-bottom: var(--s-2);
}
.masthead h1 .edition {
  display: block;
  color: var(--ink);
  font-size: 0.74em;
  margin-top: 0.12em;
}

.masthead .tagline {
  font-size: var(--t-sm);
  font-weight: 600;
  font-stretch: 100%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

.masthead .hr {
  height: 2px;
  width: 100%;
  margin-top: var(--s-5);
  background: linear-gradient(90deg, var(--burgundy) 0%, var(--burgundy) 18%, var(--line) 18%, var(--line) 100%);
}

.form-head { margin-bottom: var(--s-5); }
.form-head h2 {
  font-size: var(--t-lg);
  font-weight: 700;
  font-stretch: 92%;
  color: var(--ink);
  margin-bottom: var(--s-2);
}
.form-head p {
  font-size: var(--t-sm);
  color: var(--muted);
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   6. Form controls
   -------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-4);
}
.field { display: flex; flex-direction: column; gap: 0.4375rem; }
.field.span-2 { grid-column: 1 / -1; }

.field > label {
  font-size: var(--t-xs);
  font-weight: 600;
  font-stretch: 104%;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}
.field > label .req {
  color: var(--red);
  font-size: 1.1em;
  line-height: 1;
}
.field > label .opt {
  margin-left: auto;
  font-size: 0.95em;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: none;
}

/* Soft-filled control with a burgundy underline that grows on focus. */
.control {
  position: relative;
  display: block;
}
.control input {
  width: 100%;
  height: var(--control-h);
  padding: 0 var(--s-4);
  background: var(--field);
  border: 1px solid var(--line);
  border-bottom-color: oklch(0.8600 0.0075 17.61);
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--ink);
  transition: background var(--dur) var(--ease-out-quart),
              border-color var(--dur) var(--ease-out-quart);
  appearance: none;
}
.control input:hover:not(:focus) {
  background: var(--surface);
  border-color: oklch(0.8600 0.0075 17.61);
}
.control input:focus {
  outline: none;
  background: var(--surface);
  border-color: oklch(0.8100 0.0300 17.61);
}
/* The growing underline */
.control::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--burgundy);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease-out-quart);
  pointer-events: none;
}
.control:focus-within::after { transform: scaleX(1); }

/* Validation */
.field.is-invalid .control input { border-color: var(--danger); background: var(--danger-bg); }
.field.is-invalid .control::after { background: var(--danger); transform: scaleX(1); }
.field.is-invalid > label { color: var(--danger); }

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  min-height: 1.0625rem;
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--danger);
  letter-spacing: 0.005em;
}
.field-error:empty { display: none; }
.field-error svg { flex: 0 0 auto; margin-top: 0.12em; }
.field-error:not(:empty)::before {
  content: "";
  flex: 0 0 auto;
  width: 13px; height: 13px;
  margin-top: 0.14em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.8 19 18H1L10 1.8Zm0 5.4a.9.9 0 0 0-.9 1v4a.9.9 0 0 0 1.8 0v-4a.9.9 0 0 0-.9-1Zm0 8.4a1.1 1.1 0 1 0 0-2.2 1.1 1.1 0 0 0 0 2.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Honeypot — invisible to people, irresistible to bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Summary banner for server-side failures */
.alert {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3) var(--s-4);
  border: 1px solid;
  border-radius: var(--radius);
  font-size: var(--t-sm);
  margin-bottom: var(--s-5);
}
.alert svg { flex: 0 0 auto; margin-top: 0.15em; }
.alert-danger  { background: var(--danger-bg);  border-color: oklch(0.8200 0.0800 26.08); color: oklch(0.4200 0.1600 26.08); }
.alert-success { background: var(--success-bg); border-color: oklch(0.8200 0.0600 155);   color: oklch(0.3800 0.0900 155); }
.alert a { color: inherit; font-weight: 600; }

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--burgundy);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--control-h);
  padding: 0 var(--s-6);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--t-sm);
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out-quart),
              box-shadow var(--dur) var(--ease-out-quart),
              background-color var(--dur) var(--ease-out-quart);
}
/* Signal-red wipe on hover — the poster's accent, used as the action colour */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-bright) 100%);
  transform: translateX(-101%);
  transition: transform var(--dur-slow) var(--ease-out-expo);
}
.btn > * { position: relative; z-index: 1; }
/* The global svg max-width:100% lets icons collapse to nothing in shrink-to-fit cells like .col-act */
.btn svg { flex: none; max-width: none; }
.btn:hover::before, .btn:focus-visible::before { transform: translateX(0); }
.btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-block { width: 100%; }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--burgundy);
  border-color: var(--line);
  box-shadow: none;
}
.btn-ghost::before { display: none; }
.btn-ghost:hover {
  --btn-fg: var(--burgundy-deep);
  background: var(--field);
  border-color: oklch(0.8100 0.0300 17.61);
  box-shadow: none;
}

/* Destructive: red text at rest, solid red once the organiser confirms */
.btn-danger { --btn-bg: var(--danger); }
.btn-danger::before { background: var(--burgundy-deep); }
.btn-ghost.btn-danger { --btn-bg: transparent; --btn-fg: var(--danger); }
.btn-ghost.btn-danger:hover {
  --btn-fg: var(--danger);
  background: var(--danger-bg);
  border-color: oklch(0.8200 0.0800 26.08);
}

.btn-sm {
  min-height: 2.125rem;
  padding: 0 var(--s-3);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
}

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* Submit spinner */
.btn .spinner {
  width: 15px; height: 15px;
  border: 2px solid oklch(1 0 0 / 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 620ms linear infinite;
  display: none;
}
.btn.is-busy .spinner { display: block; }
.btn.is-busy .btn-text { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-foot {
  margin-top: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.fineprint {
  font-size: var(--t-xs);
  color: var(--muted);
  line-height: 1.55;
  max-width: 64ch;
}
.fineprint a { font-weight: 600; }

/* --------------------------------------------------------------------------
   8. Success dialog
   -------------------------------------------------------------------------- */

dialog.modal {
  width: min(31rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  /* The global "* { margin: 0 }" reset strips the auto margin that centres a modal dialog. */
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}
dialog.modal::backdrop {
  background: oklch(0.2720 0.0930 17.61 / 0.55);
  backdrop-filter: blur(5px) saturate(0.85);
}

.modal-crest {
  display: flex;
  height: 5px;
}
.modal-crest .a { flex: 0 0 26px; background: var(--cedar); }
.modal-crest .b { flex: 1; background: linear-gradient(90deg, var(--burgundy), var(--red)); }

.modal-body {
  padding: var(--s-6) clamp(1.5rem, 1rem + 2vw, 2.5rem) var(--s-5);
  text-align: center;
}

.seal {
  width: 68px; height: 68px;
  margin: 0 auto var(--s-4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success-bg);
  border: 1.5px solid oklch(0.7600 0.0800 155);
}
.seal svg { width: 34px; height: 34px; }
.seal .tick {
  fill: none;
  stroke: var(--success);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
}
dialog.modal[open] .seal .tick {
  animation: draw-tick 520ms var(--ease-out-quart) 180ms forwards;
}
@keyframes draw-tick { to { stroke-dashoffset: 0; } }

.modal-body h2:focus { outline: none; }   /* focused on open so it is announced first */
.modal-body h2 {
  font-size: var(--t-lg);
  font-weight: 800;
  font-stretch: 84%;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  color: var(--burgundy);
  margin-bottom: var(--s-2);
}
.modal-body .lede {
  font-size: var(--t-sm);
  color: var(--ink-2);
  margin-bottom: var(--s-5);
}
.modal-body .lede strong { color: var(--ink); font-weight: 600; }

.ticket {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  padding: var(--s-4);
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.ticket .row { display: flex; gap: var(--s-4); align-items: baseline; }
.ticket .row dt {
  flex: 0 0 4.5rem;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticket .row dd { font-size: var(--t-sm); font-weight: 500; color: var(--ink); }

.modal-actions {
  display: grid;
  gap: var(--s-3);
}

dialog.modal[open] { animation: modal-in 360ms var(--ease-out-expo); }
dialog.modal[open]::backdrop { animation: fade-in 280ms var(--ease-out-quart); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.975); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------------------
   9. Entrance choreography
   Content renders at its final state; these only add polish on load.
   -------------------------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes poster-in {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes rail-in {
  from { transform: scaleX(0); }
  to   { transform: none; }
}

.rail { transform-origin: left center; animation: rail-in 720ms var(--ease-out-expo) both; }
.stage-head   { animation: rise 620ms var(--ease-out-quart) 120ms both; }
.poster-wrap  { animation: poster-in 900ms var(--ease-out-expo) 180ms both; }
.meta         { animation: rise 680ms var(--ease-out-quart) 340ms both; }
.masthead     { animation: rise 640ms var(--ease-out-quart) 200ms both; }
.form-head    { animation: rise 640ms var(--ease-out-quart) 290ms both; }
.js-stagger   { animation: rise 600ms var(--ease-out-quart) both; }

/* --------------------------------------------------------------------------
   10. Login
   -------------------------------------------------------------------------- */

.auth {
  min-height: calc(100dvh - 6px);
  display: grid;
  place-items: center;
  padding: var(--s-6) var(--gutter);
  background:
    radial-gradient(130% 100% at 22% 10%, oklch(0.4900 0.1480 17.61) 0%, transparent 60%),
    linear-gradient(168deg, var(--burgundy) 0%, var(--burgundy-deep) 60%, var(--burgundy-dark) 100%);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.auth::before {
  content: "";
  position: absolute;
  inset: -20% -40%;
  z-index: -1;
  background: repeating-linear-gradient(
    114deg,
    transparent 0 70px,
    oklch(1 0 0 / 0.04) 70px 74px,
    transparent 74px 108px
  );
  pointer-events: none;
}

.auth-card {
  width: min(25.5rem, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 620ms var(--ease-out-expo) both;
}
.auth-body { padding: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }

.auth-mark {
  font-size: var(--t-lg);
  color: var(--burgundy);
  margin-bottom: var(--s-1);
}
.auth-mark .edition { display: block; color: var(--ink); font-size: 0.7em; margin-top: 0.1em; }

.auth-body > .sub {
  font-size: var(--t-sm);
  color: var(--muted);
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--line-soft);
}

.auth-body .form-grid { grid-template-columns: 1fr; }

.auth-foot {
  margin-top: var(--s-5);
  font-size: var(--t-xs);
  color: var(--muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   11. Report
   -------------------------------------------------------------------------- */

.app { min-height: calc(100dvh - 6px); display: flex; flex-direction: column; background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding: var(--s-4) var(--gutter);
  background: var(--burgundy);
  color: var(--on-burgundy);
  box-shadow: var(--shadow-md);
}
.topbar .brand {
  font-size: var(--t-md);
  font-weight: 800;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 1.05;
  color: #fff;
  text-decoration: none;
}
.topbar .brand small {
  display: block;
  font-size: 0.5rem;
  font-weight: 600;
  font-stretch: 105%;
  letter-spacing: 0.22em;
  color: var(--on-burgundy-muted);
  margin-top: 2px;
}
.topbar .spacer { margin-left: auto; }
.topbar .who {
  font-size: var(--t-xs);
  color: var(--on-burgundy-muted);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.topbar .who b { color: var(--on-burgundy-soft); font-weight: 600; }

.btn-onburg {
  --btn-bg: oklch(1 0 0 / 0.1);
  --btn-fg: #fff;
  border-color: oklch(1 0 0 / 0.26);
  box-shadow: none;
}
.btn-onburg::before { display: none; }
.btn-onburg:hover { --btn-bg: oklch(1 0 0 / 0.2); box-shadow: none; }

.report {
  flex: 1;
  width: 100%;
  max-width: 82rem;
  margin-inline: auto;
  padding: var(--s-6) var(--gutter) var(--s-8);
}

.report-head {
  display: flex;
  align-items: flex-end;
  gap: var(--s-5);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}
.report-head h1 {
  font-size: var(--t-lg);
  font-weight: 800;
  font-stretch: 84%;
  text-transform: uppercase;
  color: var(--ink);
}
.report-head .count {
  font-size: var(--t-sm);
  color: var(--muted);
  margin-top: var(--s-1);
}
.report-head .count b {
  color: var(--burgundy);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.report-tools { margin-left: auto; flex: 0 1 28rem; justify-content: flex-end; display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 14rem;
}
.search svg {
  position: absolute;
  left: 0.6875rem;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  height: 2.125rem;
  width: 100%;
  padding: 0 var(--s-3) 0 2.125rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--t-sm);
  transition: border-color var(--dur) var(--ease-out-quart),
              box-shadow var(--dur) var(--ease-out-quart);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px oklch(0.4271 0.1364 17.61 / 0.12);
}

.table-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}
table.grid thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--field);
  padding: var(--s-3) var(--s-4);
  text-align: left;
  font-size: var(--t-xs);
  font-weight: 700;
  font-stretch: 104%;
  letter-spacing: 0.095em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid tbody td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--ink);
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr { transition: background var(--dur-fast) linear; }
table.grid tbody tr:hover { background: oklch(0.4271 0.1364 17.61 / 0.035); }

.col-n    { width: 3.25rem; color: var(--muted) !important; }
.col-when { white-space: nowrap; color: var(--muted) !important; font-size: var(--t-xs); }
.col-act  { width: 1%; white-space: nowrap; text-align: right; }

.cell-name { font-weight: 600; }
.cell-name .prof {
  display: block;
  font-weight: 400;
  font-size: var(--t-xs);
  color: var(--muted);
  margin-top: 1px;
}
td a.mailto, td a.tel { color: var(--ink); text-decoration: none; }
td a.mailto { overflow-wrap: anywhere; }   /* one long address mustn't widen the whole sheet */
td a.mailto:hover, td a.tel:hover { color: var(--burgundy); text-decoration: underline; }
.dash { color: var(--muted); }

/* Row in edit mode */
tr.editing { background: oklch(0.4271 0.1364 17.61 / 0.05) !important; }
tr.editing td { padding-block: var(--s-3); }
tr.editing input {
  width: 100%;
  min-width: 7rem;
  height: 2.125rem;
  padding: 0 var(--s-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--t-sm);
}
tr.editing input:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px oklch(0.4271 0.1364 17.61 / 0.12);
}
tr.editing input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
.edit-actions, .row-actions { display: flex; gap: var(--s-2); justify-content: flex-end; align-items: center; }

/* Row waiting for delete confirmation */
tr.deleting { background: var(--danger-bg) !important; }
.confirm-q {
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--danger);
  margin-right: var(--s-1);
}
.row-error {
  display: block;
  font-size: var(--t-xs);
  color: var(--danger);
  font-weight: 500;
  margin-top: 0.25rem;
}

.empty {
  padding: var(--s-8) var(--s-5);
  text-align: center;
}
.empty .ring {
  width: 64px; height: 64px;
  margin: 0 auto var(--s-4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--field);
  border: 1px dashed var(--line);
  color: var(--muted);
}
.empty h3 {
  font-size: var(--t-md);
  font-weight: 700;
  font-stretch: 92%;
  color: var(--ink);
  margin-bottom: var(--s-2);
}
.empty p { font-size: var(--t-sm); color: var(--muted); max-width: 40ch; margin-inline: auto; margin-bottom: var(--s-5); }

/* --------------------------------------------------------------------------
   12. Error page
   -------------------------------------------------------------------------- */

.oops {
  min-height: calc(100dvh - 6px);
  display: grid;
  place-items: center;
  padding: var(--s-6) var(--gutter);
  text-align: center;
  background: var(--bg);
}
.oops .code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  font-stretch: 76%;
  line-height: 0.85;
  color: var(--burgundy);
  margin-bottom: var(--s-4);
}
.oops h1 {
  font-size: var(--t-lg);
  font-weight: 700;
  font-stretch: 92%;
  margin-bottom: var(--s-3);
}
.oops p { color: var(--muted); font-size: var(--t-sm); margin-bottom: var(--s-6); max-width: 46ch; }

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */

/* Big monitors: sizes are in rem, so lifting the root scales the whole page up */
@media (min-width: 1800px) { html { font-size: 112.5%; } }
@media (min-width: 2400px) { html { font-size: 125%; } }

@media (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
  .poster { max-height: min(60dvh, 38.75rem); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; min-height: 0; }
  .stage {
    padding-block: var(--s-6);
    gap: var(--s-5);
  }
  .poster { max-height: 62dvh; }
  .panel { justify-content: flex-start; }
  .panel-inner { max-width: 36rem; }
}

/* Report below laptop width: the 8-column sheet can't fit, so each registration becomes a card */
@media (max-width: 1180px) {
  .table-frame { background: none; border: none; box-shadow: none; overflow: visible; }
  .table-scroll { overflow: visible; }
  table.grid, table.grid tbody { display: block; }
  table.grid thead { display: none; }   /* each cell carries its own label instead */
  table.grid tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
    gap: var(--s-4);
  }
  table.grid tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: baseline;
    gap: var(--s-2) 0.35em;
    padding: var(--s-4) var(--s-5);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }
  table.grid tbody tr[hidden] { display: none; }
  table.grid tbody tr:hover { background: var(--surface); }
  table.grid tbody tr.deleting { border-color: oklch(0.8200 0.0800 26.08); }
  table.grid tbody td {
    flex: 1 1 100%;
    min-width: 0;
    padding: 0;
    border: none;
    overflow-wrap: break-word;
  }
  table.grid tbody td.col-n { display: none; }
  /* First and last name share a line as the card's title */
  table.grid tbody td.cell-name { flex: 0 1 auto; font-size: var(--t-md); }
  table.grid tbody td[data-label] { display: flex; gap: var(--s-3); align-items: baseline; }
  table.grid tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 6.25rem;
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  table.grid tbody td.col-act { width: auto; text-align: left; margin-top: auto; padding-top: var(--s-2); }
  .row-actions, .edit-actions { justify-content: flex-start; flex-wrap: wrap; }
  .row-actions .confirm-q { flex-basis: 100%; margin-bottom: var(--s-1); }
  /* While editing, each label sits above its full-width input */
  table.grid tbody tr.editing td[data-label] { display: block; }
  table.grid tbody tr.editing td[data-label]::before { display: block; margin-bottom: var(--s-1); }
}

/* Narrow phones: labels above values so long emails get the full card width */
@media (max-width: 480px) {
  table.grid tbody td[data-label] { display: block; }
  table.grid tbody td[data-label]::before { display: block; margin-bottom: 0.125rem; }
  table.grid tbody tr { padding: var(--s-4); }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; gap: var(--s-3); }
  .poster { max-height: 54dvh; }
  .report-tools { width: 100%; justify-content: flex-start; }
  .search { flex: 1 1 100%; }           /* search gets its own full-width row */
  .search input { width: 100%; }
  .topbar { gap: var(--s-3); }
  .topbar .who { display: none; }       /* keeps Sign out on the brand's row */
}

/* Short screens (landscape phones, small phones): tighten the confirmation so it fits */
@media (max-height: 620px) {
  dialog.modal { width: min(40rem, calc(100vw - 2rem)); }
  .modal-body { padding-block: var(--s-4); }
  .seal { width: 44px; height: 44px; margin-bottom: var(--s-2); }
  .seal svg { width: 24px; height: 24px; }
  .modal-body .lede { margin-bottom: var(--s-4); }
  .ticket { gap: var(--s-2); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
}
@media (max-height: 440px) {
  .seal { display: none; }
}

/* Touch screens: 16px text stops iOS zooming into fields; ~44px targets suit a fingertip */
@media (pointer: coarse) {
  input:not([type="hidden"]), tr.editing input { font-size: max(16px, 1em); }
  .btn-sm { min-height: 2.75rem; padding-inline: var(--s-4); }
  .search input, tr.editing input { height: 2.75rem; }
}

/* --------------------------------------------------------------------------
   14. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rail, .stage-head, .poster-wrap, .meta, .masthead, .form-head, .js-stagger, .auth-card {
    animation: fade-in 0.01ms both !important;
  }
  .seal .tick { stroke-dashoffset: 0 !important; }
  .control::after { transition: none; }
  a.poster-link:hover .poster { transform: none; }
  .btn:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   15. Print — a registered attendee printing their confirmation
   -------------------------------------------------------------------------- */

@media print {
  .rail, .topbar, .report-tools, .col-act, .btn, .fineprint { display: none !important; }
  body { background: #fff; color: #000; }
  .table-frame { border: none; box-shadow: none; }
  table.grid { font-size: 10pt; }
  table.grid thead th { background: #eee !important; color: #000; }
  .stage { background: #fff !important; color: #000 !important; }
  .stage::before, .stage::after, .panel::before { display: none !important; }
}
