/* ===== Tokens ===== */
:root {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --surface: #131c2e;
  --surface-2: #182338;
  --border: rgba(148, 163, 184, 0.14);
  --text: #e6edf6;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--muted); }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: clamp(72px, 10vw, 120px) 0; }
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 10px; background: var(--accent); color: #001018;
  padding: 8px 14px; border-radius: 8px; z-index: 200; font-weight: 600;
}
.skip-link:focus { left: 10px; }

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .96rem;
  border: 1px solid transparent; transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
  cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #001018; }
.btn-primary:hover { background: #7dd3fc; transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(56,189,248,.6); }
.btn-ghost { border-color: var(--border); color: var(--text); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: rgba(56,189,248,.5); background: rgba(56,189,248,.06); }
.btn-sm { padding: 9px 18px; font-size: .9rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); background: rgba(11,18,32,.9); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #6366f1); color: #04101c; font-size: .85rem; font-weight: 700;
}
.nav-menu { display: flex; align-items: center; gap: 30px; }
.nav-menu a:not(.btn) { color: var(--muted); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav-menu a:not(.btn):hover, .nav-menu a.active { color: var(--text); }
.nav-toggle {
  display: none; background: none; border: 0; padding: 10px; cursor: pointer;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: clamp(60px, 9vw, 110px) 0 clamp(70px, 10vw, 120px); }
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}
.hero::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -120px; top: -160px;
  background: radial-gradient(circle, rgba(56,189,248,.18), transparent 65%); pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 34px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta li {
  font-size: .82rem; color: var(--muted); padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 999px; background: rgba(255,255,255,.02);
}

/* Hero panel */
.panel {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.panel-title { margin-left: 10px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.panel-body { padding: 18px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.kpi-label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi-value { font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.kpi-value.ok { color: var(--ok); }
.kpi-value.warn { color: var(--warn); }
.chart { width: 100%; height: 140px; }
.chart .grid-lines line { stroke: rgba(148,163,184,.12); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.2s ease forwards .4s; }
.chart .threshold { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 5; opacity: .7; }
.panel-note { font-size: .72rem; margin: 10px 0 0; opacity: .7; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ===== Intro ===== */
.intro { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.intro-grid h2 { margin: 0; }

/* ===== Section head ===== */
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-sub { font-size: 1.05rem; }

/* ===== Cards ===== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform .25s, border-color .25s, background .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(56,189,248,.35); background: var(--surface-2); }
.card p { margin: 0; font-size: .96rem; }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 20px;
  background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.25);
}
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-cta { background: linear-gradient(150deg, rgba(56,189,248,.12), rgba(99,102,241,.08)); border-color: rgba(56,189,248,.3); display: flex; flex-direction: column; align-items: flex-start; }
.card-cta p { margin-bottom: 20px; }
.card-cta .btn { margin-top: auto; }

/* ===== Steps ===== */
.approach { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: none; }
.step { position: relative; padding: 28px 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.step-num { display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: .9rem; color: var(--accent); margin-bottom: 18px; padding: 4px 10px; border-radius: 8px; background: rgba(56,189,248,.1); }
.step p { margin: 0; font-size: .95rem; }

/* ===== Technology ===== */
.tech-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.tech-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tech-list li {
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .2s;
}
.tech-list li:hover { border-color: rgba(56,189,248,.35); }
.tech-list strong { display: block; font-family: var(--font-head); font-weight: 600; margin-bottom: 2px; }
.tech-list span { font-size: .87rem; color: var(--muted); }

/* ===== Background ===== */
.background { background: var(--bg-2); border-top: 1px solid var(--border); }
.bg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.bg-about p { font-size: 1.05rem; }
.timeline { border-left: 1px solid var(--border); padding-left: 26px; }
.timeline li { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding-bottom: 26px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -32px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.tl-year { font-family: var(--font-head); font-weight: 600; color: var(--accent); font-size: .92rem; padding-top: 1px; }
.timeline h3 { font-size: 1.02rem; margin-bottom: 2px; }
.timeline p { margin: 0; font-size: .9rem; }

/* ===== Contact ===== */
.contact-card {
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px; align-items: center;
  padding: clamp(32px, 5vw, 60px); border-radius: 24px; border: 1px solid rgba(56,189,248,.28);
  background: radial-gradient(circle at 0% 0%, rgba(56,189,248,.14), transparent 55%), var(--surface);
}
.contact-card h2 { margin-bottom: .4em; }
.contact-card p { margin: 0; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.contact-email { color: var(--text); font-weight: 500; border-bottom: 1px solid rgba(56,189,248,.4); word-break: break-all; }
.contact-email:hover { color: var(--accent); }
.contact-langs { font-size: .85rem; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-bottom: 30px; }
.footer-tag { margin: 10px 0 0; font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { color: var(--muted); font-size: .92rem; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--border); }
.footer-bottom p { margin: 0; font-size: .82rem; }
.privacy { max-width: 560px; }

/* ===== Reveal animation ===== */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { gap: 40px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; top: 70px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(11,18,32,.98); border-bottom: 1px solid var(--border);
    padding: 10px 20px 24px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .nav-menu.open { opacity: 1; transform: none; visibility: visible; }
  .nav-menu li a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
  .nav-menu li:last-child { margin-top: 18px; }
  .nav-menu .btn { width: 100%; padding: 13px; }

  .hero-inner, .intro-grid, .tech-grid, .bg-grid, .contact-card { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; }
}

@media (max-width: 600px) {
  .card-grid, .steps, .tech-list { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .kpi { padding: 8px; }
  .kpi-value { font-size: .88rem; }
  .hero-cta .btn { flex: 1 1 auto; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .chart .line { stroke-dashoffset: 0; }
}
