/* ===============================
   THEME VARIABLES (DARK DEFAULT)
   =============================== */
:root{
  --max: 1200px;

  --page: #0b1220;
  --surface: rgba(15, 23, 42, 0.75);

  --text: #e5e7eb;
  --muted: #a7b0c0;

  --border: rgba(255,255,255,0.12);
  --shadow: 0 18px 55px rgba(0,0,0,0.35);

  --accent: #7c3aed;
  --accent2: #22d3ee;

  /* buttons */
  --btn-bg: rgba(255,255,255,0.05);
  --btn-bg-hover: rgba(255,255,255,0.08);

  /* active language button (IMPORTANT) */
  --lang-active-bg: rgba(255,255,255,0.16);
  --lang-active-text: #ffffff;
}

/* ===============================
   LIGHT THEME OVERRIDES
   =============================== */
body.light{
  --page: #f8fafc;
  --surface: rgba(255,255,255,0.85);

  --text: #0f172a;
  --muted: #475569;

  --border: rgba(15,23,42,0.15);
  --shadow: 0 12px 40px rgba(0,0,0,0.12);

  --accent: #2563eb;
  --accent2: #06b6d4;

  --btn-bg: rgba(15,23,42,0.04);
  --btn-bg-hover: rgba(15,23,42,0.08);

  /* active language button in light theme */
  --lang-active-bg: rgba(37,99,235,0.14);
  --lang-active-text: #0f172a;
}

/* ================= BASE ================= */
*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 15% 0%, rgba(124,58,237,0.22), transparent 55%),
    radial-gradient(900px 520px at 85% 0%, rgba(34,211,238,0.18), transparent 55%),
    var(--page);
}

body.light{
  background:
    radial-gradient(900px 520px at 15% 0%, rgba(37,99,235,0.15), transparent 55%),
    radial-gradient(900px 520px at 85% 0%, rgba(6,182,212,0.15), transparent 55%),
    var(--page);
}

a{
  color: #c4b5fd;
  text-decoration: none;
}
body.light a{
  color: var(--accent);
}
a:hover{ text-decoration: underline; }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ================= HEADER ================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.nav{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a{
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--muted);
}

.nav a:hover{
  background: rgba(124,58,237,0.14);
  color: var(--text);
  text-decoration: none;
}

/* right side buttons */
.lang{
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-btn,
.theme-btn{
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.lang-btn:hover,
.theme-btn:hover{
  background: var(--btn-bg-hover);
}

/* ✅ FIX: active language button uses dedicated variables */
.lang-btn.active{
  background: var(--lang-active-bg);
  color: var(--lang-active-text);
  border-color: transparent;
}

/* ================= MAIN ================= */
main{
  padding: 24px 0 60px;
}

.hero h1{
  margin: 0 0 6px;
  font-size: 40px;
  letter-spacing: -0.8px;
}

.subtitle{
  margin: 0 0 10px;
  color: var(--muted);
}

.summary{
  max-width: 75ch;
  color: var(--muted);
}

/* ================= BUTTONS (hero) ================= */
.buttons{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn{
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  font-weight: 700;
  color: var(--text);
}

.btn:hover{
  background: var(--btn-bg-hover);
  text-decoration: none;
}

.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: white;
}

/* ================= SECTIONS ================= */
.block{
  margin-top: 28px;
}

.list{
  margin: 10px 0 0;
  padding-left: 18px;
}

/* ================= CARDS ================= */
.cards,
.project-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.card,
.project-card{
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px;
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow);
}

body.light .card,
body.light .project-card{
  background: rgba(255,255,255,0.70);
}

.card h2,
.project-title{
  margin: 0 0 8px;
  font-size: 18px;
}

.meta{
  font-size: 13px;
  color: var(--muted);
}

.project-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-text{
  margin: 10px 0;
  max-width: 75ch;
}

.project-subtitle{
  margin: 12px 0 6px;
  font-size: 14px;
  color: var(--muted);
}

.badge{
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
}

body.light .badge{
  background: rgba(15,23,42,0.04);
}

/* ================= FOOTER ================= */
.site-footer{
  margin-top: 80px; /* линия ниже контента */
  padding: 14px 0 24px;
  border-top: 1px solid var(--border);
  background: transparent;
}

.footer-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.dot{ opacity: 0.6; }

/* ================= MOBILE ================= */
@media (max-width: 600px){
  .hero h1{ font-size: 32px; }
}
