:root {
  --ink: #2c2924;
  --muted: #6e665a;
  --paper: #f8f6f1;
  --white: #fff;
  --bronze: #915f27;
  --bronze-dark: #70491e;
  --gold: #c9ae68;
  --gold-light: #f4ebd5;
  --line: #e5dece;
  --danger: #8b1e1e;
  --danger-bg: #fff0f0;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Avenir Next', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.brand-header { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; justify-content: center; padding: 32px 24px 0; pointer-events: none; }
.brand-header a { pointer-events: auto; }
.brand-header img { display: block; width: 250px; max-width: 58vw; height: auto; }

.intro { min-height: 760px; display: grid; grid-template-columns: 1fr 1fr; }
.intro-panel { display: flex; align-items: center; padding: 170px clamp(34px, 6vw, 100px) 90px; }
.intro-panel-en { background: var(--gold); }
.intro-panel-lt { background: var(--white); }
.intro-copy { max-width: 620px; margin-inline: auto; }
.eyebrow { margin: 0 0 18px; color: var(--bronze-dark); font-size: 12px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -.025em; }
h1, .intro-panel h2 { margin-bottom: 28px; font-size: clamp(40px, 4.4vw, 72px); }
.lead { font-size: 19px; line-height: 1.6; }
.intro-copy > p:not(.eyebrow) { max-width: 560px; }
.contact-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 24px; margin-top: 34px; }
.contact-button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--bronze); border-radius: 3px; padding: 11px 20px; background: var(--bronze); color: var(--white); font-weight: 700; text-decoration: none; cursor: pointer; }
.contact-button-dark { border-color: var(--ink); background: var(--ink); }
.text-link, .source-links a { color: var(--bronze-dark); font-weight: 700; text-underline-offset: 4px; }
.intro-panel-en .text-link { color: var(--ink); }

.tool-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; max-width: 1200px; margin: 0 auto; padding: 110px 28px 50px; }
.tool-intro h2 { margin: 0; font-size: clamp(34px, 4vw, 58px); }
.tool-intro > p { margin: 0; color: var(--muted); font-size: 18px; }
.calculator { max-width: 1200px; margin: 0 auto; padding: 0 28px 110px; }
.calculator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.card { padding: clamp(24px, 3vw, 40px); border: 1px solid var(--line); background: var(--white); box-shadow: 0 18px 60px rgba(44, 41, 36, .06); }
.card h3 { margin-bottom: 26px; font: 400 clamp(24px, 2.4vw, 34px)/1.2 var(--serif); }
.field { margin-bottom: 22px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 750; }
input { width: 100%; min-height: 48px; border: 1px solid #cfc6b5; border-radius: 3px; padding: 10px 13px; background: var(--white); color: var(--ink); font-size: 16px; }
input:focus { border-color: var(--bronze); outline: 3px solid rgba(145, 95, 39, .15); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.button-secondary { border-color: #d7c6a6; background: var(--white); color: var(--bronze-dark); }
button:hover, .contact-button:hover { background: var(--bronze-dark); border-color: var(--bronze-dark); }
.button-secondary:hover { background: var(--gold-light); color: var(--bronze-dark); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--bronze-dark); outline-offset: 4px; }
.error { margin-top: 18px; padding: 13px 15px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }
.result-main { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.sum-box, .delta-box { display: flex; min-height: 180px; flex-direction: column; justify-content: center; padding: 24px; }
.sum-box { background: var(--ink); color: var(--white); }
.delta-box { background: var(--gold-light); }
.sum-box span, .delta-box span { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.sum-box strong { margin: 6px 0; font-size: clamp(38px, 5vw, 62px); line-height: 1; }
.delta-box strong { margin: 9px 0 2px; font-size: 30px; }
.sum-box small { color: #e4dfd7; }
.status { margin-top: 14px; padding: 14px; background: #eef5eb; color: #36572f; }
.timeline-card, .details-grid, .sources { margin-top: 24px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #faf8f3; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.action, .amount-after { font-weight: 750; }
.action-indexed { color: #36572f; }
.action-skip { color: #7d5100; }
.cpi-table { min-width: 540px; }
.rules ol { margin: 0; padding-left: 21px; }
.rules li { margin: 9px 0; }
.source-links { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.legal-notice { margin-top: 22px; border-left: 4px solid var(--gold); padding: 14px 16px; background: var(--paper); }

.site-footer { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 30px; padding: 52px max(28px, calc((100vw - 1144px) / 2)); background: var(--ink); color: var(--white); font-size: 14px; }
.site-footer strong { display: block; font: 400 21px/1.3 var(--serif); }
.site-footer address { margin-top: 10px; color: #d8d2c9; font-style: normal; }
.footer-contacts, .footer-codes { display: flex; flex-direction: column; gap: 8px; }
.footer-contacts a { color: var(--white); text-underline-offset: 4px; }
.footer-codes { color: #d8d2c9; }

@media (max-width: 820px) {
  .brand-header { padding-top: 24px; }
  .brand-header img { width: 210px; }
  .intro { grid-template-columns: 1fr; }
  .intro-panel { min-height: 640px; padding: 150px 28px 70px; }
  .intro-panel-lt { min-height: 570px; padding-top: 75px; }
  .tool-intro, .calculator-grid, .site-footer { grid-template-columns: 1fr; }
  .tool-intro { padding-top: 80px; }
  .calculator { padding-inline: 18px; }
  .tool-intro { padding-inline: 22px; }
}

@media (max-width: 520px) {
  h1, .intro-panel h2 { font-size: 39px; }
  .contact-actions { align-items: stretch; flex-direction: column; }
  .contact-button { width: 100%; }
  .result-main { grid-template-columns: 1fr; }
  .card { padding: 22px 18px; }
  .buttons { flex-direction: column; }
  .buttons button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .brand-header { position: static; padding: 10px 0 25px; }
  .intro, .tool-intro, .input-card, .site-footer { display: none !important; }
  body, .calculator { background: #fff; }
  .calculator { max-width: none; padding: 0; }
  .card { break-inside: avoid; border-color: #aaa; box-shadow: none; }
}
