/* "I'm attending" card generator (attending.html).

   Lives in its own file, not in the page's inline <style>: Tailwind scans every
   token in the .html files, so plain CSS words there (sticky, resize, outline)
   would be compiled into assets/tailwind.css as unused utilities. Classes are
   prefixed att- for the same reason. */
/* Outfit, the face the card is drawn in. Self-hosted (SIL OFL 1.1, licence in
   assets/fonts/) so the exported image does not depend on a third-party
   request. One variable file per subset covers the three weights used. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/outfit-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/outfit-latin.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;
}

.att-main {
  max-width: 74rem;
  margin: 0 auto;
  padding: 6.5rem 1rem 4.5rem;
}
.att-main [hidden] { display: none !important; }

.att-layout {
  display: grid;
  gap: 2rem;
  grid-template-areas: 'intro' 'stage' 'form';
}
.att-intro { grid-area: intro; }
.att-stage { grid-area: stage; min-width: 0; }
.att-form { grid-area: form; min-width: 0; }

@media (min-width: 60rem) {
  .att-main { padding: 8.5rem 2rem 6rem; }
  .att-layout {
    grid-template-columns: minmax(0, 35rem) minmax(0, 1fr);
    grid-template-areas: 'stage intro' 'stage form';
    column-gap: 4rem;
    row-gap: 2.75rem;
    align-items: start;
  }
  .att-stage { position: sticky; top: 6rem; }
}

.att-closed { max-width: 42rem; padding: 1rem 0 5rem; }
.att-closed-actions { margin-top: 2rem; }

.att-title {
  font-family: 'Satoshi', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2.375rem, 6vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.att-lede {
  margin: 1.125rem 0 0;
  max-width: 34rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
}

/* The card rests on a field in its own light blue, so the white square
   reads as an object rather than dissolving into the white page. */
.att-field {
  padding: clamp(0.875rem, 4vw, 2.25rem);
  border-radius: 2rem;
  background: linear-gradient(168deg, #DCEBFD 0%, #EEF5FE 55%, #F7FAFE 100%);
}
.att-card {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(31, 74, 140, 0.06), 0 30px 50px -30px rgba(31, 74, 140, 0.5);
}
.att-card canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.att-card.is-dropping::after {
  content: 'Drop the photo';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'Satoshi', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  background: rgba(220, 235, 253, 0.9);
  outline: 3px dashed var(--accent);
  outline-offset: -14px;
}

.att-hit {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.att-hit[data-filled='true'] { cursor: grab; touch-action: none; }
.att-hit.is-dragging { cursor: grabbing; }
.att-hit:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 11%;
  padding: 0.5em 0.95em;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: clamp(0.6875rem, 2.6vw, 0.875rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.2s var(--ease-out-expo);
}
.att-chip svg { width: 1.1em; height: 1.1em; }
.att-hit:hover .att-chip { transform: translateY(-2px); }
.att-hit[data-filled='true'] .att-chip { display: none; }

.att-hint {
  margin: 0.875rem 0.25rem 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #5b6b85;
  text-align: center;
}

.att-group { padding: 1.625rem 0; border-top: 1px solid var(--border); }
.att-group:first-child { padding-top: 0; border-top: 0; }
.att-group:last-child { padding-bottom: 0; }
.att-label {
  display: block;
  margin: 0 0 0.75rem;
  font-family: 'Satoshi', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.att-optional {
  margin-left: 0.375rem;
  font-family: 'Avenir Next', 'Avenir', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.att-sublabel {
  display: block;
  margin: 1.25rem 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.att-note {
  margin: 0.75rem 0 0;
  max-width: 36rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}
.att-pair { display: grid; gap: 1.5rem 1rem; }
@media (min-width: 34rem) {
  .att-pair { grid-template-columns: 1fr 1fr; }
}
.att-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; }
.att-row--links { gap: 0.25rem 1rem; margin-top: 0.5rem; margin-left: -0.375rem; }

.att-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0.6875rem 1.25rem;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s var(--ease-out-expo);
}
.att-btn:hover { border-color: var(--ink); }
.att-btn:active { transform: scale(0.98); }
.att-btn svg { width: 1.125rem; height: 1.125rem; flex: none; }
.att-btn--primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.att-btn--primary:hover { border-color: #3f3f46; background: #3f3f46; }
.att-text-btn {
  padding: 0.5rem 0.375rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.att-text-btn:hover { color: var(--ink); }
.att-btn:focus-visible,
.att-text-btn:focus-visible,
.att-file:focus-visible + .att-btn { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Kept in the tab order (a hidden input would not be) but out of sight. */
.att-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.att-zoom {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1rem;
  max-width: 22rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.att-zoom input {
  flex: 1;
  min-width: 0;
  height: 1.75rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.att-zoom input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #d4d4d8; }
.att-zoom input::-moz-range-track { height: 4px; border-radius: 2px; background: #d4d4d8; }
.att-zoom input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px #d4d4d8, 0 2px 6px rgba(24, 24, 27, 0.18);
}
.att-zoom input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px #d4d4d8, 0 2px 6px rgba(24, 24, 27, 0.18);
}
.att-zoom input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 999px; }

.att-input,
.att-textarea {
  display: block;
  width: 100%;
  padding: 0.8125rem 1rem;
  border: 1px solid #d4d4d8;
  border-radius: 0.875rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.att-textarea { min-height: 14rem; resize: vertical; }
.att-input::placeholder { color: #a1a1aa; }
.att-input:focus,
.att-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 141, 247, 0.18);
}

.att-status {
  min-height: 1.4em;
  margin: 0.875rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: #15803d;
}
.att-status[data-tone='error'] { color: #b91c1c; }

.att-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.att-link:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .att-btn, .att-chip, .att-input, .att-textarea { transition: none; }
}
