/* TheFirstRanking - public site. All colours/radii/fonts come from theme tokens
   (--primary, --navy, --accent, --cta, --bg, --surface, --text, ...) which the
   Worker injects from the CMS theme. Fallbacks below match the default theme. */
:root {
  --primary: #0A5FD1; --on-primary: #fff; --navy: #0A2C5C; --on-navy: #fff;
  --accent: #FF8A00; --on-accent: #0B1220; --cta: #CF3F0C; --on-cta: #fff; --cta-hover: #b2360a;
  --bg: #fff; --surface: #F4F8FD; --text: #0E1B33; --muted: #55657D; --border: #DDE6F2; --link: #0A5FD1;
  --radius: 18px; --radius-sm: 10px; --radius-lg: 27px; --btn-radius: 999px;
  --font-head: 'Poppins', system-ui, sans-serif; --font-body: 'Inter', system-ui, sans-serif;
  --card-bg: #fff; --card-shadow: 0 14px 36px -16px rgba(10,44,92,.35); --card-border: 1px solid rgba(221,230,242,.6);
  --header-bg: #fff; --header-fg: #0E1B33;
  --hero-bg: linear-gradient(135deg, #0A2C5C, #0d4390); --hero-fg: #fff; --hero-muted: rgba(255,255,255,.82);
  --header-h: 54px; --ease: cubic-bezier(.22,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
/* Click ripple - one-shot ring expanding from the click point, removed by
   JS on animationend (see initClickRipple in site.js). */
.cursor-ripple { position: fixed; top: 0; left: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid var(--accent, #0A5FD1); pointer-events: none; z-index: 9999; mix-blend-mode: difference; animation: cursorRipple .5s ease-out forwards; }
@keyframes cursorRipple { from { transform: scale(1); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }
/* overflow-x lives on html, not body: setting it on body with no overflow-y
   forces the UA to auto-promote overflow-y to "auto" (CSS Overflow spec's
   visible/non-visible pairing rule), which turns body into its own scroll
   container that the viewport's real scroll never touches - and that quietly
   breaks position: sticky on the header, since it "sticks" against a
   container that never scrolls. html doesn't have this trap: overflow set on
   the root element controls the viewport's own scroller directly. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { margin: 0; font-family: var(--font-body); font-size: 1rem; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--cta); color: var(--on-cta); padding: 12px 18px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; vertical-align: middle; }
.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.container-narrow { width: min(780px, 100% - 40px); margin-inline: auto; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; padding: .75rem 1.6rem; border: 2px solid transparent; border-radius: var(--btn-radius); font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s; line-height: 1.2; touch-action: manipulation; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-cta { background: var(--cta); color: var(--on-cta); box-shadow: 0 10px 24px -12px var(--cta); }
.btn-cta:hover { background: var(--cta-hover); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { border-color: currentColor; background: transparent; }
.btn-outline:hover { background: rgba(127,127,127,.14); }
.btn-light { background: #fff; color: #0B1220; }
.btn-light:hover { background: #eef3fb; }
.btn .ic { transition: transform .2s var(--ease); }
.btn:hover .ic-arrow { transform: translateX(3px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-arrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; }
.link-arrow:hover .ic { transform: translateX(3px); }
.link-arrow .ic { transition: transform .2s var(--ease); }

/* ---------- topbar + header ---------- */
.topbar { background: var(--navy); color: var(--on-navy); font-size: .875rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 42px; }
.topbar a { color: inherit; text-decoration: none; opacity: .92; display: inline-flex; align-items: center; gap: .45rem; }
.topbar a:hover { opacity: 1; text-decoration: underline; }
.topbar .tb-left { display: flex; gap: 22px; flex-wrap: wrap; }
.social { display: flex; gap: 8px; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.12); transition: background .2s, transform .2s var(--ease); }
.social a:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-2px); text-decoration: none; }
/* position: relative (not static) - header stays in normal flow (unfrozen,
   scrolls with the page) but still establishes a stacking context so its
   z-index applies; without one, the Services dropdown (position: absolute,
   z-index: auto) loses stacking priority and paints behind the hero image. */
.site-header { position: relative; z-index: 60; background: var(--header-bg); color: var(--header-fg); border-bottom: 1px solid var(--border); transition: box-shadow .25s; }
.site-header.scrolled { box-shadow: 0 10px 30px -18px rgba(0,0,0,.45); }
.site-header .bar { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; font-family: var(--font-head); font-weight: 700; font-size: 1.32rem; letter-spacing: -.02em; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand b { color: var(--accent-on-dark, var(--accent)); font-weight: 800; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
/* max-width is set from JS to match .brand-name's own rendered width, so the
   tagline never runs wider than the brand name above it (truncates instead). */
/* margin-left is a small optical-alignment nudge: the bold brand-name glyph
   above has thicker strokes than this lighter, smaller line, so a geometric
   0px box match still reads as the tagline starting slightly left of it. */
.brand-tagline { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--font-body); font-size: .68rem; font-weight: 500; letter-spacing: .01em; color: var(--muted); margin-top: 2px; margin-left: 3px; }
.site-header[data-hdr="navy"] .brand-tagline { color: rgba(255,255,255,.7); }
.site-header .brand b { color: var(--link); }
.site-header[data-hdr="navy"] .brand b { color: var(--accent-on-dark); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav > ul { display: flex; align-items: center; gap: 2px; }
.nav a.nl, .nav .sub-toggle { color: inherit; text-decoration: none; font-weight: 500; font-size: .95rem; padding: 10px 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; background: none; border: 0; transition: color .2s, background .2s; }
.nav a.nl:hover, .nav .sub-toggle:hover { background: rgba(127,127,127,.12); }
.nav a.nl[aria-current="page"], .nav li.active > a.nl { color: var(--link); font-weight: 600; }
.site-header[data-hdr="navy"] .nav a.nl[aria-current="page"], .site-header[data-hdr="navy"] .nav li.active > a.nl { color: var(--accent-on-dark); }
.has-sub { position: relative; display: flex; align-items: center; }
.has-sub .sub-toggle { padding: 10px 8px 10px 0; margin-left: -6px; }
.has-sub .sub-toggle .ic { transition: transform .2s; }
.has-sub.open .sub-toggle .ic { transform: rotate(180deg); }
.sub { position: absolute; top: calc(100% + 6px); left: 0; min-width: 270px; background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 24px 48px -20px rgba(0,0,0,.45); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s var(--ease), visibility .2s; }
.has-sub:hover .sub, .has-sub.open .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.sub a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; font-weight: 500; font-size: .95rem; }
.sub a:hover, .sub a[aria-current="page"] { background: var(--surface); color: var(--primary); }
.sub a .ic { color: var(--accent); }
.header-cta { margin-left: 8px; }
.menu-btn { display: none; margin-left: auto; width: 48px; height: 48px; border-radius: 12px; background: none; border: 1px solid var(--border); align-items: center; justify-content: center; color: inherit; }

/* ---------- page transition ---------- */
main { outline: none; min-height: 60vh; }
.page-enter { animation: pageIn .42s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- sections ---------- */
.section { padding: 92px 0; }
.section-alt { background: var(--surface); }
.section-dark { background: var(--navy); color: var(--on-navy); }
.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.06rem; }
.section-dark .section-head p, .section-dark .lead { color: rgba(255,255,255,.8); }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 14px; }
.eyebrow::before { content: ''; width: 34px; height: 3px; border-radius: 3px; background: currentColor; }
.section-head .eyebrow::after { content: ''; width: 34px; height: 3px; border-radius: 3px; background: currentColor; }
.section-dark .eyebrow { color: var(--accent-on-dark); }
.lead { font-size: 1.1rem; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.rev > :first-child { order: 2; }
.card { background: var(--card-bg); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius); }
.frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 30px 60px -28px rgba(10,44,92,.55); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame-accent { position: relative; }
.frame-accent::before { content: ''; position: absolute; inset: 22px -18px -18px 22px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--primary))); opacity: .9; z-index: 0; }
.frame-accent .frame { z-index: 1; }

/* image placeholder */
.ph { display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 85%, #000), var(--navy)); color: rgba(255,255,255,.55); position: relative; overflow: hidden; }
.ph::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 55%); }
.ph img { width: 34%; max-width: 110px; opacity: .9; z-index: 1; }

/* ---------- hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-fg); position: relative; overflow: hidden; padding: 72px 0 150px; }
.hero::before { content: ''; position: absolute; width: 520px; height: 520px; right: -140px; top: -180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 42%, transparent), transparent 68%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.hero .eyebrow { color: var(--hero-eyebrow); }
.hero .eyebrow::before { background: var(--accent); }
.hero h1 { color: var(--hero-fg); }
.hero-bg .lead { text-shadow: 0 1px 14px color-mix(in srgb, var(--hero-ov) 55%, transparent); }
.hero .lead { color: var(--hero-muted); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 26px; }
.hero .btn-outline { color: var(--hero-fg); }
.hero-points { display: grid; gap: 10px; }
.hero-points li { display: flex; align-items: center; gap: 10px; color: var(--hero-muted); font-size: .98rem; }
.hero-bg .hero-points li { text-shadow: 0 1px 10px color-mix(in srgb, var(--hero-ov) 55%, transparent); }
.hero-points .ic { color: var(--accent); }
.hero-media { position: relative; max-width: 470px; margin-left: auto; width: 100%; }
.hero-frame { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; border: 6px solid rgba(255,255,255,.22); box-shadow: 0 40px 70px -30px rgba(0,0,0,.6); background: var(--navy); position: relative; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease); }
.hero-slide.on { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-chip { position: absolute; left: -30px; bottom: 56px; background: var(--card-bg); color: var(--text); border-radius: var(--radius); padding: 14px 20px; box-shadow: 0 22px 40px -18px rgba(0,0,0,.5); display: flex; align-items: center; gap: 14px; z-index: 2; animation: float 6s ease-in-out infinite; }
.hero-chip strong { font-family: var(--font-head); font-size: 1.7rem; line-height: 1; color: var(--cta); }
.hero-chip span { font-size: .85rem; color: var(--muted); font-weight: 500; line-height: 1.25; }
@keyframes float { 50% { transform: translateY(-8px); } }
.hero-ctrl { display: flex; align-items: center; gap: 10px; margin-top: 18px; justify-content: center; }
.hero-dot { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: rgba(127,127,127,.55); transition: width .25s var(--ease), background .25s; position: relative; }
.hero-dot::after { content: ''; position: absolute; inset: -16px -6px; }
.hero-dot[aria-current="true"] { width: 34px; border-radius: 8px; background: var(--accent); }
.hero-pause { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(127,127,127,.5); background: rgba(127,127,127,.15); display: grid; place-items: center; color: var(--hero-fg); margin-left: 6px; }

/* hero with full-width main image */
.hero-bg { min-height: 640px; display: flex; align-items: center; padding: 96px 0 170px; background: var(--navy); }
.hero-bg::before { display: none; }
.hero-bgimg { position: absolute; inset: 0; z-index: 0; background: var(--navy); }
.hero-bgimg img, .hero-bgimg video, .hero-bgimg .ph { position: absolute; right: 0; top: 0; width: 82%; height: 100%; object-fit: cover; object-position: 50% center; max-width: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%); mask-image: linear-gradient(90deg, transparent 0, #000 32%); }
.hero-bgimg video { background: var(--navy); }
.hero-bgimg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--hero-ov) var(--ov0), transparent) 0%, color-mix(in srgb, var(--hero-ov) var(--ov1), transparent) 44%, color-mix(in srgb, var(--hero-ov) var(--ov2), transparent) 100%); }
.hero-bg .hero-grid { grid-template-columns: minmax(0, 620px); width: min(1200px, 100% - 40px); }
.hero-bg h1 { text-shadow: 0 2px 24px color-mix(in srgb, var(--hero-ov) 60%, transparent); }
@media (max-width: 900px) {
  .hero-bg { min-height: 0; padding: 64px 0 130px; }
  .hero-bgimg img, .hero-bgimg video, .hero-bgimg .ph { width: 100%; -webkit-mask-image: none; mask-image: none; }
  .hero-bgimg::after { background: color-mix(in srgb, var(--hero-ov) var(--ov0), transparent); }
}

/* ---------- stats ---------- */
.stats-wrap { position: relative; z-index: 3; margin-top: -78px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--navy); color: var(--on-navy); border-radius: var(--radius-lg); padding: 38px 20px; box-shadow: 0 34px 60px -28px rgba(10,44,92,.7); border: 1px solid rgba(255,255,255,.1); }
.stat { text-align: center; padding: 4px 12px; position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 1px; background: rgba(255,255,255,.16); }
.stat b { display: block; font-family: var(--font-head); font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.1; color: var(--accent-on-dark); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: .92rem; color: rgba(255,255,255,.86); font-weight: 500; }

/* ---------- about teaser ---------- */
.bars { display: grid; gap: 18px; margin: 28px 0 32px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.bar-track { height: 9px; background: var(--border); border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--cta))); transition: width 1.3s var(--ease); }

/* ---------- service cards ---------- */
.grid-services { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.svc { flex: 1 1 320px; max-width: calc((100% - 56px) / 3); min-width: 290px; display: block; text-decoration: none; color: inherit; position: relative; }
.svc .img { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface); box-shadow: var(--card-shadow); }
.svc .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.svc:hover .img img { transform: scale(1.06); }
.svc .panel { position: relative; margin: -54px 18px 0; padding: 22px 22px 20px; border-radius: var(--radius); background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 72%, var(--cta))); color: var(--on-accent); box-shadow: 0 22px 36px -18px color-mix(in srgb, var(--accent) 80%, #000); transition: transform .35s var(--ease); }
.svc:hover .panel { transform: translateY(-6px); }
.svc .panel .ico { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.28); margin-bottom: 10px; }
.svc .panel h3 { margin-bottom: 6px; font-size: 1.15rem; }
.svc .panel p { font-size: .93rem; margin-bottom: 12px; opacity: .95; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.svc .panel .more { font-weight: 700; font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; letter-spacing: .02em; }

/* ---------- why / features ---------- */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
.feature { display: flex; gap: 14px; }
.feature .ico { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, var(--bg)); color: var(--primary); }
.feature h3 { font-size: 1.05rem; margin-bottom: 4px; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.55; }

/* ---------- process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: s; position: relative; }
.step { padding: 30px 26px; position: relative; }
.step .n { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: var(--accent); font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; margin-bottom: 16px; border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- CTA banner ---------- */
.cta-band { position: relative; border-radius: var(--radius-lg); overflow: hidden; color: #fff; background: var(--navy); isolation: isolate; }
.cta-band .bgimg { position: absolute; inset: 0; z-index: -2; }
.cta-band .bgimg img { width: 100%; height: 100%; object-fit: cover; }
.cta-band::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, color-mix(in srgb, var(--navy) 95%, transparent) 30%, color-mix(in srgb, var(--primary) 82%, transparent)); }
.cta-inner { padding: clamp(40px, 7vw, 84px); display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center; }
.cta-inner h2 { color: #fff; margin-bottom: 10px; }
.cta-inner p { color: rgba(255,255,255,.86); margin: 0; font-size: 1.08rem; max-width: 560px; }

/* ---------- testimonials: infinite marquee ---------- */
.tm-title { color: var(--cta); }
.tm-section { overflow: hidden; }
.tm-viewport { overflow-x: hidden; overflow-y: visible; padding: 46px 0 10px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%); }
.tm-track { display: flex; gap: 24px; width: max-content; animation-name: tm-marquee; animation-timing-function: linear; animation-iteration-count: infinite; }
/* Hover/focus pause is handled in JS (initTestimonialArrows), not here - it
   shares one Animation object with the arrow buttons so the two controls
   (hover-pause and click-to-nudge) can't fight over play/pause state. */
@keyframes tm-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tm-single { max-width: 380px; margin: 46px auto 0; }
.tm-card { position: relative; flex: 0 0 320px; padding: 58px 24px 28px; text-align: center; overflow: visible; }
.tm-card::before, .tm-card::after { content: ''; position: absolute; width: 30px; height: 30px; border: 3px solid var(--cta); pointer-events: none; }
.tm-card::before { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: var(--radius-sm); }
.tm-card::after { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: var(--radius-sm); }
.tm-avatar-wrap { position: absolute; top: -42px; left: 50%; transform: translateX(-50%); width: 100px; height: 100px; }
.tm-avatar-halo { position: absolute; inset: 0; border-radius: 50%; background: color-mix(in srgb, var(--accent) 26%, var(--card-bg)); }
.tm-avatar { position: absolute; inset: 13px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--navy)); }
.tm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tm-initials { color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; }
.tm-name { color: var(--cta); font-size: 1.08rem; margin: 6px 0 14px; }
.tm-quote { margin: 0 0 18px; color: var(--muted); font-size: .94rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tm-stars { display: flex; justify-content: center; gap: 3px; }
.tm-star-on { color: var(--cta); }
.tm-star-off { color: var(--border); }
.tm-nav { display: flex; justify-content: center; gap: 14px; margin-top: 30px; }
.tm-arrow { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--cta); background: transparent; color: var(--cta); display: grid; place-items: center; transition: background .2s, color .2s, transform .2s var(--ease); }
.tm-arrow:hover { transform: translateY(-2px); }
.tm-arrow-fill { background: var(--cta); color: var(--on-cta); }
.tm-arrow-fill:hover { background: var(--cta-hover); }
@media (max-width: 640px) {
  .tm-card { flex-basis: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-track { animation: none; }
  .tm-viewport { overflow-x: auto; scroll-snap-type: x proximity; -webkit-mask-image: none; mask-image: none; }
  .tm-card { scroll-snap-align: start; }
}

/* ---------- blog ---------- */
.b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.bcard { display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden; transition: transform .3s var(--ease); }
.bcard:hover { transform: translateY(-6px); }
.bcard .cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.bcard .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.bcard:hover .cover img { transform: scale(1.05); }
.bcard .body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bcard h3 { font-size: 1.15rem; margin: 0; }
.bcard p { margin: 0; color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); align-items: center; }
.tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: color-mix(in srgb, var(--primary) 12%, var(--bg)); color: var(--primary); border: 1px solid transparent; text-decoration: none; }
button.tag { cursor: pointer; }
.tag[aria-pressed="true"], .tag:hover { background: var(--primary); color: var(--on-primary); }
.blog-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.tagbar { display: flex; flex-wrap: wrap; gap: 8px; }
.tagbar .tag { min-height: 40px; padding-inline: 16px; display: inline-flex; align-items: center; }
.search-box { position: relative; width: min(340px, 100%); }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 44px; }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.faq-list { display: grid; gap: 12px; margin-top: 26px; }
.faq-item { background: var(--card-bg); color: var(--text); border-radius: var(--radius-sm); border: var(--card-border); overflow: hidden; }
.faq-item h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; padding: 16px 20px; min-height: 56px; background: none; border: 0; font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.faq-q .ic { color: var(--cta); transition: transform .3s var(--ease); }
.faq-item.open .faq-q { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--cta))); color: var(--on-accent); }
.faq-item.open .faq-q .ic { transform: rotate(180deg); color: inherit; }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; visibility: hidden; transition: visibility 0s .35s; }
.faq-item.open .faq-a > div { visibility: visible; transition-delay: 0s; }
.faq-a p { padding: 16px 20px 18px; margin: 0; color: var(--muted); }
.faq-item.on-light { background: var(--card-bg); }

/* ---------- consult strip ---------- */
.consult { background: linear-gradient(100deg, var(--navy), color-mix(in srgb, var(--navy) 60%, var(--primary))); color: #fff; padding: 46px 0; }
.consult .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 26px; }
.consult h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); color: #fff; }
.consult p { margin: 4px 0 0; color: rgba(255,255,255,.8); }
.consult .contacts { display: flex; flex-wrap: wrap; gap: 28px; }
.consult .contacts a { display: flex; gap: 14px; align-items: center; color: #fff; text-decoration: none; }
.consult .contacts .ico { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); color: var(--accent); }
.consult .contacts small { display: block; opacity: .75; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.consult .contacts b { font-family: var(--font-head); font-size: 1.02rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.82); padding-top: 72px; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.5fr .8fr 1fr 1.3fr; gap: 44px; padding-bottom: 56px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand .logo-chip { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; padding: 5px; }
.site-footer .brand .logo-chip img { width: 100%; height: 100%; }
.site-footer .brand-tagline { color: rgba(255,255,255,.65); }
.site-footer p { color: rgba(255,255,255,.78); }
.site-footer ul { display: grid; gap: 10px; }
.site-footer a { color: rgba(255,255,255,.82); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .social a { color: #fff; }
.site-footer .social a:hover { color: var(--on-accent); text-decoration: none; }
.foot-contact li { display: flex; gap: 10px; align-items: flex-start; }
.foot-contact .ic { color: var(--accent); margin-top: 4px; }
.news-form { display: flex; gap: 8px; margin-top: 12px; }
.news-form input { flex: 1; min-width: 0; border-radius: var(--btn-radius); padding-inline: 18px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.14); padding: 22px 0; font-size: .86rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.form-msg { font-size: .9rem; margin-top: 8px; min-height: 1.4em; }
.form-msg.ok { color: #86efac; }
.form-msg.err { color: #fecaca; }

/* ---------- inner page header ---------- */
.page-head { position: relative; color: #fff; background: var(--navy); isolation: isolate; overflow: hidden; padding: 84px 0 92px; }
.page-head .bgimg { position: absolute; inset: 0; z-index: -2; }
.page-head .bgimg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
/* Strong tint behind the text (left), fading out toward the right so the photo
   actually reads instead of disappearing under a near-solid wash. */
.page-head::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, color-mix(in srgb, var(--navy) 94%, transparent) 0%, color-mix(in srgb, var(--navy) 86%, transparent) 44%, color-mix(in srgb, var(--navy) 15%, transparent) 100%); }
.page-head::after { content: ''; position: absolute; width: 380px; height: 380px; right: -100px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%); z-index: -1; }
.page-head h1 { color: #fff; margin: 0 0 10px; font-size: clamp(2rem, 4.6vw, 3.2rem); text-shadow: 0 2px 20px color-mix(in srgb, var(--navy) 70%, transparent); }
.page-head p { color: rgba(255,255,255,.92); margin: 0; font-size: 1.1rem; max-width: 620px; text-shadow: 0 1px 12px color-mix(in srgb, var(--navy) 60%, transparent); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .86rem; margin-bottom: 18px; color: rgba(255,255,255,.85); text-shadow: 0 1px 10px color-mix(in srgb, var(--navy) 55%, transparent); }
.crumbs a { color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: .55; }
.page-head .eyebrow { color: var(--accent-on-dark); }

/* ---------- prose ---------- */
.prose { font-size: 1.08rem; line-height: 1.8; }
.prose h2 { margin-top: 1.8em; font-size: 1.65rem; }
.prose h3 { margin-top: 1.5em; }
.prose img { border-radius: var(--radius); margin: 1.6em 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose ul { list-style: disc; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.6em 0; padding: 12px 24px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; }
.prose a { font-weight: 500; }
.prose > :first-child { margin-top: 0; }
.post-cover { border-radius: var(--radius-lg); overflow: hidden; margin: -64px 0 40px; position: relative; z-index: 2; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); aspect-ratio: 16 / 8; background: var(--surface); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { margin-bottom: 26px; }
.share { display: flex; align-items: center; gap: 10px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.share .social a { background: var(--surface); color: var(--text); width: 40px; height: 40px; border: 1px solid var(--border); }
.share .social a:hover { background: var(--accent); }

/* ---------- service detail ---------- */
.svc-layout { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: start; }
.aside { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 20px); }
.aside .card { padding: 26px; }
.aside h3 { font-size: 1.1rem; margin-bottom: 14px; }
.side-links { display: grid; gap: 6px; }
.side-links a { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; transition: background .2s, color .2s; }
.side-links a:hover, .side-links a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.aside .contact-card { background: linear-gradient(150deg, var(--navy), color-mix(in srgb, var(--navy) 55%, var(--primary))); color: #fff; border: 0; }
.aside .contact-card p { color: rgba(255,255,255,.82); }
.checks { display: grid; gap: 12px; margin: 22px 0 8px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks .ic { color: #fff; background: var(--primary); border-radius: 50%; padding: 4px; margin-top: 2px; width: 24px; height: 24px; }
.svc-hero-img { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 34px; aspect-ratio: 16 / 9; background: var(--surface); box-shadow: var(--card-shadow); }
.svc-hero-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- team / values / about ---------- */
.v-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.vcard { padding: 30px 26px; text-align: left; }
.vcard .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, var(--bg)); color: color-mix(in srgb, var(--accent) 60%, var(--text)); margin-bottom: 16px; }
.vcard p { margin: 0; color: var(--muted); font-size: .96rem; }
.mv { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mv .card { padding: 34px; border-top: 4px solid var(--accent); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.member { text-align: center; padding-bottom: 24px; overflow: hidden; }
.member .photo { aspect-ratio: 4 / 5; background: var(--surface); margin-bottom: 18px; display: grid; place-items: center; }
.member .photo img { width: 100%; height: 100%; object-fit: cover; }
.member .photo .initials { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--navy)); color: #fff; font-family: var(--font-head); font-size: 2rem; font-weight: 700; }
.member h3 { margin-bottom: 2px; }
.member .role { color: var(--accent-text); font-weight: 600; font-size: .9rem; }
.member p { margin: 8px 18px 0; color: var(--muted); font-size: .92rem; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
label .req { color: var(--cta); }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; min-height: 48px; transition: border-color .2s, box-shadow .2s; }
select { appearance: auto; }
textarea { min-height: 150px; resize: vertical; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 85%, var(--bg)); }
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #dc2626; }
.field { margin-bottom: 18px; }
.field .err { display: none; color: #c81e1e; font-size: .85rem; margin-top: 6px; font-weight: 500; }
:root[style*="color-scheme:dark"] .field .err, .dark-ui .field .err { color: #fca5a5; }
.field.invalid .err { display: block; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.alert { padding: 16px 20px; border-radius: var(--radius-sm); font-weight: 500; display: flex; gap: 12px; align-items: flex-start; }
.alert.ok { background: #e7f8ee; color: #14532d; border: 1px solid #a7e3bd; }
.alert.error { background: #fdecec; color: #7f1d1d; border: 1px solid #f5b5b5; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: start; }
.info-cards { display: grid; gap: 18px; }
.info { display: flex; gap: 16px; padding: 22px 24px; align-items: center; }
.info .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--navy); color: var(--accent); flex: none; }
.info small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.info b, .info a { font-family: var(--font-head); font-weight: 600; color: var(--text); text-decoration: none; word-break: break-word; }
.form-card { padding: clamp(24px, 4vw, 44px); }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 9; }
.map iframe { width: 100%; height: 100%; border: 0; }

/* ---------- misc ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, color-mix(in srgb, var(--surface) 60%, var(--bg)) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.notfound { text-align: center; padding: 110px 0; }
.notfound .big { font-family: var(--font-head); font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .split, .faq-grid, .contact-grid { gap: 40px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .svc { max-width: calc((100% - 28px) / 2); }
  .svc-layout { grid-template-columns: 1fr; }
  .aside { position: static; }
}
@media (max-width: 900px) {
  :root { --header-h: 48px; }
  .menu-btn { display: inline-flex; }
  .header-cta.desk { display: none; }
  .nav { position: fixed; inset: var(--header-h) 0 0 0; top: var(--header-h); margin: 0; background: var(--header-bg); flex-direction: column; align-items: stretch; padding: 16px 20px 40px; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .35s var(--ease), visibility .35s; border-top: 1px solid var(--border); }
  .nav.open { transform: none; visibility: visible; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav > ul > li { border-bottom: 1px solid var(--border); }
  .nav a.nl, .nav .sub-toggle { padding: 16px 6px; font-size: 1.05rem; }
  .has-sub { flex-wrap: wrap; }
  .has-sub > a.nl { flex: 1; }
  .has-sub .sub-toggle { margin: 0; padding: 16px 12px; }
  .sub { position: static; width: 100%; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 10px 12px; min-width: 0; display: none; background: transparent; color: inherit; }
  .has-sub:hover .sub { display: none; }
  .has-sub.open .sub { display: block; }
  .nav .mobile-cta { display: flex; margin-top: 22px; }
  .hero { padding: 48px 0 120px; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-media { margin: 0 auto; max-width: 400px; }
  .hero-chip { left: 8px; }
  .split, .faq-grid, .contact-grid, .mv { grid-template-columns: 1fr; }
  .split.rev > :first-child { order: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .stat:nth-child(3)::before { display: none; }
  .cta-inner { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .topbar .tb-left a:nth-child(2), .topbar .social { display: none; }
  .frame-accent::before { inset: 14px -8px -8px 14px; }
}
@media (min-width: 901px) { .nav .mobile-cta { display: none; } }
@media (max-width: 640px) {
  .container, .container-narrow { width: calc(100% - 32px); }
  .features, .row2, .steps, .foot-grid { grid-template-columns: 1fr; }
  .svc { max-width: 100%; }
  .b-grid { grid-template-columns: 1fr; }
  .stats-wrap { margin-top: -64px; }
  .foot-grid { gap: 34px; }
  .news-form { flex-direction: column; }
  .btn { width: 100%; }
  .hero-actions .btn, .cta-inner .btn { width: 100%; }
  .brand { font-size: 1.15rem; }
  .brand img { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
