/* ---------- Tokens ---------- */
:root {
  --paper: #f5f6f8;      /* cool page background */
  --sheet: #ffffff;      /* document white */
  --ink: #16243f;        /* navy ink: text, dark band */
  --ink-soft: #4a5670;   /* secondary text */
  --line: #d6dce6;       /* hairlines, borders */
  --bar: #e2e6ee;        /* placeholder lines on the illustration */
  --stamp: #5a3e9f;      /* court-stamp violet: accent, buttons, seal */
  --stamp-dark: #462f80;
  --error: #b3261e;

  --serif: "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --gutter: 16px;
  --space-section: 64px;
  --radius: 6px;

  color-scheme: light;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; --space-section: 104px; }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.35rem, 1.4rem + 3.6vw, 3.9rem); line-height: 1.08; }
h2 { font-size: clamp(1.85rem, 1.3rem + 1.8vw, 2.6rem); line-height: 1.15; margin-bottom: 0.7em; }
h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; margin: 0 0 0.4em; }

p { margin: 0 0 1em; max-width: 68ch; }

a { color: var(--stamp); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--stamp-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

main > section { padding-block: var(--space-section); }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip:focus { top: 12px; color: #fff; }

/* ---------- Buttons & links ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  background: var(--stamp); color: #fff;
  border: 1.5px solid var(--stamp); border-radius: var(--radius);
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.button:hover { background: var(--stamp-dark); border-color: var(--stamp-dark); color: #fff; }
.button[disabled] { opacity: 0.7; cursor: progress; }

.button-ghost { background: transparent; color: var(--stamp); }
.button-ghost:hover { background: var(--stamp); color: #fff; }

.button-block { width: 100%; }

.link-quiet {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: 500 1rem/1.4 var(--sans); color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.3em; text-decoration-thickness: 2px;
}
.link-quiet:hover { color: var(--ink); text-decoration-color: var(--stamp); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 246, 248, 0.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }

.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.2; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--serif); font-size: 1.15rem; }
.brand-role { font-size: 0.8125rem; color: var(--ink-soft); }

.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: 8px 12px; border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
}
.nav-list a:hover { background: rgba(22, 36, 63, 0.06); }
.nav-list .nav-quote { background: var(--ink); color: #fff; margin-left: 8px; padding-inline: 16px; }
.nav-list .nav-quote:hover { background: var(--stamp); color: #fff; }

.nav-toggle {
  display: none; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 12px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  font: 500 0.9375rem var(--sans); color: var(--ink); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; position: relative;
  transition: transform 0.2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.lang { display: flex; border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; gap: 2px; background: var(--sheet); }
.lang button {
  min-width: 40px; min-height: 36px; padding: 0 8px;
  background: none; border: 0; border-radius: 4px; cursor: pointer;
  font: 600 0.8125rem var(--sans); letter-spacing: 0.04em; color: var(--ink-soft);
}
.lang button:hover { color: var(--ink); background: rgba(22, 36, 63, 0.06); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

@media (max-width: 919px) {
  .header-inner { gap: 10px; min-height: 64px; }
  .nav { order: 3; }
  .nav-toggle { display: inline-flex; }
  .nav-list {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 24px -16px rgba(22, 36, 63, 0.25);
  }
  .nav-list.is-open { display: flex; }
  .nav-list a { padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.0625rem; }
  .nav-list li:last-child a { border-bottom: 0; }
  .nav-list .nav-quote { margin: 12px 0 0; text-align: center; border-radius: var(--radius); padding: 14px; }
}

@media (max-width: 479px) {
  .nav-toggle > span:not(.nav-toggle-bars) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav-toggle { padding: 8px 12px; }
  .brand-name { font-size: 1.02rem; }
  .lang button { min-width: 34px; padding: 0 4px; }
}

/* ---------- Hero ---------- */
.hero { padding-block: 48px 72px; overflow-x: clip; }

.hero-inner { display: grid; gap: 48px; align-items: center; }

@media (min-width: 920px) {
  .hero { padding-block: 80px 112px; }
  .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 64px; }
}

.hero-lead { font-size: 1.1875rem; color: var(--ink-soft); margin: 24px 0 32px; max-width: 34em; }

.pairs { margin-bottom: 36px; }
.pair {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem); line-height: 1.3;
  margin: 0 0 6px;
}
.pair-arrow { width: 36px; height: 15px; flex: none; fill: none; stroke: var(--stamp); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pairs-note { font-size: 0.9375rem; color: var(--ink-soft); margin: 4px 0 0; }

.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-note { font-size: 0.9375rem; color: var(--ink-soft); margin: 14px 0 0; }

/* The document illustration */
.sheets {
  position: relative; margin: 0;
  width: 100%; max-width: 520px; justify-self: center;
  aspect-ratio: 1 / 0.98;
}

.sheet {
  position: absolute; width: 64%;
  aspect-ratio: 1 / 1.36;
  padding: 7% 7.5%;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(22, 36, 63, 0.06), 0 22px 44px -22px rgba(22, 36, 63, 0.32);
  overflow: hidden;
}

.sheet-original { left: 2%; top: 2%; transform: rotate(-4deg); background: #fbfbf9; color: var(--ink-soft); }
.sheet-translation { right: 2%; top: 13%; transform: rotate(2.5deg); border-top: 4px solid var(--stamp); }

.sheet-title { font-family: var(--serif); font-size: clamp(0.95rem, 0.7rem + 1vw, 1.3rem); line-height: 1.2; margin: 0 0 9%; }
.sheet-rows { margin: 0; }
.sheet-rows dt { font-size: clamp(0.56rem, 0.45rem + 0.35vw, 0.72rem); color: var(--ink-soft); line-height: 1.2; }
.sheet-rows dd { margin: 4px 0 7%; height: 8px; width: var(--w); background: var(--bar); border-radius: 2px; }
.sheet-lines { display: block; margin-top: 9%; }
.sheet-lines i { display: block; height: 5px; background: var(--bar); border-radius: 2px; margin-bottom: 9px; }
.sheet-lines i:nth-child(2) { width: 86%; }
.sheet-lines i:nth-child(3) { width: 64%; }

.signature { position: absolute; left: 7%; bottom: 6%; width: 46%; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }

.seal {
  position: absolute; right: 0; bottom: 1%;
  width: 36%;
  color: var(--stamp);
  transform: rotate(-14deg);
  opacity: 0.9;
  mix-blend-mode: multiply;
}
.seal-edge { fill: none; stroke: currentColor; stroke-width: 4; }
.seal-edge.thin { stroke-width: 1.5; }
.seal-ring-text { font: 700 12px var(--sans); fill: currentColor; }
.seal-mono { font: 400 34px var(--serif); fill: currentColor; letter-spacing: 1px; }
.seal-city { font: 700 8.5px var(--sans); letter-spacing: 3px; fill: currentColor; }

/* One load moment: the translation slides out from behind the original, then gets stamped. */
@media (prefers-reduced-motion: no-preference) {
  .sheet-translation { animation: slide-out 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
  .seal { animation: stamp 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) 0.95s both; }
  .seal.restamp { animation: stamp 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
  .sheet-translation.swap .sheet-title,
  .sheet-translation.swap dt { animation: ink-in 0.4s ease both; }
}

@keyframes slide-out {
  from { transform: translateX(-34%) rotate(-4deg); opacity: 0; }
  to { transform: rotate(2.5deg); opacity: 1; }
}
@keyframes stamp {
  0% { transform: rotate(-14deg) scale(1.45); opacity: 0; }
  60% { transform: rotate(-14deg) scale(0.96); opacity: 0.95; }
  100% { transform: rotate(-14deg) scale(1); opacity: 0.9; }
}
@keyframes ink-in {
  from { opacity: 0; filter: blur(2px); }
  to { opacity: 1; filter: none; }
}

/* ---------- About ---------- */
.about { background: var(--sheet); border-block: 1px solid var(--line); }

.about-inner { display: grid; gap: 48px; }
@media (min-width: 920px) {
  .about-inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 80px; }
}

.about-intro { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 0.4em; }
@media (min-width: 400px) {
  .about-intro { grid-template-columns: 96px minmax(0, 1fr); gap: 20px; }
}
@media (min-width: 720px) {
  .about-intro { grid-template-columns: 132px minmax(0, 1fr); gap: 28px; }
}
.portrait { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.about-text p { font-size: 1.125rem; }

.about-side h3 { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; margin-bottom: 14px; }
.about-side h3 + .ticks { margin-bottom: 36px; }
.about-side .ticks:last-child { margin-bottom: 0; }

@media (min-width: 920px) {
  .about-side { border-left: 1px solid var(--line); padding-left: 48px; }
}

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 9px 0 9px 30px; border-top: 1px solid var(--line); }
.ticks li:last-child { border-bottom: 1px solid var(--line); }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 0.95em;
  width: 12px; height: 7px;
  border-left: 2px solid var(--stamp); border-bottom: 2px solid var(--stamp);
  transform: rotate(-45deg);
}

/* ---------- How it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; counter-reset: step; }
@media (min-width: 600px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.steps li { counter-increment: step; border-top: 1.5px solid var(--ink); padding-top: 18px; }
.steps li::before {
  content: counter(step);
  display: block; margin-bottom: 14px;
  font: 400 2.4rem/1 var(--serif); color: var(--stamp);
}
.steps p { color: var(--ink-soft); margin: 0; }

.abroad {
  margin: 48px 0 0; padding: 18px 22px;
  background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--stamp); border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 72ch;
}

/* ---------- Quote form ---------- */
.quote { background: var(--ink); color: #fff; }
.quote h2 { color: #fff; }

.quote-inner { display: grid; gap: 40px; align-items: start; }
@media (min-width: 920px) {
  .quote-inner { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 72px; }
}

.quote-intro > p { font-size: 1.1875rem; color: #cfd6e4; }
.quote-aside { margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.quote-aside p { color: #cfd6e4; }
.quote-aside .email-link { color: #fff; font-weight: 600; font-size: 1.0625rem; word-break: break-word; }
.quote :focus-visible { outline-color: #b9a6ec; }
.form-card :focus-visible { outline-color: var(--stamp); }

.form-card {
  background: var(--sheet); color: var(--ink);
  border-radius: 8px; padding: 24px 20px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5);
}
@media (min-width: 720px) { .form-card { padding: 40px; } }

.form-required { font-size: 0.875rem; color: var(--ink-soft); margin-bottom: 20px; }

.field { margin-bottom: 22px; }
.field label { display: block; font-weight: 600; font-size: 0.9688rem; margin-bottom: 7px; line-height: 1.35; }
.opt { font-weight: 400; color: var(--ink-soft); }

.field input[type="text"],
.field input[type="email"],
.field input[type="date"],
.field select,
.field textarea {
  display: block; width: 100%; min-height: 48px;
  padding: 11px 14px;
  font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: var(--sheet);
  border: 1px solid #bfc8d6; border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2316243f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field input::placeholder { color: #8a93a6; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #8f9ab0; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--stamp); box-shadow: 0 0 0 3px rgba(90, 62, 159, 0.22);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.2); border-color: var(--error); }

.field-error { color: var(--error); font-size: 0.875rem; margin: 6px 0 0; }

.field-row { display: grid; gap: 0 20px; }
@media (min-width: 600px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; } }
@media (min-width: 600px) { .field-row .field { display: flex; flex-direction: column; } }

.field-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 12px; align-items: start; }
.field-check input {
  width: 22px; height: 22px; margin: 1px 0 0;
  accent-color: var(--stamp); cursor: pointer;
}
.field-check label { font-weight: 400; margin: 0; cursor: pointer; }
.field-check .field-error { grid-column: 2; }
.field-check input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 1px; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error {
  background: #fbeceb; color: var(--error);
  border-radius: var(--radius); padding: 12px 14px; font-size: 0.9375rem;
}
.form-error a { color: var(--error); font-weight: 600; }

.form-done { text-align: center; padding: 24px 0 8px; }
.form-done:focus { outline: none; }
.form-done p { margin-inline: auto; color: var(--ink-soft); }
.form-done h3 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; margin-bottom: 12px; }
.done-seal { width: 64px; height: 64px; margin: 0 auto 18px; fill: none; stroke: var(--stamp); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .form-done:not([hidden]) .done-seal { animation: stamp-small 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
}
@keyframes stamp-small { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Rates ---------- */
.rates-inner { display: grid; gap: 8px 72px; }
@media (min-width: 920px) { .rates-inner { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }
.rates-inner p { font-size: 1.125rem; margin-bottom: 24px; }

/* ---------- Contact ---------- */
.contact { background: var(--sheet); border-top: 1px solid var(--line); }
.contact-inner { display: grid; gap: 24px 72px; }
@media (min-width: 920px) { .contact-inner { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }
.contact-inner > div > p { font-size: 1.125rem; color: var(--ink-soft); }

.contact-list { margin: 0; }
.contact-list > div { display: grid; gap: 2px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.contact-list > div:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 600px) { .contact-list > div { grid-template-columns: 170px minmax(0, 1fr); } }
.contact-list dt { font-weight: 600; font-size: 0.9375rem; }
.contact-list dd { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.contact-list dd a { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: 0.875rem; color: var(--ink-soft); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-inner p { margin: 0; }
.footer-inner p:first-child { margin-right: auto; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--stamp); }

/* ---------- Privacy policy page ---------- */
.policy { padding-block: 40px var(--space-section); }
.policy-inner { max-width: calc(720px + 2 * var(--gutter)); }
.policy-back { font-size: 0.9375rem; margin-bottom: 32px; }
.policy h1 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3rem); }
.policy-date { color: var(--ink-soft); font-size: 0.9375rem; margin: 10px 0 28px; }
.policy-lead { font-size: 1.1875rem; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.policy h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.policy ul { margin: 0 0 1em; padding-left: 1.25em; max-width: 68ch; }
.policy li { margin-bottom: 0.5em; }
.policy li::marker { color: var(--stamp); }
.policy strong { font-weight: 600; }

/* Small link under a form field */
.field-note { grid-column: 2; font-size: 0.875rem; margin: 6px 0 0; }

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