/* Qwest site. One bold thing: the hero thread, set as display type in message
   bubbles. Everything else stays quiet. */

:root {
  --paper: #F5F7FA;
  --surface: #FFFFFF;
  --ink: #12193B;
  --ink-soft: #4B5476;
  --line: #D6DBE6;
  --sent: #2F5BFF;         /* your texts */
  --sent-ink: #FFFFFF;
  --received: #E3E7EF;     /* Qwest's replies */
  --received-ink: #12193B;
  --marigold: #FFB224;     /* actions only */
  --marigold-ink: #241800;
  --ok: #17784A;
  --warn: #9A4A06;
  --danger: #B42318;
  --focus: #2F5BFF;

  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  /* Scale: 15 / 18 / 21 / 24 / 30 / 36 / 48 */
  --t-small: 0.9375rem;
  --t-body: 1.125rem;
  --t-lede: 1.3125rem;
  --t-h3: 1.5rem;
  --t-h1: clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem);
  --t-h2: clamp(1.875rem, 1.3rem + 1.8vw, 2.25rem);
  --t-thread: clamp(1.9rem, 0.9rem + 4.4vw, 4.25rem);

  --gutter: 16px;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1330;
    --surface: #141B3D;
    --ink: #EEF1F9;
    --ink-soft: #AEB6D3;
    --line: #2A3360;
    --sent: #4A72FF;
    --received: #252D52;
    --received-ink: #EEF1F9;
    --ok: #4CC38A;
    --warn: #F2A65A;
    --danger: #FF7A6E;
    --focus: #8FA8FF;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
}
img, svg { max-width: 100%; }
a { color: var(--sent); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3 { line-height: 1.15; margin: 0; font-variation-settings: "opsz" 48; }
h1 { font-size: var(--t-h1); font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: var(--t-h2); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: var(--t-h3); font-weight: 650; }
p { margin: 0 0 1em; }
strong { font-weight: 650; }
code { font-size: 0.9em; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 42rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* --- header and footer ------------------------------------------------------ */

.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; flex-wrap: wrap; padding-block: 18px;
}
.wordmark {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  color: var(--ink); text-decoration: none; font-variation-settings: "opsz" 96;
}
.wordmark.small { font-size: 1.375rem; margin: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.nav a {
  color: var(--ink); text-decoration: none; font-size: var(--t-small); font-weight: 550;
  padding-block: 6px; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--sent); }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; }
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px; padding-block: 28px; font-size: var(--t-small); color: var(--ink-soft);
}
.footer-note { margin: 0; max-width: 34rem; }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { color: var(--ink-soft); }

/* --- message bubbles ----------------------------------------------------------- */

.bubble {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.4em 0.68em 0.46em;
  border-radius: 0.86em;
  line-height: 1.12;
}
.bubble.sent { background: var(--sent); color: var(--sent-ink); margin-left: auto; }
.bubble.received { background: var(--received); color: var(--received-ink); }
/* The tail: a sliver of bubble color, carved by a sliver of page color. */
.bubble::before, .bubble::after { content: ""; position: absolute; bottom: 0; height: 0.62em; }
.bubble.sent::before {
  right: -0.32em; width: 0.8em; background: var(--sent);
  border-bottom-left-radius: 0.66em 0.56em;
}
.bubble.sent::after {
  right: -0.52em; width: 0.52em; background: var(--paper);
  border-bottom-left-radius: 0.4em;
}
.bubble.received::before {
  left: -0.32em; width: 0.8em; background: var(--received);
  border-bottom-right-radius: 0.66em 0.56em;
}
.bubble.received::after {
  left: -0.52em; width: 0.52em; background: var(--paper);
  border-bottom-right-radius: 0.4em;
}

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

.hero { padding-block: 24px 64px; }
.thread {
  list-style: none; margin: 0 0 48px; padding: 0 0.5em;
  display: flex; flex-direction: column; gap: 0.32em;
  font-size: var(--t-thread); font-weight: 600; letter-spacing: -0.022em;
  font-variation-settings: "opsz" 96;
}
.thread .sent { max-width: 15ch; }
.thread .received { max-width: 19ch; margin-top: 0.25em; }
.thread .short { margin-top: 0.25em; }
.typing {
  display: flex; gap: 0.12em; width: fit-content; padding: 0.32em 0.5em;
  border-radius: 0.86em; background: var(--received); margin-top: 0.25em; overflow: hidden;
}
.typing span {
  width: 0.16em; height: 0.16em; border-radius: 50%; background: var(--ink-soft);
  animation: blink 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

/* The page's one orchestrated moment: the thread arrives like texts do. */
.thread .t1, .thread .t3, .thread .t4 { animation: arrive 0.42s cubic-bezier(.2,.8,.3,1.2) both; }
.thread .t1 { animation-delay: 0.15s; }
.thread .t2 { animation: typing 1.25s ease both; animation-delay: 0.75s; }
.thread .t3 { animation-delay: 1.95s; }
.thread .t4 { animation-delay: 2.9s; }
@keyframes arrive { from { opacity: 0; transform: translateY(0.3em) scale(0.96); } }
@keyframes typing {
  0% { opacity: 0; max-height: 0; margin-top: 0; padding-block: 0; }
  12%, 85% { opacity: 1; max-height: 1.5em; margin-top: 0.25em; padding-block: 0.32em; }
  100% { opacity: 0; max-height: 0; margin-top: 0; padding-block: 0; }
}
@keyframes blink { 0%, 80%, 100% { opacity: 0.35; } 40% { opacity: 1; } }

.hero-copy { max-width: 40rem; }
.hero-copy h1 { margin-bottom: 16px; }
.lede { font-size: var(--t-lede); color: var(--ink-soft); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* --- buttons and forms ------------------------------------------------------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px; border-radius: 999px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 650; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--surface); }
.button.primary { background: var(--marigold); border-color: var(--marigold); color: var(--marigold-ink); }
.button.primary:hover { filter: brightness(1.05); }
.button.small { min-height: 36px; padding: 4px 14px; font-size: var(--t-small); margin-left: 8px; }
.button.destructive { border-color: var(--danger); color: var(--danger); }

.form { display: grid; gap: 20px; align-content: start; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 1rem; }
.optional { font-weight: 400; color: var(--ink-soft); }
input, select, textarea {
  font: inherit; font-size: 1.0625rem; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-soft); }
textarea { resize: vertical; min-height: 9rem; line-height: 1.5; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.error { color: var(--danger); font-size: var(--t-small); margin: 0; }
.hint { color: var(--ink-soft); font-size: var(--t-small); margin: 0; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .button { justify-self: start; }

/* --- sections ---------------------------------------------------------------------- */

.section { padding-block: 56px; }
.section h2 { margin-bottom: 32px; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 36px; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 3rem 1fr; gap: 4px 16px; align-items: start;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--ink); font-weight: 700; font-size: 1.0625rem;
}
.step-text h3 { margin-bottom: 6px; }
.step-text p { color: var(--ink-soft); max-width: 34rem; margin: 0; }
.bubble.mini { font-size: 1.0625rem; line-height: 1.35; max-width: 22rem; margin-top: 12px; }
.steps .bubble.mini.sent { margin-left: 0; }   /* in the steps, every example sits under its text */

.facts { display: grid; gap: 28px; margin: 0; }
.facts div { border-top: 2px solid var(--ink); padding-top: 14px; }
.facts dt { font-weight: 700; font-size: 1.25rem; margin-bottom: 6px; }
.facts dd { margin: 0; color: var(--ink-soft); max-width: 30rem; }

.band { background: var(--surface); border-block: 1px solid var(--line); }
.band-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 48px; }
.band h2 { margin-bottom: 8px; }
.band p { margin: 0; color: var(--ink-soft); }

/* --- form pages ----------------------------------------------------------------------- */

.narrow h1 { margin-bottom: 12px; }
.narrow form { margin-block: 24px 12px; }
.page-grid { display: grid; gap: 32px; }
.page-intro h1 { margin-bottom: 14px; }
.page-intro p { color: var(--ink-soft); max-width: 32rem; }
.aside { border-left: 3px solid var(--marigold); padding-left: 14px; }
.reply { align-self: start; }
.reply .bubble { font-size: var(--t-lede); line-height: 1.3; max-width: 26rem; margin-bottom: 20px; }
.dev { font-size: var(--t-small); color: var(--warn); }

.banner { border-radius: 12px; padding: 12px 16px; margin: 20px 0 8px; border: 2px solid; }
.banner.ok { border-color: var(--ok); color: var(--ok); }
.banner.warn { border-color: var(--warn); color: var(--warn); }
.sub { font-size: var(--t-h3); margin: 32px 0 16px; }

.checklist { list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 18px; }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.checklist .mark { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); margin-top: 3px; }
.checklist .done .mark { background: var(--ok); border-color: var(--ok); position: relative; }
.checklist .done .mark::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.item { font-weight: 650; margin: 0; }
.detail { color: var(--ink-soft); margin: 2px 0 0; font-size: var(--t-small); }

.account-actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; }
details.danger summary { cursor: pointer; color: var(--danger); font-weight: 600; padding: 12px 0; }
details.danger p { font-size: var(--t-small); color: var(--ink-soft); max-width: 28rem; }

.mail { border-top: 1px solid var(--line); padding-block: 16px; }
.mail pre { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: var(--t-small); margin: 8px 0 0; }

/* --- wider screens --------------------------------------------------------------------- */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .hero { padding-block: 40px 88px; }
  .thread { padding: 0 1em; }
  .steps li { grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 22rem); column-gap: 32px; }
  .steps li::before { grid-row: auto; }
  .steps .bubble.mini { margin-top: 4px; }
  .steps .bubble.mini.sent { margin-left: auto; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
  .page-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); column-gap: 64px; align-items: start; }
}
@media (min-width: 1000px) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .thread .t1, .thread .t3, .thread .t4 { animation: none; }
  .thread .t2 { display: none; }
}
