/* ABC Translation Finland — site.css
   Visual idea: the world of official documents. Cool paper, stamp-ink blue,
   one lingonberry-red seal. Everything else stays quiet. */

@font-face {
  font-family: "Familjen Grotesk";
  src: url("/assets/fonts/familjen-grotesk.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3f5f4;      /* birch paper */
  --sheet: #ffffff;      /* certificate */
  --mist: #e4e9e7;       /* alternate band */
  --rule: #c7cfcc;       /* hairlines, dotted fields */
  --ink: #14213d;        /* text */
  --ink-soft: #46516a;   /* secondary text */
  --stamp: #2a47c4;      /* stamp-ink blue: links, buttons */
  --stamp-deep: #1d339a;
  --lingon: #b0233b;     /* the seal – used sparingly */

  --font: "Familjen Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.5rem);
  --step-4: clamp(2.3rem, 1.5rem + 3.4vw, 3.75rem);
  --wrap: 74rem;
  --measure: 40rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1 { font-size: var(--step-4); letter-spacing: -0.028em; max-width: 18ch; }
h2 { font-size: var(--step-3); max-width: 26ch; }
h3 { font-size: var(--step-1); letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
a { color: var(--stamp); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--stamp-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; border-radius: 2px; }
abbr[title] { text-decoration: none; color: var(--lingon); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow > * { max-width: var(--measure); }
.narrow > .index { max-width: none; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--stamp);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.8rem 1.35rem;
  border: 2px solid var(--stamp);
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover { background: var(--stamp-deep); border-color: var(--stamp-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--stamp); }
.btn-ghost:hover { background: var(--sheet); color: var(--stamp-deep); }
.btn-small { padding: 0.5rem 0.9rem; font-size: var(--step--1); }

/* Header ---------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: relative; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 1.25rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-seal { width: 2.4rem; height: 2.4rem; color: var(--lingon); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand-loc { font-size: var(--step--1); color: var(--ink-soft); }

.menu-toggle { display: none; font: inherit; font-weight: 600; background: none; border: 1px solid var(--rule); border-radius: 3px; padding: 0.4rem 0.8rem; color: var(--ink); cursor: pointer; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--stamp); text-decoration: underline; }

.lang-switch ul { list-style: none; display: flex; gap: 0.15rem; margin: 0; padding: 0; }
.lang-switch a {
  display: block; padding: 0.25rem 0.45rem; font-size: var(--step--1); font-weight: 600;
  color: var(--ink-soft); text-decoration: none; border-radius: 2px;
}
.lang-switch a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--lingon); }
.lang-switch a:hover { color: var(--stamp); }

@media (max-width: 60rem) {
  .header-row { flex-wrap: wrap; gap: 0.5rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .header-cta { display: none; }
  .lang-switch { order: 2; }
  .lang-switch a { padding: 0.25rem 0.35rem; }
  .menu-toggle { display: block; order: 3; padding: 0.35rem 0.6rem; }
  .primary { flex-basis: 100%; order: 4; }
  .primary { display: none; }
  .primary.open { display: block; }
  .nav { flex-direction: column; gap: 0; border-top: 1px solid var(--rule); }
  .nav a { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
}

/* Hero ------------------------------------------------------------------ */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 5.5rem); border-bottom: 1px solid var(--rule); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: var(--step-4); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero-phone { margin-top: 1rem; }
.hero-phone a { color: var(--ink); font-weight: 600; text-decoration: none; }

/* The certificate: the one memorable thing */
.cert { position: relative; margin: 0; justify-self: end; width: min(100%, 25rem); }
.cert-paper {
  background: var(--sheet);
  padding: 1.75rem 1.75rem 1.5rem;
  border: 1px solid var(--rule);
  outline: 1px solid var(--rule);
  outline-offset: -8px;
  box-shadow: 0 1px 0 var(--rule), 0 24px 40px -28px rgba(20, 33, 61, 0.45);
  transform: rotate(1.2deg);
}
.cert-title { text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase; margin: 0.25rem 0 0; padding-left: 0.32em; }
.cert-sub { text-align: center; font-size: 0.72rem; color: var(--ink-soft); margin: 0.15rem 0 1.1rem; }
.cert-fields { list-style: none; counter-reset: f; margin: 0; padding: 0; font-size: 0.82rem; }
.cert-fields li { counter-increment: f; display: flex; align-items: baseline; gap: 0.4rem; padding: 0.28rem 0; }
.cert-fields li::before { content: counter(f) "."; color: var(--ink-soft); min-width: 1.4rem; font-variant-numeric: tabular-nums; }
.cert-fields .k { color: var(--ink-soft); white-space: nowrap; }
.cert-fields .v {
  flex: 1; border-bottom: 1px dotted var(--rule); min-height: 1.2em;
  color: var(--stamp); font-weight: 600; padding-left: 0.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cert-sign { position: absolute; right: 1.4rem; bottom: 1.2rem; width: 6rem; color: var(--stamp); transform: rotate(-4deg); }
.cert .seal {
  position: absolute; width: 8rem; height: 8rem; left: 36%; bottom: -2.4rem;
  color: var(--lingon); opacity: 0.88; mix-blend-mode: multiply;
  transform: rotate(-14deg);
  animation: stamp 520ms cubic-bezier(.2, .9, .3, 1.2) 350ms both;
}
@keyframes stamp {
  0%   { transform: rotate(-4deg) scale(1.6); opacity: 0; }
  70%  { transform: rotate(-14deg) scale(0.96); opacity: 0.95; }
  100% { transform: rotate(-14deg) scale(1); opacity: 0.88; }
}
@media (prefers-reduced-motion: reduce) {
  .cert .seal { animation: none; }
  html { scroll-behavior: auto; }
}
@media (max-width: 26rem) {
  .brand-seal { width: 2rem; height: 2rem; }
  .brand-name { font-size: 1rem; }
}
@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .cert { justify-self: center; width: min(100%, 22rem); margin-top: 0.5rem; }
}

/* Sections -------------------------------------------------------------- */
.section { padding: clamp(2.75rem, 6vw, 4.75rem) 0; }
.section.tight { padding-top: 0.5rem; }
.section.alt, .process { background: var(--mist); }
.section-lede { color: var(--ink-soft); max-width: var(--measure); margin-bottom: 2rem; }

/* Document-index list of services: name left, description right, ruled rows */
.index { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.index li { border-bottom: 1px solid var(--rule); }
.index a {
  display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 0.5rem 2rem;
  padding: 1.15rem 0.25rem; color: var(--ink); text-decoration: none;
}
.ix-name { font-size: var(--step-1); font-weight: 650; letter-spacing: -0.01em; }
.ix-desc { color: var(--ink-soft); }
.index a:hover .ix-name { color: var(--stamp); text-decoration: underline; text-underline-offset: 0.2em; }
.index a:hover { background: var(--sheet); }
@media (max-width: 40rem) { .index a { grid-template-columns: 1fr; } }

/* Process: a real sequence, so numbered */
.steps { list-style: none; margin: 1.5rem 0 0; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.steps li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(s); display: block; font-size: var(--step-3); font-weight: 700; color: var(--stamp); line-height: 1; margin-bottom: 0.6rem; font-variant-numeric: tabular-nums; }
.steps p { color: var(--ink-soft); margin: 0; }
@media (max-width: 56rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .steps { grid-template-columns: 1fr; } }

.why-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.why-list p { color: var(--ink-soft); margin: 0; }
@media (max-width: 52rem) { .why-list { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Languages: dense columns, endonyms beside the local name */
.lang-list { list-style: none; margin: 0; padding: 0; columns: 4 13rem; column-gap: 2rem; }
.lang-list li { break-inside: avoid; padding: 0.3rem 0; border-bottom: 1px dotted var(--rule); }
.lang-list a { text-decoration: none; color: var(--ink); font-weight: 500; }
.lang-list a:hover { color: var(--stamp); text-decoration: underline; }
.endo { color: var(--ink-soft); font-weight: 400; font-size: var(--step--1); margin-left: 0.35rem; }
.lang-list.compact, .side .lang-list { columns: 1; }

/* Regions */
.regions { list-style: none; margin: 0; padding: 0; columns: 4 14rem; column-gap: 2rem; }
.region { break-inside: avoid; margin-bottom: 1.4rem; }
.region-name { font-weight: 650; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--ink); display: inline-block; margin-bottom: 0.3rem; }
.region-name:hover { color: var(--stamp); border-color: var(--stamp); }
.region ul { list-style: none; margin: 0; padding: 0; }
.region li a { color: var(--ink-soft); text-decoration: none; line-height: 1.9; }
.region li a:hover { color: var(--stamp); text-decoration: underline; }

/* Inner pages ----------------------------------------------------------- */
.crumbs { padding-top: 1.25rem; font-size: var(--step--1); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.3rem; color: var(--rule); }
.crumbs a { color: var(--ink-soft); }
.crumbs [aria-current] { color: var(--ink); }
.page-head { padding-top: clamp(1.75rem, 4vw, 3rem); padding-bottom: clamp(1.75rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.1rem); max-width: 24ch; }
.native { font-size: var(--step--1); color: var(--ink-soft); }
.native span { color: var(--ink); font-weight: 600; font-size: var(--step-0); }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 56rem) { .article-grid { grid-template-columns: 1fr; } }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-2); margin-top: 2.2rem; max-width: none; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--stamp); }
.prose .index { margin-bottom: 2rem; padding-left: 0; }
.prose .lang-list { padding-left: 0; }
.prose .index li::marker, .prose .lang-list li::marker { content: none; }
.prose .index a { grid-template-columns: 1fr; gap: 0.15rem; }
.prose .lang-list { columns: 2 12rem; }
.steps-inline { counter-reset: none; }

.side { border-top: 2px solid var(--ink); padding-top: 1rem; font-size: var(--step--1); position: sticky; top: 1rem; }
.side h2 { font-size: var(--step-0); margin: 1.4rem 0 0.5rem; }
.side h2:first-child { margin-top: 0; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 0.3rem 0; border-bottom: 1px dotted var(--rule); }
.side-list a { text-decoration: none; color: var(--ink); }
.side-list a:hover { color: var(--stamp); text-decoration: underline; }
@media (max-width: 56rem) { .side { position: static; } }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item:first-of-type { border-top: 2px solid var(--ink); }
.faq-item summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font-weight: 600; font-size: var(--step-1); list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.85rem; color: var(--stamp); font-size: 1.4rem; line-height: 1; transition: transform 160ms ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-a { color: var(--ink-soft); max-width: var(--measure); padding-bottom: 0.5rem; }

/* CTA band */
.cta-band { background: var(--ink); color: var(--paper); }
.cta-band h2 { color: #fff; }
.cta-band p { color: #c9d0dd; max-width: var(--measure); }
.cta-band a:not(.btn) { color: #fff; }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: center; }
.cta-actions .btn { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.cta-actions .btn:hover { background: #fff; color: var(--stamp-deep); }
.direct { margin-top: 1.25rem; line-height: 1.8; }
@media (max-width: 52rem) { .cta-grid { grid-template-columns: 1fr; } }

/* Contact */
.contact-dl { display: flex; flex-wrap: wrap; gap: 1rem 3rem; margin: 1.5rem 0 0.5rem; }
.contact-dl dt { font-size: var(--step--1); color: var(--ink-soft); }
.contact-dl dd { margin: 0; font-size: var(--step-1); font-weight: 600; }
.note { color: var(--ink-soft); }

/* Form -------------------------------------------------------------------- */
.form-section { background: var(--mist); }
.form-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 56rem) { .form-grid { grid-template-columns: 1fr; } }
.form-aside p { color: var(--ink-soft); }
.quote-form {
  background: var(--sheet); padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--rule); border-top: 4px solid var(--stamp);
  display: grid; gap: 1rem;
}
.quote-form .row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
@media (max-width: 36rem) { .quote-form .row.two { grid-template-columns: 1fr; } }
.quote-form label { display: grid; gap: 0.3rem; align-content: start; font-size: var(--step--1); font-weight: 600; }
.quote-form input[type=text], .quote-form input[type=email], .quote-form input[type=tel],
.quote-form select, .quote-form textarea {
  width: 100%; font: inherit; font-size: 1rem; font-weight: 400; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-bottom: 2px solid var(--ink-soft);
  border-radius: 2px; padding: 0.65rem 0.75rem;
}
.quote-form input:focus, .quote-form select:focus, .quote-form textarea:focus { outline: none; border-bottom-color: var(--stamp); background: #fff; box-shadow: 0 0 0 3px rgba(42, 71, 196, 0.18); }
.quote-form input[type=file] { font: inherit; font-size: var(--step--1); font-weight: 400; }
.quote-form .hint { font-weight: 400; color: var(--ink-soft); }
.quote-form .consent { grid-template-columns: auto 1fr; align-items: start; gap: 0.6rem; font-weight: 400; }
.quote-form .consent input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--stamp); }
.quote-form .btn { justify-self: start; }
.quote-form .btn[disabled] { opacity: 0.6; cursor: progress; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: #1d6b3a; }
.form-status.err { color: var(--lingon); }

/* Thanks / 404 */
.thanks { padding-top: clamp(3rem, 8vw, 6rem); }
.seal-static { width: 6rem; height: 6rem; color: var(--lingon); transform: rotate(-12deg); margin-bottom: 1rem; }

/* Footer ---------------------------------------------------------------- */
.site-footer { border-top: 2px solid var(--ink); padding: 3rem 0 2rem; font-size: var(--step--1); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.site-footer h2 { font-size: var(--step-0); margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 0.2rem 0; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--stamp); text-decoration: underline; }
.site-footer .endo { display: none; }
.footer-about p { color: var(--ink-soft); max-width: 22rem; }
.footer-about .brand-name { color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--ink-soft); }
.footer-bottom p { margin: 0; }
.footer-bottom a { margin-left: 1rem; }
@media (max-width: 52rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 30rem) { .footer-grid { grid-template-columns: 1fr; } }

@media print {
  .site-header, .site-footer, .form-section, .cta-band { display: none; }
}
