/* ==========================================================================
   Meri 2 — creative dark
   Near-black canvas, Meri red for actions, amber "signal" for artwork
   (taken from the glow in the brand film). Space Grotesk display, Inter body,
   IBM Plex Mono labels.

   Performance rules (measured on the creps sites):
   - no filter / backdrop-filter / mix-blend-mode; images are graded offline
   - images reveal with a solid wipe overlay, never by fading the image block
   - infinite animations pause off-screen (.is-paused set by meri.js)
   ========================================================================== */

:root {
  --red: #e3262f;
  --red-700: #c51d26;
  --radius: 14px;
  --radius-sm: 10px;
  --shell: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(80px, 10vw, 140px);
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Dark palette — the default, and forced inside surfaces that always sit on
   dark footage (hero, cinema reel, header while it floats over the hero). */
:root,
.meri-hero,
.meri-cinema,
.meri-band-image,
.meri-header--over:not(.is-scrolled) {
  --bg: #07090f;
  --bg-2: #0b0f19;
  --surface: #10151f;
  --surface-2: #1a2232;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --white: #f4f6fa;
  --text: #b7bfcc;
  --text-2: #c9d0db;
  --muted: #7c8696;
  --amber: #f2a93b;
  --amber-dim: rgba(242, 169, 59, .38);
  --amber-glow: rgba(242, 169, 59, .16);
  --header-bg: rgba(7, 9, 15, .94);
  --stroke: rgba(244, 246, 250, .55);
  --placeholder: #5d6676;
  --shadow-scan: 0 18px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* Light palette — pure white, cool slate neutrals, brand red as the accent. */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --line: rgba(16, 24, 40, .08);
  --line-2: rgba(16, 24, 40, .16);
  --white: #0a0f1a;
  --text: #424b5a;
  --text-2: #1f2733;
  --muted: #6a7383;
  --amber: #d12a2f;
  --amber-dim: rgba(209, 42, 47, .32);
  --amber-glow: rgba(209, 42, 47, .07);
  --header-bg: rgba(255, 255, 255, .92);
  --stroke: rgba(10, 15, 26, .45);
  --placeholder: #9aa3b2;
  --shadow-scan: 0 18px 40px rgba(16, 24, 40, .14);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -16px rgba(16, 24, 40, .16);
  --glow-neutral: #eef1f5;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  transition: background-color .3s;
  color: var(--text);
  font: 400 16px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
figure { margin: 0; }
a { color: var(--white); text-decoration: none; }
a:hover { color: var(--amber); }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--white); font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); }
h3 { font-size: 1.1875rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: normal; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meri-skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--red); color: #fff; border-radius: var(--radius-sm); }
.meri-skip-link:focus { top: 12px; color: #fff; }

.meri-shell { position: relative; width: 100%; max-width: calc(var(--shell) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
.meri-display {
  margin: 0;
  font-size: clamp(2.75rem, 1.4rem + 6vw, 6.5rem);
  font-weight: 600; line-height: .98; letter-spacing: -.04em;
}
.meri-display span { display: block; }
.meri-display--md { font-size: clamp(2.25rem, 1.3rem + 4vw, 4.75rem); line-height: 1.02; }
.meri-display em, .meri-h2 em { color: var(--muted); }
.meri-hero .meri-display em { color: var(--red); }
.meri-h2 { max-width: 20ch; margin: 0; font-size: clamp(1.875rem, 1.1rem + 3vw, 3.5rem); line-height: 1.05; letter-spacing: -.03em; }

.meri-label, .meri-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 20px; color: var(--muted);
  font: 500 .75rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.meri-eyebrow { color: var(--amber); }
.meri-label__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-glow); }
.meri-lead { max-width: 52ch; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); }
.meri-note { margin-top: 28px; color: var(--muted); font-size: .9375rem; }

.meri-link {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 .8125rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--white);
}
.meri-link::after { content: ""; width: 28px; height: 1px; background: currentColor; transition: width .3s var(--ease); }
.meri-link:hover::after { width: 44px; }

/* ---------- Buttons (pills) ---------- */
.meri-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 36px; }
.meri-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border: 1px solid transparent; border-radius: 999px;
  font: 500 .9375rem/1 var(--body); letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  transition: background-color .25s, border-color .25s, color .25s;
}
.meri-btn--sm { min-height: 42px; padding: 0 20px; font-size: .875rem; }
.meri-btn--primary { background: var(--red); color: #fff; }
.meri-btn--primary:hover { background: var(--red-700); color: #fff; }
.meri-btn--ghost { background: transparent; border-color: var(--line-2); color: var(--white); }
.meri-btn--ghost:hover { border-color: var(--white); color: var(--white); }
.meri-btn--block { width: 100%; }
.meri-btn--play::before { content: ""; border-left: 9px solid var(--amber); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

/* ---------- Header ---------- */
.meri-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  transition: background-color .3s, border-color .3s;
}
.meri-header--over { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; }
.meri-header--over.is-scrolled { background: var(--header-bg); border-color: var(--line); }
.admin-bar .meri-header { top: 32px; }
.meri-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.meri-brand { display: block; flex: none; }
.meri-brand__img { width: auto; height: 44px; }
.meri-nav { display: flex; align-items: center; gap: 28px; }
.meri-nav__list { display: flex; gap: 2px; }
.meri-nav__list a { display: block; padding: 8px 14px; color: var(--text); font-size: .9375rem; font-weight: 500; }
.meri-nav__list a:hover, .meri-nav__list .current-menu-item > a, .meri-nav__list a[aria-current="page"] { color: var(--white); }
.meri-nav__list .current-menu-item > a, .meri-nav__list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--red); }
.meri-header__toggle { display: none; }
.meri-nav__account { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: .9375rem; font-weight: 500; white-space: nowrap; }
.meri-nav__account:hover { color: var(--white); }
.meri-nav__account span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--amber-glow); border: 1px solid var(--amber-dim); color: var(--amber); font-family: var(--display); font-weight: 700; font-size: .8125rem; }

@media (max-width: 1023px) {
  .meri-header__toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -8px; border: 0; background: none; cursor: pointer; }
  .meri-header__toggle-bars, .meri-header__toggle-bars::before, .meri-header__toggle-bars::after { display: block; width: 22px; height: 2px; background: var(--white); border-radius: 2px; transition: transform .2s, background-color .2s; }
  .meri-header__toggle-bars { position: relative; }
  .meri-header__toggle-bars::before, .meri-header__toggle-bars::after { content: ""; position: absolute; left: 0; }
  .meri-header__toggle-bars::before { top: -7px; }
  .meri-header__toggle-bars::after { top: 7px; }
  [aria-expanded="true"] .meri-header__toggle-bars { background: transparent; }
  [aria-expanded="true"] .meri-header__toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  [aria-expanded="true"] .meri-header__toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }
  .meri-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 20px;
    padding: 12px var(--gutter) 28px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
  .meri-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
  .meri-header--over:has(.meri-nav.is-open) { background: var(--bg); }
  .meri-nav__list { flex-direction: column; }
  .meri-nav__list a { padding: 16px 0; border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 1.5rem; color: var(--white); }
  .meri-nav__list .current-menu-item > a, .meri-nav__list a[aria-current="page"] { box-shadow: none; color: var(--red); }
  .meri-nav__account { padding: 8px 0; font-size: 1.125rem; color: var(--white); }
  .meri-nav__cta { min-height: 52px; }
}
@media (max-width: 782px) { .admin-bar .meri-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .meri-header { top: 0; } }

/* ---------- Circuit artwork ---------- */
.meri-circuit { position: absolute; pointer-events: none; overflow: visible; }
.meri-circuit__traces path { fill: none; stroke: var(--amber); stroke-width: 1.4; stroke-opacity: .32; stroke-dasharray: 1; stroke-dashoffset: 1; }
.meri-circuit__pads circle { fill: var(--bg); stroke: var(--amber); stroke-width: 1.4; stroke-opacity: .55; opacity: 0; }
.meri-circuit__pulses circle { fill: var(--amber); opacity: 0; transition: opacity .6s 1.6s; }
.meri-circuit.is-in .meri-circuit__traces path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) calc(var(--i) * 70ms); }
.meri-circuit.is-in .meri-circuit__pads circle { opacity: 1; transition: opacity .4s calc(1.1s + var(--i) * 70ms); }
.meri-circuit.is-in .meri-circuit__pulses circle { opacity: .95; }

/* ---------- Reveal ---------- */
.js [data-reveal]:not(svg) { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
/* Blocks that hold images do not move or fade; their image is uncovered by a wipe. */
.js .meri-wipe[data-reveal], .js .meri-cinema[data-reveal], .js .meri-showcase__item[data-reveal] { opacity: 1; transform: none; }
.meri-wipe { position: relative; overflow: hidden; }
.meri-wipe::after { content: ""; position: absolute; inset: 0; background: var(--surface); transform-origin: right; transform: scaleX(0); }
.js .meri-wipe::after { transform: scaleX(1); transition: transform 1s var(--ease); transition-delay: calc(var(--d, 0) * 110ms); }
.js .is-in .meri-wipe::after, .js .meri-wipe.is-in::after, .js [data-reveal].is-in.meri-wipe::after { transform: scaleX(0); }

/* ---------- Hero ---------- */
.meri-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: max(640px, min(100svh, 980px));
  padding: calc(var(--header-h) + 48px) 0 0;
}
.meri-hero__bg { position: absolute; inset: 0; z-index: -2; background: #000; }
.meri-hero__bg video, .meri-hero__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.meri-hero__video { opacity: 0; transition: opacity 1.2s; }
.meri-hero__video.is-playing { opacity: 1; }
.meri-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 9, 15, .92) 0%, rgba(7, 9, 15, .62) 42%, rgba(7, 9, 15, .12) 75%),
    linear-gradient(0deg, #07090f 0%, rgba(7, 9, 15, 0) 38%);
}
.meri-hero__art { z-index: -1; right: -4%; top: 6%; width: min(62vw, 900px); height: auto; aspect-ratio: 4 / 3; opacity: .9; }
.meri-hero__inner { padding-bottom: clamp(40px, 6vw, 72px); }
.meri-hero .meri-display { max-width: 12ch; }
.meri-hero__lead { max-width: 46ch; margin: 28px 0 0; color: var(--text-2); font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); }
.meri-hero__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 32px; }
.meri-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; flex: 1; margin: 0; border-top: 1px solid var(--line-2); }
.meri-stats > div { padding: 18px 20px 0 0; }
.meri-stats dd { margin: 0; color: var(--white); font: 600 clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem)/1.1 var(--display); letter-spacing: -.02em; }
.meri-stats dt { margin-top: 4px; color: var(--muted); font: 500 .6875rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
@media (min-width: 768px) { .meri-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .meri-stats > div + div { padding-left: 20px; border-left: 1px solid var(--line); } }
@media (max-width: 767px) { .meri-stats > div:nth-child(n+3) { padding-top: 14px; } }
.meri-scroll { flex: none; position: relative; width: 44px; height: 64px; border: 1px solid var(--line-2); border-radius: 999px; }
.meri-scroll::after { content: ""; position: absolute; left: 50%; top: 14px; width: 2px; height: 12px; margin-left: -1px; border-radius: 2px; background: var(--amber); animation: meri-scroll 1.8s var(--ease) infinite; }
@keyframes meri-scroll { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(22px); opacity: 0; } }
@media (max-width: 767px) { .meri-scroll { display: none; } .meri-hero__art { width: 120vw; right: -40%; top: 4%; opacity: .55; } }

/* ---------- Marquee ---------- */
.meri-marquee { overflow: hidden; padding: 26px 0; border-block: 1px solid var(--line); background: var(--bg-2); }
.meri-marquee__track { display: flex; align-items: center; gap: 40px; width: max-content; animation: meri-marquee 38s linear infinite; }
.meri-marquee span { color: var(--white); font: 600 clamp(2.5rem, 1.8rem + 3.5vw, 5.5rem)/1 var(--display); letter-spacing: -.03em; white-space: nowrap; }
.meri-marquee span.is-outline { color: transparent; -webkit-text-stroke: 1.5px var(--stroke); }
.meri-marquee i { flex: none; width: 18px; height: 18px; border: 2px solid var(--red); transform: rotate(45deg); }
@keyframes meri-marquee { to { transform: translateX(-50%); } }
.is-paused .meri-marquee__track, .is-paused .meri-logo-row__track, .meri-marquee.is-paused .meri-marquee__track { animation-play-state: paused; }

/* ---------- Sections ---------- */
.meri-section { position: relative; padding: var(--section) 0; }
.meri-section--tight { padding: clamp(56px, 7vw, 96px) 0; }
.meri-section--flush-top { padding-top: clamp(48px, 6vw, 80px); }
.meri-band { background: var(--bg-2); border-block: 1px solid var(--line); }
.meri-head { display: grid; gap: 0 48px; align-items: end; margin-bottom: clamp(40px, 5vw, 72px); }
.meri-head .meri-label { grid-column: 1 / -1; }
.meri-head .meri-link { justify-self: start; margin-top: 24px; }
@media (min-width: 900px) { .meri-head { grid-template-columns: 1fr auto; } .meri-head .meri-link { margin: 0 0 10px; } }
/* Legacy subpage heading markup */
.meri-section__head { max-width: 760px; margin-bottom: clamp(36px, 4vw, 56px); }
.meri-section__head h2 { margin: 0; font-size: clamp(1.75rem, 1.1rem + 2.4vw, 3rem); line-height: 1.08; letter-spacing: -.03em; }
.meri-section__head--center { margin-inline: auto; text-align: center; }

/* ---------- Process (signal path) ---------- */
.meri-process-wrap { background: var(--bg-2); border-block: 1px solid var(--line); }
.meri-process { position: relative; display: grid; gap: 28px 20px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.meri-process::before, .meri-process::after { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: var(--line-2); }
.meri-process::after { height: 2px; top: 6px; background: linear-gradient(90deg, var(--amber), var(--red)); transform: scaleX(0); transform-origin: left; }
.js .meri-process[data-reveal] { opacity: 1; transform: none; }
.meri-process.is-in::after { transform: scaleX(1); transition: transform 1.5s var(--ease) .15s; }
.meri-process__step { position: relative; padding-top: 40px; }
.meri-process__node { position: absolute; left: 0; top: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--line-2); transition: border-color .4s, background-color .4s, box-shadow .4s; transition-delay: calc(.25s + var(--i) * .2s); }
.meri-process.is-in .meri-process__node { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 6px var(--amber-glow); }
.meri-process__num, .meri-commitments .meri-process__num, .meri-panel .meri-process__num { display: block; margin-bottom: 10px; color: var(--muted); font: 500 .75rem/1 var(--mono); letter-spacing: .14em; }
.meri-process__step h3 { margin: 0 0 8px; font-size: 1.0625rem; }
.meri-process__step p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.js .meri-process__step { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(.25s + var(--i) * .2s); }
.meri-process.is-in .meri-process__step { opacity: 1; transform: none; }
@media (max-width: 1023px) {
  .meri-process { grid-template-columns: 1fr 1fr; padding-left: 28px; }
  .meri-process::before, .meri-process::after { left: 7px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .meri-process::after { width: 2px; left: 6px; background: linear-gradient(180deg, var(--amber), var(--red)); transform: scaleY(0); transform-origin: top; }
  .meri-process.is-in::after { transform: scaleY(1); }
  .meri-process__step { padding-top: 0; }
  .meri-process__node { left: -28px; top: 2px; }
}
@media (max-width: 599px) { .meri-process { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Factory: reel corners ---------- */
.meri-reel__corner { position: absolute; z-index: 2; width: 28px; height: 28px; border: 2px solid var(--amber); }
.meri-reel__corner--tl { left: 20px; top: 20px; border-right: 0; border-bottom: 0; }
.meri-reel__corner--br { right: 20px; bottom: 20px; border-left: 0; border-top: 0; }

/* ---------- Certificates ---------- */
.meri-certs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.meri-cert { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .3s; }
.meri-cert:hover { border-color: var(--amber-dim); }
.meri-cert__scan { display: block; padding: 22px; background: radial-gradient(120% 80% at 50% 0%, var(--surface-2) 0%, var(--surface) 70%); }
.meri-cert__scan img { width: 100%; aspect-ratio: 480 / 680; object-fit: contain; border-radius: 3px; box-shadow: var(--shadow-scan); transition: transform .5s var(--ease); }
.meri-cert__scan:hover img { transform: translateY(-4px) rotate(-1deg); }
.meri-cert__body { padding: 18px 22px 22px; border-top: 1px solid var(--line); }
.meri-cert__body h3 { margin: 0 0 6px; font-size: 1.0625rem; }
.meri-cert__kind { margin: 0 0 6px; color: var(--amber); font: 500 .6875rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.meri-cert__meta { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.meri-certs--compact { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 32px; }
.meri-certs--compact .meri-cert { flex-direction: row; align-items: center; }
.meri-certs--compact .meri-cert__scan { flex: none; width: 70px; padding: 10px; }
.meri-certs--compact .meri-cert__body { padding: 10px 14px; border-top: 0; }
.meri-certs--compact .meri-cert__body h3 { margin: 0; font-size: .9375rem; }
@media (max-width: 479px) { .meri-certs--compact { grid-template-columns: 1fr; } }

/* ---------- Logo marquees ---------- */
.meri-network { overflow: hidden; }
.meri-logo-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.meri-logo-row + .meri-logo-row { margin-top: 28px; }
.meri-logo-row__label { margin: 0 auto; width: 100%; max-width: calc(var(--shell) + var(--gutter) * 2); padding: 0 var(--gutter); color: var(--muted); font: 500 .75rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.meri-logo-row__viewport { position: relative; overflow: hidden; border-block: 1px solid var(--line); }
.meri-logo-row__viewport::before, .meri-logo-row__viewport::after { content: ""; position: absolute; top: 0; bottom: 0; z-index: 1; width: 12%; pointer-events: none; }
.meri-logo-row__viewport::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.meri-logo-row__viewport::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.meri-logo-row__track { display: flex; width: max-content; animation: meri-marquee 48s linear infinite; }
.meri-logo-row--reverse .meri-logo-row__track { animation-direction: reverse; animation-duration: 56s; }
.meri-logo-row__track li { display: flex; align-items: center; justify-content: center; width: clamp(170px, 18vw, 240px); height: 112px; padding: 0 14px; border-right: 1px solid var(--line); }
.meri-logo-chip { display: flex; align-items: center; justify-content: center; width: 100%; height: 80px; padding: 14px 20px; border-radius: 12px; background: #fff; }
.meri-logo-row__track img { width: auto; max-width: 100%; max-height: 46px; object-fit: contain; }
[data-theme="light"] .meri-logo-chip { background: transparent; }
.meri-logo--on-light { display: none; }
[data-theme="light"] .meri-logo--on-light { display: block; }
[data-theme="light"] .meri-logo--on-dark { display: none; }

/* ---------- CTA ---------- */
.meri-cta { position: relative; isolation: isolate; overflow: hidden; padding: clamp(96px, 12vw, 180px) 0; border-top: 1px solid var(--line); background: radial-gradient(60% 80% at 85% 30%, var(--amber-glow), transparent 70%), var(--bg); }
.meri-cta__art { z-index: -1; right: -6%; top: 0; width: min(70vw, 980px); height: 100%; opacity: .8; }
.meri-cta .meri-display { max-width: 12ch; }
.meri-cta__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; }
.meri-cta__contacts { display: grid; gap: 6px; text-align: right; font: 500 .875rem/1.5 var(--mono); }
.meri-cta__contacts a { color: var(--text); }
.meri-cta__contacts a:hover { color: var(--amber); }
@media (max-width: 767px) { .meri-cta__contacts { text-align: left; } .meri-cta__art { opacity: .45; width: 140vw; right: -60%; } }

/* ---------- Page hero (interior) ---------- */
.meri-page-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(72px, 10vw, 140px) 0 clamp(56px, 7vw, 96px); border-bottom: 1px solid var(--line); background: radial-gradient(50% 90% at 90% 20%, var(--amber-glow), transparent 70%), var(--bg); }
.meri-page-hero__art { z-index: -1; right: -8%; top: -4%; width: min(60vw, 820px); height: auto; aspect-ratio: 4 / 3; opacity: .75; }
.meri-page-hero h1 { max-width: 16ch; }
.meri-page-hero__lead { max-width: 58ch; margin: 28px 0 0; color: var(--text-2); font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); }
@media (max-width: 767px) { .meri-page-hero__art { width: 130vw; right: -55%; opacity: .4; } }

/* ---------- Subpage components ---------- */
.meri-split { display: grid; gap: 48px; align-items: center; }
.meri-split__copy > :last-child { margin-bottom: 0; }
.meri-split__copy h2 { font-size: clamp(1.75rem, 1.1rem + 2.2vw, 2.75rem); letter-spacing: -.03em; }
.meri-split__media { border-radius: var(--radius); }
.meri-split__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
@media (min-width: 1024px) { .meri-split { grid-template-columns: 1fr 1.1fr; gap: 80px; } .meri-split--even { grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; } }
@media (min-width: 768px) and (max-width: 1023px) { .meri-split--even { grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; } }

.meri-panel { position: relative; padding: clamp(28px, 3.5vw, 44px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.meri-panel::before { content: ""; position: absolute; left: 0; top: 0; width: 64px; height: 2px; background: var(--red); }
.meri-panel h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }
.meri-panel h3 { margin-top: 4px; font-size: 1.625rem; }
.meri-panel > :last-child { margin-bottom: 0; }

.meri-products { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .meri-products { grid-template-columns: repeat(4, minmax(0, 1fr)); } .meri-products li:first-child { grid-column: span 2; grid-row: span 2; } }
.meri-products li { overflow: hidden; border-radius: var(--radius); background: #fff; }
.meri-products img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: contain; transition: transform .6s var(--ease); }
.meri-products li:hover img { transform: scale(1.05); }

.meri-values { display: grid; gap: 1px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.meri-values li { padding: 30px 28px; background: var(--bg-2); transition: background-color .3s; }
.meri-values li:hover { background: var(--surface); }
.meri-values h3 { margin-bottom: 10px; }
.meri-values h3::before { content: ""; display: block; width: 10px; height: 10px; margin-bottom: 18px; border: 2px solid var(--amber); transform: rotate(45deg); }
.meri-values p { margin: 0; font-size: .9375rem; }

.meri-commitments { display: grid; gap: 0; border-top: 1px solid var(--line); }
.meri-commitments li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.meri-commitments .meri-process__num { margin: 4px 0 0; color: var(--amber); }
.meri-commitments p { margin: 0; color: var(--text-2); }

.meri-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meri-duo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.meri-duo figure:last-child { margin-top: 56px; }

.meri-metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 36px 0 0; border-top: 1px solid var(--line-2); }
.meri-metrics > div { display: flex; flex-direction: column-reverse; padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); }
.meri-metrics dd { margin: 0; color: var(--white); font: 600 clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem)/1.1 var(--display); letter-spacing: -.02em; }
.meri-metrics dt { margin-top: 4px; color: var(--muted); font: 500 .6875rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Contact & forms ---------- */
.meri-contact { display: grid; gap: 48px; }
@media (min-width: 1024px) { .meri-contact { grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: start; } }
.meri-contact__info h2 { margin-bottom: 18px; font-size: 1.375rem; }
.meri-contact__info h2:not(:first-child) { margin-top: 44px; }
.meri-contact__list { border-top: 1px solid var(--line); }
.meri-contact__list li { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.meri-contact__list a { font: 500 1.25rem/1.3 var(--display); }
.meri-contact__label { color: var(--muted); font: 500 .6875rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.meri-checklist { display: grid; border-top: 1px solid var(--line); counter-reset: c; }
.meri-checklist li { position: relative; padding: 18px 0 18px 48px; border-bottom: 1px solid var(--line); color: var(--text-2); counter-increment: c; }
.meri-checklist li::before { content: counter(c, decimal-leading-zero); position: absolute; left: 0; top: 20px; color: var(--amber); font: 500 .75rem/1.4 var(--mono); letter-spacing: .1em; }

.meri-form-card { padding: clamp(24px, 3.5vw, 44px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.meri-form { display: grid; gap: 18px; }
.meri-form__row { display: grid; gap: 18px; }
@media (min-width: 600px) { .meri-form__row { grid-template-columns: 1fr 1fr; } }
.meri-form__hp { position: absolute; left: -9999px; }
.meri-field { display: grid; gap: 8px; }
.meri-field > span { color: var(--muted); font: 500 .6875rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.meri-field input, .meri-field select, .meri-field textarea {
  width: 100%; min-height: 52px; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg);
  color: var(--white); font: 400 1rem/1.4 var(--body);
  transition: border-color .2s, box-shadow .2s;
}
.meri-field textarea { min-height: 140px; resize: vertical; }
.meri-field ::placeholder { color: var(--placeholder); }
.meri-field input:focus, .meri-field select:focus, .meri-field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.meri-notice { display: grid; gap: 4px; margin-bottom: 22px; padding: 16px 18px; border-radius: var(--radius-sm); font-size: .9375rem; }
.meri-notice--ok { background: rgba(46, 160, 98, .12); border: 1px solid rgba(46, 160, 98, .35); color: var(--ok-text, #9fe0bb); }
.meri-notice--error { background: rgba(227, 38, 47, .1); border: 1px solid rgba(227, 38, 47, .35); color: var(--error-text, #ffb3b6); }

/* ---------- Prose / news ---------- */
.meri-prose { max-width: 760px; color: var(--text-2); }
.meri-prose h2 { margin-top: 1.8em; font-size: 1.5rem; }
.meri-prose h3 { margin-top: 1.6em; }
.meri-prose strong { color: var(--white); }
.meri-prose ul, .meri-prose ol { margin: 0 0 1em; padding-left: 1.25em; list-style: disc; }
.meri-prose ol { list-style: decimal; }
.meri-prose li { margin-bottom: .4em; }
.meri-prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.meri-prose img { border-radius: var(--radius-sm); }
.meri-post-cover img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); margin-bottom: 48px; }
.meri-posts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.meri-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .3s; }
.meri-card:hover { border-color: var(--line-2); }
.meri-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.meri-card__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.meri-card__body { padding: 22px 24px 26px; }
.meri-card__body h2 { font-size: 1.25rem; }
.meri-card__meta { margin-bottom: 8px !important; color: var(--amber) !important; font: 500 .6875rem/1.4 var(--mono) !important; letter-spacing: .12em; text-transform: uppercase; }
.meri-empty { max-width: 560px; padding: 44px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.meri-empty h2 { font-size: 1.5rem; }
.meri-pagination { margin-top: 48px; }
.meri-pagination .nav-links { display: flex; gap: 8px; }
.meri-pagination .page-numbers { padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; }
.meri-pagination .current { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Footer ---------- */
.meri-footer { padding: clamp(64px, 7vw, 96px) 0 0; background: var(--bg-2); border-top: 1px solid var(--line); font-size: .9375rem; }
.meri-footer__grid { display: grid; gap: 40px; }
@media (min-width: 768px) { .meri-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .meri-footer__grid { grid-template-columns: 1.3fr .7fr 1fr 1.3fr; gap: 56px; } }
.meri-footer__brand .meri-brand__img { height: 48px; margin-bottom: 20px; }
.meri-footer__brand p { max-width: 34ch; color: var(--muted); }
.meri-footer__certs { color: var(--amber) !important; font: 500 .75rem/1.4 var(--mono); letter-spacing: .1em; }
.meri-footer__title { margin: 0 0 18px; color: var(--muted); font: 500 .6875rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.meri-footer__links { display: grid; gap: 12px; }
.meri-footer__links a { color: var(--text); }
.meri-footer__links a:hover { color: var(--white); }
.meri-footer__phones li, .meri-footer__addresses li { display: grid; gap: 2px; }
.meri-footer__phones a { color: var(--white); font-weight: 500; }
.meri-footer__phones span, .meri-footer__addresses span { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.meri-footer__addresses b { color: var(--white); font-weight: 500; font-size: .875rem; }
.meri-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 64px; padding-top: 22px; padding-bottom: 26px; border-top: 1px solid var(--line); color: var(--muted); font: 500 .75rem/1.5 var(--mono); letter-spacing: .06em; }
.meri-footer__bottom a { margin-left: 22px; color: var(--muted); }
.meri-footer__bottom a:first-child { margin-left: 0; }
.meri-footer__bottom a:hover { color: var(--white); }

/* ---------- Media dialog ---------- */
.meri-dialog { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: #000; overflow: hidden; }
.meri-dialog::backdrop { background: rgba(3, 5, 9, .88); }
.meri-dialog img, .meri-dialog video { width: 100%; max-height: calc(100vh - 32px); object-fit: contain; }
.meri-dialog img { background: #fff; }
.meri-dialog__close { position: absolute; top: 12px; right: 12px; z-index: 1; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #07090f; font-size: 24px; line-height: 1; cursor: pointer; }

/* ---------- Brand + theme toggle ---------- */
.meri-brand__img--on-light { display: none; }
[data-theme="light"] .meri-brand__img--on-light { display: block; }
[data-theme="light"] .meri-brand__img--on-dark { display: none; }
[data-theme="light"] .meri-header--over:not(.is-scrolled) .meri-brand__img--on-light { display: none; }
[data-theme="light"] .meri-header--over:not(.is-scrolled) .meri-brand__img--on-dark { display: block; }
.meri-header__inner > .meri-nav { order: 1; margin-left: auto; }
.meri-theme-toggle {
  order: 2; flex: none; display: inline-grid; place-items: center;
  width: 42px; height: 42px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%;
  background: transparent; color: var(--white); cursor: pointer; transition: border-color .25s, color .25s;
}
.meri-theme-toggle:hover { border-color: var(--amber); color: var(--amber); }
.meri-theme-toggle svg { grid-area: 1 / 1; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; transition: transform .45s var(--ease), opacity .3s; }
.meri-theme-toggle__moon { fill: currentColor !important; stroke: none !important; opacity: 0; transform: rotate(-60deg) scale(.6); }
[data-theme="light"] .meri-theme-toggle__sun { opacity: 0; transform: rotate(60deg) scale(.6); }
[data-theme="light"] .meri-theme-toggle__moon { opacity: 1; transform: none; }
@media (max-width: 1023px) {
  .meri-theme-toggle { margin-left: auto; }
  .meri-header__toggle { order: 3; margin-left: 4px; }
}
[data-theme="light"] { --ok-text: #17603a; --error-text: #9b1c22; }

/* ---------- Service showcase (home) ---------- */
.meri-showcase { display: grid; gap: 40px; }
.meri-showcase__item { border-top: 1px solid var(--line); }
.meri-showcase__item:last-child { border-bottom: 1px solid var(--line); }
.meri-showcase__trigger {
  display: flex; align-items: baseline; gap: 22px; width: 100%; padding: 26px 0 18px;
  border: 0; background: none; text-align: left; cursor: pointer; color: var(--muted);
  transition: color .3s;
}
.meri-showcase__num { flex: none; color: var(--amber); font: 500 .8125rem/1 var(--mono); letter-spacing: .14em; }
.meri-showcase__title { position: relative; font: 600 clamp(1.625rem, 1rem + 2.2vw, 2.75rem)/1.08 var(--display); letter-spacing: -.03em; }
.meri-showcase__title::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 100%; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.meri-showcase__item.is-active .meri-showcase__trigger, .meri-showcase__trigger:hover { color: var(--white); }
.meri-showcase__item.is-active .meri-showcase__title::after { transform: scaleX(1); }
.meri-showcase__text { max-width: 46ch; padding: 0 0 26px 52px; color: var(--text-2); }
.meri-showcase__text p { margin: 0; min-height: 0; overflow: hidden; }
.meri-showcase__thumb { display: none; }
.meri-showcase__stage { position: relative; display: none; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.meri-showcase__slide { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); transition: clip-path .9s var(--ease); }
.meri-showcase__slide.is-active { z-index: 1; clip-path: inset(0 0 0 0); }
.meri-showcase__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.4s var(--ease); }
.meri-showcase__slide.is-active img { transform: none; }
.meri-showcase__count { position: absolute; right: 20px; bottom: 18px; z-index: 2; color: #fff; font: 500 .75rem/1 var(--mono); letter-spacing: .14em; }
.meri-showcase__count b { color: var(--amber); font-weight: 500; }
@media (min-width: 1024px) {
  .meri-showcase { grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: start; }
  .meri-showcase__text { display: grid; grid-template-rows: 0fr; padding-bottom: 0; transition: grid-template-rows .5s var(--ease), padding .5s var(--ease); overflow: hidden; }
  .meri-showcase__item.is-active .meri-showcase__text { grid-template-rows: 1fr; padding-bottom: 28px; }
  .meri-showcase__stage { display: block; position: sticky; top: calc(var(--header-h) + 24px); aspect-ratio: 4 / 5; max-height: calc(100vh - var(--header-h) - 48px); width: 100%; }
}
@media (max-width: 1023px) {
  .meri-showcase__list { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px; scrollbar-width: none; }
  .meri-showcase__list::-webkit-scrollbar { display: none; }
  .meri-showcase__item { flex: 0 0 min(82vw, 380px); scroll-snap-align: start; border: 0 !important; }
  .meri-showcase__thumb { display: block; overflow: hidden; border-radius: var(--radius); }
  .meri-showcase__thumb img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
  .meri-showcase__trigger { padding: 18px 0 8px; color: var(--white); cursor: default; }
  .meri-showcase__title { font-size: 1.5rem; }
  .meri-showcase__title::after { display: none; }
  .meri-showcase__text { padding: 0; font-size: .9375rem; }
}

/* ---------- Cinema reel + bento (home factory) ---------- */
.meri-cinema { position: relative; overflow: hidden; min-height: 560px; aspect-ratio: 21 / 9; border-radius: var(--radius); background: #000 url("../img/reel-poster-2.jpg") center / cover; }
.meri-cinema__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.meri-cinema::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(7, 9, 15, .85) 0%, rgba(7, 9, 15, .35) 55%, rgba(7, 9, 15, 0) 80%), linear-gradient(0deg, rgba(7, 9, 15, .6), rgba(7, 9, 15, 0) 45%); }
.meri-cinema__copy { position: absolute; left: 0; bottom: 0; z-index: 2; max-width: 640px; padding: clamp(28px, 4vw, 56px); }
.meri-cinema__copy .meri-h2 { margin-bottom: 28px; }
.meri-label__dot--live { background: var(--red); box-shadow: 0 0 0 4px rgba(227, 38, 47, .25); }
.meri-btn--light { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.meri-btn--light:hover { border-color: #fff; color: #fff; }
@media (max-width: 767px) { .meri-cinema { aspect-ratio: auto; min-height: 520px; } }

.meri-bento { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(220px, 24vw, 330px); }
.meri-bento figure { overflow: hidden; border-radius: var(--radius); }
.meri-bento img { width: 100%; height: 100%; object-fit: cover; }
.meri-bento__a { grid-column: 1 / 8; grid-row: 1 / 3; }
.meri-bento__b { grid-column: 8 / 13; grid-row: 1; }
.meri-bento__c { grid-column: 8 / 13; grid-row: 2; }
.meri-bento__copy { grid-column: 1 / -1; grid-row: 3; align-self: start; display: grid; gap: 24px 48px; align-items: center; padding: 28px 0 0; }
.meri-bento__copy p { margin: 0; max-width: 52ch; color: var(--text-2); font-size: 1.0625rem; }
.meri-bento__copy .meri-certs--compact { margin: 0; }
@media (min-width: 1024px) { .meri-bento { grid-template-rows: repeat(2, clamp(220px, 24vw, 330px)) auto; grid-auto-rows: auto; } .meri-bento__copy { grid-template-columns: 1fr auto; } }
@media (max-width: 1023px) {
  .meri-bento { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .meri-bento__a { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 4 / 3; }
  .meri-bento__b, .meri-bento__c { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 5; }
  .meri-bento__copy { grid-row: auto; padding-top: 12px; }
}

/* ---------- Page hero panorama ---------- */
.meri-page-hero--image { padding-bottom: clamp(140px, 16vw, 230px); border-bottom: 0; }
.meri-pano-wrap { margin-top: calc(-1 * clamp(96px, 12vw, 170px)); }
.meri-pano { position: relative; overflow: hidden; aspect-ratio: 21 / 9; border-radius: var(--radius); }
.meri-pano img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .meri-pano { aspect-ratio: 4 / 3; } }

/* Full-bleed band with caption (about) */
.meri-band-image { position: relative; overflow: hidden; height: clamp(360px, 46vw, 680px); }
.meri-band-image img { width: 100%; height: 100%; object-fit: cover; }
.meri-band-image::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(7, 9, 15, .7), rgba(7, 9, 15, 0) 50%); }
.meri-band-image figcaption { position: absolute; left: var(--gutter); bottom: clamp(24px, 4vw, 48px); z-index: 2; display: flex; align-items: center; gap: 12px; max-width: 18ch; color: #fff; font: 600 clamp(1.75rem, 1.1rem + 2.6vw, 3.25rem)/1.05 var(--display); letter-spacing: -.03em; }
@media (min-width: 1320px) { .meri-band-image figcaption { left: calc((100vw - var(--shell)) / 2); } }
.meri-band-image figcaption .meri-label__dot { flex: none; }

/* ---------- Service rows (services page) ---------- */
.meri-rows { display: grid; gap: clamp(56px, 8vw, 120px); }
.meri-row { display: grid; gap: 28px; align-items: center; }
.meri-row__media { overflow: hidden; border-radius: var(--radius); }
.meri-row__media img { width: 100%; aspect-ratio: 4 / 5; max-height: 760px; object-fit: cover; }
.meri-row__num { display: block; margin-bottom: 8px; color: transparent; -webkit-text-stroke: 1.5px var(--amber); font: 600 clamp(4.5rem, 3rem + 6vw, 9rem)/.9 var(--display); letter-spacing: -.05em; }
.meri-row h3 { font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem); letter-spacing: -.03em; }
.meri-row p { max-width: 44ch; color: var(--text-2); font-size: 1.125rem; }
@media (min-width: 900px) {
  .meri-row { grid-template-columns: 1.15fr 1fr; gap: clamp(48px, 7vw, 110px); }
  .meri-row:nth-child(even) .meri-row__media { order: 2; }
  .meri-row__media img { aspect-ratio: 4 / 4.4; }
}
@media (min-width: 1024px) { .meri-split--wide { grid-template-columns: .8fr 1.2fr; } .meri-split--wide .meri-split__media { overflow: hidden; } }
.meri-split__media { overflow: hidden; }

/* ---------- Certificate showcase (home) ---------- */
.meri-certwall { overflow: hidden; background: radial-gradient(70% 55% at 50% 0%, var(--amber-glow), transparent 70%), var(--bg-2); border-block: 1px solid var(--line); }
.meri-certwall__list { display: grid; gap: 28px; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.meri-certwall__item { display: grid; gap: 22px; }
.meri-certwall__frame {
  position: relative; display: block; padding: 18px;
  border-radius: 18px; border: 1px solid var(--line-2);
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 60%);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  transform: rotate(-1.6deg); transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s;
}
.meri-certwall__item:nth-child(even) .meri-certwall__frame { transform: rotate(1.4deg) translateY(18px); }
.meri-certwall__frame:hover, .meri-certwall__frame:focus-visible { transform: rotate(0) translateY(-10px) !important; border-color: var(--amber-dim); box-shadow: 0 40px 80px -24px rgba(0, 0, 0, .6), 0 0 0 1px var(--amber-dim); }
.meri-certwall__frame img { width: 100%; aspect-ratio: 1200 / 1700; object-fit: contain; border-radius: 4px; background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.meri-certwall__zoom { position: absolute; top: 28px; right: 28px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font: 400 1.5rem/1 var(--body); opacity: 0; transform: scale(.8); transition: opacity .3s, transform .3s var(--ease); }
.meri-certwall__frame:hover .meri-certwall__zoom, .meri-certwall__frame:focus-visible .meri-certwall__zoom { opacity: 1; transform: none; }
.meri-certwall__body { padding: 0 4px; }
.meri-certwall__item:nth-child(even) .meri-certwall__body { margin-top: 18px; }
.meri-certwall__kind { margin: 0 0 6px; color: var(--amber); font: 500 .6875rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.meri-certwall__body h3 { margin: 0 0 8px; font-size: clamp(1.25rem, 1rem + .8vw, 1.625rem); line-height: 1.15; }
.meri-certwall__meta { margin: 0 0 10px; color: var(--text-2); font-size: .9375rem; }
.meri-certwall__ref { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font: 500 .75rem/1.5 var(--mono); }
@media (max-width: 1023px) {
  .meri-certwall__list { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 12px var(--gutter) 24px; scrollbar-width: none; }
  .meri-certwall__list::-webkit-scrollbar { display: none; }
  .meri-certwall__item { flex: 0 0 min(74vw, 320px); scroll-snap-align: start; }
  .meri-certwall__item:nth-child(even) .meri-certwall__frame { transform: rotate(1.4deg); }
  .meri-certwall__item:nth-child(even) .meri-certwall__body { margin-top: 0; }
}
[data-theme="light"] .meri-certwall__frame { box-shadow: 0 30px 60px -24px rgba(17, 20, 28, .28); }

/* ---------- News (home) ---------- */
.meri-news__grid { display: grid; gap: 20px; }
@media (min-width: 1024px) { .meri-news__grid { grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; } .meri-story--lead { grid-row: span 2; } }
.meri-story { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .3s; }
.meri-story:hover { border-color: var(--line-2); }
.meri-story__link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.meri-story__media { overflow: hidden; }
.meri-story__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 1s var(--ease); }
.meri-story--lead .meri-story__media img { aspect-ratio: 4 / 3; }
@media (min-width: 1024px) { .meri-story--lead .meri-story__media { position: relative; flex: 1; min-height: 320px; } .meri-story--lead .meri-story__media img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; } }
.meri-story:hover .meri-story__media img { transform: scale(1.04); }
.meri-story__body { display: grid; gap: 8px; padding: 22px 24px 26px; }
.meri-story__date { margin: 0; color: var(--amber); font: 500 .6875rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.meri-story h3 { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.meri-story--lead h3 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem); line-height: 1.12; letter-spacing: -.02em; }
.meri-story__excerpt { margin: 4px 0 0; color: var(--text-2); }
.meri-story__more { margin-top: 6px; color: var(--white); font-weight: 500; font-size: .875rem; }
.meri-story__link:hover .meri-story__more { color: var(--amber); }

/* ---------- GBA Quote plugin bridge ----------
   The plugin's stylesheet (gbaq-quote, depends on this one) is written against
   the v0.7 `--meri-*` tokens and `.meri-button`. Map them onto the live palette
   so the quotation workspace follows dark/light mode. Declared on the root,
   where data-theme lives, so they resolve to the active palette. */
:root, [data-theme] {
  --meri-red: var(--red);
  --meri-red-hover: var(--red-700);
  --meri-navy: var(--amber);
  --meri-navy-deep: #1b2a44;
  --meri-canvas: var(--bg);
  --meri-surface: var(--surface);
  --meri-technical: var(--surface-2);
  --meri-ink: var(--white);
  --meri-body: var(--text);
  --meri-muted: var(--muted);
  --meri-line: var(--line);
  --meri-line-strong: var(--line-2);
  --meri-reading: 66ch;
  --meri-gutter: var(--gutter);
  --meri-radius-sm: var(--radius-sm);
  --meri-radius-md: var(--radius);
  --meri-radius-lg: 20px;
  --meri-shadow: var(--shadow-scan);
  --meri-fast: 160ms;
  --meri-ease: var(--ease);
  --meri-motion-feedback: 180ms;
  --meri-motion-state: 220ms;
  --meri-motion-ease: var(--ease);
}
.meri-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: 1px solid var(--red); border-radius: 999px;
  background: var(--red); color: #fff; font: 500 .9375rem/1 var(--body); cursor: pointer;
  transition: background-color .25s, border-color .25s, color .25s;
}
.meri-button:hover, a.meri-button:hover { background: var(--red-700); border-color: var(--red-700); color: #fff; }
.meri-button--outline, a.meri-button--outline { background: transparent; border-color: var(--line-2); color: var(--white); }
.meri-button--outline:hover, a.meri-button--outline:hover { background: transparent; border-color: var(--white); color: var(--white); }
.meri-quote-workspace { padding-top: clamp(40px, 5vw, 64px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .js .meri-wipe::after { transform: scaleX(0) !important; }
  .meri-circuit__traces path { stroke-dashoffset: 0 !important; }
  .meri-circuit__pads circle { opacity: 1 !important; }
}

/* Account (GBA Quote): content follows the hero closely. */
.meri-section.meri-account { padding-top: clamp(28px, 4vw, 56px); }


/* ---------- Light mode refinements ----------
   White pages need depth from soft shadows instead of glows, and the warm amber
   washes of the dark design read as yellowed paper on white. */
.meri-home, .meri-page { overflow-x: clip; } /* the cinema panel bleeds right by design */
[data-theme="light"] .meri-cta { background: radial-gradient(60% 80% at 85% 30%, var(--glow-neutral), transparent 70%), var(--bg); }
[data-theme="light"] .meri-page-hero { background: radial-gradient(50% 90% at 90% 20%, var(--glow-neutral), transparent 70%), var(--bg); }
[data-theme="light"] .meri-certwall { background: linear-gradient(180deg, var(--bg-2), var(--bg) 85%); }
[data-theme="light"] .meri-footer { background: var(--bg-2); }
[data-theme="light"] :is(.meri-cta, .meri-page-hero) .meri-circuit__traces path { stroke: var(--white); stroke-opacity: .13; }
[data-theme="light"] :is(.meri-cta, .meri-page-hero) .meri-circuit__pads circle { stroke: var(--white); stroke-opacity: .28; fill: var(--bg); }
[data-theme="light"] :is(.meri-cta, .meri-page-hero) .meri-circuit__pulses circle { fill: var(--red); }
[data-theme="light"] :is(.meri-story, .meri-card) { border-color: var(--line); box-shadow: var(--shadow-card); }
[data-theme="light"] :is(.meri-story, .meri-card):hover { border-color: var(--line-2); }
[data-theme="light"] .meri-certwall__frame { border-color: var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 28px 56px -28px rgba(16, 24, 40, .28); }
[data-theme="light"] .meri-certwall__frame img { box-shadow: 0 6px 16px rgba(16, 24, 40, .12); }
[data-theme="light"] .meri-header.is-scrolled, [data-theme="light"] .meri-header:not(.meri-header--over) { box-shadow: 0 1px 0 var(--line); }
[data-theme="light"] ::selection { background: rgba(209, 42, 47, .16); color: var(--white); }
