/* ==========================================================================
   Balance SIA — www.balance.lv
   Pašu rakstīts CSS. Bez Bootstrap, bez jQuery, bez ārējiem pieprasījumiem.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Ķīniešu rakstzīmes. unicode-range nozīmē, ka pārlūks šo failu lejupielādē
   TIKAI tad, ja lapā ir CJK rakstzīmes — pārējām sešām valodām tas nemaksā neko.
   Apakškopa satur tieši tās 364 rakstzīmes, kas ir /zh/ lapā. */
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/noto-sc-subset.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}

/* Arābu rakstzīmes — tāpat tikai /ar/ lapai. Apakškopā saglabātas arī
   kontekstuālās burtu formas (sākuma/vidus/beigu), citādi vārdi nesavienotos. */
@font-face {
  font-family: "Noto Sans Arabic";
  src: url("../fonts/noto-ar-subset.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  --brand: #56b7e0;
  --brand-deep: #8ed2ee;
  --brand-tint: #254554;
  --ink: #f6f0e3;
  --ink-soft: #d9d0bd;
  --ink-mute: #c1b9aa;
  --bg: #1b3241;
  --bg-alt: #233e4e;
  --line: #37596b;
  --line-soft: #294b5c;
  --on-dark: #f6f0e3;
  --on-dark-soft: #d9d0bd;
  --on-dark-mute: #c1b9aa;
  --wrap: 1140px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4rem, 9vw, 7rem);
  --radius: 4px;
  /* Inter latīņu burtiem, Noto Sans SC ķīniešu rakstzīmēm; sistēmas CJK fonti
     seko kā rezerve, ja apakškopā kādas rakstzīmes pietrūktu. */
  --font: "Inter", "Noto Sans SC", "Noto Sans Arabic", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Geeza Pro", "Segoe UI Historic", "Helvetica Neue", Arial, sans-serif;
}

/* --- Base ----------------------------------------------------------------- */
*,
*::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;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.021em;
  font-weight: 640;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-deep); }

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

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

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 200;
  background: var(--bg);
  color: var(--ink);
  padding: .75rem 1.25rem;
  font-weight: 600;
}
.skip:focus { inset-inline-start: 0; }

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

/* --- Shared type ---------------------------------------------------------- */
.eyebrow {
  font-size: .78rem;
  font-weight: 620;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 1rem;
}
.eyebrow--dark { color: var(--on-dark-soft); }

.section-title {
  font-size: clamp(1.65rem, 3.4vw, 2.25rem);
}

.lead {
  font-size: clamp(1.06rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 62ch;
}

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 72px;
  padding-block: .75rem;
}

.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { width: 132px; }

.header-tools {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.75rem);
}

.header-phone {
  color: var(--on-dark);
  text-decoration: none;
  font-weight: 560;
  font-size: .96rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.header-phone:hover { color: var(--on-dark); text-decoration: underline; }
.header-phone svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .8; }

/* Šaurā ekrānā slēpjam numuru, bet vārdu "WhatsApp" paturam —
   tikai ikona nepasaka, kas notiks, uzspiežot. Vietu atbrīvojam,
   samazinot logo un atstarpes, nevis izmetot uzrakstu. */
@media (max-width: 34rem) {
  .header-phone .hp-num { display: none; }
  .header-phone { font-size: .88rem; gap: .38rem; }
  .brand img { width: 108px; }
  .header-tools { gap: .7rem; }
  .lang > summary { padding: .28rem .55rem; font-size: .76rem; }
}

/* Ļoti šauri ekrāni (Galaxy Fold ārējais ~280px) */
@media (max-width: 24rem) {
  /* Šaurās malas atbrīvo 16px — pietiek, lai galvene ietilptu 280px ekrānā
     un nebūtu jāizmet uzraksts "WhatsApp". */
  :root { --gutter: .7rem; }
  .brand img { width: 86px; }
  .header-phone { font-size: .8rem; }
  .lang > summary { padding: .26rem .45rem; font-size: .72rem; }
  .site-header__inner { gap: .6rem; }
}

/* Galaxy Fold ārējais ekrāns (280px) — pēdējais solis, lai galvene ietilptu */
@media (max-width: 18rem) {
  .brand img { width: 72px; }
  .header-tools { gap: .5rem; }
  .header-phone { font-size: .76rem; }
}

/* Valodu izvēlne uz <details> — strādā bez JavaScript,
   jo CSP aizliedz skriptus (script-src 'none'). */
.lang { position: relative; }

.lang > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 620;
  letter-spacing: .04em;
  color: var(--on-dark-soft);
  line-height: 1.6;
  white-space: nowrap;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary::after {
  content: "";
  width: .42em;
  height: .42em;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .15s ease;
}
.lang[open] > summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.lang > summary:hover { color: var(--on-dark); border-color: var(--brand); }

.lang__menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + .5rem);
  z-index: 120;
  min-width: 12rem;
  padding: .35rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.lang__menu a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .7rem;
  border-radius: 4px;
  font-size: .93rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.lang__menu a:hover { background: var(--bg); color: var(--ink); }
.lang__menu a[aria-current="true"] { color: var(--brand); font-weight: 620; }
.lang__code {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-mute);
  min-width: 1.7em;
}
.lang__menu a[aria-current="true"] .lang__code { color: var(--brand); }

/* --- Hero ----------------------------------------------------------------- */
.hero {
  background: var(--brand);
  color: var(--on-dark);
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem);
  position: relative;
  overflow: hidden;
}

/* .wrap nosaka konteinera platumu un malas; tekstu ierobežojam pa bērniem,
   lai hero sāktos tajā pašā vertikālē kā pārējās sadaļas. */
.hero__inner { position: relative; z-index: 1; }
.hero__inner > * { max-width: 46rem; }

.hero h1 {
  font-size: clamp(2.05rem, 5.4vw, 3.35rem);
  font-weight: 660;
  letter-spacing: -0.028em;
}

.hero__lead {
  margin-top: 1.4rem;
  font-size: clamp(1.06rem, 1.8vw, 1.24rem);
  line-height: 1.62;
  color: var(--on-dark-soft);
  max-width: 40rem;
}

.hero__actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
}

/* Balansa sija — logo motīvs kā dekoratīvs elements.
   width:100% ir obligāts — bez tā absolūti pozicionēts SVG ņem iekšējo
   platumu no viewBox un nesniedzas līdz malām. */
.hero__beam {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  z-index: 0;
  opacity: .18;
  pointer-events: none;
  color: var(--on-dark);
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .82rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

.btn--primary {
  background: var(--on-dark);
  color: var(--brand);
  border-color: var(--on-dark);
}
.btn--primary:hover { background: var(--brand-tint); color: var(--brand-deep); }

.btn--ghost {
  color: var(--on-dark);
  border-color: rgba(255, 255, 255, .45);
}
.btn--ghost:hover {
  color: var(--on-dark);
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .8);
}

/* --- Sections ------------------------------------------------------------- */
.section { padding-block: var(--section); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line-soft); }

.section__head { max-width: 46rem; margin-bottom: clamp(2.25rem, 5vw, 3.25rem); }
.section__head .lead { margin-top: 1rem; }

/* --- Facts ---------------------------------------------------------------- */
/* Atdalītājlīnijas zīmē šūnu box-shadow, NEVIS 1px gap uz pelēka fona.
   Tā tukša režģa šūna paliek balta, nevis pelēka — skaits var būt jebkurš.
   Ārējās līnijas nogriež konteinera overflow:hidden. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.fact {
  padding: 1.6rem 1.5rem;
  box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line);
}

/* Platāks variants apjoma sadaļai — 6 statistikas 3 kolonnās, nevis 6. */
.facts--wide {
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
}

.fact__value {
  font-size: clamp(1.75rem, 3.4vw, 2.3rem);
  font-weight: 660;
  letter-spacing: -0.03em;
  color: var(--brand);
  line-height: 1.1;
}
.fact__label {
  margin-top: .5rem;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--ink-mute);
}

/* --- Service cards -------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17.5rem, 100%), 1fr));
  gap: clamp(1rem, 2.2vw, 1.5rem);
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.1rem);
  display: flex;
  flex-direction: column;
}

.card__num {
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .12em;
  color: var(--brand);
  margin-bottom: .9rem;
}

.card h3 { font-size: 1.2rem; font-weight: 620; }

.card__desc {
  margin-top: .7rem;
  color: var(--ink-soft);
  font-size: .98rem;
  line-height: 1.6;
}

.ticks { margin-top: 1.35rem; display: grid; gap: .6rem; }
.ticks li {
  position: relative;
  padding-inline-start: 1.6rem;
  font-size: .96rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.ticks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .52em;
  width: .62rem;
  height: .34rem;
  border-left: 1.9px solid var(--brand);
  border-bottom: 1.9px solid var(--brand);
  transform: rotate(-45deg);
}

/* --- Split (Moneo / kam strādājam) --------------------------------------- */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (min-width: 52rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--narrow { grid-template-columns: 0.85fr 1.15fr; }
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.pill {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-size: .94rem;
  color: var(--ink-soft);
}

.note {
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  border-inline-start: 3px solid var(--brand);
  background: var(--brand-tint);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .97rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.note strong { color: var(--ink); }

/* Ārējā saite sadaļas beigās */
.more { margin-top: 1.5rem; }
.more a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 560;
  font-size: .98rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.more a:hover { border-bottom-color: transparent; }
.more svg { width: 15px; height: 15px; flex: 0 0 auto; }

.subhead {
  margin: clamp(2.25rem, 5vw, 3rem) 0 1.1rem;
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.source {
  margin-top: 2rem;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--ink-mute);
  max-width: 60ch;
}

/* --- Contact -------------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
}
@media (min-width: 46rem) {
  .contact-grid { grid-template-columns: repeat(3, 1fr); }
}

.contact-block { min-width: 0; }

.contact-block h3 {
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: .9rem;
}
.contact-block p, .contact-block a { font-size: 1.02rem; line-height: 1.65; }
.contact-block a { font-weight: 560; }
.contact-block .big { font-size: 1.2rem; font-weight: 620; }

/* Norāde, ka numurs atver WhatsApp, nevis zvanu */
.wa-hint {
  margin-top: -.15rem;
  font-size: .85rem;
  color: var(--ink-mute);
}

/* WhatsApp ikona pie numura */
.contact-block .big a,
.site-footer__bottom a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.wa-ico { width: 1em; height: 1em; flex: 0 0 auto; }

/* minmax(0,1fr) + overflow-wrap: bez tā IBAN (21 nedalāma rakstzīme)
   uzspiež režģim min-content platumu un lapa pārplūst pie 320px. */
.dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .35rem 1rem;
  font-size: .95rem;
}
.dl dt { color: var(--ink-mute); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--on-dark-soft);
  padding-block: clamp(2.75rem, 6vw, 4rem) 2rem;
  font-size: .93rem;
}
.site-footer a { color: var(--on-dark); }

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.site-footer__top img { width: 118px; }

.site-footer__bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  color: var(--on-dark-mute);
}

/* ==========================================================================
   Tumšās tēmas komponenšu pielāgojumi
   ========================================================================== */

body { background: var(--bg); color: var(--ink); }

h1, h2, h3 { letter-spacing: -0.03em; font-weight: 680; }

/* --- Galvene: tumšāka par lapu, ar plānu līniju --- */
.site-header {
  background: rgba(27, 50, 65, .88);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

/* --- Hero --- */
.hero {
  background: linear-gradient(180deg, #224b61 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(4rem, 10vw, 7.5rem) clamp(4rem, 9vw, 6.5rem);
}
.hero h1 { font-size: clamp(2.2rem, 5.8vw, 3.8rem); font-weight: 700; }
.hero__beam { color: var(--brand); opacity: .22; }
.eyebrow--dark { color: var(--brand); }

.btn--primary { background: var(--brand); color: #06171f; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #06171f; }
.btn--ghost { color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-alt); border-color: var(--brand); color: var(--ink); }

/* --- Sekcijas --- */
.section--alt { background: var(--bg-alt); border-block-color: var(--line); }

.facts, .clients { background: var(--bg-alt); border-color: var(--line); }
.fact, .client { box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.fact__value {
  color: var(--brand);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
}

.card { background: var(--bg-alt); border-color: var(--line); }
.section--alt .card { background: var(--bg); }
.card__num { color: var(--brand); }

.pill { background: transparent; border-color: var(--line); color: var(--ink-soft); }

.note { background: var(--brand-tint); border-inline-start-color: var(--brand); }
.note strong { color: var(--ink); }

.ticks li::before { border-color: var(--brand); }

.subhead { color: var(--ink-mute); }

/* --- Kājene: vēl tumšāka --- */
.site-footer { background: #152936; border-top: 1px solid var(--line); }

a { color: var(--brand); }
a:hover { color: var(--brand-deep); }

/* ==========================================================================
   Labais-uz-kreiso (arābu). Izkārtojums pārsvarā jau uz loģiskajām īpašībām;
   šeit tikai tas, kas paliek fizisks.
   ========================================================================== */
[dir="rtl"] .fact,
[dir="rtl"] .client { box-shadow: -1px 0 0 var(--line), 0 1px 0 var(--line); }

/* Ārējās saites bultiņa un ķeksīši spoguļojas */
[dir="rtl"] .more svg { transform: scaleX(-1); }
[dir="rtl"] .ticks li::before { transform: rotate(45deg) scaleX(-1); }

/* Latīņu/ciparu virknes RTL tekstā jāizolē, citādi bidi algoritms
   pārkārto plusu un domuzīmi (piem. "+371 …" un "0 – 6,9"). */
[dir="rtl"] .fact__value,
[dir="rtl"] .dl dd { direction: ltr; text-align: right; }
[dir="rtl"] .contact-block .big a,
[dir="rtl"] .site-footer__bottom a { direction: ltr; }
/* Galvenes numurs: bez izolācijas bidi pārvieto "+" uz otru galu */
[dir="rtl"] .hp-num,
[dir="rtl"] .btn--primary { direction: ltr; unicode-bidi: isolate; }
