/* ============================================================
   base.css — shared foundation for all layouts
   Layout-specific structure lives in layouts/<name>.css
   ============================================================ */

:root {
  --accent-2: var(--accent);
  --t-xs: .78rem; --t-sm: .9rem; --t-base: 1rem; --t-md: 1.15rem;
  --t-lg: 1.45rem; --t-xl: 1.9rem; --t-2xl: 2.5rem; --t-3xl: 3.4rem; --t-4xl: 4.4rem;
  --gutter: 1.5rem; --measure: 66ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0; font-family: var(--body); font-size: var(--t-base);
  line-height: 1.65; color: var(--ink-soft); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--display); color: var(--ink); margin: 0;
  line-height: 1.1; text-wrap: balance;
}
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; }

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

.skip { position: absolute; left: -9999px; background: var(--ink); color: var(--paper); padding: .75rem 1.25rem; z-index: 200; }
.skip:focus { left: 1rem; top: 1rem; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons (shared, restyled per layout) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--body); font-size: var(--t-sm); font-weight: 600;
  padding: .85rem 1.5rem; border: 1px solid transparent; border-radius: var(--r);
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--tg { background: var(--ink); color: var(--paper); }
.btn--tg:hover { opacity: .86; }

/* ---------- Form (shared across all layouts) ---------- */

.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  font-family: var(--body); font-size: var(--t-base); padding: .82rem .9rem;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--ink); width: 100%;
}
.field textarea { min-height: 6.5rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline-offset: 1px; }
.field[data-invalid="true"] input, .field[data-invalid="true"] textarea { border-color: var(--warn); }
.field__err { font-size: var(--t-xs); color: var(--warn); min-height: 1em; }

.form__status { margin-top: 1rem; font-size: var(--t-sm); }
.form__status[data-state="ok"] { color: var(--signal); font-weight: 600; }
.form__status[data-state="err"] { color: var(--warn); font-weight: 600; }
.form__legal { font-size: var(--t-xs); color: var(--ink-faint); margin-top: .9rem; }

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

/* ---------- FAQ (shared behaviour, restyled per layout) ---------- */

.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: var(--t-md);
  color: var(--ink); padding: 1.3rem 2.5rem 1.3rem 0; position: relative;
}
.faq__q::after {
  content: ""; position: absolute; right: .4rem; top: 50%;
  width: 10px; height: 10px;
  border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-70%) rotate(45deg); transition: transform .22s ease;
}
.faq__q[aria-expanded="true"]::after { transform: translateY(-30%) rotate(-135deg); }
.faq__a { display: none; padding-bottom: 1.4rem; }
.faq__a p { margin: 0; color: var(--ink-faint); }
.faq__item[data-open="true"] .faq__a { display: block; }

/* ---------- Entrance (one orchestrated moment, on load only) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(15px); animation: rise .6s cubic-bezier(.2,.7,.3,1) forwards; }
  .rise:nth-child(1) { animation-delay: .04s; }
  .rise:nth-child(2) { animation-delay: .11s; }
  .rise:nth-child(3) { animation-delay: .18s; }
  .rise:nth-child(4) { animation-delay: .25s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

@media print { .nav, .rail, .hero__acts, form { display: none !important; } }

/* ---------- Locality block (region trust signals) ---------- */

.local {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  background: var(--mist);
}
.local__head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.local__flag { font-size: 2rem; line-height: 1; }
.local__head h2 { font-size: clamp(var(--t-md), 2.6vw, var(--t-xl)); margin: 0; }
.local__points {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .7rem 2rem; margin: 0;
}
.local__points li {
  list-style: none; font-size: var(--t-sm); color: var(--ink);
  padding-inline-start: 1.6rem; position: relative;
}
.local__points li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .48em;
  width: 9px; height: 5px;
  border-inline-start: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
[dir="rtl"] .local__points li::before { transform: rotate(-135deg) scaleY(-1); }
.local__note { font-size: var(--t-sm); color: var(--ink-faint); margin: 1.3rem 0 0; max-width: none; }


/* ---------- Locality ----------
   The flag reads as a deliberate design element, not decoration: a large
   clipped backdrop behind the section, plus one crisp chip by the heading.
   Low opacity so it signals country without shouting it. */

.local-band { position: relative; }

/* The card is the clipping boundary, so the flag can never bleed past the
   rounded corner. It was previously positioned against the section, which is
   full page width — hence the overhang. */
.local {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); background: var(--mist);
  padding: clamp(1.8rem, 4vw, 2.8rem);
}
.local > *:not(.local__backdrop) { position: relative; z-index: 1; }

.local__backdrop {
  position: absolute; inset-block: 0; inset-inline-end: 0;
  width: min(42%, 420px); pointer-events: none;
  opacity: .10; filter: saturate(.85);
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent 100%);
  mask-image: linear-gradient(to left, #000 30%, transparent 100%);
}
[dir="rtl"] .local__backdrop {
  -webkit-mask-image: linear-gradient(to right, #000 30%, transparent 100%);
  mask-image: linear-gradient(to right, #000 30%, transparent 100%);
}
.local__backdrop-svg { width: 100%; height: 100%; display: block; }

.local__head { display: flex; align-items: center; gap: .95rem; margin-bottom: 1.6rem; }
.local__chip {
  display: block; flex: none; width: 34px; height: 22px;
  border-radius: 3px; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent),
              0 1px 3px rgba(0,0,0,.18);
}
.local__chip-svg { width: 100%; height: 100%; display: block; }
.local__head h2 { font-size: clamp(var(--t-lg), 3.2vw, var(--t-2xl)); }

.local__points { display: grid; gap: .85rem; max-width: 46rem; }
.local__points li {
  list-style: none; position: relative; padding-inline-start: 1.6rem;
  font-size: var(--t-base);
}
.local__points li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .58em;
  width: 8px; height: 5px;
  border-inline-start: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
[dir="rtl"] .local__points li::before { transform: rotate(-135deg) scaleY(-1); }
.local__note { font-size: var(--t-sm); color: var(--ink-faint); margin: 1.4rem 0 0; }

@media (max-width: 720px) { .local__backdrop { opacity: .07; width: 62%; } }

/* ---------- Second national colour ----------
   The flag's other colour, used on a few small surfaces so both appear
   without the page turning into a flag: the locality chip ring, the offer
   badge, and the rule above each step. */

.local__chip {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-2) 55%, transparent),
              0 1px 4px rgba(0,0,0,.20);
}
.local__head { position: relative; padding-inline-start: 0; }
.local__points li::before { border-color: var(--accent-2); }

.offer__tag { background: var(--accent-2); color: var(--paper); }

.proof__item b { color: var(--accent-2); }

/* The nav link rule outranks .btn--primary on specificity, which was
   repainting the CTA's label in the link colour. Restore it explicitly. */
.nav__links a.btn--primary,
.rail__nav a.btn--primary,
.topbar__nav a.btn--primary { color: var(--on-accent); }
.nav__links a.btn--ghost,
.nav__links a.btn--tg { color: var(--paper); }

/* ============================================================
   Layout A — "Index"
   Split hero with a specification card. Indexed catalogue rows.
   Reads: technical, measured, consultant-grade.
   ============================================================ */

:root {
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --shell: 1160px; --r: 6px; --r-lg: 14px;
}
h1,h2,h3,h4 { font-weight: 700; letter-spacing: -.028em; }

/* ---------- Section frame ---------- */

.band { padding-block: clamp(4rem, 9vw, 7.5rem); }
.band--mist { background: var(--mist); }
.band--ink  { background: var(--ink); }
.band--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.band__head { max-width: 46rem; margin-bottom: 3rem; }
.band__head h2 { font-size: clamp(var(--t-xl), 4.2vw, var(--t-3xl)); }
.band__head p {
  font-size: var(--t-md);
  margin-top: 1.1rem;
  color: var(--ink-faint);
}
.band--ink .band__head h2 { color: var(--paper); }
.band--ink .band__head p { color: #A6AEBD; }

/* ---------- Navigation ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav[data-stuck="true"] { border-bottom-color: var(--line); }
.nav__in {
  display: flex; align-items: center; gap: 2rem;
  min-height: 68px;
}
.nav__brand {
  font-family: var(--display); font-weight: 800;
  font-size: var(--t-md); color: var(--ink);
  letter-spacing: -0.04em; text-decoration: none;
  margin-right: auto;
}
.nav__links { display: flex; gap: 1.9rem; align-items: center; }
.nav__links a {
  color: var(--ink-soft); text-decoration: none;
  font-size: var(--t-sm); font-weight: 500;
  padding-block: .4rem;
  border-bottom: 2px solid transparent;
}
.nav__links a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav__toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--r); padding: .5rem .7rem; cursor: pointer;
}
.nav__toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--ink); margin: 3px 0;
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3.5rem, 7vw, 5.5rem); }
.hero__grid {
  display: grid; gap: clamp(2.5rem, 5vw, 4.5rem);
  grid-template-columns: 1.15fr .85fr; align-items: start;
}
.hero__flag {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--t-xs); font-weight: 600;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  padding: .35rem .75rem; border-radius: 100px;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 6.2vw, var(--t-4xl));
  font-weight: 800; letter-spacing: -0.04em;
}
.hero__sub {
  font-size: clamp(var(--t-md), 2vw, var(--t-lg));
  color: var(--ink-faint); margin-top: 1.4rem;
  max-width: 34ch; line-height: 1.5;
}
.hero__acts { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }
.hero__note { font-size: var(--t-sm); color: var(--ink-faint); margin-top: 1.1rem; }

/* Signature element: the proposition card */
.spec {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--paper); overflow: hidden;
  box-shadow: 0 1px 2px rgba(17,19,24,.04), 0 12px 34px -16px rgba(17,19,24,.16);
}
.spec__top {
  background: var(--ink); color: var(--paper);
  padding: 1.15rem 1.4rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.spec__top strong { font-family: var(--display); font-size: var(--t-md); letter-spacing: -.02em; }
.spec__ref { font-size: var(--t-xs); color: #8B94A6; }
.spec__rows { list-style: none; margin: 0; padding: 0; }
.spec__rows li {
  display: flex; gap: 1rem; justify-content: space-between; align-items: baseline;
  padding: .9rem 1.4rem; border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.spec__rows li:last-child { border-bottom: 0; }
.spec__rows dt, .spec__k { color: var(--ink-faint); flex: none; }
.spec__v { color: var(--ink); font-weight: 600; text-align: right; }
.spec__foot { padding: 1.2rem 1.4rem; background: var(--mist); border-top: 1px solid var(--line); }

/* ---------- Proof strip ---------- */

.proof { border-block: 1px solid var(--line); background: var(--paper); }
.proof__in { display: flex; flex-wrap: wrap; gap: 1rem 3rem; align-items: center; padding-block: 1.4rem; }
.proof__item { font-size: var(--t-sm); color: var(--ink-faint); }
.proof__item b { color: var(--ink); font-weight: 600; }

/* ---------- Problem list ---------- */

.pains { display: grid; gap: 0; max-width: 52rem; }
.pains li {
  list-style: none;
  padding: 1.4rem 0 1.4rem 2.2rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: var(--t-md); color: var(--ink);
}
.pains li::before {
  content: ""; position: absolute; left: 0; top: 2.05rem;
  width: 12px; height: 2px; background: var(--warn);
}
.pains li:last-child { border-bottom: 0; }

/* ---------- Catalogue (signature section) ---------- */

.cat { display: grid; gap: 0; }
.cat__item {
  display: grid;
  grid-template-columns: 5.5rem 1fr minmax(0, 22rem);
  gap: 1.5rem 2.5rem;
  padding-block: 2.4rem;
  border-top: 1px solid var(--line);
  align-items: start;
}
.cat__item:last-child { border-bottom: 1px solid var(--line); }
.cat__ref {
  font-family: var(--display); font-weight: 700;
  font-size: var(--t-sm); color: var(--accent);
  letter-spacing: .04em; padding-top: .3rem;
}
.cat__name { font-size: var(--t-lg); }
.cat__desc { margin-top: .7rem; color: var(--ink-faint); margin-bottom: 0; }
.cat__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.cat__facts li {
  font-size: var(--t-sm); color: var(--ink);
  padding-left: 1.4rem; position: relative;
}
.cat__facts li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* ---------- Steps ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; counter-reset: s; }
.steps__item { counter-increment: s; }
.steps__item::before {
  content: counter(s);
  font-family: var(--display); font-weight: 800; font-size: var(--t-xl);
  color: var(--paper);
  display: grid; place-items: center;
  width: 2.7rem; height: 2.7rem; border-radius: 50%;
  background: var(--accent); margin-bottom: 1.2rem;
}
.steps__item h3 { font-size: var(--t-md); margin-bottom: .6rem; }
.steps__item p { color: var(--ink-faint); font-size: var(--t-sm); margin: 0; }

/* ---------- Offer band ---------- */

.offer {
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-lg); overflow: hidden;
  display: grid; grid-template-columns: 1.4fr 1fr;
}
.offer__body { padding: clamp(2rem, 4vw, 3.2rem); }
.offer__tag {
  display: inline-block; font-size: var(--t-xs); font-weight: 700;
  background: var(--signal); color: #05261A;
  padding: .3rem .7rem; border-radius: 100px; margin-bottom: 1.2rem;
}
.offer__body h2 { color: var(--paper); font-size: clamp(var(--t-lg), 3.4vw, var(--t-2xl)); }
.offer__body p { color: #A6AEBD; margin-top: .9rem; }
.offer__list { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .7rem; }
.offer__list li { padding-left: 1.7rem; position: relative; color: #DDE1E8; font-size: var(--t-sm); }
.offer__list li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: 9px; height: 5px; border-left: 2px solid var(--signal);
  border-bottom: 2px solid var(--signal); transform: rotate(-45deg);
}
.offer__side {
  background: #1A1D25; padding: clamp(2rem, 4vw, 3.2rem);
  display: flex; flex-direction: column; justify-content: center; gap: 1rem;
  border-left: 1px solid #262A35;
}
.offer__price { font-family: var(--display); font-weight: 800; font-size: var(--t-2xl); color: var(--paper); letter-spacing: -.03em; }
.offer__meta { font-size: var(--t-sm); color: #8B94A6; margin: 0; }

/* ---------- Contact ---------- */

.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  font-family: var(--body); font-size: var(--t-base);
  padding: .8rem .9rem;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  width: 100%;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); outline-offset: 1px; }
.field textarea { min-height: 6.5rem; resize: vertical; }
.field[data-invalid="true"] input,
.field[data-invalid="true"] textarea { border-color: var(--warn); }
.field__err { font-size: var(--t-xs); color: var(--warn); min-height: 1em; }

.form__status { margin-top: 1rem; font-size: var(--t-sm); }
.form__status[data-state="ok"]  { color: var(--signal); font-weight: 600; }
.form__status[data-state="err"] { color: var(--warn); font-weight: 600; }
.form__legal { font-size: var(--t-xs); color: var(--ink-faint); margin-top: .9rem; }

.direct {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.2rem); background: var(--mist);
}
.direct h3 { font-size: var(--t-lg); margin-bottom: .7rem; }
.direct p { color: var(--ink-faint); font-size: var(--t-sm); }
.direct__note { font-size: var(--t-xs); color: var(--ink-faint); margin: .9rem 0 0; }

/* ---------- Footer ---------- */

.foot { background: var(--ink); color: #8B94A6; padding-block: 3rem 2.2rem; }
.foot a { color: #DDE1E8; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot__top { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: start; }
.foot__brand { font-family: var(--display); font-weight: 800; color: var(--paper); font-size: var(--t-md); letter-spacing: -.03em; }
.foot__links { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: var(--t-sm); }
.foot__bar {
  margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid #262A35;
  font-size: var(--t-xs); display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__sub { max-width: 46ch; }
  .offer { grid-template-columns: 1fr; }
  .offer__side { border-left: 0; border-top: 1px solid #262A35; }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .cat__item { grid-template-columns: 3.5rem 1fr; }
  .cat__facts { grid-column: 2; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1rem;
  }
  .nav__links[data-open="true"] { display: flex; }
  .nav__links a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav__links .btn { margin-top: .8rem; }
  .hero__acts .btn { width: 100%; }
  .proof__in { gap: .6rem 1.6rem; }
}

@media print {
  .nav, .hero__acts, .form { display: none; }
}

.pains li::before { background: var(--accent-2); }
.spec__top { border-bottom: 3px solid var(--accent-2); }
.hero__flag { color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 8%, transparent);
  border-color: color-mix(in srgb, var(--accent-2) 26%, transparent); }

/* Layout rules load after base, so restate the clipping here — the card is
   the boundary that keeps the flag backdrop inside the rounded corner. */
.local { position: relative; overflow: hidden; }
.local > *:not(.local__backdrop) { position: relative; z-index: 1; }
