/* =========================================================
   Винтик — portfolio
   Monochrome / graphite minimalist theme
   ========================================================= */

:root {
  /* surfaces */
  --bg:        #0a0a0b;
  --bg-2:      #0e0e10;
  --surface:   #141416;
  --surface-2: #1a1a1d;
  --border:    rgba(255, 255, 255, 0.08);
  --border-2:  rgba(255, 255, 255, 0.14);

  /* text */
  --text:      #f4f4f5;
  --text-2:    #a1a1aa;
  --text-3:    #6b6b73;

  /* accent — silver/graphite instead of color */
  --accent:      #e6e6e9;
  --accent-soft: #c8c8ce;
  --accent-glow: rgba(220, 220, 228, 0.35);

  /* misc */
  --radius:   16px;
  --radius-s: 10px;
  --maxw:     1160px;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: default;
}

a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }

::selection { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26262a; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34343a; }

/* =========================================================
   ANIMATED BACKGROUND
   ========================================================= */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
  animation: gridDrift 24s linear infinite;
}
@keyframes gridDrift { to { background-position: 46px 46px; } }

.bg-glow {
  position: fixed; z-index: -2;
  top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 700px;
  background: radial-gradient(circle, rgba(180,180,190,0.10) 0%, transparent 60%);
  filter: blur(30px);
  animation: floatGlow 12s ease-in-out infinite alternate;
}
@keyframes floatGlow { to { transform: translateX(-50%) translateY(40px) scale(1.1); } }

.cursor-glow {
  position: fixed; z-index: -1;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,200,210,0.06) 0%, transparent 65%);
  pointer-events: none; transform: translate(-50%, -50%);
  transition: opacity .4s; opacity: 0;
  will-change: left, top;
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s var(--ease), border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 24px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.nav__brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 8px; font-family: var(--mono); font-size: 15px;
  box-shadow: 0 0 14px rgba(230,230,235,0.12) inset;
}
.nav__brand-text { font-size: 17px; }

.nav__links { display: flex; gap: 26px; margin: 0 auto; }
.nav__links a {
  font-size: 14px; color: var(--text-2); font-weight: 500;
  position: relative; padding: 4px 0; transition: color .25s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }
.nav__links a.active { color: var(--text); }

.nav__meta { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.nav__date { white-space: nowrap; }
.nav__sep { color: var(--text-3); }
.nav__clock { color: var(--text); min-width: 66px; }
.nav__lang {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 5px 10px; border-radius: 20px;
  font-family: var(--mono); font-size: 12px; transition: border-color .25s, background .25s;
}
.nav__lang:hover { border-color: var(--border-2); background: var(--surface-2); }
.nav__lang .dot { width: 6px; height: 6px; border-radius: 50%; background: #7ee29b; box-shadow: 0 0 8px #7ee29b; }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s var(--ease); }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--radius-s);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-2); transition: .3s var(--ease);
  position: relative; overflow: hidden;
}
.btn .ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--accent); color: #0a0a0b; border-color: var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--accent-glow); }
.btn--ghost { background: var(--surface); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-2); transform: translateY(-2px); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 24px 80px; position: relative;
}
.hero__inner { max-width: 860px; }
.hero__eyebrow {
  font-family: var(--mono); font-size: 13px; color: var(--text-2);
  letter-spacing: .04em; margin-bottom: 22px;
}
.hero__title { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; }
.hero__name {
  background: linear-gradient(135deg, #ffffff 0%, #b6b6bf 55%, #7d7d86 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px var(--accent-glow);
  position: relative;
}
.hero__sub {
  font-size: clamp(1rem, 2vw, 1.18rem); color: var(--text-2);
  max-width: 640px; margin: 26px auto 0;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 38px; }

.hero__stats { display: flex; gap: 44px; justify-content: center; margin-top: 60px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat__num { font-size: 2rem; font-weight: 800; font-family: var(--mono); letter-spacing: -.02em; }
.stat__label { font-size: 12.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

.hero__scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border-2); border-radius: 20px;
  display: flex; justify-content: center; padding-top: 8px;
}
.hero__scroll span { width: 4px; height: 8px; background: var(--text-2); border-radius: 4px; animation: scrollDot 1.6s ease-in-out infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(-4px);} 50%{opacity:1;} 100%{opacity:0; transform: translateY(10px);} }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { max-width: var(--maxw); margin: 0 auto; padding: 110px 24px; }
.section--alt { max-width: 100%; background: var(--bg-2); border-block: 1px solid var(--border); }
.section--alt > * { max-width: var(--maxw); margin-inline: auto; }
.section__head { max-width: 640px; margin-bottom: 48px; }
.section__kicker { font-family: var(--mono); font-size: 13px; color: var(--text-2); letter-spacing: .05em; margin-bottom: 14px; }
.section__title { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; }
.section__desc { color: var(--text-2); margin-top: 14px; font-size: 1.05rem; }

/* =========================================================
   FILTERS
   ========================================================= */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter {
  font-family: var(--mono); font-size: 13px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 15px; border-radius: 20px; cursor: pointer; transition: .25s var(--ease);
}
.filter:hover { border-color: var(--border-2); color: var(--text); }
.filter.active { background: var(--accent); color: #0a0a0b; border-color: var(--accent); font-weight: 600; }

/* =========================================================
   PROJECT CARDS
   ========================================================= */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-6px); border-color: var(--border-2);
  box-shadow: 0 24px 50px -24px rgba(0,0,0,.8);
}
.card__media {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #17171a, #0f0f11);
  display: grid; place-items: center;
}
.card__media img { width: 100%; height: 100%; object-fit: contain; padding: 12px 0; transition: transform .6s var(--ease); }
.card:hover .card__media img { transform: scale(1.06); }
.card__ph {
  font-family: var(--mono); font-size: 3rem; font-weight: 700;
  color: rgba(255,255,255,.10); letter-spacing: -.04em; user-select: none;
}
.card__media::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 22px 22px;
}
.card__badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--mono); font-size: 11px; padding: 4px 9px;
  background: rgba(10,10,11,.7); border: 1px solid var(--border-2);
  border-radius: 6px; color: var(--text-2); backdrop-filter: blur(6px);
}
.card__body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.card__desc { color: var(--text-2); font-size: .94rem; margin-top: 8px; flex: 1; }
.card__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 6px; }
.card__links { display: flex; gap: 10px; margin-top: 18px; }
.card__link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--text-2); transition: color .25s;
}
.card__link:hover { color: var(--text); }
.card__link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* GitHub CTA card */
.card--gh { border-style: dashed; text-decoration: none; }
.card--gh:hover .gh-cta-icon { border-color: var(--accent); }
.card__body--center { align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 220px; }
.gh-cta-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--border-2); border-radius: 13px; margin-bottom: 8px; transition: border-color .3s var(--ease); }
.gh-cta-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card--gh .card__link { color: var(--text-2); margin-top: 4px; }
.card--gh:hover .card__link { color: var(--text); }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.skill {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: .35s var(--ease);
}
.skill:hover { border-color: var(--border-2); transform: translateY(-4px); }
.skill__icon { width: 42px; height: 42px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-2); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; margin-bottom: 16px; }
.skill__name { font-weight: 700; font-size: 1.05rem; }
.skill__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

/* =========================================================
   ABOUT
   ========================================================= */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: center; }
.about__text p { color: var(--text-2); margin-top: 16px; font-size: 1.05rem; }
.about__text .btn { margin-top: 28px; }
.about__text .section__title { margin-top: 6px; }
.about__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 24px; }
.about__card-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.about__card-row:last-child { border-bottom: 0; }
.about__card-row span { color: var(--text-3); font-size: .95rem; }
.about__card-row b { font-weight: 600; font-size: .98rem; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: #7ee29b; box-shadow: 0 0 10px #7ee29b; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.contact-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 6px;
  transition: .35s var(--ease); position: relative; overflow: hidden;
}
.contact-card:hover { border-color: var(--border-2); transform: translateY(-4px); background: var(--surface-2); }
.contact-card__icon { width: 44px; height: 44px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border-2); display: grid; place-items: center; margin-bottom: 12px; }
.contact-card__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-card__label { font-size: 13px; color: var(--text-3); font-family: var(--mono); }
.contact-card__value { font-weight: 600; font-size: 1.02rem; word-break: break-all; }
.contact-card__arrow { position: absolute; top: 22px; right: 22px; color: var(--text-3); transition: .3s var(--ease); }
.contact-card:hover .contact-card__arrow { color: var(--text); transform: translate(3px,-3px); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { border-top: 1px solid var(--border); padding: 30px 24px; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer__brand { font-weight: 700; }
.footer__copy { color: var(--text-3); font-size: .9rem; font-family: var(--mono); }
.footer__top { color: var(--text-2); font-size: .9rem; transition: color .25s; }
.footer__top:hover { color: var(--text); }

/* =========================================================
   REVEAL ANIMATION
   ========================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .06s; }
.reveal:nth-child(3) { transition-delay: .12s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .nav__links, .nav__date, .nav__sep { display: none; }
  .nav__burger { display: flex; }
  .nav__links.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: rgba(10,10,11,.96); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border); padding: 8px 24px 18px;
  }
  .nav__links.open a { padding: 13px 0; border-bottom: 1px solid var(--border); }
  .hero__stats { gap: 28px; }
  .stat__num { font-size: 1.6rem; }
  .section { padding: 80px 20px; }
}
@media (max-width: 480px) {
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .projects-grid { grid-template-columns: 1fr; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
