/* WIRED Apply. Two looks, picked by data-theme on <html> (config.js sets it):
   dark  = the WIRED brand, same as the ads: ink ground, white type, steel for what is secondary;
   light = paper ground, near-black type, dark-grey small type, for cold traffic that does not know WIRED yet.
   In both, red is once per screen: the action. */
:root {
  --bg: #0B0A0A;
  --line: rgba(255, 255, 255, 0.12);
  --strong: #FFFFFF;
  --text: #F2F2F2;
  /* Small type (eyebrow, note, footer). Brighter than at first: it read dim on a phone in the sun. */
  --muted: #BDB6B3;
  --faint: #8A8381;
  --red: #ED1C24;
  --red-deep: #C9141B;
  --on-red: #FFFFFF;
  --fiber: var(--red);
  --form-bg: #1C1C1E;
  --form-shadow: none;

  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --label: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;

  --col: 560px;
  color-scheme: dark;
}

/* Light: paper, not pure white (pure white looks empty on a phone). No red glow; the line under the headline is graphite. */
:root[data-theme="light"] {
  --bg: #F5F3EF;
  --line: rgba(17, 16, 16, 0.14);
  --strong: #111010;
  --text: #1F1C1B;
  --muted: #4F4A48;
  --faint: #6B6563;
  --fiber: #2B2827;
  /* SRG+ Forms in theme=light draws a white card. */
  --form-bg: #FFFFFF;
  --form-shadow: 0 1px 2px rgba(17, 16, 16, 0.05), 0 12px 36px rgba(17, 16, 16, 0.07);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 18px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
img, svg, iframe { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- background
   A fiber bundle (bg-wide.svg, bg-tall.svg on portrait screens) with one red signal running a strand,
   a warm glow from the top right, a cool one from the bottom left, film grain, and edges that fall to black. */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    url("bg-wide.svg") center / cover no-repeat,
    radial-gradient(ellipse 85% 65% at 100% 0%, rgba(201, 20, 27, 0.24), transparent 62%),
    radial-gradient(ellipse 75% 60% at 0% 100%, rgba(140, 152, 164, 0.10), transparent 60%),
    var(--bg);
}
@media (orientation: portrait) {
  .bg { background-image:
    url("bg-tall.svg"),
    radial-gradient(ellipse 110% 55% at 100% 0%, rgba(201, 20, 27, 0.24), transparent 62%),
    radial-gradient(ellipse 90% 50% at 0% 100%, rgba(140, 152, 164, 0.10), transparent 60%); }
}
.bg::before, .bg::after { content: ""; position: absolute; inset: 0; }
.bg::before { background: radial-gradient(ellipse 75% 70% at 50% 42%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
.bg::after {
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* Light: pale steel strands (bg-*-light.svg), a cool tint from the bottom left, dark grain, barely shaded edges. */
[data-theme="light"] .bg {
  background:
    url("bg-wide-light.svg") center / cover no-repeat,
    radial-gradient(ellipse 75% 60% at 0% 100%, rgba(126, 139, 151, 0.12), transparent 60%),
    var(--bg);
}
@media (orientation: portrait) {
  [data-theme="light"] .bg { background-image:
    url("bg-tall-light.svg"),
    radial-gradient(ellipse 90% 50% at 0% 100%, rgba(126, 139, 151, 0.12), transparent 60%); }
}
[data-theme="light"] .bg::before { background: radial-gradient(ellipse 80% 75% at 50% 42%, transparent 60%, rgba(60, 50, 44, 0.06) 100%); }
[data-theme="light"] .bg::after { opacity: 0.05; filter: invert(1); }

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  max-width: calc(var(--col) + 48px);
  margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

/* ---------- top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 28px 0; }
.brand img { width: 128px; height: auto; }
/* White logo on dark, black logo on light. */
.logo-light, [data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }
.step-tag { font: 600 13px/1 var(--label); text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted); }

main { flex: 1; display: flex; flex-direction: column; }
section { flex: 1; display: flex; flex-direction: column; }

/* ---------- intro */
.intro { justify-content: center; gap: 22px; padding-block: 56px 40px; }
.intro-main { display: flex; flex-direction: column; gap: 22px; }

/* "How it works": under the button on phones (the skeptic's first question), the right half on wide screens. */
.how {
  margin-top: 18px; padding: 26px 24px 24px;
  border: 1px solid var(--line); border-radius: 20px;
  background: color-mix(in srgb, var(--form-bg) 60%, transparent); box-shadow: var(--form-shadow);
}
.how-title { font: 700 13px/1 var(--label); letter-spacing: 0.2em; color: var(--muted); }
.how-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 20px; }
.how-steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.how-n { font: 400 26px/1 var(--display); color: var(--strong); }
.how-steps strong { display: block; font: 700 19px/1.2 var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--strong); }
.how-steps p { margin-top: 4px; font-size: 15px; color: var(--muted); text-wrap: pretty; }
.eyebrow { font: 600 14px/1.2 var(--label); text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); }
h1, h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 0.96; letter-spacing: 0.005em; color: var(--strong); text-wrap: balance; }
h1 { font-size: clamp(46px, 15vw, 88px); }
h2 { font-size: clamp(38px, 10vw, 56px); }

/* The fiber line from the WIRED mark: a thin run that ends in a node (red on dark, graphite on light). */
.fiber-line { position: relative; width: 112px; height: 2px; background: var(--fiber); margin-block: 6px; }
.fiber-line::after { content: ""; position: absolute; right: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--fiber); }

/* pretty: no single word left alone on the last line. */
.lede { max-width: 30em; font-size: 19px; color: var(--text); text-wrap: pretty; }
.note { max-width: 30em; font-size: 16px; color: var(--muted); text-wrap: pretty; }

.cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 14px;
  margin-top: 10px;
  min-height: 60px; padding: 0 30px;
  border: 0; border-radius: 999px;
  background: var(--red); color: var(--on-red);
  font: 700 20px/1 var(--label); text-transform: uppercase; letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.cta svg { width: 22px; height: 22px; transition: transform 0.2s ease; }
.cta:hover { background: var(--red-deep); }
.cta:hover svg { transform: translateX(4px); }
.cta:active { transform: scale(0.98); }

/* ---------- quick check: one question per screen, answers are plain buttons (red stays on Apply now) */
.check { padding-block: 32px 32px; gap: 22px; }
.check-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.back {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--text); font: 600 13px/1 var(--label); text-transform: uppercase; letter-spacing: 0.18em;
  cursor: pointer;
}
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--strong); }
.q-count { font: 600 13px/1 var(--label); text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted); }
.q { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
/* A legend sits outside the fieldset's flex flow, so the gap above does not reach it: it takes its own margin. */
.q-title { padding: 0; margin-bottom: 22px; font: 400 clamp(32px, 8.5vw, 46px)/1 var(--display); text-transform: uppercase; color: var(--strong); text-wrap: balance; }
.q-title:focus { outline: none; }
.opts { display: grid; gap: 10px; }
.opts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt {
  min-height: 56px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--form-bg) 70%, transparent);
  color: var(--text); text-align: left;
  font: 600 18px/1.2 var(--label); letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.opt:hover { border-color: var(--strong); }
.opt:active { background: var(--form-bg); }
.opts-grid .opt-wide { grid-column: 1 / -1; }
/* The other-state list after "Another state", and its Continue. */
.select {
  width: 100%; min-height: 56px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--form-bg); color: var(--text);
  font: 600 18px/1.2 var(--label); letter-spacing: 0.02em;
}
.q .cta { margin-top: 0; }
.pick-hint { margin-top: -10px; font-size: 15px; color: var(--text); }

/* Shown above the contact step on the hold path. */
.hold-note { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); font-size: 16px; text-wrap: pretty; }

/* Quiet secondary actions on the end screens. */
.text-link { align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font-size: 16px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-link:hover { color: var(--strong); }
.share-link { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 15px; color: var(--text); word-break: break-all; user-select: all; }

.ghost {
  align-self: flex-start;
  min-height: 52px; padding: 0 26px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--strong);
  font: 700 17px/1 var(--label); text-transform: uppercase; letter-spacing: 0.08em;
  cursor: pointer;
}
.ghost:hover { border-color: var(--strong); }

/* ---------- survey and booking */
.apply, .book { padding-block: 28px 32px; gap: 18px; }
.apply { padding-top: 16px; }
.apply-title { font-size: clamp(32px, 8.5vw, 46px); line-height: 1; }
.frame-wrap { position: relative; }
/* Until the form reports in: a blank white card read as broken. */
.frame-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; font: 600 14px/1 var(--label); text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); pointer-events: none; }
/* SRG+ Forms draws its card in this colour; the frame takes the same ground so no seam shows. */
.frame { width: 100%; border: 0; border-radius: 20px; background: var(--form-bg); box-shadow: var(--form-shadow); }
/* Until the survey reports its height; its shortest step is about 460px. */
.frame-form { min-height: 460px; }
/* The CRM calendar switches to three columns from 760px wide and needs about 1000px for them:
   below that it must keep its one-column layout, so the frame stays under 760px. */
.frame-book { min-height: 720px; max-width: 720px; }
.book .lede { color: var(--muted); }
.placeholder { padding: 28px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 16px; }

/* ---------- booked */
.done { justify-content: center; gap: 22px; padding-block: 56px 40px; }

/* ---------- footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-block: 20px 28px; border-top: 1px solid var(--line); font: 500 13px/1.4 var(--label); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.foot-links { display: flex; gap: 18px; }
.foot a { color: var(--text); text-decoration: none; }
.foot a:hover { color: var(--strong); }

/* ---------- legal pages (privacy.html, sms-terms.html) */
.legal { gap: 0; padding-block: 48px 56px; }
.legal h1 { font-size: clamp(40px, 11vw, 64px); }
.legal .updated { margin-top: 14px; font: 600 13px/1.2 var(--label); text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }
.legal h2 { margin-top: 36px; font: 700 20px/1.2 var(--label); text-transform: uppercase; letter-spacing: 0.08em; color: var(--strong); }
.legal p, .legal li { font-size: 16px; color: var(--text); }
.legal p { margin-top: 12px; }
.legal ul { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.legal li::marker { color: var(--faint); }
.legal a { color: var(--strong); text-underline-offset: 3px; }
.legal strong { color: var(--strong); font-weight: 600; }
/* Facts the client still has to give: replace every one before going live. */
.fill { padding: 0 4px; border-radius: 4px; background: rgba(237, 28, 36, 0.2); color: var(--strong); }

/* ---------- the dealer mark: the T-Mobile Fiber logo from the dealer's own site, with the words */
.eyebrow.dealer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.eyebrow.dealer img { width: auto; height: 24px; }
.foot-dealer { display: inline-flex; align-items: center; gap: 8px; }
.foot-dealer img { width: auto; height: 16px; }
.foot-legal { flex-basis: 100%; font-size: 12px; line-height: 1.5; color: var(--faint); }

/* ---------- moving signals on the strands: a short dash runs each strand every 9-15 s, faint, behind everything */
.bg-flow { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-flow path {
  fill: none; stroke: var(--fiber); stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 0.06 0.94; stroke-dashoffset: 1; opacity: 0; animation: flow 11s linear infinite;
}
.bg-flow path:nth-child(2) { animation-duration: 13s; animation-delay: -5s; }
.bg-flow path:nth-child(3) { animation-duration: 9s; animation-delay: -2s; }
.bg-flow path:nth-child(4) { animation-duration: 15s; animation-delay: -9s; }
@keyframes flow {
  0% { stroke-dashoffset: 1; opacity: 0; }
  12% { opacity: 0.5; }
  82% { opacity: 0.5; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.bg-flow-tall { display: none; }
@media (orientation: portrait) {
  .bg-flow-wide { display: none; }
  .bg-flow-tall { display: block; }
}
[data-theme="light"] .bg-flow path { stroke: #3A4550; }

/* ---------- the one-minute reel under "How it works": square, muted, plays while on screen */
.intro-side { display: flex; flex-direction: column; gap: 18px; }
.reel { position: relative; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 20px; background: #0B0A0A; box-shadow: var(--form-shadow); }
.reel-video { width: 100%; height: 100%; object-fit: cover; }
.reel-sound {
  position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 0; border-radius: 50%; background: rgba(11, 10, 10, 0.6); color: #FFFFFF; cursor: pointer;
}
.reel-sound svg { width: 20px; height: 20px; }
.reel-sound .on, .reel-sound[aria-pressed="true"] .off { display: none; }
.reel-sound[aria-pressed="true"] .on { display: block; }

/* ---------- the recruiter on the booking step: his face, so people know who calls */
.recruiter { display: flex; align-items: center; gap: 14px; }
.recruiter img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.recruiter p { display: flex; flex-direction: column; gap: 2px; font-size: 15px; color: var(--muted); }
.recruiter strong { font: 700 19px/1.2 var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--strong); }

@media (min-width: 760px) {
  .top { padding-top: 40px; }
  .opts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro, .done { padding-block: 72px 56px; }
}

/* ---------- wide screens: a bigger page, the pitch on the left and how it works on the right;
   the steps after it keep a centred reading column. */
@media (min-width: 1100px) {
  .page {
    max-width: calc(1180px + 96px);
    padding-left: max(48px, env(safe-area-inset-left, 0px));
    padding-right: max(48px, env(safe-area-inset-right, 0px));
  }
  .brand img { width: 168px; }
  .step-tag { font-size: 14px; }

  .intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr); align-items: center; gap: 72px; padding-block: 40px 32px; }
  .intro-main { gap: 26px; }
  .intro h1 { font-size: clamp(88px, 7.4vw, 116px); }
  .eyebrow { font-size: 16px; }
  .lede { font-size: 23px; }
  .note { font-size: 18px; }
  .cta { min-height: 68px; padding: 0 36px; font-size: 22px; }

  .how { margin-top: 0; padding: 36px 36px 34px; border-radius: 24px; }
  .intro-side { gap: 22px; }
  .reel { border-radius: 24px; }
  .eyebrow.dealer img { height: 30px; }
  .how-title { font-size: 14px; }
  .how-steps { margin-top: 28px; gap: 28px; }
  .how-steps li { grid-template-columns: 48px minmax(0, 1fr); gap: 16px; }
  .how-n { font-size: 30px; }
  .how-steps strong { font-size: 21px; }
  .how-steps p { margin-top: 6px; font-size: 16px; }

  .check, .book, .done, .legal { width: 100%; max-width: 760px; margin-inline: auto; }
  /* The booking step gets the width the calendar's three columns need; its words keep the reading width. */
  .book { max-width: 1072px; }
  .book .lede, .book .note { max-width: 760px; }
  .frame-book { max-width: none; min-height: 540px; }
  .check { justify-content: center; padding-block: 48px; }
  .apply { width: 100%; max-width: 640px; margin-inline: auto; }
  .q-title, .apply-title { font-size: 56px; }
  .opt, .select { min-height: 64px; font-size: 20px; }
}

/* Big monitors: grow again so the page does not float in empty space. */
@media (min-width: 1600px) {
  .page { max-width: calc(1360px + 96px); }
  .brand img { width: 188px; }
  .eyebrow { font-size: 17px; }
  .intro h1 { font-size: clamp(116px, 7.2vw, 140px); }
  .lede { font-size: 26px; }
  .note { font-size: 20px; }
  .cta { min-height: 76px; padding: 0 42px; font-size: 24px; }
  .how { padding: 44px 44px 40px; }
  .how-title { font-size: 15px; }
  .how-n { font-size: 36px; }
  .how-steps strong { font-size: 24px; }
  .how-steps p { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cta, .cta svg, .opt { transition: none; }
  .bg-flow { display: none; }
}
