/* =========================================================================
   Konotop IT Cluster — Base / Reset / Nav / Sections / Footer
   Ported from the index.html prototype. Mobile-first.
   Prototype breakpoints preserved: 700px (container), 800/900px (layout).
   Depends on design-tokens.css.
   ========================================================================= */

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; overflow-x: hidden; line-height: 1.6; transition: background var(--transition), color var(--transition); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; cursor: pointer; }
img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
input, textarea, select, button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

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

ul[role="list"] { list-style: none; padding: 0; }

/* ---- Shared text helpers ------------------------------------------------- */
.mono { font-family: var(--font-mono); letter-spacing: 0; }
.serif { font-family: var(--font-display); font-style: italic; font-weight: 400; }
.caps { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 500; }
/* Cyrillic reads tighter than Latin — cap tracking at ~0.08–0.10em when the
   document (or a block) is Ukrainian. */
[lang="uk"] .caps, .caps[lang="uk"] { letter-spacing: .08em; }
.text-muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ---- Container ----------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}
@media (max-width: 700px) { .container { padding-inline: var(--pad-mobile); } }

/* ---- Accessibility ------------------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--bg);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono); font-size: 12px;
}
.skip-link:focus { left: 0; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* =========================================================================
   NAV
   ========================================================================= */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--rule-2);
}
.nav-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; height: 64px; gap: 32px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { color: inherit; }
.brand-mark { width: auto; height: 30px; flex-shrink: 0; }
.brand-name { font-family: var(--font-sans); font-weight: 600; font-size: 14px; letter-spacing: -.005em; line-height: 1; }
.brand-name b { font-weight: 600; }
.brand-sub { display: block; font-family: var(--font-mono); font-size: 9px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; line-height: 1; margin-top: 3px; }

.nav-links { display: flex; gap: 26px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.nav-link { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 6px 2px; position: relative; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after,
.nav-links .current-menu-item > .nav-link::after,
.nav-links .current_page_item > .nav-link::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 14px; }

/* Language switch (Polylang) */
.lang { display: flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--muted); list-style: none; margin: 0; padding: 0; }
.lang a, .lang span { color: inherit; }
.lang .current-lang a, .lang .current-lang span, .lang a:hover { color: var(--ink); }

/* Icon buttons: theme toggle + mobile nav toggle */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink);
  border-radius: var(--radius-pill);
  transition: border-color var(--transition);
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: inline-grid; }

/* Mobile nav: the floating bottom bar owns primary nav + the Join CTA, so the
   top bar only needs logo + language + theme + burger (full menu). Drop the
   tagline and the top Join button so nothing overflows on a phone. */
@media (max-width: 900px) {
	.nav-right > .btn { display: none; } /* Join lives in the bottom tab bar */
}
@media (max-width: 700px) {
	.nav-inner { gap: 12px; }
	.brand-name { white-space: nowrap; }
	.brand-sub { display: none; }
	.nav-right { gap: 8px; }
}
@media (max-width: 360px) {
	.lang { display: none; } /* tightest phones; language still reachable in the menu */
}

/* ---- Buttons (pill) ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  transition: transform .15s ease, background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:hover { transform: translateY(-1px); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.outline-accent { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-big {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 28px; border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 500; border: 0;
  background: var(--accent-2); color: var(--accent-2-ink);
  transition: transform .15s ease;
}
.btn-big:hover { transform: translateY(-2px); }
.btn-big.outline { background: transparent; border: 1px solid rgba(255, 255, 255, .3); color: inherit; } /* takes the dark band's light text in both themes */

/* =========================================================================
   TICKER
   ========================================================================= */
.ticker { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 14px 0; overflow: hidden; background: var(--bg-2); }
.ticker-track { display: flex; gap: 56px; white-space: nowrap; width: max-content; animation: roll 40s linear infinite; }
.ticker-track span { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 14px; }
.ticker-track span::before { content: "✦"; color: var(--accent); }
@keyframes roll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* =========================================================================
   SECTION FRAMEWORK
   ========================================================================= */
section.section { padding: 100px 0; position: relative; }
.section--alt { background: var(--bg-2); }

.section-head { display: grid; grid-template-columns: 80px 1fr auto; gap: 32px; align-items: baseline; padding-bottom: 28px; margin-bottom: 56px; border-bottom: 1px solid var(--rule); }
.section-num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.section-title { font-family: var(--font-sans); font-weight: 500; font-size: clamp(34px, 5vw, 64px); line-height: 1; letter-spacing: -.035em; margin: 0; text-wrap: balance; }
.section-title em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--accent); }
.section-sub { color: var(--muted); font-size: 13px; max-width: 280px; text-align: right; }
@media (max-width: 800px) {
  section.section { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; gap: 8px; margin-bottom: 36px; }
  .section-sub { text-align: left; }
}

.section-foot { margin-top: 40px; display: flex; justify-content: center; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer { padding: 60px 0 36px; border-top: 1px solid var(--rule); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-col h5 { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 18px; font-weight: 500; }
.foot-col a { display: block; padding: 6px 0; font-size: 14px; color: var(--ink-2); }
.foot-col a:hover { color: var(--accent); }
.foot-menu { list-style: none; margin: 0; padding: 0; }
.foot-brand { font-family: var(--font-display); font-style: italic; font-size: 56px; line-height: 1; letter-spacing: -.02em; margin: 0 0 20px; }
.foot-brand em { color: var(--accent); font-style: italic; }
.foot-about { max-width: 280px; line-height: 1.5; letter-spacing: .1em; color: var(--muted); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 28px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.foot-bottom a:hover { color: var(--ink); }

/* =========================================================================
   HEX BACKGROUND MESH (decorative; ≤ 12% opacity per brand rules)
   ========================================================================= */
.hex-canvas { position: absolute; inset: 0; pointer-events: none; opacity: .9; color: var(--ink); z-index: 0; }

/* ---- Utilities ----------------------------------------------------------- */
.row { display: flex; align-items: center; gap: 14px; }
.between { justify-content: space-between; }
.flow > * + * { margin-top: var(--space-4); }
.center { text-align: center; }
.is-hidden { display: none !important; }
