/* ============================================================
   kyivtech-portal — Design System v2
   "Confident craft" — warm light base + industrial yellow accent
   References: Apple (whitespace + display type), Anthropic (warmth),
               build.nvidia.com (live stats), Dewalt (industrial accent).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* ── Color tokens ─────────────────────────────────────── */
  --bg:              #FAF7F2;   /* warm off-white, page base */
  --bg-2:            #F2EDE3;   /* slightly darker, alt sections */
  --surface:         #FFFFFF;   /* card surface */
  --surface-ink:     #18181B;   /* dark "industrial pill" surface */
  --surface-ink-2:   #27272A;   /* dark surface, slightly lifted */

  --text:            #18181B;   /* primary text on light bg */
  --text-muted:      #52525B;   /* secondary text */
  --text-dim:        #71717A;   /* labels, footnotes */
  --text-inv:        #FAFAFA;   /* on dark/yellow surfaces */
  --text-on-accent:  #18181B;   /* dark text on yellow accent */

  --border:          rgba(24,24,27,0.08);
  --border-strong:   rgba(24,24,27,0.16);
  --border-ink:      rgba(255,255,255,0.10);

  --accent:          #FFCC00;   /* industrial yellow (Dewalt nod) */
  --accent-hover:    #FFD633;
  --accent-soft:     rgba(255,204,0,0.14);
  --accent-ink:      #18181B;

  --success:         #16A34A;
  --warning:         #F59E0B;
  --danger:          #DC2626;

  /* ── Spacing scale (8-based) ─────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* ── Radius (chunky / friendly) ─────────────────────── */
  --r-sm:  10px;   /* inputs */
  --r-md:  16px;   /* small cards, dropdowns */
  --r-lg:  22px;   /* main cards */
  --r-xl:  32px;   /* hero cards, demo blocks */
  --r-2xl: 40px;   /* large featured surfaces */
  --r-pill: 999px;

  /* ── Shadows ─────────────────────────────────────────── */
  --shadow-sm:    0 1px 2px rgba(24,24,27,0.04);
  --shadow-md:    0 4px 12px rgba(24,24,27,0.06), 0 2px 4px rgba(24,24,27,0.04);
  --shadow-lg:    0 12px 32px rgba(24,24,27,0.08), 0 4px 8px rgba(24,24,27,0.04);
  --shadow-yellow: 0 8px 24px rgba(255,204,0,0.32);
  --inset-line:   inset 0 -1px 0 var(--border);

  /* ── Typography scale ────────────────────────────────── */
  --font-display: 'Onest', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    'Onest', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --fs-mono:    11px;   /* labels, footnotes */
  --fs-sm:      13px;   /* small body */
  --fs-base:    15px;   /* body */
  --fs-md:      17px;   /* lead paragraphs */
  --fs-lg:      20px;   /* card titles */
  --fs-xl:      28px;   /* section h2 */
  --fs-2xl:     40px;   /* section heroes */
  --fs-3xl:     56px;   /* page hero (mobile) */
  --fs-4xl:     80px;   /* page hero (desktop) */
  --fs-5xl:     112px;  /* mega display, sparingly */

  /* ── Motion ──────────────────────────────────────────── */
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:     150ms;
  --t-base:     250ms;
  --t-slow:     420ms;

  /* ── Layout ──────────────────────────────────────────── */
  --maxw-prose:    640px;
  --maxw-content:  960px;
  --maxw-wide:     1200px;

  color-scheme: light;
}

/* ── Reset-ish ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* Belt + suspenders: every section never wider than its container. */
section, header, footer, main { max-width: 100%; min-width: 0; }
img, iframe, video, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.06; font-weight: 700; }
h1 { font-size: var(--fs-3xl); }
@media (min-width: 768px) { h1 { font-size: var(--fs-4xl); } }
h2 { font-size: var(--fs-2xl); letter-spacing: -0.025em; line-height: 1.1; }
h3 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
h4 { font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
p  { margin: 0; }

.lead { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.55; }

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--text-dim);
}

.display-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ── Layout helpers ────────────────────────────────────── */
.kt-section { padding: var(--space-9) 0; }
@media (min-width: 1024px) { .kt-section { padding: var(--space-10) 0; } }

.kt-container { width: 100%; max-width: var(--maxw-wide); margin-inline: auto; padding-inline: var(--space-5); }
@media (min-width: 768px) { .kt-container { padding-inline: var(--space-6); } }

.kt-grid { display: grid; gap: var(--space-5); }

/* ── Card ──────────────────────────────────────────────── */
.kt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  /* Grid/flex children with nowrap text otherwise blow out the column. */
  min-width: 0;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.kt-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.kt-card-lg { padding: var(--space-6); border-radius: var(--r-xl); }
.kt-card-xl { padding: var(--space-7); border-radius: var(--r-2xl); }

.kt-card-ink {
  background: var(--surface-ink);
  color: var(--text-inv);
  border: 1px solid var(--border-ink);
}
.kt-card-ink:hover { border-color: rgba(255,255,255,0.18); }

.kt-card-accent {
  background: var(--accent);
  color: var(--text-on-accent);
  border: 1px solid transparent;
}
.kt-card-accent:hover {
  box-shadow: var(--shadow-yellow);
  transform: translateY(-2px);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-base);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-yellow);
}
.btn-ink {
  background: var(--surface-ink);
  color: var(--text-inv);
}
.btn-ink:hover { background: var(--surface-ink-2); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--text); }

.btn-sm { padding: 8px 14px; font-size: var(--fs-mono); letter-spacing: 0.06em; }
.btn-lg { padding: 16px 28px; font-size: var(--fs-base); }

/* ── Pill / badge ──────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pill-accent { background: var(--accent-soft); border-color: rgba(255,204,0,0.32); color: var(--text); }
.pill-ink { background: var(--surface-ink); color: var(--text-inv); border-color: transparent; }
.pill-live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22,163,74,0.16);
  animation: pulse-live 2s ease-in-out infinite;
}
@keyframes pulse-live { 50% { box-shadow: 0 0 0 6px rgba(22,163,74,0.06); } }

/* ── Stat ──────────────────────────────────────────────── */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.stat-num {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-num-sm { font-size: var(--fs-2xl); }
.stat-label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

/* ── Form field ───────────────────────────────────────── */
.field-label { display: block; font-family: var(--font-mono); font-size: var(--fs-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); margin-bottom: 8px; }
.field-input,
input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:hover, select:hover, textarea:hover { border-color: var(--text-dim); }
input:focus, select:focus, textarea:focus, .field-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ── Bar (progress / telemetry) ───────────────────────── */
.bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--text);
  border-radius: 999px;
  transition: width 600ms var(--ease-out);
}
.bar-accent > span { background: var(--accent); }

/* ── Tab nav (admin) ──────────────────────────────────── */
.tabs {
  display: inline-flex;
  background: var(--bg-2);
  padding: 4px;
  border-radius: var(--r-pill);
  gap: 2px;
}
.tab {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
  cursor: pointer;
  border: 0;
  background: transparent;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--surface-ink);
  color: var(--text-inv);
}

/* ── Section header ───────────────────────────────────── */
.section-head { display: grid; gap: var(--space-3); margin-bottom: var(--space-7); max-width: var(--maxw-content); }
.section-head .eyebrow { color: var(--text-dim); }

/* ── Reveal on scroll ─────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); }
.reveal.in  { opacity: 1; transform: none; }

/* ── Live ticker ──────────────────────────────────────── */
.ticker {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: var(--bg);
}
.ticker-track {
  display: inline-flex;
  gap: 48px;
  animation: ticker-scroll 60s linear infinite;
  padding-block: var(--space-3);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Top-of-page hairline ─────────────────────────────── */
.hairline { height: 1px; background: var(--border); }

/* ── Lists with row dividers (services, news) ────────── */
.kt-list { display: flex; flex-direction: column; }
.kt-list > * + * { border-top: 1px solid var(--border); }

.kt-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  transition: background-color var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.kt-list-item:hover { background: var(--bg); }
.kt-list-item .arrow { color: var(--text-dim); transition: transform var(--t-fast), color var(--t-fast); }
.kt-list-item:hover .arrow { transform: translateX(4px); color: var(--text); }

/* Icon square */
.kt-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--bg-2);
  font-size: 20px;
  flex-shrink: 0;
}
.kt-icon-accent { background: var(--accent); color: var(--text-on-accent); }

/* FAQ */
.kt-faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  transition: border-color var(--t-base);
}
.kt-faq[open] { border-color: var(--text-dim); }
.kt-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  cursor: pointer; list-style: none;
  font-weight: 600; font-size: var(--fs-md); color: var(--text);
}
.kt-faq summary::-webkit-details-marker { display: none; }
.kt-faq-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  font-size: 18px;
  transition: transform var(--t-fast), background-color var(--t-fast);
  flex-shrink: 0;
}
.kt-faq[open] .kt-faq-icon { transform: rotate(45deg); background: var(--accent); color: var(--text-on-accent); }
.kt-faq-body { margin-top: var(--space-3); color: var(--text-muted); line-height: 1.6; }

/* Chip / filter */
.chip {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.active { background: var(--surface-ink); color: var(--text-inv); border-color: transparent; }

/* News-specific */
.lang-badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  color: var(--text-muted);
  text-transform: uppercase;
}
.lang-badge.active { background: var(--accent); color: var(--text-on-accent); }
.hot-tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--text-on-accent);
}

/* Topnav */
.kt-topnav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250,247,242,0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.kt-topnav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  padding: var(--space-3) 0;
}
.kt-topnav-links { display: none; gap: var(--space-5); }
@media (min-width: 768px) { .kt-topnav-links { display: flex; } }
.kt-topnav-links a {
  font-size: var(--fs-sm); color: var(--text-muted); transition: color var(--t-fast);
}
.kt-topnav-links a:hover { color: var(--text); }
.kt-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; letter-spacing: -0.04em; font-size: var(--fs-md); }
.kt-brand-spark { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* Hover spotlight on cards */
.kt-spotlight { position: relative; overflow: hidden; }
.kt-spotlight::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--px,50%) var(--py,50%), var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity var(--t-base);
}
.kt-spotlight:hover::before { opacity: 1; }

/* Hide on mobile / desktop */
.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: initial; } .hide-md { display: none; } }
