/* AI Builders Club colors (operations/shared/BRAND_RULES.md): navy, lime, cyan, white, slate. */
:root {
  --navy: #0F172A;
  --navy-2: #131D35;
  --navy-3: #0B1324;
  --line: #26324D;
  --line-2: #3A4868;
  --white: #F8FAFC;
  --slate: #CBD5E1;
  --muted: #94A3B8;
  --lime: #A3E635;
  --cyan: #22D3EE;
  --red: #F87171;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Menlo, "SF Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--white);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(163, 230, 53, 0.05), transparent 60%),
    var(--navy);
  background-attachment: fixed;
}

a { color: var(--cyan); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(34, 211, 238, 0.6);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--lime); color: var(--navy); padding: 8px 12px; border-radius: 8px; font-weight: 700; }

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 40px;
}

/* ---------- hero ---------- */

.brand { display: flex; align-items: center; gap: 14px; }
.emblem { width: 76px; height: 76px; flex: none; border-radius: 50%; }
.kicker { margin: 0 0 2px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--cyan); }
h1 {
  margin: 0;
  font-size: clamp(28px, 7.6vw, 48px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.tagline { margin: 18px 0 12px; font-size: clamp(22px, 5.8vw, 34px); line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.lime { color: var(--lime); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.pills li { padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--slate); }
.pills li:first-child, .pills li:nth-child(2) { border-color: rgba(34, 211, 238, 0.55); color: var(--cyan); font-weight: 700; }

.net {
  margin: 0 0 20px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(11, 19, 36, 0.65);
}
#net-canvas { display: block; width: 100%; height: 150px; cursor: pointer; }
.net figcaption { display: flex; gap: 8px; align-items: baseline; margin: 6px 2px 0; font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--muted); }
.live { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.6); animation: pulse 2s infinite; transform: translateY(-1px); }
.readout { color: var(--lime); white-space: nowrap; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(163, 230, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

/* ---------- cards and form ---------- */

.card {
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--navy-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.card h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.15; font-weight: 800; }
.lede { margin: 0 0 20px; color: var(--slate); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
label, legend { display: block; margin: 0 0 6px; padding: 0; font-size: 15px; font-weight: 700; color: var(--white); }
.opt { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--muted); }

input, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--navy-3);
  color: var(--white);
  font: inherit;
  font-size: 16px; /* 16px keeps iPhone Safari from zooming in on focus */
}
textarea { resize: vertical; min-height: 88px; }
input::placeholder, textarea::placeholder { color: #64748B; }
input:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); }

.hint { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.err { margin: 6px 0 0; font-size: 14px; line-height: 1.4; color: var(--red); }

.affix { display: flex; align-items: stretch; }
.prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #16223D;
  font-family: var(--mono);
  color: var(--cyan);
}
.affix input { border-radius: 0 10px 10px 0; font-family: var(--mono); letter-spacing: 0.02em; }
.affix:focus-within .prefix { border-color: var(--cyan); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; display: block; margin: 0; font-weight: 500; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--navy-3);
  font-size: 15px;
  line-height: 1.25;
  color: var(--slate);
}
.choice span::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-2);
  border-radius: 50%;
}
.choice input:checked + span { border-color: var(--lime); background: rgba(163, 230, 53, 0.1); color: var(--white); box-shadow: inset 0 0 0 1px var(--lime); }
.choice input:checked + span::before { border-color: var(--lime); background: radial-gradient(circle, var(--lime) 45%, transparent 50%); }
.choice input:focus-visible + span { outline: 3px solid rgba(34, 211, 238, 0.6); outline-offset: 2px; }
.invalid .choice span { border-color: rgba(248, 113, 113, 0.7); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.1);
  color: #FECACA;
}

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--lime); color: var(--navy); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { margin-top: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--white); }
.btn.ghost:hover { border-color: var(--cyan); }
.btn[disabled] { cursor: progress; opacity: 0.8; }
.btn.busy::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.privacy { margin-top: 14px; font-size: 13px; color: var(--muted); }
.privacy summary { padding: 6px 0; color: var(--slate); cursor: pointer; }
.privacy p { margin: 8px 0 0; line-height: 1.5; }

/* ---------- done ---------- */

.done { text-align: center; }
.done:focus { outline: none; }
.done-mark { margin: 4px 0 8px; color: var(--lime); }
.done-mark svg { display: inline-block; }
.builder { margin: 4px 0 0; font-size: 18px; color: var(--slate); }
.mono { font-family: var(--mono); color: var(--lime); }
.digits { display: flex; justify-content: center; gap: 10px; min-height: 0; margin: 14px 0 4px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; animation: rise 0.45s ease-out forwards; }
.tile canvas { width: 48px; height: 48px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--navy-3); image-rendering: pixelated; }
.tile span { font-family: var(--mono); font-size: 14px; color: var(--lime); }
.digits-note { margin: 0 0 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.next { margin: 18px 0 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--navy-3); text-align: left; }
.next h3 { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--cyan); }
.next ol { margin: 0; padding-left: 20px; color: var(--slate); }
.next li { margin: 6px 0; }
.link { padding: 12px; border: 0; background: none; color: var(--cyan); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- page not found ---------- */

.notfound { max-width: 480px; margin: 48px auto; text-align: center; }
.notfound h1 { font-size: 28px; text-transform: none; margin: 0 0 8px; }
.problems { margin: 0 0 20px; padding-left: 20px; text-align: left; color: #FECACA; }
.problems li { margin: 4px 0; }

/* ---------- footer ---------- */

.foot { margin-top: 36px; text-align: center; font-size: 14px; color: var(--muted); }
.foot p { margin: 6px 0; }
.motto { font-family: var(--mono); font-size: 18px; color: var(--lime); }
.small { font-size: 12px; }

/* ---------- wide screens: story on the left, form on the right ---------- */

@media (min-width: 960px) {
  .join-page .page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
    gap: 32px 56px;
    align-items: start;
    padding-top: 16px;
  }
  .join-page .hero { position: sticky; top: 40px; }
  .emblem { width: 112px; height: 112px; }
  #net-canvas { height: 230px; }
  .card { padding: 28px 28px 24px; }
  .join-page .foot, .join-page .sitebar { grid-column: 1 / -1; }
}

@media (max-width: 359px) {
  .row, .choices { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .live, .btn.busy::after { animation: none; }
  .tile { opacity: 1; animation: none; }
}

/* The club website's bar, so the sign-up page reads as part of abc-wvc.pages.dev. */
.sitebar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 12px 0 4px; }
.sitebar-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--white); font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.sitebar-brand img { border-radius: 50%; }
.sitebar-tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy-2); }
.sitebar-tabs a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.sitebar-tabs a:hover { color: var(--white); }
@media (max-width: 959px) {
  .sitebar { margin-bottom: 12px; }
  .sitebar-tabs { width: 100%; }
  .sitebar-tabs a { flex: 1; text-align: center; }
}
