/* ═══════════════════════════════════════════
   VIVA Solutions — "Strukturēta skaidrība"
   ═══════════════════════════════════════════ */

/* ── Krāsu mainīgie ── */
:root {
  --paper:       #F7F8FA;
  --ink:         #1C2A3A;
  --ink-muted:   rgba(28, 42, 58, .66);
  --structure:   #27566B;
  --structure-d: #1E4453;
  --ochre:       #C28A2C;
  --grid:        #E6EAEE;
  --line-soft:   #C9D2DB;
  --flow:        #8FA9B4;
  --border:      #E2E7EC;
}

/* ── Reset un bāze ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Izkārtojums ── */
.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

/* ── Tipogrāfija ── */
h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}

h2 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: .375rem;
}

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: lowercase;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.wordmark {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.005em;
}
.wordmark:hover { color: var(--structure); }

/* ── Valodas pārslēgs ── */
.lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .25rem .625rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  display: flex;
  gap: .2rem;
  align-items: center;
}
.lang-btn:hover { border-color: var(--structure); color: var(--structure); }
.lang-btn:focus-visible {
  outline: 2px solid var(--structure);
  outline-offset: 2px;
}

.lang-sep { opacity: .4; }

/* Aktīvā valoda — ochre akcents */
body.lang-lv .lang-lv,
body.lang-en .lang-en {
  color: var(--ochre);
  font-weight: 500;
}
body:not(.lang-en) .lang-lv,
body.lang-en .lang-en { color: var(--ochre); font-weight: 500; }

/* ── Hero ── */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

/* Smalks fona režģis tikai aiz hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(120% 100% at 70% 40%, #000 35%, transparent 80%);
          mask-image: radial-gradient(120% 100% at 70% 40%, #000 35%, transparent 80%);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 560px;
}

.hero-sub {
  color: var(--ink-muted);
  font-size: 1.0625rem;
}

.btn-cta {
  display: inline-block;
  align-self: flex-start;
  background: var(--structure);
  color: #fff;
  text-decoration: none;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: .9375rem;
  font-weight: 500;
  padding: .65rem 1.5rem;
  border-radius: 5px;
  transition: background .15s;
}
.btn-cta:hover { background: var(--structure-d); }
.btn-cta:focus-visible {
  outline: 2px solid var(--structure);
  outline-offset: 3px;
}

.hero-diagram {
  width: 100%;
  max-width: 560px;
  align-self: center;
}

/* ── Hero SVG animācijas ── */
.hero-svg .vlbl {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .5px;
  fill: var(--ink);
  opacity: .55;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-svg .conn {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: draw 1.1s ease forwards;
  }
  .hero-svg .nd {
    opacity: 0;
    animation: fin .6s ease forwards;
  }
  .hero-svg .anode {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: fin .6s ease forwards .4s, breathe 4.5s ease-in-out 1s infinite;
  }
}

@keyframes draw    { to { stroke-dashoffset: 0; } }
@keyframes fin     { to { opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* ── Sekcijas ── */
.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--border);
}

/* ── Pakalpojumi ── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.service-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.service-card p {
  color: var(--ink-muted);
  font-size: 1rem;
}

/* ── Par uzņēmumu ── */
.about-text {
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
  max-width: 680px;
  margin-bottom: 1.75rem;
}

.founder-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  color: var(--structure);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
  transition: border-color .15s, color .15s;
}
.founder-link:hover { color: var(--structure-d); border-bottom-color: var(--structure-d); }
.founder-link:focus-visible {
  outline: 2px solid var(--structure);
  outline-offset: 2px;
}

.link-arrow { font-style: normal; }

/* ── Footer ── */
.site-footer {
  background: var(--ink);
  color: rgba(247, 248, 250, .85);
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.footer-contact .eyebrow { color: rgba(247, 248, 250, .45); margin-bottom: .75rem; }

.contact-link {
  color: #fff;
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 500;
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.contact-link:hover { border-bottom-color: rgba(255,255,255,.5); }
.contact-link:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 2px;
}

.mono-block {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .8125rem;
  line-height: 1.9;
  color: rgba(247, 248, 250, .55);
}

.footer-copy { border-top: 1px solid rgba(247,248,250,.1); padding-top: 1.25rem; }

/* ── Responsīvums ── */
@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .hero-inner {
    flex-direction: row;
    align-items: center;
    gap: 4rem;
  }

  .hero-text { flex: 1; max-width: none; }
  .hero-diagram { flex: 1; max-width: none; }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 5. karte — centrēta apakšējā rindā */
  .service-card:last-child:nth-child(3n+2) {
    grid-column: 2;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
  }
}
