/* Balance Grille guest Wi-Fi: shared styles for /, /terms and /connected/.
   Values from the Figma Brand Guide (file pXAE7AO9nEKtoQUuRBopD7). */

/* ------------------------------------------------------------------ */
/* 1. Fonts                                                            */
/* ------------------------------------------------------------------ */
/* Both families come from Adobe Typekit kit urb0jph, loaded by each page's
   <link rel="stylesheet" href="https://use.typekit.net/urb0jph.css">.
   The kit declares these families (names are lowercase, exactly as below):

     "fatfrank"  400 normal                        headlines
     "effra"     300 / 400 / 500 / 700 / 900       everything else, italics too

   Nothing is self-hosted. If the kit CSS does not load (offline, or the AP
   blocks use.typekit.net before Connect) the stacks below fall back to the
   system sans-serif. The stylesheet is pulled non-blocking on the pre-auth
   pages so a blocked request never delays first paint. */
:root {
  --font: "effra", sans-serif;
  --font-display: "fatfrank", "effra", sans-serif;

  /* Weights per the web guide */
  --weight-body: 400;      /* Effra Regular: body copy */
  --weight-label: 700;     /* Effra Bold: eyebrows, Label/Title */
  --weight-heavy: 900;     /* Effra Heavy: buttons, tags */
  --weight-display: 400;   /* FatFrank Regular: all headlines */
}

/* ------------------------------------------------------------------ */
/* 2. Color tokens                                                     */
/* ------------------------------------------------------------------ */
:root {
  /* core & neutrals */
  --black: #000;
  --white: #fff;
  --gray: #707070;
  --light-gray: #a7a7a7;
  --charcoal: #262626;
  --midnight: #212738;
  --periwinkle: #818ce6;
  /* food colors, as RGB triplets for rgba() */
  --wiseman: 15, 191, 239;
  --sweet-sour: 239, 65, 106;
  --budda: 239, 196, 17;
  --nuts-4-pao: 252, 197, 159;
  /* white alphas */
  --white-72: rgba(255, 255, 255, 0.72);
  --white-45: rgba(255, 255, 255, 0.45);
  --white-15: rgba(255, 255, 255, 0.15);
  --white-10: rgba(255, 255, 255, 0.10);
  --white-05: rgba(255, 255, 255, 0.05);
  /* misc */
  --focus: #0fbfef;
  --animate-time: 300ms;
  --radius: 12px;
  --radius-lg: 24px;
}

/* ------------------------------------------------------------------ */
/* 3. Base                                                             */
/* ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--black);
}
body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-weight: var(--weight-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100svh;
  min-height: 100vh;
  overflow-x: hidden;
}
/* Splash: everything vertically centred */
body.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
/* Connected: top-aligned scrolling page */
body.connected {
  padding: 40px 16px 32px;
  padding-top: calc(40px + env(safe-area-inset-top));
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
/* Terms: left-aligned reading page */
body.terms {
  padding: 40px 20px 48px;
  padding-top: calc(40px + env(safe-area-inset-top));
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

main, footer { position: relative; z-index: 1; }
main {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}
body.connected main { max-width: 440px; }
body.terms main { max-width: 560px; text-align: left; }

a { transition: color var(--animate-time) ease-in-out; }

/* ------------------------------------------------------------------ */
/* 4. Lights (ambient glow from balancegrille.com)                     */
/* ------------------------------------------------------------------ */
.lights {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.68;
  background:
    radial-gradient(220% 255% at -68% 98%, rgba(var(--sweet-sour), 0.30), rgba(var(--sweet-sour), 0) 70%),
    radial-gradient(180% 190% at 87% 38%, rgba(var(--wiseman), 0.26), rgba(var(--wiseman), 0) 70%),
    radial-gradient(120% 115% at 50% 100%, rgba(var(--budda), 0.14), rgba(var(--budda), 0) 70%);
}
/* Post-auth only: slow rotation. Oversized so edges never show. */
.lights.animated {
  inset: -40%;
  background:
    radial-gradient(60% 60% at 15% 85%, rgba(var(--sweet-sour), 0.30), rgba(var(--sweet-sour), 0) 70%),
    radial-gradient(55% 55% at 85% 35%, rgba(var(--wiseman), 0.26), rgba(var(--wiseman), 0) 70%),
    radial-gradient(45% 45% at 50% 100%, rgba(var(--budda), 0.14), rgba(var(--budda), 0) 70%);
  animation: drift 60s linear infinite;
}
@keyframes drift { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lights.animated { animation: none; } }
@media (prefers-reduced-transparency: reduce) { .lights { display: none; } }

/* ------------------------------------------------------------------ */
/* 5. Logo                                                             */
/* ------------------------------------------------------------------ */
.logo {
  display: block;
  width: 260px;
  height: auto;
  margin: 0 auto 36px;
  color: var(--white);
}
body.connected .logo { width: 200px; margin-bottom: 40px; }
body.terms .logo { width: 180px; margin: 0 0 32px; }

/* ------------------------------------------------------------------ */
/* 6. Type                                                             */
/* ------------------------------------------------------------------ */
/* Label/Title: Effra Bold 14px, lh 1.1, .2em, uppercase */
.eyebrow,
.location,
body.terms h2 {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: var(--weight-label);
  line-height: 1.1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-72);
}
.location { margin-bottom: 10px; }
.location:empty { display: none; }
section > .eyebrow { color: var(--white-45); margin-bottom: 16px; }
body.terms h2 { margin: 28px 0 8px; }

/* Headlines: FatFrank Regular, lh 1.1, ls -0.01em */
h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
body.connected h1 { font-size: 3rem; text-transform: lowercase; }
body.terms h1 { font-size: 2.375rem; margin-bottom: 20px; }

/* Body: Effra Regular 18px, lh 1.6 */
p.lede {
  margin: 0 auto 32px;
  max-width: 24em;
  color: var(--white-72);
  font-size: 1.125rem;
}
section p.body { margin: 0 auto 20px; max-width: 26em; color: var(--white-72); }
body.terms p { margin: 0 0 12px; color: var(--white-72); }
body.terms a { color: var(--white); text-decoration: underline; text-underline-offset: 0.15em; }

/* Body Small: Effra 12px */
p.terms,
footer {
  font-size: 0.75rem;
  color: var(--white-45);
  text-align: center;
}
p.terms { margin: 20px auto 0; }
p.terms a,
footer a {
  color: var(--white-72);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--white-45);
}
footer a { color: inherit; }
p.terms a:hover,
footer a:hover { color: var(--white); }
footer { margin: 48px auto 0; max-width: 440px; }
body.connected footer { margin-top: 24px; }
body.terms footer { max-width: 560px; text-align: left; }
footer p { margin: 0 0 6px; }

/* ------------------------------------------------------------------ */
/* 7. Buttons                                                          */
/* ------------------------------------------------------------------ */
/* One spec for every button: Effra Heavy, uppercase, 16px, .2em tracking,
   2px border, pill, padding 1em x 2em, 300ms ease-in-out. Variants only
   change fill, border and text. Default here is .filled.light (white). */
.cta {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  min-height: 56px;
  padding: 1em 2em;
  border: 2px solid var(--white);
  border-radius: 20em;
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: var(--weight-heavy);
  line-height: 1;
  letter-spacing: 0.2em;
  text-indent: 0.2em; /* visually re-centre letter-spaced text */
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--animate-time) ease-in-out,
              border-color var(--animate-time) ease-in-out,
              color var(--animate-time) ease-in-out,
              transform var(--animate-time) ease-in-out,
              opacity var(--animate-time) ease-in-out;
}
.cta.ghost.dark { background: transparent; color: var(--white); }
.cta.sm { font-size: 0.875rem; min-height: 48px; padding: 0.9em 1.6em; }
/* Hover only on devices that really hover; touch devices get a stuck :hover after a tap. */
@media (hover: hover) {
  .cta:hover { background-color: #e6e6e6; border-color: #e6e6e6; transform: translateY(-1px); }
  .cta.ghost.dark:hover { background: var(--white); border-color: var(--white); color: var(--black); }
}
.cta:active { transform: scale(0.98); }
.cta:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.cta[disabled] { opacity: 0.68; cursor: default; transform: none; }
.actions { display: grid; gap: 14px; margin: 0 auto 56px; max-width: 320px; }
.actions .cta { max-width: none; }
.stores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 360px; margin: 0 auto; }
.stores .cta { max-width: none; padding-left: 1.2em; padding-right: 1.2em; }
form { margin: 0; }

/* Back link on terms: a Label/Title */
.back {
  display: inline-block;
  margin-top: 32px;
  font-size: 0.875rem;
  font-weight: var(--weight-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}
.back,
body.terms .back { text-decoration: none; }
.back:hover { color: var(--white-72); }

/* ------------------------------------------------------------------ */
/* 8. Sections, cards, tags                                            */
/* ------------------------------------------------------------------ */
section { margin: 0 0 48px; }

/* Cards: Midnight base, 24px radius, hairline border, Nuts 4 Pao glow top-left */
.cards { display: grid; gap: 14px; text-align: left; }
.card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 22px 22px 20px;
  border: 1px solid var(--white-10);
  border-radius: var(--radius-lg);
  background: var(--midnight);
  color: var(--white);
  text-decoration: none;
  transition: border-color var(--animate-time) ease-in-out, transform var(--animate-time) ease-in-out;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 70% at -50% -50%, rgba(var(--nuts-4-pao), 0.55), rgba(var(--nuts-4-pao), 0) 70%);
  transition: background-position var(--animate-time) ease-in-out;
}
.card.alt::before { background: radial-gradient(70% 70% at -50% -50%, rgba(129, 140, 230, 0.55), rgba(129, 140, 230, 0) 70%); }
@media (hover: hover) {
  .card:hover { border-color: var(--white-15); transform: translateY(-2px); }
  .card:hover::before { background-position: 10% 10%; }
}
.card:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.card > * { position: relative; }
/* Heading/H3: FatFrank, lh 1.2 */
.card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 1.6rem;
  line-height: 1.2;
}
.card p { margin: 0; color: var(--white-72); font-size: 1rem; }
.card .more {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.875rem;
  font-weight: var(--weight-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
}

/* Tag filled: Effra Heavy .75rem, uppercase, .1em, white fill, black text, 12px radius */
.tag {
  display: inline-block;
  margin: 0 0 12px;
  padding: 0.4em 0.75em 0.35em;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  font-size: 0.75rem;
  font-weight: var(--weight-heavy);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Socials */
.social { display: flex; justify-content: center; gap: 14px; list-style: none; margin: 0; padding: 0; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  transition: background-color var(--animate-time) ease-in-out, color var(--animate-time) ease-in-out;
}
.social svg { width: 22px; height: 22px; fill: currentColor; }
@media (hover: hover) { .social a:hover { background: var(--white); color: var(--black); } }
.social a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* ------------------------------------------------------------------ */
/* 9. Breakpoints                                                      */
/* ------------------------------------------------------------------ */
@media (min-width: 600px) {
  .logo { width: 320px; margin-bottom: 44px; }
  body.connected .logo { width: 240px; }
  body.connected h1 { font-size: 4rem; }
  .actions { grid-template-columns: 1fr 1fr; max-width: 440px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
