/* === THEME: solid black everywhere === */
:root {
  --bg: #000;          /* Background always black */
  --e1: #0e0e14;       /* Card top */
  --e2: #12121c;       /* Card bottom */
  --e3: #1a1a29;       /* Inputs */
  --txt: #e6e6f0;      /* Text */
  --mut: #9aa0b4;      /* Secondary */
  --ttl: #fff;         /* Titles */
  --border: rgba(255,255,255,.10);
  --glass: rgba(255,255,255,.06);
  --a1: #96a3ff;       /* Accent 1 */
  --a2: #e4a7ff;       /* Accent 2 */
  --a3: #86ffd2;       /* Accent 3 */
  --shadow: 0 14px 40px rgba(0,0,0,.55);
  --r: 20px;           /* Radius */
  --w: clamp(260px, 92vw, 1160px);
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body.page {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 16px/1.6 Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 20px; }

/* Navigation */
.nav {
  margin-bottom: 32px;
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 74px; background: rgba(0,0,0,.7); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav nav { display: flex; align-items: center; gap: 20px; }
.brand { font-weight: 900; font-size: 22px; letter-spacing: .5px; }
.navlink { padding: 6px 10px; border-radius: 10px; color: var(--txt); transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.navlink:hover, .navlink:focus-visible, .navlink[aria-current="page"] { background: #fff; color: #000; box-shadow: 0 0 0 6px rgba(255,255,255,.12); }
/* Extra spacing before the Contact button */
.nav-cta { margin-left: 12px; }


/* Buttons */
.btn { display: inline-block; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(150,163,255,.18), rgba(228,167,255,.14)); transition: transform .2s ease, box-shadow .2s ease, background-color .15s ease, color .15s ease; }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(255,255,255,.12); background: #fff; color: #000; }
.btn.primary { background: linear-gradient(135deg, var(--a1), var(--a2)); color: #000; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 8px 12px; font-size: 14px; }

/* Cards & Sections */
.card { background: linear-gradient(180deg, var(--e2), var(--e1)); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 10px 0 20px; }
.section h2 { font-size: 28px; margin: 0; color: var(--ttl); }

/* Hero */
.hero { display: grid; grid-template-columns: 160px 1fr; gap: 28px; padding: 28px; }
.avatar { width: 160px; height: 160px; border-radius: var(--r); object-fit: cover; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.hero-text h1 { font-size: 46px; margin: 2px 0 8px; color: var(--ttl); }
.grad { background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 20px; margin: 0 0 6px; }
.sub { color: var(--mut); margin: 0 0 14px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-spaced { margin-top: 22px; } /* Extra space below name block */

/* Grids */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.mini h3 { margin: 0 0 6px; font-size: 22px; }
.mini p { margin: 0; color: var(--mut); }

/* Projects (shared base) */
.masonry { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.tile { padding: 22px; grid-column: span 6; }
.tile:nth-child(3n) { grid-column: span 7; }
.tile:nth-child(2n) { grid-column: span 5; }
.tile h3 { margin: 2px 0 8px; color: var(--ttl); }
.tile p { margin: 0 0 10px; color: var(--mut); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .5px; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--glass); margin-bottom: 8px; }
.pill { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #fff; color: #000; margin-left: 6px; }
.meta { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 10px; }
.meta li { font: 12px/1.2 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; opacity: .9; }

/* Articles list in Projects */
.list { display: flex; flex-direction: column; gap: 14px; }
.row { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 18px; padding: 14px 18px; }
.row .mono { font: 12px/1.2 "JetBrains Mono", ui-monospace; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; padding: 22px; }
.contact label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.contact input, .contact textarea { background: var(--e3); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--txt); }
.contact button { align-self: end; }

/* Footer + Socials */
.footer { padding: 40px 0 80px; color: var(--mut); text-align: center; border-top: 1px solid var(--border); }
.socials { display: flex; gap: 12px; justify-content: center; margin-bottom: 10px; }
.social { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--glass); transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.social:hover, .social:focus-visible { color: #000; background: #fff; box-shadow: 0 0 0 6px rgba(255,255,255,.14); }

/* Certificate grid and lightbox */
.muted { color: var(--mut); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.cert { display: flex; flex-direction: column; gap: 8px; background: var(--e1); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.cert img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; }
.cert span { font-size: 14px; color: var(--txt); }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }

/* Responsive */
@media (max-width: 900px) {
  .grid3, .grid2 { grid-template-columns: 1fr; }
  .masonry { grid-template-columns: 1fr; }
  .tile { grid-column: span 1; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .avatar { margin: 0 auto; }
  .contact { grid-template-columns: 1fr; }
}

/* A11y */
:focus { outline: 2px solid var(--a3); outline-offset: 4px; }
a { text-decoration: none; color: inherit; }


/* Spacing tweaks */
.hero{margin-bottom:60px}
.grid3{margin-top:20px}


/* Contact stacked layout (always vertical) */
.contact--stack { 
  grid-template-columns: 1fr; 
  gap: 14px; 
}
.contact--stack label { 
  font-weight: 600; 
}
.contact--stack input, 
.contact--stack textarea {
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, var(--e3), #0b0b0f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.contact--stack textarea { min-height: 140px; resize: vertical; }


/* Nav button sizing */
.nav .btn { padding: 10px 16px; font-size: 14px; line-height: 1; }


/* Project thumbnails */
.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: #0b0b10;
}


/* Full-bleed section helper */
.fullbleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.fullbleed .inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 20px;
}


/* --- About band refinements --- */
.fullbleed { overflow: hidden; } /* avoid horizontal shift on some browsers */

.about-band { padding: 40px 0; } /* top+bottom spacing */

.about-wrap {
  max-width: var(--w);          /* center the inner card */
  margin: 28px auto;            /* centered horizontally */
  padding: 32px;                /* a bit more air */
}

.about-head { text-align: center; padding: 4px 0 12px; }

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* responsive columns */
  gap: 22px;
  justify-items: stretch;   /* stretch cards evenly */
  align-items: stretch;
}


/* === ABOUT: 2 бокса, чистое дно === */
.about-inline{background:none;padding-top:40px;padding-bottom:20px}
.about-inner{max-width:var(--w);margin:0 auto;padding:32px;background:linear-gradient(180deg,var(--e2),var(--e1));border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow)}
.about-inner h2{font-size:2rem;margin-bottom:10px;margin-top:10px;color:var(--ttl)}
.about-sub{font-size:1.05rem;color:var(--mut);margin-bottom:24px}
.about-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px;align-items:stretch}
.about-col{background:transparent;border:0;padding:0;height:100%}
.about-col+.about-col{border-left:1px solid var(--border);padding-left:28px}
.about-col h3{margin-top:0;color:var(--ttl)}
.about-col ul{margin:8px 0 0;padding-left:20px;color:var(--txt)}
.about-col li{margin:6px 0}
