/* Companido — "9:47, answered." (RM000015 redesign)
 *
 * One story: after hours, the phone rings, and something answers.
 * Visual language: near-black night, one emerald presence dot, huge quiet
 * typography, hairlines instead of boxes, motion only where it tells the
 * story. No cards, no shadows, no second accent.
 */

/* ---------------------------------- tokens ------------------------------- */

:root {
  color-scheme: dark;

  --bg: #0a0b0d;
  --text: #f5f6f7;
  --text-dim: #9aa3ab;
  --text-mute: #6e7681;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #34d399;
  --accent-ink: #06130d;
  --accent-dim: rgba(52, 211, 153, 0.35);

  --font:
    system-ui, -apple-system, 'Segoe UI Variable Display', 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --shell: 66rem;
}

/* ---------------------------------- base --------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--text);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: min(var(--shell), 100% - 3rem);
  margin-inline: auto;
}

.shell-narrow {
  width: min(42rem, 100% - 3rem);
}

.skip-link {
  position: absolute;
  left: -100vw;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* The presence dot — the brand mark. It means: someone is there. */
.dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.05em;
}

.accent {
  color: var(--accent);
}

/* --------------------------------- header -------------------------------- */

.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.4rem;
}

.wordmark {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.wordmark .dot {
  width: 0.32em;
  height: 0.32em;
  margin-left: 0.18em;
}

/* --------------------------------- buttons ------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.button:active {
  transform: translateY(1px);
}

.button-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-accent:hover {
  background: #4be0a8;
}

.button-accent[disabled] {
  opacity: 0.55;
  cursor: wait;
}

.button-quiet {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.button-quiet:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.button-wide {
  width: 100%;
  padding-block: 0.95rem;
  font-size: 1.0625rem;
}

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

.hero {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: 7.5rem 5rem;
}

.display {
  font-size: clamp(2.5rem, 7.6vw, 5.1rem);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -0.031em;
  color: var(--text);
  text-wrap: balance;
  max-width: 15em;
}

.display span {
  display: block;
}

.display-dim {
  color: var(--text-mute);
}

.lede {
  margin-top: 1.6rem;
  max-width: 34em;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 2.2rem;
}

.micro {
  font-size: 0.875rem;
  color: var(--text-mute);
}

/* ------------------------------- transcript ------------------------------ */

.transcript {
  margin-top: clamp(3.5rem, 9vh, 6rem);
  max-width: 33rem;
  display: grid;
  gap: 1.05rem;
  border-left: 1px solid var(--line);
  padding-left: clamp(1.2rem, 4vw, 2rem);
}

.t-caption {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.t-caption .dot {
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.6em;
}

.t-caller {
  color: var(--text-mute);
  font-size: 1.02rem;
}

.t-companido {
  position: relative;
  color: var(--text);
  font-size: 1.02rem;
}

.t-companido .t-reply::before {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.6em;
  vertical-align: 0.08em;
}

.t-confirm {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Typing indicator occupies the reply's line, then hands over to the text. */
.t-typing {
  position: absolute;
  left: 0;
  top: 0.35em;
  display: inline-flex;
  gap: 0.28em;
}

.t-typing i {
  width: 0.32em;
  height: 0.32em;
  border-radius: 50%;
  background: var(--text-mute);
}

/* -------- hero timeline (plays once; reduced motion sees the ending) ----- */

@media (prefers-reduced-motion: no-preference) {
  .transcript > * {
    opacity: 0;
    transform: translateY(10px);
    animation: t-in 0.6s var(--ease) forwards;
  }

  .t-1 {
    animation-delay: 0.5s;
  }
  .t-2 {
    animation-delay: 1.4s;
  }
  .t-3 {
    animation-delay: 2.3s;
  } /* row arrives with the typing dots */
  .t-4 {
    animation-delay: 5.3s;
  }
  .t-5 {
    animation-delay: 6.7s;
  }
  .t-6 {
    animation-delay: 8s;
  }
  .t-7 {
    animation-delay: 9.2s;
  }

  /* The reply row appears at 3.9s, but its text holds until typing ends. */
  .t-3 .t-reply {
    opacity: 0;
    animation: t-show 0.4s var(--ease) 3.95s forwards;
  }

  .t-typing i {
    opacity: 0;
    animation:
      t-window 1.6s linear 2.4s both,
      t-bounce 0.9s ease-in-out 2.4s 2;
  }

  .t-typing i:nth-child(2) {
    animation-delay: 2.55s, 2.55s;
  }
  .t-typing i:nth-child(3) {
    animation-delay: 2.7s, 2.7s;
  }

  .dot-pulse {
    animation: pulse 2.4s ease-in-out 0.6s 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-typing {
    display: none;
  }
}

@keyframes t-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes t-show {
  to {
    opacity: 1;
  }
}

@keyframes t-window {
  0%,
  4% {
    opacity: 0;
  }
  10%,
  82% {
    opacity: 1;
  }
  90%,
  100% {
    opacity: 0;
  }
}

@keyframes t-bounce {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: translateY(-0.18em);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
  }
  50% {
    box-shadow: 0 0 0 0.45em rgba(52, 211, 153, 0);
  }
}

/* -------------------------------- chapters ------------------------------- */

.chapter {
  padding-block: clamp(7rem, 20vh, 12rem);
  border-top: 1px solid var(--line);
}

.headline {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 620;
  line-height: 1.12;
  letter-spacing: -0.024em;
  color: var(--text);
  text-wrap: balance;
}

.body {
  margin-top: 1.1rem;
  max-width: 32em;
  color: var(--text-dim);
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
}

/* Scroll reveals are JS-gated: without JS everything is simply visible. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Stagger, in hundredths of a second.
 *
 * These were `style="--d: 0.12s"` in the markup until the live site was read
 * with a console open: the page's own Content-Security-Policy is
 * `style-src 'self'` with no `unsafe-inline`, so **every one of them was
 * blocked**. The attribute was in the HTML, the custom property resolved to
 * empty, and the whole sequence revealed at once — a silent failure that looked
 * like a design choice. Declaring them here is what makes them apply at all.
 *
 * A value used in the markup with no rule here does nothing, exactly as before,
 * so a test asserts the two sets match. */
html.js [data-reveal][data-delay='8'] {
  --d: 0.08s;
}
html.js [data-reveal][data-delay='10'] {
  --d: 0.1s;
}
html.js [data-reveal][data-delay='12'] {
  --d: 0.12s;
}
html.js [data-reveal][data-delay='16'] {
  --d: 0.16s;
}
html.js [data-reveal][data-delay='20'] {
  --d: 0.2s;
}
html.js [data-reveal][data-delay='22'] {
  --d: 0.22s;
}
html.js [data-reveal][data-delay='24'] {
  --d: 0.24s;
}
html.js [data-reveal][data-delay='32'] {
  --d: 0.32s;
}
html.js [data-reveal][data-delay='34'] {
  --d: 0.34s;
}
html.js [data-reveal][data-delay='40'] {
  --d: 0.4s;
}
html.js [data-reveal][data-delay='50'] {
  --d: 0.5s;
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* -------------------------------- memory --------------------------------- */

.chapter-grid {
  display: grid;
  gap: 3.5rem;
  align-items: center;
}

@media (min-width: 880px) {
  .chapter-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 5rem;
  }
}

.thread {
  border-left: 1px solid var(--line);
  padding-left: 1.6rem;
  max-width: 24rem;
}

.thread-name {
  color: var(--text);
  font-weight: 650;
  font-size: 1.1rem;
}

.thread-sub {
  margin-left: 0.6em;
  color: var(--text-mute);
  font-weight: 400;
  font-size: 0.85rem;
}

.thread ul {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.9rem;
}

.thread li {
  position: relative;
  color: var(--text-dim);
  font-size: 0.98rem;
}

.thread li::before {
  content: '';
  position: absolute;
  left: calc(-1.6rem - 3px);
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.thread-when {
  margin-left: 0.6em;
  color: var(--text-mute);
  font-size: 0.85rem;
}

/* -------------------------------- channels ------------------------------- */

.channels {
  margin-top: 2.8rem;
  display: grid;
  gap: 0.35em;
}

.channels li {
  font-size: clamp(1.7rem, 4.6vw, 3rem);
  font-weight: 620;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: var(--text);
}

.channels li::after {
  content: '.';
  color: var(--accent);
}

#channels .micro {
  margin-top: 2.6rem;
}

/* --------------------------------- control ------------------------------- */

.tenets {
  margin-top: 2.6rem;
  display: grid;
  gap: 1.5rem;
  max-width: 34em;
}

.tenets li {
  color: var(--text);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

/* ---------------------------------- apply -------------------------------- */

.apply .headline,
.apply .body {
  text-align: left;
}

/* What happens after applying — certainty, not decoration. */
.next-steps {
  margin-top: 2.2rem;
  display: grid;
  gap: 0.9rem;
  counter-reset: step;
  max-width: 36em;
  font-size: 0.97rem;
  color: var(--text-dim);
}

.next-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.1rem;
}

.next-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-mute);
}

.next-steps strong {
  color: var(--text);
  font-weight: 600;
}

.ea-form {
  margin-top: 2.8rem;
  display: grid;
  gap: 1.4rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field-row {
  display: grid;
  gap: 1.4rem;
}

@media (min-width: 640px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.opt {
  color: var(--text-mute);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 0.35em;
}

.field input,
.field select {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.72rem 0.9rem;
  width: 100%;
  transition: border-color 0.2s var(--ease);
}

.field input::placeholder {
  color: var(--text-mute);
}

.field input:hover,
.field select:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}

.field input[aria-invalid='true'] {
  border-color: #e5484d;
}

.field-error {
  color: #ff8589;
  font-size: 0.88rem;
  font-weight: 500;
}

.hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.consent {
  color: var(--text-mute);
  font-size: 0.85rem;
  line-height: 1.55;
}

.form-status {
  min-height: 1.2em;
  font-weight: 500;
  color: var(--text-dim);
}

.form-status.is-error {
  color: #ff8589;
}

.ea-success {
  margin-top: 3rem;
  border-left: 1px solid var(--accent-dim);
  padding-left: 1.6rem;
}

.success-mark .dot {
  width: 0.6rem;
  height: 0.6rem;
}

.ea-success h3 {
  margin-top: 0.9rem;
  color: var(--text);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 620;
  letter-spacing: -0.02em;
}

.ea-success p:last-child {
  margin-top: 0.5rem;
  color: var(--text-dim);
}

/* --------------------------------- footer -------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 2.6rem 3rem;
}

.foot-row {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 760px) {
  .foot-row {
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 2.5rem;
  }
}

.foot .wordmark {
  font-size: 1rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  font-size: 0.9rem;
}

.foot-links a {
  color: var(--text-dim);
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--text);
}

.footer-note {
  color: var(--text-mute);
  font-size: 0.9rem;
}

.foot-fine {
  color: var(--text-mute);
  font-size: 0.85rem;
}

/* ------------------------------ the receptionist -------------------------- */
/* RM000019 — the chat entry points and the dialog she is mounted in.
 *
 * Deliberately not a support bubble. The hero control sits beside the primary
 * action as a second, quieter way in; the fixed control is a hairline pill that
 * appears once the page has been scrolled past the hero, so it is available
 * without ever competing with the first screen.
 *
 * Both are hidden until main.js has confirmed a receptionist is on duty — a
 * no-JS visitor, or one arriving while she is stood down, is never shown a
 * control that would go nowhere. */

.chat-entry[hidden] {
  display: none;
}

.hero-actions .chat-entry {
  gap: 0.55rem;
}

.chat-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 11, 13, 0.86);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  font: 600 0.9375rem/1.2 var(--font);
  cursor: pointer;
  /* Out of the way until the hero has been read: the first screen is the
     argument, and a floating control on top of it is an interruption. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease),
    visibility 0.25s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.chat-fab.is-in {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.chat-fab:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.chat-fab:focus-visible,
.chat-dialog-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Keyboard users must be able to reach it even before it has faded in. */
.chat-fab:focus-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* --------------------------------- dialog -------------------------------- */

.chat-dialog {
  width: min(26rem, 100vw);
  max-width: 100vw;
  height: min(40rem, 100dvh);
  max-height: 100dvh;
  /* Anchored bottom-right on desktop, where a conversation belongs, rather than
     centred over the page it is about. */
  margin: 0 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.chat-dialog[open] {
  display: flex;
  flex-direction: column;
}

.chat-dialog::backdrop {
  background: rgba(4, 5, 6, 0.62);
}

@media (prefers-reduced-motion: no-preference) {
  .chat-dialog[open] {
    animation: chat-in 0.22s var(--ease);
  }
}

@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

.chat-dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.7rem 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}

.chat-dialog-note {
  margin: 0;
  flex: 1;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-mute);
}

.chat-dialog-close {
  flex: none;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  cursor: pointer;
}

.chat-dialog-close:hover {
  color: var(--text);
}

/* The widget mounts here and fills what is left. */
.chat-mount {
  flex: 1;
  min-height: 0;
}

/* Full-height sheet on a phone: a 26rem panel floating in a 24rem viewport is
   a worse experience than simply being the screen. */
@media (max-width: 34rem) {
  .chat-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .chat-fab {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-fab {
    transition: none;
    transform: none;
  }

  .chat-dialog[open] {
    animation: none;
  }
}

/* ============================ consent & legal (RM000028) =================== */
/*
 * The consent banner, the preferences dialog, and the legal pages.
 *
 * One rule governs the banner's layout above all others: **Accept all and
 * Reject all are the same control**. Same class, same border, same padding,
 * same minimum width, same hover. A reject button that is smaller, greyer or
 * one step further away is the most common way a consent banner is quietly
 * rigged, and it is the one thing here that must not be allowed to drift.
 */

.foot-link-button,
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
}

.foot-link-button:hover,
.link-button:hover {
  color: var(--text);
}

.link-button {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* --------------------------------- banner -------------------------------- */

.cc-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 90;
  border-top: 1px solid var(--line);
  background: rgba(10, 11, 13, 0.97);
  backdrop-filter: blur(8px);
  padding-block: 1.15rem 1.25rem;
}

.cc-banner:focus {
  outline: none;
}

.cc-banner:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

@media (prefers-reduced-motion: no-preference) {
  .cc-banner {
    animation: cc-rise 0.24s var(--ease);
  }
}

@keyframes cc-rise {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
}

.cc-banner-shell {
  width: min(var(--shell), 100% - 3rem);
  margin-inline: auto;
  display: grid;
  gap: 1rem;
}

@media (min-width: 940px) {
  .cc-banner-shell {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
  }
}

.cc-banner-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: normal;
}

.cc-banner-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 62ch;
}

.cc-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* The equivalence rule, written once and shared by both choices. */
.cc-action {
  border-color: rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--text);
  min-width: 9.5rem;
  padding-block: 0.68rem;
  font-size: 0.95rem;
}

.cc-action:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.cc-action.button-accent {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.cc-action.button-accent:hover {
  background: #4be0a8;
  color: var(--accent-ink);
}

.cc-action-manage {
  border-color: transparent;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  min-width: 0;
}

.cc-action-manage:hover {
  color: var(--text);
  border-color: transparent;
}

.cc-action:focus-visible,
.cc-dialog-close:focus-visible,
.foot-link-button:focus-visible,
.link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 34rem) {
  .cc-banner-actions {
    flex-direction: column;
  }

  .cc-action {
    width: 100%;
  }
}

/* ---------------------------- preferences dialog -------------------------- */

.cc-dialog {
  width: min(34rem, 100vw);
  max-width: 100vw;
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
}

.cc-dialog::backdrop {
  background: rgba(4, 5, 6, 0.62);
}

.cc-dialog-form {
  position: relative;
  margin: 0;
  padding: 1.5rem 1.4rem 1.3rem;
  display: grid;
  gap: 1.1rem;
}

.cc-dialog-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: normal;
}

.cc-dialog-intro {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 52ch;
}

.cc-cats {
  display: grid;
  gap: 0.9rem;
  max-height: 46vh;
  overflow-y: auto;
}

.cc-cat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
}

.cc-cat-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.cc-cat-input {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}

.cc-cat-input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.cc-cat-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cc-cat-name {
  font-weight: 620;
  color: var(--text);
  font-size: 0.98rem;
}

.cc-cat-summary {
  margin: 0.45rem 0 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.cc-cat-items {
  margin: 0.4rem 0 0;
  font-size: 0.79rem;
  color: var(--text-mute);
}

.cc-cat-items-empty {
  font-style: italic;
}

.cc-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cc-dialog-actions .cc-action {
  min-width: 7.5rem;
}

.cc-dialog-close {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.15rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
}

.cc-dialog-close:hover {
  color: var(--text);
}

.cc-dialog-policy {
  margin: 0;
  font-size: 0.82rem;
}

.cc-dialog-policy a {
  color: var(--text-mute);
}

.cc-dialog-policy a:hover {
  color: var(--accent);
}

@media (max-width: 34rem) {
  .cc-dialog-actions {
    flex-direction: column;
  }

  .cc-dialog-actions .cc-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner {
    animation: none;
  }
}

/* ------------------------------- legal pages ------------------------------ */

.legal {
  padding-block: 3.5rem 4.5rem;
}

.legal:focus {
  outline: none;
}

.legal-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.legal-title {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  font-weight: 620;
  line-height: 1.08;
  color: var(--text);
}

.legal-updated {
  margin: 0 0 2rem;
  font-size: 0.85rem;
  color: var(--text-mute);
}

.legal-lede {
  font-size: 1.05rem;
  color: var(--text-dim);
}

.legal h2 {
  margin: 2.6rem 0 0.8rem;
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: normal;
}

.legal h3 {
  margin: 1.7rem 0 0.6rem;
  font-size: 1rem;
  font-weight: 620;
  color: var(--text);
  letter-spacing: normal;
}

.legal p,
.legal li {
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--text-dim);
}

.legal ul {
  padding-left: 1.15rem;
  display: grid;
  gap: 0.5rem;
}

.legal a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.legal code {
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  word-break: break-word;
}

/* A placeholder must be impossible to mistake for a fact. */
mark.tbc {
  background: rgba(52, 211, 153, 0.12);
  border: 1px dashed var(--accent-dim);
  border-radius: 6px;
  padding: 0.06em 0.4em;
  color: var(--accent);
  font-size: 0.92em;
  font-weight: 600;
}

.legal-notice-box {
  margin: 0 0 2rem;
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.06);
  padding: 1rem 1.15rem;
}

.legal-notice-box p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
}

.legal-notice-box strong {
  color: var(--text);
}

/* ------------------------------ cookie tables ----------------------------- */

.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cc-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.cc-table th,
.cc-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
}

.cc-table thead th {
  color: var(--text);
  font-weight: 620;
  white-space: nowrap;
}

.cc-table tbody tr:last-child th,
.cc-table tbody tr:last-child td {
  border-bottom: 0;
}

.cc-table th[scope='row'] {
  color: var(--text-mute);
  font-weight: 600;
  white-space: nowrap;
}

.cc-table td {
  color: var(--text-dim);
}

.cc-provider {
  color: var(--text-mute);
  font-size: 0.92em;
}

.cc-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--text-mute);
  font-size: 0.9rem;
}

.cc-empty strong {
  color: var(--text-dim);
}

.cc-note {
  font-size: 0.85rem;
  color: var(--text-mute);
}

.cc-note strong {
  color: var(--text-dim);
}
