/* Intelisoft.ee — tume indigo-violetne identiteet, eristuv Infrasoft'i
   puhtast sinisest. Space Grotesk (pealkirjad) + Inter (tekst).
   Signatuur: canvas-põhine võrgustik-animatsioon taustal + gradient-
   aktsent, mis kannab kogu lehe visuaalset läbivust. */

:root {
  --bg: #080911;
  --surface: rgba(20, 21, 36, 0.72);
  --surface-solid: #14152499;
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(167, 139, 250, 0.45);
  --text: #f3f2fa;
  --muted: #928fa8;
  --accent-1: #6366f1;
  --accent-2: #a855f7;
  --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --accent-glow: rgba(124, 92, 255, 0.28);

  --radius: 16px;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

#network {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--bg);
}

/* Topbar — fikseeritud (mitte sticky), et ei võtaks eraldi ruumi
   dokumendivoos: hero saab siis täita täpselt 100dvh, header hõljub
   selle kohal (poolläbipaistev taust juba toetab seda). */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  backdrop-filter: blur(12px);
  background: rgba(8, 9, 17, 0.55);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  /* Lilla/gradient tekst, mitte vaikimisi valge - sama töötlus mis
     .hero-title'il, ainult väiksemas suuruses (suurus jäi samaks). */
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand:hover { text-decoration: none; opacity: 0.85; }
.brand img, .brand svg { display: block; height: 28px; width: auto; }
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
}
/* BUG-FIX: .topbar-right koondab lang-switch + CTA ÜHTE flex-plokki
   koos selge gap'iga - varem olid need topbar'i otsesed lapsed koos
   .topbar-nav'i margin:0 auto'ga, mis kitsamatel akendel surus
   keelevaliku ja "Võta ühendust" nupu kokku/üksteise peale, kuna
   space-between + auto-margin koosmõju ei jätnud nende vahele
   kindlat ruumi. */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}
.topbar-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  transition: color 150ms ease;
}
.topbar-nav a:hover { color: var(--text); }

/* Keelevalik - minimalistlikud tekstilingid, sama muster mis
   infrasoftnew "ET | EN" (vt PROJECTS/intelisoft-ee.md analüüs) */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
}
.lang-switch a {
  text-decoration: none;
  color: var(--muted);
  transition: color 150ms ease;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { color: #c4b5fd; }
.topbar-cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.topbar-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

main { position: relative; z-index: 1; }

/* Hero — täisekraani kõrgus (100dvh, dünaamiline viewport height, et
   mobiilis/tablettides brauseririba avanemine/sulgumine ei jätaks
   tühja riba või lõikaks sisu ära; 100vh on tagavaravariant vanematele
   brauseritele, mis dvh ei toeta). */
.hero {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero-orb {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  transition: transform 200ms ease-out;
  will-change: transform;
}
.hero-orb-one {
  width: 340px;
  height: 340px;
  top: 8%;
  left: -8%;
  background: radial-gradient(circle, var(--accent-1), transparent 70%);
}
.hero-orb-two {
  width: 420px;
  height: 420px;
  bottom: 4%;
  right: -12%;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Kui logo.svg on olemas (vt lang.php brand_logo_svg()), asendab see
   tekstilise "InteliSoft" pealkirja - suurus ligikaudu vastab varasema
   teksti visuaalsele kõrgusele, PEAB Ivari poolt visuaalselt üle
   kontrollitama, kui päris fail lisandub (vt PROJECTS/intelisoft-ee.md). */
.hero-title svg { display: inline-block; height: clamp(64px, 11vw, 96px); width: auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hero-sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  color: var(--text);
  margin: 0 0 20px;
  line-height: 1.4;
}
.hero-desc {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Sektsiooni pealkiri (numbriga eyebrow, sama muster nagu topbar-nav) */
.section-heading { margin: 0 auto 32px; max-width: 1100px; padding: 0 24px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Teenuseplokid */
.services {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 24px 40px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.service-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.service-card:hover, .service-card:focus-visible {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-glow) inset;
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(168, 85, 247, 0.18));
  color: #c4b5fd;
}
.service-icon svg { width: 22px; height: 22px; }
.service-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
}
.service-short {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* "Loe lähemalt / Näita vähem" - natiivne <details>, ilma JS-ita */
.service-more { width: 100%; }
.service-more summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: #c4b5fd;
  margin-top: 2px;
}
.service-more summary::-webkit-details-marker { display: none; }
.service-more summary i {
  font-style: normal;
  transition: transform 180ms ease;
}
.service-more[open] summary i { transform: rotate(45deg); }
.service-more .label-less { display: none; }
.service-more[open] .label-more { display: none; }
.service-more[open] .label-less { display: inline; }
.service-more p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* Kontakt: kaheveeruline (tutvustus vasakul, vorm paremal) */
.contact {
  max-width: 1100px;
  margin: 40px auto 100px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: start;
}
.contact-intro h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin: 14px 0 14px;
  letter-spacing: -0.01em;
}
.contact-intro p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
  margin: 0 0 24px;
}
.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.98rem;
  transition: color 150ms ease;
}
.contact-links a svg { width: 18px; height: 18px; color: #c4b5fd; flex-shrink: 0; }
.contact-links a:hover { color: #c4b5fd; }

.contact-form {
  display: grid;
  gap: 16px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.contact-form label.full { grid-column: 1 / -1; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: var(--text);
  resize: vertical;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--border-hover);
}
.contact-form label.consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}
.contact-form label.consent input { margin-top: 3px; }
.btn-submit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 32px var(--accent-glow); }
.btn-submit:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }
.form-status { margin: 0; font-size: 0.86rem; min-height: 1.2em; }
.form-status-success { color: #86efac; }
.form-status-error { color: #fca5a5; }

/* Footer */
/* Kolm gruppi: vasak (autoriõigus+privaatsus), keskel (e-post),
   parem (Intranet) - vt PROJECTS/intelisoft-ee.md. */
.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-col { display: flex; flex-direction: column; gap: 6px; }
.footer-col-left { text-align: left; align-items: flex-start; }
.footer-col-center { text-align: center; align-items: center; }
.footer-col-right { text-align: right; align-items: flex-end; }
/* Sisemine (intranet) link - teadlikult diskreetne, mitte esiletõstetud:
   väiksem kiri, madalam kontrast, ilma ikoonita. Ainult sisemiseks
   kasutuseks, mitte avalikuks reklaamiks. */
.footer-internal {
  font-size: 0.76rem;
  color: rgba(146, 143, 168, 0.55);
}
.footer-internal:hover { color: var(--muted); }

/* Küpsiseteavitus */
.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #12131f;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
/* BUG-FIX: ilma selleta jääb author-CSS `display:flex` alati
   ülekaalu brauseri vaikimisi `[hidden]{display:none}` reegli üle
   (mõlemal on sama spetsiifilisus, autori CSS võidab alati UA
   stiili) - "hidden" atribuudi lisamine/eemaldamine JS-ist ei
   mõjunud kunagi visuaalselt, bänner ei kadunud kunagi klõpsates. */
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: 0.86rem; color: var(--muted); line-height: 1.55; }
.cookie-banner a { color: #c4b5fd; font-weight: 600; }
.cookie-banner .btn-submit { flex-shrink: 0; padding: 9px 20px; font-size: 0.86rem; }

/* Privaatsuse/küpsiste leht */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 140px 24px 80px;
}
.legal-page h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  margin: 0 0 18px;
}
.legal-page h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 36px 0 12px;
}
.legal-page p { color: var(--muted); line-height: 1.75; margin: 0 0 4px; }
.legal-intro { font-size: 1.02rem; color: var(--text); }
.legal-jump { margin: 0 0 8px; font-size: 0.88rem; }
.legal-jump a { color: #c4b5fd; font-weight: 600; }
.back-link { margin: 48px 0 0; font-size: 0.88rem; text-align: left; }
.back-link a { color: var(--muted); }
.back-link a:hover { color: #c4b5fd; }

/* Kerimisel ilmuv sisu (.reveal -> .is-visible IntersectionObserver'iga) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.service-grid .reveal:nth-child(2) { transition-delay: 60ms; }
.service-grid .reveal:nth-child(3) { transition-delay: 120ms; }
.service-grid .reveal:nth-child(4) { transition-delay: 60ms; }
.service-grid .reveal:nth-child(5) { transition-delay: 120ms; }
.service-grid .reveal:nth-child(6) { transition-delay: 180ms; }

/* Responsiivsus */
@media (max-width: 860px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar-nav { display: none; }
}
@media (max-width: 560px) {
  .service-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; gap: 18px; }
  .footer-col-center, .footer-col-right { text-align: left; align-items: flex-start; }
  .contact-form { padding: 24px 20px; }
  .topbar-right { gap: 14px; }
  .topbar-cta { padding: 8px 14px; font-size: 0.8rem; }
  .lang-switch { gap: 7px; font-size: 0.7rem; }
  .legal-page { padding-top: 96px; }
}
/* Kitsad telefonid (nt iPhone SE 375px, väiksemad Androidid): brand +
   4-keeleline lüliti + CTA-nupp koos ei mahu enam ära isegi eelmise
   kitsendamisega - "Võta ühendust" nupp peidetakse, sest sama tegevus
   on niikuinii hero enda CTA-nupuna kohe allpool nähtaval. */
@media (max-width: 460px) {
  .topbar-cta { display: none; }
  .brand { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .service-card, .topbar-cta, .btn-submit, .hero-cta { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-orb { transition: none; }
}
