:root{
  --bg:#0b1220;
  --panel:#0f172a;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --line:rgba(148,163,184,.18);
  --card:rgba(15,23,42,.60);

  --brand:#e5e7eb;
  --accent:#2563eb;

  --shadow: 0 16px 44px rgba(2,6,23,.35);
  --radius: 16px;

  --nav-h: 72px;
}

*{box-sizing:border-box}
html{
  scroll-behavior:smooth;
  scroll-padding-top: var(--nav-h); /* чтобы якоря не прятались под navbar */
}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
  position: relative;
  overflow-x:hidden;
}

/* global hero-like vignette background */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 50% 0%, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(900px 500px at 15% 85%, rgba(37,99,235,.08), transparent 60%),
    linear-gradient(180deg, rgba(11,18,32,.92), rgba(11,18,32,.86));
  pointer-events:none;
  z-index:-1;
}

a{color:inherit;text-decoration:none}
.container{max-width:1120px;margin:0 auto;padding:0 18px}
.section{
  min-height: calc(100vh - var(--nav-h));
  padding: 48px 0;
  display: flex;
  align-items: center;
}

.section[id]{
  scroll-margin-top: var(--nav-h);
}

/* чтобы контейнер всегда занимал ширину и красиво центровался */
.section > .container{
  width: 100%;
}
.section-head{margin-bottom:22px}

.h1{font-size:46px;line-height:1.08;margin:12px 0 12px}
.h2{font-size:30px;margin:0 0 8px}
.h3{font-size:18px;margin:0 0 10px}

.lead{font-size:18px;color:var(--muted);max-width:62ch}
.muted{color:var(--muted)}
.small{font-size:13px}

/* cards / glass panels */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
  backdrop-filter: blur(8px);
}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  gap:10px;
  padding:12px 16px;
  border-radius:12px;
  border:1px solid var(--line);
  font-weight:700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.btn.primary{
  background:var(--accent);
  color:#fff;
  border-color:transparent;
  box-shadow: 0 12px 26px rgba(37,99,235,.25);
}
.btn.primary:hover{filter:brightness(.96); transform: translateY(-1px);}

.btn.ghost{
  background: rgba(255,255,255,.06);
  border-color: rgba(226,232,240,.20);
  color: #e5e7eb;
}
.btn.ghost:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(226,232,240,.28);
  transform: translateY(-1px);
}

/* Navbar */
/* Navbar (light) */
.nav-wrap{
  position: sticky;
  top: 0;
  z-index: 50;

  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);

  border-bottom: 1px solid rgba(226,232,240,.8);
  transition: box-shadow .25s ease, background .25s ease;
  padding: 0 24px;
}

.nav-wrap.scrolling{
  background: rgba(255,255,255,.96);
  box-shadow: 0 6px 20px rgba(2,6,23,.08);
}

.nav{
  display:flex;align-items:center;justify-content:space-between;
  height:72px;
}

.brand{display:flex;align-items:center;text-decoration:none}
.brand-logo{height:36px;width:auto;display:block}

/* if you still use placeholder */
.brand-mark{
  width:180px;height:36px;border-radius:10px;
  background: linear-gradient(135deg, rgba(96,165,250,.65), rgba(37,99,235,.18));
  border:1px solid rgba(226,232,240,.20);
}

.nav-links{display:flex;align-items:center;gap:18px}
.nav-links a{
  font-weight: 700;
  color: #334155;
}

.nav-links a:hover{
  color: #0f172a;
}

/* Language switch (navbar) */
.lang{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;            /* лёгкая подложка */
  border-radius: 999px;
}

.lang-btn{
  appearance: none;
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: #64748b;                 /* muted */
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.lang-btn:hover{
  color: #0f172a;
}

.lang-btn.active{
  background: #ffffff;            /* активная “табка” */
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(2,6,23,.08);
}

.burger{
  display:none;
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid #e2e8f0;
  background:#fff;
  cursor:pointer;
}

.burger span{
  display:block;
  height:2px;
  background:#0f172a;
  margin:6px 10px;
  border-radius:2px;
}

/* Mobile menu */
.nav-mobile{display:none;}
.nav-mobile:not([hidden]){
  display:flex;
  flex-direction:column;
  gap:10px;
  border-top:1px solid #e2e8f0;
  padding:12px 18px;
  background:#fff;
}
.nav-mobile[hidden]{display:none !important;}
.nav-mobile a{
  font-weight:800;
  color:#475569;
}

.nav-mobile a:hover{
  color:#0f172a;
}
.mobile-lang{margin-top:6px}

/* ===== HERO: full-width matrix background + content overlay ===== */
.hero{
  position: relative;
  overflow: hidden;
  background: transparent;

  min-height: calc(100vh - var(--nav-h));
  padding: 0;               /* секция уже центрится через .section */
  display: flex;
  align-items: center;
}

.hero-content{
  position: relative;
  z-index:2;
  max-width: 760px;
  padding: 48px 0;
}

.hero-bg{
  position:absolute;
  inset:0;
  z-index:0;
}
.hero-bg canvas{width:100%;height:100%;display:block}

/* readability overlay so text is always readable */
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background: linear-gradient(
    90deg,
    rgba(11,18,32,.92) 0%,
    rgba(11,18,32,.72) 45%,
    rgba(11,18,32,.35) 70%,
    rgba(11,18,32,.08) 100%
  );
}

.hero-content{
  position: relative;
  z-index:2;
  max-width: 760px;
}

.hero h1{
  margin:0 0 16px;
  font-size: clamp(42px, 5.2vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color:#f8fafc;
}
.hero h1 .accent {
  color: #60a5fa;
}

.hero .lead{
  color: rgba(226,232,240,.82);
  font-size: 18px;
  line-height: 1.65;
  max-width: 62ch;
}

.hero-cta{
  display:flex;
  gap:12px;
  margin-top:18px;
  flex-wrap:wrap;
}

/* ===== ABOUT split (clean + aligned like Hero) ===== */

#about{
  position:relative;
  padding-top: 56px;
  padding-bottom: 56px;
}

/* лёгкий верхний переход, чтобы секции не "резались" */
#about::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height:120px;
  background: linear-gradient(
    180deg,
    rgba(11,18,32,.55) 0%,
    rgba(11,18,32,.25) 45%,
    rgba(11,18,32,0) 100%
  );
  pointer-events:none;
}

.about-split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}

/* LEFT */
.about-left .section-head{
  margin-bottom: 16px;
}

.about-left .card{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: 0 12px 30px rgba(2,6,23,.28);
}

.bullets{
  margin:12px 0 0;
  padding-left:18px;
  color: rgba(226,232,240,.82);
}
.bullets li{ margin:6px 0; }

/* RIGHT panel */
.about-right{
  position: relative;
  overflow:hidden;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.14);
  background:
    radial-gradient(900px 420px at 70% 20%, rgba(37,99,235,.16), transparent 60%),
    linear-gradient(180deg, rgba(11,18,32,.92), rgba(10,16,32,.92));
  box-shadow: 0 12px 30px rgba(2,6,23,.28);
}

/* full-bleed вправо, но без ломания сетки */
.about-right::after{
  content:"";
  position:absolute;
  top:-1px;
  bottom:-1px;
  right:-2000px;
  width:2000px;
  background: inherit;
  border-top: 1px solid rgba(148,163,184,.10);
  border-bottom: 1px solid rgba(148,163,184,.10);
  pointer-events:none;
}

/* чтобы "inherit" выглядел одинаково */
.about-right::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 420px at 70% 20%, rgba(37,99,235,.16), transparent 60%),
    linear-gradient(180deg, rgba(11,18,32,.92), rgba(10,16,32,.92));
  z-index:0;
}

.about-right-inner{
  position: relative;
  z-index: 1;
  width:100%;
  padding: 26px 28px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.about-cards{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.mini-card{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
}

.mini-title{
  font-weight: 900;
  color:#f8fafc;
}
.mini-desc{
  margin-top:6px;
  color: rgba(226,232,240,.80);
  line-height: 1.45;
}
.about-note{
  margin-top: 14px;
  color: rgba(226,232,240,.70);
}

/* Responsive */
@media (max-width: 980px){
  .about-split{ grid-template-columns: 1fr; }
  .about-right::after{ display:none; } /* на мобиле full-bleed не нужен */
  .about-cards{ grid-template-columns: 1fr; }
}

/* ===== Projects Carousel ===== */
.carousel{position:relative}
.car-track{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns: minmax(240px, 1fr);
  gap:14px;
  overflow:auto;
  scroll-snap-type:x mandatory;
  padding:6px 44px;
}
.project{scroll-snap-align:start}
.project-tag{
  display:inline-flex;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.18);
  font-size:12px;
  color:rgba(226,232,240,.78);
  margin-bottom:10px;
  background: rgba(255,255,255,.06);
}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.chip{
  font-size:12px;
  border:1px solid rgba(148,163,184,.18);
  padding:4px 8px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  color:rgba(226,232,240,.78);
}

.car-btn{
  position:absolute;top:50%;transform:translateY(-50%);
  width:38px;height:38px;border-radius:12px;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.65);
  color:#e5e7eb;
  cursor:pointer;font-size:22px;line-height:1;
}
.car-btn.prev{left:0}
.car-btn.next{right:0}
.car-btn:hover{background: rgba(15,23,42,.85)}

/* ===== Contact ===== */
.contact-grid{
  display:grid;
  grid-template-columns: 1fr;     /* одна колонка */
  gap:18px;
  justify-items:center;          /* центрируем карточку */
}

.contact-card{
  width: min(720px, 100%);       /* аккуратная ширина как ты хотел */
}

.form{display:flex;flex-direction:column;gap:12px}

/* ВОТ ЭТО — КЛЮЧЕВО, чтобы не “уезжало” в одну строку */
label{display:block}

label span{display:block;font-weight:800;margin-bottom:6px;color:#e5e7eb}

input,textarea{
  width:100%;
  border:1px solid rgba(148,163,184,.18);
  border-radius:12px;
  padding:12px;
  font-size:15px;
  background: rgba(255,255,255,.08);
  color:#f8fafc;
  outline:none;
}
textarea{min-height:140px}

input::placeholder, textarea::placeholder{color:rgba(226,232,240,.55)}
input:focus,textarea:focus{
  border-color: rgba(96,165,250,.55);
  box-shadow:0 0 0 4px rgba(59,130,246,.18)
}

.hp{display:none !important}

/* ===== Footer ===== */
.footer{
  border-top:1px solid rgba(148,163,184,.14);
  padding:26px 0;
  background: rgba(15,23,42,.60);
  backdrop-filter: blur(8px);
}
.footer-grid{
  display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;
}
.footer-brand{font-weight:900;color:#f8fafc;letter-spacing:.2px}
.footer-link{font-weight:900;color:#60a5fa}
.footer-link:hover{text-decoration:underline}

.footer-legal{
  margin-top:6px;
  font-size:13px;
  color:rgba(226,232,240,.75);
  line-height:1.5;
}

.footer-legal div{
  white-space:nowrap;
}

.footer-year{
  margin-top:4px;
  color:rgba(226,232,240,.55);
  font-weight:700;
}

.footer-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .section{padding:64px 0}
  .hero{padding:74px 0 58px; min-height: 72vh;}
  .lead{max-width: 100%;}
  .about-split{grid-template-columns: 1fr;}
  .about-right-inner{padding: 22px 24px;}
  .about-cards{grid-template-columns: 1fr;}
  .contact-grid{grid-template-columns: 1fr;}
}

@media (max-width: 820px){
  .nav-links{display:none}
  .burger{display:block}
  .nav-wrap{padding:0 16px;}
}

/* ===== Toast ===== */
.toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  width: min(420px, calc(100% - 36px));
  transform: translateY(16px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show{
  opacity: 1;
  transform: translateY(0);
}

.toast-inner{
  position: relative;
  background: rgba(15,23,42,.92);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(2,6,23,.45);
  backdrop-filter: blur(10px);
  padding: 18px 18px 16px 18px;
}

/* крестик */
.toast-close{
  position: absolute;
  top: 10px;
  right: 10px;

  width: 30px;
  height: 30px;
  border-radius: 8px;

  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.06);
  color: rgba(226,232,240,.9);

  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.toast-close:hover{
  background: rgba(255,255,255,.12);
}

.toast-title{
  font-weight: 900;
  color: #f8fafc;
}

.toast-text{
  grid-column: 1 / -1;
  color: rgba(226,232,240,.82);
  line-height: 1.45;
  margin-top: -4px;
}

.toast-close{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.06);
  color: rgba(226,232,240,.9);
  cursor: pointer;
}

.toast.ok .toast-inner{
  border-color: rgba(34,197,94,.35);
}

.toast.bad .toast-inner{
  border-color: rgba(239,68,68,.35);
}