/* ============================================================================
   Built Analytics — dead-simple landing + subpages
   Uses the two-theme tokens from theme.css. No noise: text only, no icons.

   Transitions are pure opacity:
     entering  → text fades in, the accent word arrives last
     leaving   → text fades out, the accent (and the chosen door) goes last
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Leave choreography — landing.js waits (--fx-out + --fx-out-accent) before navigating */
  --fx-out: 0.30s;
  --fx-out-accent: 0.36s;
  /* Same shape, quicker, for swapping one hero for the next on click */
  --hero-out: 0.18s;
  --hero-out-accent: 0.22s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-y: auto;   /* pages are single-screen; the product grid may need room */
  transition: background-color 0.4s ease, color 0.4s ease;
}

.page {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.page.is-leaving { pointer-events: none; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 30px;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
  flex-wrap: wrap;
}

/* Section nav — the three subpages live up here, not in the hero */
.topnav { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); }
.topnav-link {
  position: relative;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: 3px 0;
  transition: color 0.2s ease;
}
.topnav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.topnav-link:hover { color: var(--text-primary); }
.topnav-link:hover::after { transform: scaleX(1); }
.topnav-link.is-current { color: var(--text-primary); }

/* Company wordmark — the BA logo as a plain <img> (its alt text shows if the
   SVG ever fails to load). The asset is white, so the light theme inverts it. */
.wordmark {
  display: block;
  flex-shrink: 0;
  line-height: 0;               /* kill the inline descender gap under the img */
  opacity: 0.78;                /* ≈ --text-secondary against either background */
  transition: opacity 0.2s ease;
}
.wordmark:hover { opacity: 1; }
.wordmark img {
  display: block;
  width: clamp(112px, 12vw, 148px);
  height: auto;
}
[data-theme="light"] .wordmark img { filter: invert(1); }

.topbar-right { display: flex; align-items: center; gap: 20px; }

/* Language switcher */
.switch { display: flex; align-items: center; gap: 2px; }
.lang {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 6px;
}
.lang.active { color: var(--accent-primary); }

/* Theme toggle — sun in dark theme, moon in light (shows what you'll get) */
.mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.mode svg {
  display: block;
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode .icon-moon { display: none; }
[data-theme="light"] .mode .icon-sun { display: none; }
[data-theme="light"] .mode .icon-moon { display: block; }

.lang,
.mode {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.lang:hover,
.mode:hover { color: var(--text-primary); }

.switch-sep {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pv-text-dim);
  opacity: 0.6;
}

/* ── Hero (centered slogan + doors) ──────────────────────────────────────── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(48px, 9vh, 96px);
  padding: 0 24px 6vh;
}

/* Slogan + tagline travel together, so they sit tight while the hero's own
   gap keeps the CTA well clear of them. */
.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.4vh, 24px);
  cursor: pointer;   /* click to cycle to the next hero */
}

/* min-height is the reserve landing.js measures — the tallest slogan across
   all three languages — so neither a shorter hero nor a language switch moves
   the subtitle or the CTA below it. Keep this a plain block: display:flex or
   grid would turn the .plain / .accent spans into separate items, one a line. */
.slogan {
  max-width: 90vw;
  min-height: 2.4em;   /* two lines, until landing.js measures */
  text-align: center;
  font-weight: 300;
  font-size: clamp(1.35rem, 3.2vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
/* nowrap: the accent is split into per-letter spans, which would otherwise let
   the line break in the middle of the word */
.slogan .accent { color: var(--accent-primary); font-weight: 400; white-space: nowrap; }

/* Wide enough that even the longest subtitle (French, ~108 characters) stays
   on one line where there is room; same measured reserve as the slogan for
   the narrow screens where it still has to wrap. */
.tagline {
  max-width: min(94vw, 112ch);
  min-height: 1.6em;   /* one line, until landing.js measures */
  text-align: center;
  text-wrap: balance;
  font-size: clamp(0.9rem, 1.25vw, 1.02rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

/* The one call to action under the hero — plain purple text, underline on hover */
.cta {
  position: relative;
  padding: 6px 2px;
  font-family: var(--font-sans);
  font-size: clamp(0.98rem, 1.6vw, 1.15rem);
  color: var(--accent-primary);
  text-decoration: none;
  background: none;
  border: none;
}
.cta::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--accent-primary);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}
.cta:hover::after { width: 100%; }

/* Three doors — plain words, underline on hover */
.doors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 88px);
  flex-wrap: wrap;
}
.door {
  position: relative;
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  padding: 6px 2px;
  transition: color 0.2s ease;
}
.door::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -4px;
  width: 0; height: 1.5px;
  background: var(--accent-primary);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}
.door:hover { color: var(--text-primary); }
.door:hover::after { width: 100%; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 30px 20px;
}
.footer-sep { font-size: 11px; color: var(--pv-text-dim); opacity: 0.6; }
.footer-link {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pv-text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-link:hover,
.footer-link.is-current { color: var(--text-secondary); }

/* ── Legal pages ─────────────────────────────────────────────────────────── */
.legal {
  flex: 1;
  width: min(74ch, 92vw);
  margin: 0 auto;
  padding: clamp(18px, 4vh, 48px) 0 clamp(32px, 6vh, 64px);
}
/* inline-block so its box hugs the text — the word morph measures this rect */
.legal .sub-title {
  display: inline-block;
  text-align: left;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: clamp(14px, 2.5vh, 26px);
}
.legal h2 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 26px 0 8px;
}
.legal h3 {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 18px 0 6px;
}
.legal p,
.legal li {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 9px;
}
.legal ul { margin: 0 0 9px 18px; }
.legal li { margin-bottom: 3px; }
.legal a { color: var(--accent-primary); text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal-address {
  line-height: 1.75;
  color: var(--text-primary);
}
.legal-address a { color: var(--accent-primary); }

/* ── Subpages ────────────────────────────────────────────────────────────── */
.subpage .hero { gap: 20px; }
.subpage .doors { margin-top: clamp(14px, 3.5vh, 34px); }
.sub-title {
  text-align: center;
  font-weight: 300;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
/* The headline is the way home — it flies back into the nav link it came from */
.sub-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.sub-title a:hover { color: var(--accent-primary); }
.sub-note {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 46ch;
  line-height: 1.6;
}
.sub-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--pv-text-dim);
  letter-spacing: 0.05em;
}

/* Product cards — image, name, one line. No frames, no fills, no shadows. */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 34px);
  width: min(1180px, 92vw);
  margin-top: clamp(16px, 3.5vh, 34px);
}
.card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-decoration: none;
  /* Building Analytics is a <button>: strip the chrome so it matches the links */
  font: inherit;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.card-media {
  display: block;
  aspect-ratio: 16 / 9;   /* the stills are pre-cropped to this, so nothing is lost */
  overflow: hidden;
  background: var(--surface-primary);
}
.card-media img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.45s ease;
}

/* Line drawings on white paper can simply be flipped. hue-rotate undoes the
   colour half of the inversion — without it the orange shadow bands come out
   blue, which would misread the drawing. Flipped to match the other product
   stills (see updateThemedImages): the light page gets the inverted, dark
   drawing, the dark page keeps it on its white paper. */
img[data-invert] { filter: none; }
[data-theme="light"] img[data-invert] { filter: invert(1) hue-rotate(180deg); }
.card-name {
  font-size: 0.98rem;
  color: var(--text-primary);
  transition: color 0.2s ease;
}
.card-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.card[data-deep]:hover .card-media img { opacity: 1; transform: scale(1.03); }
.card[data-deep]:hover .card-name { color: var(--accent-primary); }

/* ── Product deep-dive ──────────────────────────────────────────────────────
   The panel's image and headline start out sitting exactly on the card's, then
   fly to their real size — the same growth the page-to-page morph uses. */
.deep {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  overflow: auto;   /* a tall panel scrolls inside the overlay, not the page */
}
.deep[hidden] { display: none; }
/* Quick in, so the grid behind is gone before the panel grows over it; slower
   out, so the page only comes back once the panel has shrunk away. */
.deep-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  opacity: 0;
  transition: opacity 0.34s ease;
}
.deep.is-open .deep-backdrop {
  opacity: 0.97;
  transition: opacity 0.26s ease;
}

/* The card whose content the panel is currently borrowing */
.card.is-source { visibility: hidden; }

.deep-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: var(--deep-w, 520px);
  max-width: 100%;
  /* Closing, the panel fades over the back half of the shrink, so it is gone
     before it is hidden — no half-shrunk headline snapping out of view. */
  opacity: 0;
  transition: opacity 0.22s ease 0.2s;
}
.deep.is-open .deep-panel {
  opacity: 1;
  transition: opacity 0.16s ease;
}
.deep-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-primary);
  transform-origin: 0 0;
}
.deep-media img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.deep-title {
  font-weight: 300;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transform-origin: 0 50%;
}
.deep-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 54ch;
}
/* Client quote — a thin accent rule rather than a box, hidden until filled.
   Where a product has one it leads the panel, so it carries more size than the
   description that follows. */
.deep-quote {
  margin: 0;
  padding-left: 15px;
  border-left: 1px solid var(--accent-primary);
  max-width: 52ch;
}
.deep-quote[hidden] { display: none; }
.deep-quote p {
  font-weight: 300;
  font-style: italic;
  /* The emoji font has no italic cut, so the browser fakes one by slanting the
     glyph. Forbid the synthesis: real italics still apply to the text. */
  font-synthesis-style: none;
  font-synthesis: none;
  font-size: clamp(0.98rem, 1.7vw, 1.12rem);
  line-height: 1.55;
  color: var(--text-primary);
}
/* The marks come from CSS, not from the strings, so each language gets its own
   pair — <html lang> follows the language switch. */
.deep-quote p::before { content: open-quote; }
.deep-quote p::after  { content: close-quote; }
:root          { quotes: "\201C" "\201D"; }               /* “ ”  — English */
:root:lang(de) { quotes: "\201E" "\201C"; }               /* „ “  — German  */
:root:lang(fr) { quotes: "\00AB\00A0" "\00A0\00BB"; }     /* « … » — French */
/* Attribution sits under the quote, pushed to its right edge */
.deep-quote cite {
  display: block;
  margin-top: 8px;
  text-align: right;
  font-size: 12.5px;
  font-style: normal;
  color: var(--pv-text-dim);
}

.deep-actions { display: flex; align-items: baseline; gap: 24px; }
.deep-link {
  position: relative;
  font-size: 14px;
  color: var(--accent-primary);
  text-decoration: none;
}
.deep-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.deep-link:hover::after { transform: scaleX(1); }
.deep-close {
  font: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.deep-close:hover { color: var(--text-primary); }

/* The copy waits for the image and headline to land, but leaves promptly */
.deep-text,
.deep-quote,
.deep-actions { opacity: 0; transition: opacity 0.18s ease; }
.deep.is-open .deep-text,
.deep.is-open .deep-quote,
.deep.is-open .deep-actions { opacity: 1; transition: opacity 0.4s ease 0.26s; }


/* Contact card — portrait beside the details, nothing else */
.vcard {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3.5vw, 44px);
  margin-top: clamp(14px, 3vh, 30px);
}
.portrait {
  display: block;
  width: clamp(104px, 11vw, 146px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.vcard-lines { display: flex; flex-direction: column; gap: 9px; }
.vcard-id { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.vcard-name { font-size: 1.05rem; color: var(--text-primary); }
.vcard-role { font-size: 12.5px; color: var(--pv-text-dim); }
.vcard-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;   /* the page's own font — no separate face here */
}
.vcard-label,
.vcard-place { color: var(--pv-text-dim); }
.vcard-val {
  position: relative;
  color: var(--accent-primary);
  text-decoration: none;
}
.vcard-val::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
a.vcard-val:hover::after { transform: scaleX(1); }

/* Client logos — landing.js swaps each src for its -light variant in light theme */
.clients {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4.5vw, 58px);
  flex-wrap: wrap;
  margin-top: clamp(18px, 4vh, 40px);
}
.client-logo {
  height: clamp(24px, 3.2vw, 36px);
  width: auto;
  max-width: 132px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.25s ease;
  user-select: none;
}
.client-logo:hover { opacity: 1; }

/* ── Entering: fade in, accent last ──────────────────────────────────────── */
@keyframes ba-fade-in { from { opacity: 0; } to { opacity: 1; } }

.intro .topbar         { animation: ba-fade-in 0.5s ease both; }
.intro .slogan .plain  { animation: ba-fade-in 0.55s ease 0.1s both; }
.intro .tagline        { animation: ba-fade-in 0.55s ease 0.26s both; }
.intro .doors          { animation: ba-fade-in 0.55s ease 0.28s both; }
.intro .cta            { animation: ba-fade-in 0.55s ease 0.4s both; }
.intro .slogan .accent { animation: ba-fade-in 0.6s ease 0.52s both; }
.intro .sub-title      { animation: ba-fade-in 0.6s ease 0.16s both; }
.intro .sub-note,
.intro .sub-meta       { animation: ba-fade-in 0.6s ease 0.4s both; }
.intro .clients,
.intro .cards,
.intro .vcard          { animation: ba-fade-in 0.6s ease 0.44s both; }

/* ── Hero swap on click ──────────────────────────────────────────────────
   Out: the plain words go, the accent last. In: the same order again. These
   must follow the .intro rules — equal specificity, so source order decides.
   `animation: none` matters: a finished intro animation with `both` fill
   would otherwise pin opacity and the transition would never show. */
.hero-text.is-out .plain,
.hero-text.is-out .tagline {
  opacity: 0;
  animation: none;
  transition: opacity var(--hero-out) ease;
}
.hero-text.is-out .accent {
  opacity: 0;
  animation: none;
  transition: opacity var(--hero-out-accent) ease var(--hero-out);
}
/* The slogan finishes completely — accent letters and all, done by ~0.62s —
   before the tagline starts at 0.64s. The subtitle waits its turn. */
.hero-text.is-in .plain   { animation: ba-fade-in 0.32s ease both; }
.hero-text.is-in .accent  { animation: none; }
.hero-text.is-in .accent .ltr { animation: ba-fade-in 0.24s ease both; }
.hero-text.is-in .tagline { animation: ba-fade-in 0.4s ease 0.64s both; }

/* ── Leaving: fade out, accent last ──────────────────────────────────────── */
.page.is-leaving .topbar,
.page.is-leaving .door,
.page.is-leaving .slogan .plain,
.page.is-leaving .tagline,
.page.is-leaving .cta,
.page.is-leaving .sub-note,
.page.is-leaving .sub-meta,
.page.is-leaving .clients,
.page.is-leaving .cards,
.page.is-leaving .vcard {
  opacity: 0;
  animation: none;
  transition: opacity var(--fx-out) ease;
}

/* The accent word — and the door that was chosen — linger, then go */
.page.is-leaving .slogan .accent,
.page.is-leaving .sub-title,
.page.is-leaving .door.is-picked {
  opacity: 0;
  animation: none;
  transition: opacity var(--fx-out-accent) ease var(--fx-out);
}
.page.is-leaving .door.is-picked { color: var(--accent-primary); }
.page.is-leaving .door::after { width: 0; }

/* ── The word morph ──────────────────────────────────────────────────────
   #flyer is the clone of the clicked word, lifted out of the page so the
   fade can happen underneath it. It never moves: the next page's headline
   starts exactly here and flies home, which is what sells the continuity. */
#flyer {
  position: fixed;
  z-index: 10;
  margin: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: color 0.22s ease;
}

/* Set by an inline <head> script when a flight is pending, so the headline is
   never painted at its resting place before the morph is armed. The guard
   animation is a safety net: if landing.js never runs, the headline still
   appears rather than staying hidden forever. */
.ba-morph .sub-title,
.ba-morph .topnav-link,
.ba-morph .footer-link {
  visibility: hidden;
  animation: ba-morph-guard 0s linear 1.2s forwards;
}
@keyframes ba-morph-guard { to { visibility: visible; } }

/* A morphing arrival: the headline is placed by JS, not faded in, and the
   rest of the page waits for the flight to read. Must follow the .intro
   rules above — same specificity, so source order decides. */
.is-morphing .sub-title { animation: none; opacity: 1; visibility: visible; }
.is-morphing .topbar,
.is-morphing .sub-note,
.is-morphing .sub-meta,
.is-morphing .clients,
.is-morphing .cards,
.is-morphing .vcard,
.is-morphing .doors { animation-delay: 0.36s; }

/* Coming home, the word lands in the topbar — so the topbar has to be there
   from the first frame. The hero waits for the flight to clear, since the word
   flies straight through the space the slogan occupies. */
.is-morphing-nav .topbar { animation: none; opacity: 1; }
.is-morphing-nav .topnav-link,
.is-morphing-nav .footer-link { visibility: visible; }
.is-morphing-nav .slogan .plain  { animation-delay: 0.46s; }
.is-morphing-nav .tagline        { animation-delay: 0.56s; }
.is-morphing-nav .cta            { animation-delay: 0.66s; }
.is-morphing-nav .slogan .accent { animation-delay: 0.74s; }

@media (prefers-reduced-motion: reduce) {
  .intro .topbar,
  .intro .slogan .plain,
  .intro .slogan .accent,
  .intro .tagline,
  .intro .doors,
  .intro .cta,
  .intro .sub-title,
  .intro .sub-note,
  .intro .sub-meta,
  .intro .clients,
  .intro .cards,
  .intro .vcard { animation: none; }
}

@media (max-width: 700px) {
  .topbar { padding: 16px 18px; gap: 10px 14px; flex-wrap: wrap; }
  .topbar-left { gap: 14px 18px; }
  .topbar-right { gap: 14px; flex: 1; justify-content: flex-end; }
  .topnav { gap: 16px; }
  .topnav-link { font-size: 12.5px; }
  .wordmark img { width: 100px; }
  .lang { font-size: 11px; padding: 4px 4px; }
  .mode svg { width: 16px; height: 16px; }
  .clients { gap: 22px 30px; }
  .client-logo { height: 22px; max-width: 104px; }
}

@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; width: 100%; }
}
