/*
 * haloclub.app — one screen, no scrolling, and of a piece with the app's Sign in page:
 * the same textured navy ground, the club's lockup, a Playfair title over Inter, fields and the
 * button exactly as the app draws them (radius 24, gold only for the thing to press), and the
 * club's globe.
 *
 * Phone:   laid out as Sign in is: centred, the form in the middle, the globe rising from the bottom.
 * Desktop: the same things left-aligned, with the globe large at the lower right, cut by the screen.
 */
@font-face { font-family: 'Playfair Display'; src: url('fonts/PlayfairDisplay-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('fonts/PlayfairDisplay-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  /* The app's own tokens (constants/colors.ts, spacing.ts) */
  --navy: #0d1b2a;
  --cream: #f5f0e8;
  --text: #e0d6d0;                          /* textLight */
  --text-muted: rgba(224, 214, 208, 0.6);   /* textLight60 */
  --gold-cta: #f6d664;
  --gold: #d4a853;
  --gold-border: rgba(212, 168, 83, 0.20);
  --gold-label: rgba(212, 168, 83, 0.5);
  --field: rgba(255, 255, 255, 0.03);
  --field-focus: rgba(255, 255, 255, 0.06);
  --radius: 24px;
  --gutter: clamp(24px, 4.2vw, 76px);
  /* The lockup is built from the mark: every distance in it is a fraction of the mark's height,
     so the whole thing scales as one piece (see scripts/brand/make-lockup.py, which draws the
     same arrangement as artwork) */
  --mark-h: clamp(34px, 5.2vh, 46px);
  /* The wordmark answers the mark: capitals 0.28 of its height (Inter's capitals are 0.7275em) */
  --word-size: calc(var(--mark-h) * 0.385);
  /* The globe's box; the sphere itself is 82% of it, the rest is room for its halo */
  --g: 155vh;
}

* { box-sizing: border-box; }
/* Pinned: the page is the screen, and there is nowhere for it to scroll or slide to */
html, body { position: fixed; inset: 0; width: 100%; height: 100%; margin: 0; overflow: hidden; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #0a121d;
  overscroll-behavior: none;
  touch-action: manipulation;            /* no double-tap zoom */
}

/* The ground, as NavyBackground lays it: the textured navy with its pool of light, then darkened by 45% */
.page { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(rgba(5, 10, 20, 0.45), rgba(5, 10, 20, 0.45)), url('bg-navy.png') center 32% / cover no-repeat, #0d1b2a; }

/* ── Top: the lockup ── */
.top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: clamp(18px, 3.4vh, 40px) var(--gutter) 0; }
/* Side by side, the wordmark stands half a mark-height clear of the mark */
.lockup { display: flex; align-items: center; gap: calc(var(--mark-h) / 2); text-decoration: none; }
.mark { display: block; width: auto; height: var(--mark-h); opacity: 0.9; }
/* The wordmark, as the app's splash sets it: Inter SemiBold in capitals, tracked at 0.3em */
.wordmark { font-family: 'Inter', sans-serif; font-weight: 600; font-size: var(--word-size); letter-spacing: 0.3em; text-transform: uppercase; color: var(--text); }
/* Set as the wordmark is — capitals, tracked, SemiBold — so the two read as a pair across the top.
   The trailing tracking after the last N is pulled back, so the letters end on the gutter. */
.soon { font-size: 12px; font-weight: 600; letter-spacing: 0.22em; margin-right: -0.22em; text-transform: uppercase; color: var(--text); }

/* ── Words and form ── */
.copy { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; width: min(46rem, 100%); padding: 0 var(--gutter); padding-bottom: 5vh; pointer-events: none; }
.copy > * { pointer-events: auto; }
h1 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: clamp(36px, min(5vw, 9.6vh), 88px); line-height: 1.06; letter-spacing: -0.005em; color: var(--text); }
.tagline { margin: clamp(12px, 2.4vh, 26px) 0 0; max-width: 40rem; text-wrap: balance; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(17px, min(1.7vw, 3.1vh), 27px); line-height: 1.35; color: var(--text); }
.lede { margin: clamp(8px, 1.6vh, 16px) 0 0; max-width: 35rem; font-size: clamp(14px, min(1.08vw, 2.2vh), 17px); line-height: 1.6; color: var(--text-muted); }

.waitlist { margin-top: clamp(18px, 4vh, 44px); max-width: 35rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
/* The app's FloatingField: the label lives inside the field and floats up as soon as you focus or
   type; the field grows a little (52 to 60) and its border turns gold, so it is plain where you are. */
.field { position: relative; display: block; min-width: 0; text-align: left; }
.field.wide { grid-column: 1 / -1; }
.field input {
  display: block; width: 100%; height: 52px; padding: 0 20px;
  /* 16px and no smaller: below that an iPhone zooms the page in when a field is tapped, which is
     what shoved everything to the left */
  font: 400 16px 'Inter', system-ui, sans-serif; color: var(--text);
  background: var(--field); border: 1px solid var(--gold-border); border-radius: var(--radius);
  outline: none; -webkit-appearance: none; appearance: none;
  transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1), padding 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.28s, background-color 0.28s;
}
.field > span {
  position: absolute; left: 21px; right: 21px; top: 16px; pointer-events: none;
  font: 500 15px/20px 'Inter', system-ui, sans-serif; letter-spacing: 0.2px; color: var(--gold-label);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: top 0.28s cubic-bezier(0.22, 1, 0.36, 1), font-size 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.28s;
}
.field input:focus, .field input:not(:placeholder-shown) { height: 60px; padding-top: 18px; }
.field input:focus + span, .field input:not(:placeholder-shown) + span { top: 9px; font-size: 11px; line-height: 14px; }
.field input:focus { border-color: var(--gold); background-color: var(--field-focus); }
.field input:focus + span { color: var(--gold); }
.field input.invalid { border-color: #ff6b5e; }
.field input.invalid + span { color: #ff8a7f; }
/* A browser that fills a field in paints it its own pale colour, and insists on it. The colour cannot
   be overruled, but it can be confined: clipped to the letters, where the text's own colour covers it,
   so the field stays ours. The inset shadow puts back the field's faint tint. (Safari and Chrome both.) */
.field input:-webkit-autofill, .field input:-webkit-autofill:hover, .field input:-webkit-autofill:focus, .field input:autofill {
  -webkit-background-clip: text !important; background-clip: text !important;
  -webkit-text-fill-color: var(--text) !important; caret-color: var(--text);
  box-shadow: inset 0 0 0 100px var(--field) !important;
  transition: background-color 99999s ease-out, height 0.28s, padding 0.28s, border-color 0.28s;
}
.field input:-webkit-autofill:focus { box-shadow: inset 0 0 0 100px var(--field-focus) !important; }
.field input:-webkit-autofill + span { top: 9px; font-size: 11px; line-height: 14px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cta {
  width: 100%; height: 50px; margin-top: 12px;
  font: 600 15px 'Inter', system-ui, sans-serif; color: var(--navy);
  background: var(--gold-cta); border: 0; border-radius: var(--radius); cursor: pointer;
  transition: transform 0.15s, filter 0.2s, opacity 0.2s;
}
.cta:hover { filter: brightness(1.05); }
.cta:active { transform: scale(0.985); }
.cta:disabled { opacity: 0.6; cursor: default; }
.note { margin: 0; font-size: 13px; color: var(--text-muted); }
.note:not(:empty) { margin-top: 10px; }
.note.error { color: #ff8a7f; }
.note.done { color: var(--text); white-space: pre-line; }
.waitlist.joined .fields, .waitlist.joined .cta { display: none; }
.waitlist.joined .note { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(17px, 1.5vw, 23px); line-height: 1.35; }

/* ── Foot ── */
.foot { position: absolute; z-index: 2; left: var(--gutter); bottom: clamp(16px, 3.4vh, 36px); display: flex; gap: 12px; }
.foot a { font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none; }
.foot .dot { font-size: 13px; color: var(--text-muted); }
.foot a:hover { color: var(--text); }

/* ── Globe ── */
.globe-window { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.globe {
  position: absolute; width: var(--g); height: var(--g);
  /* Its centre: well to the right and below the middle, and never so far left that it crowds the words */
  left: calc(max(76vw, 46rem + 0.41 * var(--g) - 3vw) - var(--g) / 2);
  top: calc(72vh - var(--g) / 2);
  opacity: 0; transition: opacity 1.4s ease;
  pointer-events: none;                  /* it turns; it is not for stopping or spinning, here */
}
.globe.ready { opacity: 1; }
.globe canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe-labels { position: absolute; inset: 0; pointer-events: none; }
.place { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; }
/* Hung from its foot, as the app hangs them: the pin's centre is the place itself */
.place-hang { position: absolute; left: 0; bottom: -3px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.place-hang.at-pole { bottom: -14px; }
.chip { display: block; white-space: nowrap; padding: 3px 10px; border-radius: var(--radius); background: var(--gold-cta); color: var(--navy); font: 600 11px/1.3 'Inter', sans-serif; letter-spacing: 0.4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.chip-stem { width: 1.5px; height: 8px; background: var(--gold-cta); }
.pin { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-cta); border: 1px solid var(--navy); }
/* A sticker: the emoji with a white edge all round, and the dot that marks its place */
.sticker { display: block; font-size: 22px; line-height: 28px; text-shadow: 1.5px 0 0 #fff, -1.5px 0 0 #fff, 0 1.5px 0 #fff, 0 -1.5px 0 #fff, 1.1px 1.1px 0 #fff, -1.1px 1.1px 0 #fff, 1.1px -1.1px 0 #fff, -1.1px -1.1px 0 #fff; }
.sticker-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-cta); margin-top: -2px; }
@media (min-width: 901px) {
  .chip { font-size: 13px; padding: 4px 12px; }
  .sticker { font-size: 27px; line-height: 34px; }
}
.no-globe { display: none; }

/* ── Phone and narrow windows: Sign in's own arrangement ── */
@media (max-width: 900px) {
  /* Stacked, the mark leads and the wordmark is a caption under it, so it is set at a readable
     fixed size rather than as a fraction of the mark (which the brand's own stacked artwork,
     made for large reproduction, would put at about 8px here) */
  :root { --g: min(190vw, 120vh); --mark-h: clamp(40px, 7.4vh, 64px); --word-size: 13px; }
  .top { flex-direction: column; gap: 0; padding-top: clamp(14px, 3vh, 34px); }
  /* Stacked, the brand artwork sets the wordmark 0.345 mark-heights under the mark; its line box
     already carries 0.2415em of that above the capitals, so only the rest is asked of the gap */
  .lockup { flex-direction: column; gap: calc(var(--mark-h) * 0.345 - var(--word-size) * 0.2415); }
  .mark { opacity: 0.62; }                                       /* AUTH_MARK_OPACITY */
  .wordmark { padding-left: 0.3em; }               /* the tracking after the last letter, balanced */
  .soon { display: none; }

  .copy { flex: 0 0 auto; justify-content: flex-start; width: 100%; max-width: 30rem; margin: 0 auto; padding-top: clamp(12px, 2.6vh, 30px); padding-bottom: 0; text-align: center; }
  h1 { font-size: clamp(27px, min(8.4vw, 5.2vh), 52px); line-height: 1.1; }
  .tagline { margin-top: clamp(8px, 1.5vh, 16px); font-size: clamp(14px, min(4.05vw, 2.4vh), 21px); }
  .lede { margin-top: clamp(6px, 1.1vh, 12px); font-size: clamp(12.5px, min(3.5vw, 1.95vh), 15px); line-height: 1.5; }
  .waitlist { margin-top: clamp(12px, 2.2vh, 26px); }
  .fields { gap: 10px; }                     /* first and last share a row on a phone too: it saves a row of height */
  .field input { padding-left: 16px; padding-right: 16px; }
  .field > span { left: 17px; right: 17px; }
  .cta { margin-top: 10px; }

  /* The halo reaches above the sphere; it fades in under the form rather than being cut by the window's edge */
  .globe-window { position: relative; inset: auto; flex: 1 1 0; min-height: 0; margin-top: clamp(0px, 0.6vh, 8px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34px); mask-image: linear-gradient(to bottom, transparent 0, #000 34px); }
  .globe { left: 50%; top: calc(26px - 0.09 * var(--g)); margin-left: calc(var(--g) / -2); }

  /* The links stand on the globe: a shade under them so they read whatever is turning past */
  .page::after { content: ''; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 84px; pointer-events: none; background: linear-gradient(to bottom, rgba(8, 14, 24, 0), rgba(8, 14, 24, 0.82)); }
  .foot { left: 0; right: 0; bottom: max(12px, env(safe-area-inset-bottom)); justify-content: center; gap: 12px; }
  .foot a { color: var(--text); text-shadow: 0 1px 8px rgba(8, 18, 29, 0.95); }
}

/* Very short windows (a phone on its side): the globe gives way before the form does */
@media (max-height: 520px) and (max-width: 900px) { .globe-window { display: none; } }

/* ── Not found ── */
/* The label sits with the words rather than in the corner, because the corner is where the
   phone stacks the lockup and there is no room left beside it */
.lost-label { margin: 0 0 clamp(10px, 1.8vh, 18px); font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); }
/* The same page, with the form's place taken by one way back. The globe carries on turning
   behind it, which is the point: we really did look everywhere. */
.lost-cta {
  display: inline-flex; align-items: center; justify-content: center;
  /* .copy is a column flexbox, so without this the button stretches the whole way across */
  align-self: flex-start;
  width: auto; min-width: 11rem; padding: 0 32px; margin-top: clamp(20px, 4vh, 44px);
  text-decoration: none;
}

@media (max-width: 900px) {
  /* Centred with everything else it sits under */
  .lost-cta { align-self: center; }
}
