/* WM Forge — wm-forge.com
   Layout: a navy field lit from the top left, like the ground of the emblem. Left-aligned editorial hero with the
   looping emblem on the right; one chamfered calculator panel as the centrepiece; gold hairlines, diamonds as markers.
   Tokens mirror the WM Forge design system. */

@font-face { font-family: "Forum"; src: url("../fonts/Forum-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;

  /* color */
  --navy-950: #01122d;
  --navy-900: #041b3a;
  --navy-800: #0d2645;
  --navy-700: #1a3151;
  --navy-600: #2b4568;
  --navy-400: #6a86ab;
  --ink: #f4efe2;
  --ink-muted: #9fb0cc;
  --gold-100: #f9e39b;
  --gold-300: #e8bc67;
  --gold-500: #c4934a;
  --gold-700: #835824;
  --gold-900: #5f3a10;
  --on-gold: var(--navy-950);
  --emerald-200: #c0f7c1;
  --emerald-400: #5ec374;
  --emerald-600: #2b9248;
  --emerald-800: #0b6428;
  --danger: #ff9b8a;
  --line-gold: rgba(232, 188, 103, 0.28);

  /* type */
  --font-display: "Forum", "Times New Roman", serif;
  --font-text: "Manrope", "Segoe UI", system-ui, sans-serif;

  /* space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* shape */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-pill: 999px;
  --cut-sm: 10px;
  --cut-md: 18px;
  --cut-lg: 28px;

  /* depth */
  --shadow-panel: 0 24px 64px rgba(1, 10, 28, 0.55);
  --glow-gold: 0 0 28px rgba(232, 188, 103, 0.28);
  --glow-emerald: 0 0 32px rgba(94, 195, 116, 0.35);
  --focus-ring: 0 0 0 2px #041b3a, 0 0 0 4px #5ec374;

  /* page */
  --surface: var(--navy-900);
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--navy-900);
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 620px at 82% 120px, rgba(26, 49, 81, 0.62), rgba(26, 49, 81, 0) 70%),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-900) 60%, #03162f 100%);
  background-color: var(--navy-900);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* the paper grain of the emblem's ground */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.78  0 0 0 0 0.84  0 0 0 0 1  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }

html.i18n-pending body { visibility: hidden; }

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 400; text-wrap: balance; }
p { margin: 0; }

.container {
  width: 100%; max-width: 1200px; margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--emerald-400); outline-offset: 3px; }

/* ---------- type ---------- */
.overline {
  display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; margin: 0;
  font-family: var(--font-display); font-size: 13px; line-height: 1.4; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold-300);
}
.overline .ov { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.diamond { flex: none; width: 8px; height: 8px; background: var(--gold-500); transform: rotate(45deg); }
.lead { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; color: var(--ink-muted); max-width: 56ch; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- chamfered surfaces ---------- */
.cut {
  --cut: var(--cut-md);
  position: relative;
  isolation: isolate;
}
.cut::before, .cut::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
/* the hairline: a gold shape … */
.cut::before {
  inset: 0;
  background: var(--cut-line, var(--line-gold));
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
/* … with the surface laid 1px inside it */
.cut::after {
  inset: 1px;
  background: var(--cut-fill, var(--navy-800));
  clip-path: polygon(calc(var(--cut) - 0.6px) 0, 100% 0, 100% calc(100% - var(--cut) + 0.6px), calc(100% - var(--cut) + 0.6px) 100%, 0 100%, 0 calc(var(--cut) - 0.6px));
}
.cut-lg { --cut: var(--cut-lg); }

/* ---------- buttons ---------- */
.btn {
  --cut: var(--cut-sm);
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  border: 0; background: none; cursor: pointer;
  font-family: var(--font-text); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: 0.02em;
  color: var(--on-gold); text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn::before, .btn::after {
  content: ""; position: absolute; z-index: -1;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background-color 0.18s ease;
}
.btn::before { inset: 0; background: var(--gold-300); }
.btn::after { display: none; }
.btn:hover::before { background: var(--gold-100); }
.btn:active::before { background: var(--gold-500); }
.btn svg { flex: none; width: 18px; height: 18px; }

.btn-ghost { color: var(--gold-300); }
.btn-ghost::before { background: var(--gold-500); }
.btn-ghost::after {
  display: block; inset: 1px; background: var(--surface);
  clip-path: polygon(calc(var(--cut) - 0.6px) 0, 100% 0, 100% calc(100% - var(--cut) + 0.6px), calc(100% - var(--cut) + 0.6px) 100%, 0 100%, 0 calc(var(--cut) - 0.6px));
}
.btn-ghost:hover { color: var(--gold-100); }
.btn-ghost:hover::before { background: var(--gold-100); }
.btn-ghost:hover::after { background: var(--navy-700); }
.btn-ghost:active::before { background: var(--gold-500); }

.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; --cut: 8px; }
.btn .short { display: none; }
.btn[disabled] { cursor: default; opacity: 0.6; pointer-events: none; }

.link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--gold-300); font-weight: 600; font-size: 15px; text-decoration: none;
  border-bottom: 1px solid transparent; padding-block: 4px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.link:hover { color: var(--gold-100); border-bottom-color: currentColor; }
.link svg { width: 18px; height: 18px; flex: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(4, 27, 58, 0.84);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line-gold); box-shadow: 0 12px 32px rgba(1, 10, 28, 0.45); }
.header-row { display: flex; align-items: center; gap: var(--space-6); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { width: 39px; height: 44px; }
.brand-name {
  font-family: var(--font-display); font-size: 20px; letter-spacing: 0.2em; line-height: 1; white-space: nowrap;
  color: var(--gold-300);
  background: linear-gradient(180deg, var(--gold-100) 0%, var(--gold-300) 52%, var(--gold-500) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); margin-inline: auto; }
.site-nav a {
  position: relative; padding-block: 8px;
  font-size: 15px; font-weight: 500; color: var(--ink-muted); text-decoration: none;
  transition: color 0.18s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: -3px; width: 6px; height: 6px; margin-left: -3px;
  background: var(--gold-300); transform: rotate(45deg);
}
.header-actions { display: flex; align-items: center; gap: var(--space-4); flex: none; margin-left: auto; }
.site-nav + .header-actions { margin-left: 0; }

.lang {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--navy-400); border-radius: var(--radius-pill);
}
.lang button {
  min-width: 38px; height: 28px; padding: 0 10px;
  border: 0; border-radius: var(--radius-pill); background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-muted);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--gold-300); color: var(--on-gold); }

.tg-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none;
  transition: color 0.18s ease;
}
.tg-link svg { width: 20px; height: 20px; color: var(--gold-300); }
.tg-link:hover { color: var(--gold-100); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(28px, 5vw, 64px) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.hero h1 { font-size: clamp(36px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.01em; color: var(--ink); }
.hero h1 em { font-style: normal; color: var(--gold-300); }
/* the Russian line is longer: a step smaller, it sets in three lines beside the emblem */
html[lang="ru"] .hero h1 { font-size: clamp(36px, 5.1vw, 64px); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); margin-top: var(--space-2); }

.hero-media { position: relative; z-index: 1; justify-self: center; width: min(100%, 540px); aspect-ratio: 1 / 1; }
.hero-media::before, .success-media::before {
  /* the ground of the clip, carried past its edges and dissolved into the page */
  content: ""; position: absolute; inset: -34%; z-index: 0; pointer-events: none;
  background: url("../img/logo-ground.webp") center / 100% 100% no-repeat;
}
.loop-frame { position: relative; z-index: 1; width: 100%; height: 100%; }
.logo-loop {
  display: block; width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 6%, #000 94.5%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 6%, #000 94.5%, transparent 100%);
  mask-composite: intersect;
}
/* The emblem has no controls and cannot be stopped: no native play glyph, no context menu, no tap target. */
.logo-loop { pointer-events: none; }
.logo-loop::-webkit-media-controls, .logo-loop::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-head { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section-head h2 { font-size: clamp(32px, 4.2vw, 50px); line-height: 1.08; }

/* ---------- calculator ---------- */
.calc { --surface: var(--navy-800); padding: clamp(20px, 3.6vw, 48px); }
.calc-grid {
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "controls headline" "controls detail" "note note";
  grid-template-rows: auto 1fr auto;
}
.calc-note { grid-area: note; min-width: 0; padding-top: var(--space-6); border-top: 1px solid var(--line-gold); }
.calc-note .disclaimer { max-width: 118ch; }
.calc-headline { grid-area: headline; min-width: 0; }
.calc-controls { grid-area: controls; min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.calc-detail { grid-area: detail; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }

.field-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-3); }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field-scale { display: flex; justify-content: space-between; margin-top: 2px; font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.value-box {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 40px; padding: 0 12px;
  background: var(--navy-700); border: 1px solid var(--navy-400); border-radius: var(--radius-xs);
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.value-box:focus-within { border-color: var(--emerald-400); box-shadow: var(--focus-ring); }
.value-box input {
  width: 10.5ch; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
  font-size: 16px; font-weight: 600; text-align: right; color: var(--ink);
}
/* Russian puts the currency sign after the number */
html[lang="ru"] .value-box.is-money { flex-direction: row-reverse; }
.value-box input.w-sm { width: 4.5ch; }
.value-box .unit { color: var(--ink-muted); font-weight: 500; }

/* range: a pill track, a diamond thumb */
.range {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 32px; margin: 0; padding: 0;
  background: transparent; cursor: pointer;
}
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--gold-300) 0, var(--gold-300) var(--p), var(--navy-400) var(--p), var(--navy-400) 100%);
}
.range::-moz-range-track { height: 4px; border-radius: var(--radius-pill); background: var(--navy-400); }
.range::-moz-range-progress { height: 4px; border-radius: var(--radius-pill); background: var(--gold-300); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -7px;
  background: var(--gold-100); border: 2px solid var(--navy-800); border-radius: 1px;
  box-shadow: 0 0 0 1px var(--gold-500);
  transform: rotate(45deg);
  transition: box-shadow 0.18s ease, background-color 0.18s ease;
}
.range::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--gold-100); border: 2px solid var(--navy-800); border-radius: 1px;
  box-shadow: 0 0 0 1px var(--gold-500);
  transform: rotate(45deg);
}
.range:hover::-webkit-slider-thumb { background: #fff3c4; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--navy-800), 0 0 0 4px var(--emerald-400); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--navy-800), 0 0 0 4px var(--emerald-400); }

.result-label { font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.result-figure {
  margin-top: 6px;
  font-size: clamp(40px, 5.4vw, 64px); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em;
  color: var(--gold-300);
  background: linear-gradient(180deg, var(--gold-100) 0%, var(--gold-300) 55%, var(--gold-500) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap; overflow: hidden;
}
.result-sub { margin-top: 8px; font-size: 15px; color: var(--ink-muted); }
.result-sub strong { color: var(--ink); font-weight: 600; }

.stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.45fr); border-top: 1px solid var(--line-gold); }
.stat { padding: var(--space-4) var(--space-4) 0 0; min-width: 0; }
.stat + .stat { padding-left: var(--space-4); border-left: 1px solid var(--line-gold); }
.stat-label { font-size: 13px; line-height: 1.35; color: var(--ink-muted); }
.stat-value { margin-top: 4px; font-size: clamp(17px, 1.7vw, 21px); font-weight: 600; line-height: 1.2; color: var(--ink); white-space: nowrap; overflow: hidden; }
.stat-value.is-up { color: var(--emerald-400); }
.stat-value.is-down { color: var(--danger); }
.stat-note { margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ink-muted); }

/* chart */
.chart { margin: 0; min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 var(--space-3); padding: 0; list-style: none; font-size: 13px; color: var(--ink-muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.key { flex: none; display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--gold-300); }
.key-dash { border-top: 2px dashed var(--navy-400); }
.key-area { height: 10px; border-top: 2px solid var(--navy-400); background: rgba(106, 134, 171, 0.18); }
.plot { position: relative; width: 100%; touch-action: pan-y; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot:focus-visible { outline: 2px solid var(--emerald-400); outline-offset: 4px; }
.plot .grid line { stroke: var(--navy-600); stroke-width: 1; shape-rendering: crispEdges; }
.plot .axis text { fill: var(--ink-muted); font-family: var(--font-text); font-size: 12px; font-variant-numeric: tabular-nums; }
.plot .s-compound { fill: none; stroke: var(--gold-300); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .s-compound-area { fill: var(--gold-300); fill-opacity: 0.1; stroke: none; }
.plot .s-bench { fill: none; stroke: var(--navy-400); stroke-width: 2; stroke-dasharray: 5 5; stroke-linejoin: round; stroke-linecap: round; }
.plot .s-invested { fill: none; stroke: var(--navy-400); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .s-invested-area { fill: var(--navy-400); fill-opacity: 0.16; stroke: none; }
.plot .dot { stroke: var(--navy-800); stroke-width: 2; }
.plot .dot-compound { fill: var(--gold-300); }
.plot .dot-context { fill: var(--navy-400); }
.plot .end-label { fill: var(--ink); font-family: var(--font-text); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--navy-800); stroke-width: 4px; stroke-linejoin: round; }
.plot .end-label-context { fill: var(--ink-muted); font-weight: 500; }
.plot .cross { stroke: var(--ink-muted); stroke-width: 1; shape-rendering: crispEdges; }
.tip {
  position: absolute; z-index: 5; top: 0; left: 0; min-width: 190px; padding: 10px 12px;
  background: var(--navy-950); border: 1px solid var(--line-gold); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel); pointer-events: none;
  font-size: 13px; line-height: 1.35;
}
.tip-title { margin-bottom: 6px; font-weight: 600; color: var(--ink-muted); }
.tip-row { display: grid; grid-template-columns: 22px auto 1fr; align-items: center; gap: 8px; padding-block: 2px; }
.tip-row b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-row span:last-child { color: var(--ink-muted); }
/* phones: the readout sits under the chart instead of over it */
.plot.is-compact .tip { position: static; min-width: 0; margin-top: var(--space-3); box-shadow: none; }
.plot.is-compact .tip-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
.plot.is-compact .tip-row b { order: 3; min-width: calc(var(--vch, 11) * 1ch); text-align: right; }

.calc-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0;
  border: 0; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--gold-300);
}
.toggle:hover { color: var(--gold-100); }
.toggle svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.table-wrap {
  overflow-x: auto; border: 1px solid var(--navy-600); border-radius: var(--radius-xs); -webkit-overflow-scrolling: touch;
  /* a shadow on the side that still has columns to scroll to */
  background:
    linear-gradient(to right, var(--navy-800) 40%, rgba(13, 38, 69, 0)) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--navy-800) 40%, rgba(13, 38, 69, 0)) right center / 36px 100% no-repeat local,
    linear-gradient(to right, rgba(1, 10, 28, 0.8), rgba(1, 10, 28, 0)) left center / 18px 100% no-repeat scroll,
    linear-gradient(to left, rgba(1, 10, 28, 0.8), rgba(1, 10, 28, 0)) right center / 18px 100% no-repeat scroll;
}
.table-wrap:focus-visible { outline-offset: 2px; }
table.years { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.years caption { caption-side: top; text-align: left; padding: 10px 12px; font-size: 13px; color: var(--ink-muted); }
.years th, .years td { padding: 9px 12px; text-align: right; white-space: nowrap; border-top: 1px solid var(--navy-600); }
.years th:first-child, .years td:first-child { text-align: left; }
.years thead th { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ink-muted); background: rgba(1, 18, 45, 0.45); border-top: 0; white-space: normal; vertical-align: bottom; }
.years tbody th { font-weight: 500; color: var(--ink-muted); }
.years tbody tr:last-child td { font-weight: 600; color: var(--gold-300); }

.disclaimer { font-size: 13px; line-height: 1.55; color: var(--ink-muted); max-width: 90ch; }
.noscript-note { font-size: 15px; line-height: 1.55; color: var(--ink); max-width: 70ch; }

/* ---------- call to action ---------- */
.cta { --surface: var(--navy-800); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(20px, 4vw, 48px); padding: clamp(24px, 4vw, 48px); }
.cta img { width: clamp(88px, 11vw, 132px); height: auto; }
.cta h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; }
.cta p { margin-top: var(--space-3); color: var(--ink-muted); max-width: 52ch; }
.cta-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); }

/* ---------- footer ---------- */
.site-footer { margin-top: clamp(32px, 6vw, 72px); background: var(--navy-950); border-top: 1px solid var(--line-gold); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-6); padding-block: var(--space-8); }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-nav a { font-size: 14px; font-weight: 500; color: var(--ink-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }
.footer-nav a.tg-link { color: var(--ink); }
.footer-bottom { display: grid; gap: var(--space-4); padding-block: var(--space-6) var(--space-8); border-top: 1px solid var(--navy-600); }
.copyright { font-size: 13px; color: var(--ink-muted); }

/* ---------- contact ---------- */
.contact { padding-block: clamp(32px, 6vw, 80px) clamp(48px, 7vw, 96px); }
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(28px, 5vw, 72px); row-gap: var(--space-8);
  grid-template-areas: "copy form" "tg form"; grid-template-rows: auto 1fr; align-items: start;
}
.contact-copy { grid-area: copy; }
.form-panel { grid-area: form; }
.contact-grid > .tg-card { grid-area: tg; }
.contact-copy { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.contact-copy h1 { font-size: clamp(40px, 5.4vw, 64px); line-height: 1.04; }

.tg-card { --surface: var(--navy-800); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-6); }
.tg-card-text { min-width: 0; flex: 1 1 200px; }
.tg-card-title { font-weight: 600; color: var(--ink); }
.tg-card-note { font-size: 14px; color: var(--ink-muted); }

.calc-chip { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--navy-400); border-radius: var(--radius-xs); background: rgba(26, 49, 81, 0.5); font-size: 14px; }
.calc-chip .diamond { margin-top: 7px; }
.calc-chip-text { flex: 1 1 auto; min-width: 0; color: var(--ink-muted); }
.calc-chip-text strong { display: block; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip-remove { flex: none; width: 32px; height: 32px; margin: -4px -4px 0 0; display: inline-grid; place-items: center; border: 0; background: none; color: var(--ink-muted); cursor: pointer; border-radius: var(--radius-xs); }
.chip-remove:hover { color: var(--ink); background: var(--navy-700); }
.chip-remove svg { width: 16px; height: 16px; }

.form-panel { --surface: var(--navy-800); padding: clamp(20px, 3.6vw, 44px); }
.form { display: grid; gap: var(--space-6); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.control { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.control label { font-size: 14px; font-weight: 600; color: var(--ink); }
.control .req { color: var(--gold-300); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--navy-700); border: 1px solid var(--navy-400); border-radius: var(--radius-xs);
  font-size: 16px; line-height: 1.4; color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.textarea { min-height: 120px; resize: vertical; }
.select {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23e8bc67' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select option { background: var(--navy-800); color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: var(--ink-muted); opacity: 0.85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--emerald-400); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.error { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.4; color: var(--danger); }
.error svg { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.form-foot .btn { flex: none; }
.consent { flex: 1 1 240px; font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--danger); border-radius: var(--radius-xs); font-size: 14px; line-height: 1.5; color: var(--ink); }
.banner svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--danger); }

.form-panel { overflow: hidden; }
.success { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); text-align: center; }
.success-media { position: relative; width: min(230px, 64%); aspect-ratio: 1 / 1; margin-top: -8px; }
.success h2 { font-size: clamp(32px, 4vw, 46px); line-height: 1.08; }
.success-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: var(--radius-pill); background: var(--emerald-800); color: var(--emerald-200); font-size: 13px; font-weight: 600; box-shadow: var(--glow-emerald); }
.success-badge svg { width: 16px; height: 16px; }
.success p { color: var(--ink-muted); max-width: 46ch; overflow-wrap: anywhere; }
.success h2:focus, .contact-copy h1:focus, .banner:focus { outline: none; }
.success > :not(.success-media) { position: relative; z-index: 1; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); margin-top: var(--space-2); }
.demo-note { padding: 10px 12px; border: 1px dashed var(--navy-400); border-radius: var(--radius-xs); font-size: 13px; line-height: 1.5; color: var(--ink-muted); }

/* ---------- responsive ---------- */
@media (max-width: 1150px) {
  .years th, .years td { padding-inline: 8px; }
}

@media (max-width: 1080px) {
  .site-nav { display: none; }
  .site-nav + .header-actions { margin-left: auto; }
}

@media (max-width: 920px) {
  .calc-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "headline" "controls" "detail" "note"; grid-template-rows: auto; }
  .calc-note { padding-top: 0; border-top: 0; }
  .cta { grid-template-columns: auto minmax(0, 1fr); }
  .cta-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "form" "tg"; grid-template-rows: auto; }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .hero h1, html[lang="ru"] .hero h1 { font-size: clamp(36px, 10.6vw, 64px); }
  .hero-media { order: -1; width: min(78vw, 380px); }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .brand img { width: 34px; height: 38px; }
  .brand-name { font-size: 17px; letter-spacing: 0.16em; }
  .header-row { gap: var(--space-3); }
  .header-actions { gap: var(--space-3); }
  .header-actions .tg-link { display: none; }
  .btn .long { display: none; }
  .btn .short { display: inline; }
  .stats { grid-template-columns: minmax(0, 1fr); border-top: 0; }
  .stat, .stat + .stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 12px 0; border-left: 0; border-top: 1px solid var(--line-gold); }
  .stat-value { margin-top: 0; text-align: right; font-size: 18px; }
  table.years { font-size: 13px; }
  .years th, .years td { padding: 8px 6px; }
  .years th:first-child, .years td:first-child { padding-left: 10px; }
  .years th:last-child, .years td:last-child { padding-right: 10px; }
  .stat-note { grid-column: 1 / -1; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .cta { grid-template-columns: minmax(0, 1fr); }
  .cta img { width: 84px; }
  .cta-actions .btn { flex: 1 1 auto; }
  .hero-actions .btn { flex: 1 1 100%; }
  .calc-actions .btn { flex: 1 1 100%; }
  .form-foot .btn { flex: 1 1 100%; }
  .success-actions .btn { flex: 1 1 100%; }
}

@media (max-width: 360px) {
  .brand-name { display: none; }
}

/* the narrowest screens (folded phones): a long button label takes two lines instead of running off */
@media (max-width: 340px) {
  .btn:not(.btn-sm) { white-space: normal; height: auto; padding-block: 12px; line-height: 1.25; text-align: center; }
}

@media (forced-colors: active) {
  .btn, .cut, .lang button[aria-pressed="true"] { border: 1px solid ButtonText; }
  .range { -webkit-appearance: auto; appearance: auto; }
  .result-figure, .brand-name { -webkit-text-fill-color: currentColor; background: none; }
  .diamond { forced-color-adjust: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
