/* "I'm attending" card maker (/attending). Colours come from the card artwork itself. */
:root {
  --teal: #0d4a57;
  --teal-2: #136373;
  --gold: #c6721f;
  --gold-soft: #ebca80;
  --ink: #141414;
  --muted: #5d6266;
  --line: #e4ddd5;
  --paper: #fbf7f2;
  --card: #ffffff;
  --li: #0a66c2;
  --li-dark: #004182;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 0% 0%, #fde9dc 0%, transparent 60%),
    radial-gradient(1000px 600px at 100% 10%, #dfe9f6 0%, transparent 60%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }

/* nav */
.at-nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1240px; margin: 0 auto; padding: 18px 24px;
}
.at-nav__brand img { height: 30px; display: block; }
.at-nav__link { color: var(--teal); font-weight: 600; font-size: 14px; text-decoration: none; }
.at-nav__link:hover { text-decoration: underline; }

.at-wrap { max-width: 1240px; margin: 0 auto; padding: 8px 24px 64px; }

.at-intro { max-width: 720px; margin: 12px 0 28px; }
.at-eyebrow {
  margin: 0 0 6px; color: var(--gold); font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase;
}
.at-intro h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.02em; }
.at-lede { margin: 0; color: var(--muted); font-size: 17px; }

.at-grid {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 28px; align-items: start;
}

/* preview */
.at-preview { position: sticky; top: 16px; }
.at-canvas-box {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 18px 50px -18px rgba(13,74,87,.45);
  background: #efe6dc; aspect-ratio: 2400 / 1444;
}
#card { display: block; width: 100%; height: 100%; touch-action: none; }
#card.has-photo { cursor: grab; }
#card.dragging { cursor: grabbing; }
.at-hint {
  position: absolute; right: 12px; top: 12px;
  background: rgba(20,20,20,.72); color: #fff; font-size: 12px; font-weight: 500;
  padding: 6px 10px; border-radius: 999px; pointer-events: none;
}
.at-privacy {
  display: flex; align-items: center; gap: 8px; margin: 12px 2px 0;
  color: var(--muted); font-size: 13px;
}
.at-privacy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }

/* form */
.at-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.at-field { margin-bottom: 18px; }
.at-field > label, .at-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.at-opt { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.at-field input:not([type=file]):not([type=range]) {
  width: 100%; padding: 12px 14px; border: 1px solid #d6cfc7; border-radius: 10px;
  background: #fff; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.at-field input:focus { outline: none; border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(19,99,115,.18); }
.at-field input.invalid { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,.14); }

.at-drop {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border: 1.5px dashed #cdbfb0; border-radius: 12px; background: #fdfaf6;
  cursor: pointer; transition: border-color .15s, background .15s; font-size: 14px; color: var(--muted);
}
.at-drop b { color: var(--teal); }
.at-drop:hover, .at-drop.over { border-color: var(--teal-2); background: #f2f8f9; }
.at-drop:focus-within { outline: 3px solid rgba(19,99,115,.25); outline-offset: 2px; }
.at-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.at-drop svg { width: 28px; height: 28px; fill: none; stroke: var(--teal); stroke-width: 1.6; flex: none; }
.at-drop.has-photo { border-style: solid; }

.at-zoom { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; }
.at-zoom[hidden] { display: none; }
.at-zoom label { font-weight: 600; }
.at-zoom input { flex: 1; accent-color: var(--teal); }
.at-tip { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }

.at-link {
  background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600;
  font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

.at-actions { display: grid; gap: 10px; margin-top: 22px; }
.at-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.at-btn:active { transform: translateY(1px); }
.at-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.at-btn svg.at-in { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.at-btn--primary { background: var(--teal); color: #fff; }
.at-btn--primary:hover { background: var(--teal-2); }
.at-btn--linkedin { background: var(--li); color: #fff; }
.at-btn--linkedin:hover { background: var(--li-dark); }
.at-btn--ghost { background: #fff; border-color: #d6cfc7; color: var(--ink); }
.at-btn[disabled] { opacity: .6; cursor: progress; }

.at-error { margin: 12px 0 0; color: #b03a2e; font-size: 14px; font-weight: 500; }

.at-caption { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.at-caption summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.at-caption textarea {
  width: 100%; margin: 10px 0 6px; padding: 10px 12px; border: 1px solid #d6cfc7;
  border-radius: 10px; resize: vertical; font-size: 14px; line-height: 1.5;
}

/* modal */
.at-modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 25, 30, .55);
}
.at-modal[hidden] { display: none; }
.at-modal__card {
  background: #fff; border-radius: 16px; padding: 26px; max-width: 460px; width: 100%;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
}
.at-modal__card h2 { margin: 0 0 12px; font-size: 22px; }
.at-modal__card ol { margin: 0 0 20px; padding-left: 20px; color: #333; }
.at-modal__card li { margin-bottom: 8px; }
.at-li__lead { margin: 0 0 12px; color: #333; }
.at-li__steps b { word-break: break-word; }
.at-li__icon { width: 20px; height: 20px; vertical-align: -5px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.at-modal__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.at-modal__actions .at-btn { flex: 1; }
.at-modal__card--wide { max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; }
.at-pm__img { display: block; width: 100%; border-radius: 10px; margin-bottom: 14px; background: #efe6dc; aspect-ratio: 2400 / 1444; }
.at-pm__label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.at-modal__card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d6cfc7; border-radius: 10px;
  resize: vertical; font-size: 14px; line-height: 1.5;
}
.at-pm__note { margin: 8px 0 14px; color: var(--muted); font-size: 13px; }
.at-pm__signin { display: grid; gap: 10px; margin-bottom: 14px; font-size: 14px; color: #8a4b12;
  background: #fdf3e7; border-radius: 10px; padding: 12px; }
.at-pm__signin[hidden] { display: none; }
#pmForm[hidden], #pmDone[hidden] { display: none; }

.at-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
  max-width: calc(100vw - 32px);
}
.at-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .at-grid { grid-template-columns: 1fr; }
  .at-preview { position: static; }
}
@media (max-width: 520px) {
  .at-nav { padding: 14px 16px; }
  .at-wrap { padding: 4px 16px 48px; }
  .at-form { padding: 18px; }
  .at-lede { font-size: 15.5px; }
}
