:root {
    --ink: #0f172a;
    --slate: #334155;
    --quiet: #475569;
    --action: #0369a1;       /* blue = action, AA-safe */
    --action-hover: #075985;
    --ring: #0284c7;
    --verified: #047857;     /* green only for the confirmation */
    --verified-soft: #d1fae5;
    --danger: #b91c1c;       /* red only for errors */
    --field-edge: #748499;
    --hairline: #e2e8f0;
    --radius-card: 44px;
    --radius-field: 16px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Arial, sans-serif;
    /* Fine grain: inline SVG turbulence as a data URI (no network request) */
    --grain: url("inline-e0c8c6247a.svg");
  }

  *, *::before, *::after { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html { -webkit-text-size-adjust: 100%; }

  body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--slate);
    background-color: #e0f2fe;
    background-image: linear-gradient(140deg, #e0f2fe 0%, #e6f6fb 38%, #ccfbf1 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    padding: max(24px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  img { max-width: 100%; height: auto; display: block; }

  /* Background: colour fields, the watermark, then grain over both */
  .fields { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .fields span { position: absolute; border-radius: 50%; filter: blur(8px); }
  .fields .f1 { width: 46vmax; height: 46vmax; left: -10vmax; top: -12vmax;
    background: radial-gradient(circle at 40% 40%, #7dd3fc 0%, rgba(125, 211, 252, 0) 68%); opacity: .85; }
  .fields .f2 { width: 52vmax; height: 52vmax; right: -14vmax; bottom: -18vmax;
    background: radial-gradient(circle at 50% 50%, #5eead4 0%, rgba(94, 234, 212, 0) 66%); opacity: .8; }
  .fields .f3 { width: 28vmax; height: 28vmax; right: 18vw; top: 6vh;
    background: radial-gradient(circle, #a5f3fc 0%, rgba(165, 243, 252, 0) 70%); opacity: .9; }

  /* Watermark: bigger than the card and set so its circuit traces sit in the open margin (crisp)
     while the bar and foot run behind the glass (frosted) */
  .watermark {
    position: absolute;
    height: 110vh;
    width: auto;
    aspect-ratio: 400 / 520;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -46%);
    color: #0369a1;
    opacity: .15;
  }
  @media (min-width: 880px) {
    .watermark { left: calc(25% - min(245px, 25vw - 16px) - 45.3vh); transform: translate(0, -50%); }
  }
  .fields::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--grain);
    background-size: 160px 160px;
    opacity: .22;
    mix-blend-mode: multiply;
  }

  main, footer { position: relative; z-index: 1; }
  main { flex: 1; display: grid; place-items: center; padding-block: 8px 24px; }

  /* Liquid glass: a thick slab. Layered translucency (body tint + top sheen + bottom caustic),
     a bright rim, deep inner bevel shadows for thickness, and refraction-like highlights in ::after */
  .card {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 1000px;
    background:
      radial-gradient(120% 70% at 12% -8%, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, 0) 52%),
      radial-gradient(90% 60% at 100% 108%, rgba(186, 230, 253, .55) 0%, rgba(186, 230, 253, 0) 60%),
      linear-gradient(160deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .16) 50%, rgba(255, 255, 255, .3) 100%),
      rgba(240, 249, 255, .3);
    -webkit-backdrop-filter: blur(48px) saturate(210%) brightness(1.05);
    backdrop-filter: blur(48px) saturate(210%) brightness(1.05);
    border: 1.5px solid rgba(255, 255, 255, .8);
    border-radius: var(--radius-card);
    box-shadow:
      0 2px 0 rgba(255, 255, 255, 1) inset,
      0 0 0 1px rgba(255, 255, 255, .35) inset,
      2px 0 0 rgba(255, 255, 255, .45) inset,
      0 22px 34px -26px rgba(255, 255, 255, .95) inset,
      0 -26px 46px -28px rgba(3, 105, 161, .34) inset,
      -14px 0 30px -26px rgba(2, 132, 199, .3) inset,
      0 50px 90px -36px rgba(3, 105, 161, .45),
      0 18px 34px -20px rgba(15, 118, 110, .3),
      0 2px 6px rgba(3, 105, 161, .08);
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    animation: settle .8s cubic-bezier(.2, .7, .2, 1) both;
  }
  .card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--grain);
    background-size: 160px 160px;
    opacity: .14;
    mix-blend-mode: multiply;
    border-radius: inherit;
  }
  /* Refraction-like highlights: a curved specular arc along the top-left, a thin caustic line
     near the base, and a soft prism glint at the right edge */
  .card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
      radial-gradient(140% 90% at 30% -42%, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .7) 60.5%, rgba(255, 255, 255, 0) 64%),
      radial-gradient(160% 70% at 60% 150%, rgba(255, 255, 255, 0) 60%, rgba(224, 242, 254, .75) 62%, rgba(255, 255, 255, 0) 65%),
      radial-gradient(18% 40% at 101% 30%, rgba(165, 243, 252, .55) 0%, rgba(165, 243, 252, 0) 100%),
      radial-gradient(10% 22% at 4% 82%, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 100%);
    mix-blend-mode: screen;
    opacity: .9;
  }
  .card > section { position: relative; z-index: 1; }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card { background: rgba(255, 255, 255, .94); }
    .join { background: rgba(255, 255, 255, .96); }
  }

  @keyframes settle {
    from { opacity: 0; transform: translateY(18px) scale(.975); }
    to   { opacity: 1; transform: none; }
  }

  .intro { padding: 32px 24px 28px; display: flex; flex-direction: column; gap: 22px; }
  .brand { display: flex; align-items: center; gap: 12px; color: var(--ink); width: fit-content; }
  .tile {
    width: 52px; height: 52px; border-radius: 17px; overflow: hidden; flex: none;
    background: #10101c; box-shadow: 0 6px 16px -6px rgba(15, 23, 42, .45);
  }
  .tile img { width: 294%; max-width: none; margin: -83.8% 0 0 -103%; }
  .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; line-height: 1.2; }
  .brand-name small { display: block; font-family: var(--font); font-weight: 500; font-size: .8125rem; color: var(--quiet); letter-spacing: 0; }

  h1 {
    margin: 0; font-family: var(--font-display); font-weight: 700; color: var(--ink);
    font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); line-height: 1.08; letter-spacing: -.025em;
    max-width: 18ch; text-wrap: balance;
  }
  .lede { margin: 0; font-size: 1.125rem; line-height: 1.6; color: var(--slate); max-width: 40ch; }
  .aside {
    margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(148, 163, 184, .4);
    font-size: .9375rem; color: var(--quiet); max-width: 44ch;
  }
  .aside p { margin: 0; }
  .aside p + p { margin-top: 6px; }

  a { color: var(--action); text-underline-offset: 3px; text-decoration-thickness: 1px; }
  a:hover { color: var(--action-hover); text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 6px; }

  .join {
    margin: 0 10px 10px;
    padding: 28px 20px 30px;
    border-radius: calc(var(--radius-card) - 10px);
    background:
      radial-gradient(120% 60% at 20% -10%, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, 0) 55%),
      linear-gradient(180deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .5) 100%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow:
      0 1.5px 0 rgba(255, 255, 255, 1) inset,
      0 -14px 28px -22px rgba(3, 105, 161, .3) inset,
      0 18px 36px -24px rgba(3, 105, 161, .38),
      0 2px 4px rgba(3, 105, 161, .06);
  }
  .join h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
  .join .hint { margin: 0 0 20px; font-size: .875rem; color: var(--quiet); }

  form { display: grid; gap: 16px; }
  .field { display: grid; gap: 6px; }
  .field label { font-weight: 600; font-size: .9375rem; color: var(--ink); }
  .field label .opt { font-weight: 400; color: var(--quiet); }

  input[type="text"], input[type="email"], select {
    font: inherit; font-size: 1rem; color: var(--ink); width: 100%; min-height: 46px;
    padding: 10px 14px; border: 1px solid var(--field-edge); border-radius: var(--radius-field);
    background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06) inset, 0 1px 0 rgba(255, 255, 255, .8); transition: border-color .15s, box-shadow .15s;
  }
  select {
    -webkit-appearance: none; appearance: none; padding-right: 42px;
    background-image: url("inline-aa0d60e65d.svg");
    background-repeat: no-repeat; background-position: right 14px center;
  }
  input[type="text"]:hover, input[type="email"]:hover, select:hover { border-color: #52627a; }
  input[type="text"]:focus-visible, input[type="email"]:focus-visible, select:focus-visible {
    outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(2, 132, 199, .35); border-radius: var(--radius-field);
  }
  [aria-invalid="true"] { border-color: var(--danger) !important; }
  [aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgba(185, 28, 28, .25) !important; }
  .pair { display: grid; gap: 16px; }

  .error { margin: 0; font-size: .875rem; color: var(--danger); }
  .consent {
    display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
    padding: 12px 14px; border-radius: var(--radius-field);
    background: rgba(240, 249, 255, .9); border: 1px solid var(--hairline);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
  }
  .consent.is-invalid { border-color: var(--danger); }
  .consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--action); }
  .consent label { font-size: .875rem; line-height: 1.5; color: var(--slate); }
  .consent .error { grid-column: 1 / -1; }

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

  .submit {
    font: inherit; font-weight: 650; font-size: 1rem; min-height: 50px; padding: 12px 20px;
    border: 0; border-radius: 999px; color: #fff; background-color: var(--action); cursor: pointer;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, 0) 46%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 -3px 8px -4px rgba(8, 47, 73, .45) inset, 0 12px 22px -12px rgba(3, 105, 161, .85);
    transition: background-color .15s, transform .15s;
  }
  .submit:hover { background-color: var(--action-hover); }
  .submit:active { transform: translateY(1px); }
  .submit:focus-visible { border-radius: 999px; }
  .fine { margin: 0; font-size: .8125rem; color: var(--quiet); }
  .talk { margin: 4px 0 0; font-size: .875rem; color: var(--slate); }

  .done { display: grid; gap: 12px; justify-items: start; padding-block: 12px; }
  .done h2 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); }
  .done h2:focus { outline: none; }
  .done h2:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; }
  .check { width: 56px; height: 56px; border-radius: 50%; background: var(--verified-soft); display: grid; place-items: center; }
  .check svg { width: 28px; height: 28px; }
  .check path { stroke: var(--verified); stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .1s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  .done p { margin: 0; color: var(--slate); max-width: 42ch; }
  .linkish {
    font: inherit; font-size: .9375rem; color: var(--action); background: none; border: 0; padding: 4px 0;
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  }
  .linkish:hover { color: var(--action-hover); }

  footer {
    display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; align-items: center;
    font-size: .875rem; color: var(--slate); padding-top: 4px; text-align: center;
  }
  footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }

  /* Privacy Notice dialog */
  dialog {
    width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 860px);
    border: 1px solid rgba(255, 255, 255, .9); border-radius: 30px; padding: 0;
    color: var(--slate); background: rgba(255, 255, 255, .97);
    box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .45); overflow: hidden;
  }
  dialog::backdrop { background: rgba(15, 23, 42, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  dialog[open] { animation: settle .25s ease-out both; }
  .dlg { display: flex; flex-direction: column; max-height: min(86vh, 860px); }
  .dlg-head {
    flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    padding: 20px 24px 14px; border-bottom: 1px solid var(--hairline);
  }
  .dlg-head h2 { margin: 10px 0 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; color: var(--ink); }
  .dlg-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 24px 24px; }
  .dlg-body:focus { outline: none; }
  .dlg-body:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }
  .draft {
    display: inline-flex; padding: 4px 12px; border-radius: 999px; background: #fef3c7; color: #92400e;
    border: 1px solid #f59e0b; font-size: .8125rem; font-weight: 700;
  }
  .close {
    font: inherit; font-weight: 600; min-height: 40px; padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--field-edge); background: #fff; color: var(--ink); cursor: pointer;
  }
  .close:hover { background: #f1f5f9; }
  .close:focus-visible { border-radius: 999px; }
  .notice h3 { margin: 18px 0 6px; font-size: 1rem; color: var(--ink); }
  .notice p, .notice li { font-size: .9375rem; }
  .notice p { margin: 0 0 8px; }
  .notice ul { margin: 0 0 8px; padding-left: 1.2em; }
  .notice li + li { margin-top: 4px; }
  .ph { background: #fef3c7; color: #78350f; padding: 0 4px; border-radius: 4px; }

  @media (min-width: 880px) {
    body { padding-inline: 32px; }
    .card { grid-template-columns: 1.05fr 1fr; min-height: 520px; }
    .intro { padding: 48px 44px 40px; gap: 28px; }
    .join { margin: 14px 14px 14px 0; padding: 40px 36px; border-radius: calc(var(--radius-card) - 14px); }
  }
  @media (min-width: 560px) and (max-width: 879px) { .pair { grid-template-columns: 1fr 1fr; } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
    .check path { stroke-dashoffset: 0; }
  }
  @media (prefers-reduced-transparency: reduce) {
    .card { background: rgba(255, 255, 255, .94); }
    .join { background: rgba(255, 255, 255, .97); }
    .card::after { display: none; }
  }
  @media (forced-colors: active) {
    .card, dialog { border: 1px solid CanvasText; }
    .submit { border: 1px solid ButtonText; }
    .card::before, .card::after, .fields::after, .watermark { display: none; }
  }
