/* ===========================================================
   NBI Teenused OÜ — green / nature themed site
   Fonts: Sora (display) + Inter (body) via Google Fonts
   =========================================================== */

:root {
  /* Green nature palette */
  --green-900: #0b3d2e;
  --green-800: #11543f;
  --green-700: #176b50;
  --green-600: #1f8a64;
  --green-500: #2faa78;
  --green-400: #4cc795;
  --green-300: #8fe0bd;
  --green-100: #e6f7ef;
  --green-50:  #f3fbf7;

  --leaf:      #6fcf6b;
  --mint:      #d6f5e6;
  --ink:       #102a22;
  --muted:     #5c7268;
  --line:      #dceee6;
  --white:     #ffffff;

  --bg:        #fbfdfc;

  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 18px 50px -24px rgba(11, 61, 46, 0.45);
  --shadow-sm: 0 8px 24px -16px rgba(11, 61, 46, 0.5);

  --maxw: 1140px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--green-900);
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

a { color: var(--green-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-500); }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green-600);
  margin-bottom: 0.9rem;
  display: inline-block;
}

.lead { font-size: 1.18rem; color: var(--muted); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); color: #fff; box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  color: var(--green-800);
  border-color: var(--green-300);
}
.btn-ghost:hover { background: var(--green-100); color: var(--green-800); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 253, 252, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--green-900);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--green-900); }
.brand .logo-mark { width: 38px; height: 38px; flex: none; }
.brand small { display:block; font-family: var(--font-body); font-weight:500; font-size:0.65rem; letter-spacing:0.18em; text-transform:uppercase; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--green-900);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}
.nav-links a:hover, .nav-links a.active { background: var(--green-100); color: var(--green-800); }
.nav-cta { margin-left: 0.6rem; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display:block; width:24px; height:2px; background: var(--green-900); margin: 5px 0; border-radius: 2px; transition: .25s; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--green-100), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, var(--mint), transparent 55%),
    var(--bg);
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5.5rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 span { color: var(--green-500); }
.hero .lead { margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(11,61,46,0.18)); }

.badges { display:flex; gap: 1.5rem; flex-wrap:wrap; margin-top: 2.5rem; }
.badge {
  display:flex; align-items:center; gap:0.6rem;
  font-family: var(--font-display); font-weight:600; font-size:0.85rem; color: var(--green-800);
}
.badge svg { width:26px; height:26px; flex:none; color: var(--green-500); }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-tinted { background: linear-gradient(180deg, var(--green-50), var(--bg)); }
.section-head { max-width: 64ch; margin-bottom: 2.8rem; }
.section-head.center { margin-left:auto; margin-right:auto; text-align:center; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green-300); }
.card .icon {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green-100), var(--mint));
  margin-bottom: 1.1rem;
}
.card .icon svg { width: 28px; height: 28px; color: var(--green-600); }
.card h3 { margin-bottom: 0.4rem; }
.card p { color: var(--muted); margin-bottom: 0; font-size: 0.97rem; }

/* ---------- Stats ---------- */
.stats { display:grid; grid-template-columns: repeat(4,1fr); gap:1.2rem; }
.stat {
  text-align:center; padding: 1.6rem 1rem;
  background: var(--white); border:1px solid var(--line); border-radius: var(--radius);
}
.stat .num { font-family: var(--font-display); font-weight:700; font-size: 2.1rem; color: var(--green-600); line-height:1; }
.stat .lbl { font-size:0.85rem; color: var(--muted); margin-top:0.4rem; }

/* ---------- Feature split ---------- */
.split { display:grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items:center; }
.split .art { background: linear-gradient(135deg, var(--green-700), var(--green-500)); border-radius: var(--radius); padding: 2.5rem; color:#fff; }

.checklist { list-style:none; padding:0; margin: 1.4rem 0 0; display:grid; gap:0.8rem; }
.checklist li { display:flex; gap:0.7rem; align-items:flex-start; color: var(--ink); }
.checklist li svg { width:22px; height:22px; flex:none; color: var(--green-500); margin-top:2px; }

/* ---------- Certificates ---------- */
.cert-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:1.4rem; }
.cert {
  display:flex; gap:1.2rem; align-items:flex-start;
  background: var(--white); border:1px solid var(--line); border-radius: var(--radius); padding:1.6rem;
  box-shadow: var(--shadow-sm);
}
.cert .doc { width:48px; height:48px; flex:none; color: var(--green-600); }
.cert h3 { font-size:1.08rem; margin-bottom:0.25rem; }
.cert p { font-size:0.9rem; color:var(--muted); margin-bottom:0.7rem; }
.cert a.doc-link { font-family:var(--font-display); font-weight:600; font-size:0.9rem; display:inline-flex; align-items:center; gap:0.35rem; }

/* ---------- Banner / CTA ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(2.5rem, 5vw, 4rem);
  color:#fff; text-align:center;
  position: relative; overflow:hidden;
}
.cta-banner::after {
  content:""; position:absolute; inset:auto -10% -60% auto; width:380px; height:380px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
}
.cta-banner h2 { color:#fff; }
.cta-banner p { color: rgba(255,255,255,0.85); max-width: 52ch; margin:0 auto 1.8rem; }
.cta-banner .btn-primary { background:#fff; color: var(--green-800); }
.cta-banner .btn-primary:hover { color: var(--green-900); }

/* ---------- Page hero (interior) ---------- */
.page-hero {
  background:
    radial-gradient(900px 400px at 80% -20%, var(--green-100), transparent 60%),
    var(--bg);
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem,4vw,3rem);
  border-bottom: 1px solid var(--line);
}
.page-hero .lead { margin-bottom:0; }

/* ---------- Prose (markdown content) ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose blockquote {
  border-left: 4px solid var(--green-400);
  margin: 1.5rem 0; padding: 0.4rem 1.2rem; background: var(--green-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--green-900);
}

/* ---------- Contact ---------- */
.contact-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items:start; }
.info-card {
  background: var(--white); border:1px solid var(--line); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow-sm);
}
.info-row { display:flex; gap:1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom:0; }
.info-row .ic { width:42px; height:42px; flex:none; display:grid; place-items:center; border-radius:12px; background: var(--green-100); }
.info-row .ic svg { width:20px; height:20px; color: var(--green-600); }
.info-row .k { font-family: var(--font-display); font-weight:600; font-size:0.78rem; text-transform:uppercase; letter-spacing:0.1em; color: var(--muted); }
.info-row .v { font-size:1.02rem; color: var(--ink); }
.info-row .v a { font-weight:600; }

.bank-card { background: var(--green-50); border:1px solid var(--line); border-radius: var(--radius); padding:1.6rem; margin-bottom:1.2rem; }
.bank-card h4 { font-family:var(--font-display); margin:0 0 0.8rem; color:var(--green-800); font-size:1.05rem; }
.bank-row { display:flex; justify-content:space-between; gap:1rem; font-size:0.92rem; padding:0.3rem 0; }
.bank-row .lbl { color: var(--muted); }
.bank-row .val { font-weight:600; font-family: var(--font-display); color: var(--ink); text-align:right; }

.map-embed { border:0; width:100%; height:510px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #cfe9dd; padding: 3.5rem 0 2rem; margin-top: 2rem; }
.footer-grid { display:grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 2.5rem; }
.site-footer h4 { color:#fff; font-size:0.85rem; text-transform:uppercase; letter-spacing:0.14em; margin-bottom:1rem; }
.site-footer a { color:#cfe9dd; }
.site-footer a:hover { color:#fff; }
.footer-brand { display:flex; align-items:center; gap:0.7rem; font-family:var(--font-display); font-weight:700; color:#fff; font-size:1.2rem; margin-bottom:0.8rem; }
.footer-brand .logo-mark { width:36px; height:36px; }
.footer-list { list-style:none; padding:0; margin:0; display:grid; gap:0.5rem; font-size:0.95rem; }
.footer-bottom { border-top:1px solid rgba(255,255,255,0.12); margin-top:2.5rem; padding-top:1.5rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:0.6rem; font-size:0.85rem; color:#9fc7b6; }

/* ===========================================================
   Animations
   =========================================================== */

/* Reveal-on-load — a SELF-COMPLETING CSS animation.
   The element starts faded/below and animates to its final visible state
   on its own. It never depends on JS to become visible, so content can
   never get stuck hidden. Only active when .anim is present (i.e. JS ran
   and the user did NOT request reduced motion); otherwise content is just
   plainly visible. */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.anim .reveal {
  animation: revealUp .8s cubic-bezier(.2,.7,.2,1) both;
}
/* Gentle stagger for siblings (cards in a grid, stat tiles, etc.) */
.anim .reveal:nth-child(2) { animation-delay: .07s; }
.anim .reveal:nth-child(3) { animation-delay: .14s; }
.anim .reveal:nth-child(4) { animation-delay: .21s; }
.anim .reveal:nth-child(5) { animation-delay: .28s; }
.anim .reveal:nth-child(6) { animation-delay: .35s; }

/* Header lifts a subtle shadow once scrolled */
.site-header { transition: box-shadow .3s ease, background .3s ease; }
.site-header.scrolled { box-shadow: 0 10px 30px -20px rgba(11,61,46,0.55); }

/* Animated nav underline */
.nav-links a { position: relative; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.9rem; right: 0.9rem; bottom: 0.32rem;
  height: 2px; border-radius: 2px;
  background: var(--green-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* Language switcher */
.lang-switch {
  display: flex; align-items: center; gap: 2px;
  margin-left: 0.4rem; padding-left: 0.7rem;
  border-left: 1px solid var(--line);
}
.lang-switch a {
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.8rem;
  color: var(--muted);
  padding: 0.3rem 0.5rem; border-radius: 8px;
  transition: color .2s, background .2s;
}
.lang-switch a:hover { color: var(--green-700); background: var(--green-100); }
.lang-switch a.active { color: var(--green-800); background: var(--green-100); }
.lang-switch a::after { display: none; }

/* Buttons get a soft sheen on hover */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::before {
  content: "";
  position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-18deg);
  transition: left .6s ease;
}
.btn-primary:hover::before { left: 130%; }

/* Cards: animated icon + arrow nudge */
.card .icon { transition: transform .3s ease; }
.card:hover .icon { transform: translateY(-3px) rotate(-4deg); }
/* Anchor target offset so the sticky header doesn't cover #enquiry */
#enquiry { scroll-margin-top: 96px; }

.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn .arrow, .btn svg:last-child { transition: transform .25s ease; }
.cert a.doc-link svg { width: 1.05em; height: 1.05em; flex: none; }
.btn:hover svg:last-child { transform: translateX(3px); }

/* Hero artwork — gentle continuous motion */
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes floatYb { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseHalo { 0%,100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }

.anim .art-cyl-a { animation: floatY 6s ease-in-out infinite; }
.anim .art-cyl-b { animation: floatYb 6s ease-in-out infinite; }
.anim .art-halo { transform-origin: 230px 200px; animation: pulseHalo 7s ease-in-out infinite; }
.anim .art-snow { transform-box: fill-box; transform-origin: center; }
.anim .art-snow-1 { animation: spin 22s linear infinite; }
.anim .art-snow-2 { animation: spin 16s linear infinite reverse; }
.anim .art-snow-3 { animation: spin 28s linear infinite; }

/* Respect reduced-motion: kill all motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; }
  .hero-art { order:-1; max-width:420px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: absolute; top: 76px; left:0; right:0;
    flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom:1px solid var(--line);
    padding: 1rem; gap: 0.2rem; display:none;
  }
  .nav-links.open { display:flex; }
  .nav-toggle { display:block; }
  .nav-cta { margin:0.5rem 0 0; }
  .grid-3, .grid-2, .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
