/* ============================================================
   NeuroCreator Portfolio — Main Stylesheet
   Breakpoints: 360 | 480 | 640 | 768 | 1024 | 1280 | 1440
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg:          #060610;
  --bg-card:     #0d0d20;
  --bg-card2:    #111128;
  --border:      rgba(168,85,247,.18);
  --border-hover:rgba(168,85,247,.45);
  --purple:      #a855f7;
  --blue:        #3b82f6;
  --cyan:        #22d3ee;
  --tg:          #29b6f6;
  --kwork:       #ff6b35;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --text-dim:    #64748b;
  --nav-h:       70px;
  --radius:      14px;
  --radius-lg:   20px;
  --shadow:      0 4px 32px rgba(0,0,0,.5);
  --glow:        0 0 40px rgba(168,85,247,.25);
  --transition:  .3s ease;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  min-width: 320px;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }

/* ---- Selection ---- */
::selection { background: rgba(168,85,247,.35); }

/* ---- Typography ---- */
h1,h2,h3,h4 { line-height: 1.2; font-weight: 700; }

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  box-shadow: 0 4px 20px rgba(168,85,247,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(168,85,247,.55); }
.btn-outline {
  border: 1.5px solid var(--border-hover);
  color: var(--purple);
}
.btn-outline:hover { background: rgba(168,85,247,.12); transform: translateY(-2px); }
.btn-full { width: 100%; justify-content: center; }

/* ---- Section commons ---- */
.section { padding: clamp(4rem, 8vw, 7rem) 0; }

.section-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(168,85,247,.18), rgba(59,130,246,.18));
  border: 1px solid var(--border);
  color: var(--purple);
  padding: .3rem .9rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .9rem;
}
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  background: linear-gradient(135deg, #fff 40%, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-desc {
  color: var(--text-muted);
  max-width: 560px;
  margin: .8rem auto 0;
  font-size: .97rem;
}

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ======================================================
   NAVBAR
   ====================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(6,6,16,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(6,6,16,.97);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img  { height: 36px; width: auto; object-fit: contain; }
.logo-text {
  display: none; /* shown via JS onerror when logo.png fails */
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: nowrap;
}
.nav-link {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .7rem;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(168,85,247,.12); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1.1rem;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  border-radius: 50px;
  transition: var(--transition);
  min-height: 36px;
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(168,85,247,.4); }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background .2s;
}
.burger:hover { background: rgba(168,85,247,.12); }
.burger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease, width .3s ease;
  transform-origin: center;
}
.burger.open .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open .burger-line:nth-child(2) { opacity: 0; width: 0; }
.burger.open .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: rgba(6,6,16,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem clamp(1rem, 5vw, 2rem) 2rem;
  z-index: 999;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.mobile-menu.open {
  display: block;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.mobile-nav-links { display: flex; flex-direction: column; gap: .4rem; }
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--transition);
  min-height: 52px;
}
.mobile-nav-link:hover, .mobile-nav-link:active {
  background: rgba(168,85,247,.1);
  border-color: var(--border);
  color: var(--purple);
}
.mobile-nav-link.kwork-link { color: var(--kwork); }
.mobile-nav-link.kwork-link:hover { background: rgba(255,107,53,.1); border-color: rgba(255,107,53,.3); }
.mobile-nav-link.tg-link { color: var(--tg); }
.mobile-nav-link.tg-link:hover { background: rgba(41,182,246,.1); border-color: rgba(41,182,246,.3); }

/* ======================================================
   HERO
   ====================================================== */
.hero {
  min-height: 100svh;
  padding: calc(var(--nav-h) + 3rem) 0 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
#particlesCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

/* Photo */
.hero-photo-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-photo-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(var(--purple), var(--blue), var(--cyan), var(--purple));
  animation: spin 6s linear infinite;
  z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-photo {
  width: clamp(160px, 22vw, 240px);
  height: clamp(160px, 22vw, 240px);
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border: 4px solid var(--bg);
  box-shadow: var(--glow);
}
.hero-photo-fallback {
  display: none;
  width: clamp(160px, 22vw, 240px);
  height: clamp(160px, 22vw, 240px);
  border-radius: 50%;
  background: var(--bg-card2);
  border: 4px solid var(--bg);
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--purple);
  position: relative;
  z-index: 1;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
  font-size: .8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: .35rem .85rem;
  border-radius: 20px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* Text */
.hero-text { flex: 1; min-width: 0; }
.hero-greeting { color: var(--text-muted); font-size: .95rem; margin-bottom: .25rem; }
.hero-name {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: .5rem;
}
.hero-roles {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.hero-role { color: var(--cyan); font-weight: 600; }
.hero-cursor {
  color: var(--purple);
  animation: blink .8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-bio {
  color: var(--text-muted);
  font-size: clamp(.9rem, 2vw, 1.05rem);
  max-width: 520px;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.stat-num {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-label { font-size: .78rem; color: var(--text-dim); margin-top: .2rem; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
  animation: bounce 2s infinite;
  z-index: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* ======================================================
   ABOUT
   ====================================================== */
.about-section { background: var(--bg-card); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-text p { color: var(--text-muted); margin-bottom: 1rem; font-size: .97rem; }
.about-text p:last-of-type { margin-bottom: 0; }
.about-lead { font-size: 1.1rem !important; color: var(--text) !important; font-weight: 500; }

.about-meta { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .7rem; }
.about-meta-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.about-meta-item i { color: var(--purple); font-size: 1rem; width: 18px; text-align: center; }

.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.about-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  transition: var(--transition);
}
.about-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.about-card i { font-size: 1.5rem; color: var(--purple); margin-bottom: .7rem; }
.about-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.about-card p  { font-size: .82rem; color: var(--text-muted); }

/* ======================================================
   SERVICES
   ====================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: var(--transition);
}
.service-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--glow);
}
.service-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(168,85,247,.2), rgba(59,130,246,.2));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--purple);
  flex-shrink: 0;
}
.service-icon.ai-icon { background: linear-gradient(135deg, rgba(168,85,247,.3), rgba(34,211,238,.2)); }
.service-title { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.service-desc  { font-size: .87rem; color: var(--text-muted); flex: 1; line-height: 1.6; }
.service-price {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.service-details { font-size: .8rem; color: var(--text-dim); }
.service-details i { margin-right: .3rem; }

.service-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.2rem;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  transition: var(--transition);
  align-self: flex-start;
  min-height: 44px;
}
.service-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(168,85,247,.4); }
.service-btn.tg-btn { background: linear-gradient(135deg, #0088cc, var(--tg)); }
.service-btn.tg-btn:hover { box-shadow: 0 6px 20px rgba(41,182,246,.4); }

/* ======================================================
   SKILLS
   ====================================================== */
.skills-section { background: var(--bg-card); }

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.skills-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  letter-spacing: .03em;
}

.skill-item { margin-bottom: 1.2rem; }
.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.skill-bar {
  height: 8px;
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.tool-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  background: rgba(168,85,247,.1);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: .82rem;
  color: var(--purple);
  transition: var(--transition);
}
.tool-tag:hover { background: rgba(168,85,247,.2); border-color: var(--border-hover); }
.tool-tag.spec { background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.2); color: var(--cyan); }
.tool-tag.spec:hover { background: rgba(34,211,238,.15); }

/* ======================================================
   PORTFOLIO
   ====================================================== */
.portfolio-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: .5rem 1.2rem;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  background: transparent;
  transition: var(--transition);
  min-height: 40px;
}
.filter-btn:hover  { color: var(--purple); border-color: var(--border-hover); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  border-color: transparent;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.portfolio-item { border-radius: var(--radius); overflow: hidden; transition: var(--transition); }
.portfolio-item.hidden { display: none; }
.portfolio-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.portfolio-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card2);
  border: 1px solid var(--border);
}
.portfolio-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.portfolio-item:hover .portfolio-img { transform: scale(1.05); }

.portfolio-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  font-weight: 600;
  font-size: .9rem;
}
.portfolio-placeholder i { font-size: 2.2rem; opacity: .7; }
.portfolio-placeholder.blue   { background: linear-gradient(135deg,#0d1b3e,#1a3a6e); color:#60a5fa; }
.portfolio-placeholder.purple { background: linear-gradient(135deg,#1a0d3e,#3b1a6e); color:#c084fc; }
.portfolio-placeholder.green  { background: linear-gradient(135deg,#0d3e1b,#1a6e3a); color:#4ade80; }
.portfolio-placeholder.orange { background: linear-gradient(135deg,#3e1a0d,#6e3b1a); color:#fb923c; }
.portfolio-placeholder.teal   { background: linear-gradient(135deg,#0d3e3e,#1a6e6e); color:#2dd4bf; }
.portfolio-placeholder.pink   { background: linear-gradient(135deg,#3e0d2a,#6e1a4e); color:#f472b6; }
.portfolio-placeholder.indigo { background: linear-gradient(135deg,#0d0d3e,#1a1a6e); color:#818cf8; }

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6,6,16,.88);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  opacity: 0;
  transition: opacity .3s ease;
  backdrop-filter: blur(4px);
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay h3 { font-size: .95rem; margin-bottom: .3rem; color: #fff; }
.portfolio-overlay p  { font-size: .78rem; color: var(--text-muted); margin-bottom: .6rem; }
.portfolio-tag {
  display: inline-block;
  padding: .2rem .65rem;
  background: rgba(168,85,247,.3);
  border-radius: 20px;
  font-size: .72rem;
  color: var(--purple);
  font-weight: 600;
  align-self: flex-start;
}

.portfolio-more { text-align: center; margin-top: 2.5rem; }

/* ======================================================
   WHY ME
   ====================================================== */
.why-section { background: var(--bg-card); }
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.why-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}
.why-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow); }
.why-icon {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168,85,247,.2), rgba(59,130,246,.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--purple);
}
.why-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.why-card p  { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }

/* ======================================================
   CONTACT
   ====================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-cards { display: flex; flex-direction: column; gap: 1rem; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  min-height: 76px;
}
.contact-card:hover { border-color: var(--border-hover); transform: translateX(4px); }
.contact-card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.email-icon { background: rgba(59,130,246,.15); color: var(--blue); }
.tg-icon    { background: rgba(41,182,246,.15);  color: var(--tg); }
.kwork-icon { background: rgba(255,107,53,.15);  color: var(--kwork); }

.contact-card-label { display: block; font-size: .75rem; color: var(--text-dim); margin-bottom: .2rem; }
.contact-card-value { font-size: .9rem; font-weight: 500; color: var(--text); word-break: break-all; }

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.form-group { display: flex; flex-direction: column; gap: .45rem; }
.form-group label { font-size: .85rem; color: var(--text-muted); font-weight: 500; }
.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  padding: .75rem 1rem;
  transition: border-color .2s;
  width: 100%;
  min-height: 48px;
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,.12);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }

.form-note {
  font-size: .8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ======================================================
   FOOTER
   ====================================================== */
.footer {
  background: #020208;
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-tagline { font-size: .85rem; color: var(--text-dim); margin-top: .6rem; }
.footer-nav h4,
.footer-contact h4 {
  font-size: .85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
}
.footer-nav ul,
.footer-contact ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-nav a,
.footer-contact a {
  font-size: .88rem;
  color: var(--text-dim);
  transition: color .2s;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 28px;
}
.footer-nav a:hover,
.footer-contact a:hover { color: var(--purple); }
.footer-contact i { width: 14px; text-align: center; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.05);
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom p { font-size: .82rem; color: var(--text-dim); }
.footer-social { display: flex; gap: .6rem; }
.social-link {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .95rem;
  transition: var(--transition);
}
.social-link.tg:hover    { background: rgba(41,182,246,.15);  color: var(--tg);    border-color: rgba(41,182,246,.3); }
.social-link.kwork:hover { background: rgba(255,107,53,.15);  color: var(--kwork); border-color: rgba(255,107,53,.3); }
.social-link.email:hover { background: rgba(59,130,246,.15);  color: var(--blue);  border-color: rgba(59,130,246,.3); }

/* ======================================================
   FLOATING TELEGRAM
   ====================================================== */
.tg-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088cc, var(--tg));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 30px rgba(41,182,246,.45);
  z-index: 800;
  opacity: 0;
  transform: scale(.7) translateY(20px);
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}
.tg-float.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.tg-float:hover { transform: scale(1.1) translateY(-2px); }
.tg-float:active { transform: scale(.95); }

.tg-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(41,182,246,.5);
  animation: tgPulse 2s ease-out infinite;
}
.tg-pulse-ring-2 { animation-delay: 1s; }
@keyframes tgPulse {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(1.6); opacity: 0; }
}

.tg-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  background: rgba(10,10,30,.9);
  color: #fff;
  font-size: .8rem;
  font-weight: 500;
  padding: .4rem .8rem;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  border: 1px solid var(--border);
}
.tg-float:hover .tg-tooltip { opacity: 1; }

/* ======================================================
   BACK TO TOP
   ====================================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 800;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s, transform .3s, background .2s;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.back-to-top:hover { background: rgba(168,85,247,.2); color: var(--purple); }

/* ======================================================
   MEDIA QUERIES — RESPONSIVE
   ====================================================== */

/* ---------- 1280px ---------- */
@media (max-width: 1280px) {
  .portfolio-grid    { grid-template-columns: repeat(3, 1fr); }
  .services-grid     { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 1024px ---------- */
@media (max-width: 1024px) {
  .nav-link   { font-size: .82rem; padding: .35rem .55rem; }
  .nav-cta    { padding: .4rem .85rem; font-size: .8rem; }

  .hero-content { gap: 2.5rem; }
  .about-grid  { gap: 2rem; }
  .why-grid    { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand{ grid-column: 1 / -1; }
}

/* ---------- 768px — Tablet / Mobile ---------- */
@media (max-width: 768px) {
  /* Nav */
  .nav-links  { display: none; }
  .burger     { display: flex; }

  /* Hero — stack vertically */
  .hero { padding-top: calc(var(--nav-h) + 2rem); padding-bottom: 5rem; }
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .hero-bio    { margin-left: auto; margin-right: auto; }
  .hero-stats  { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-roles  { justify-content: center; }

  /* About */
  .about-grid  { grid-template-columns: 1fr; }
  .about-cards { grid-template-columns: 1fr 1fr; }

  /* Services */
  .services-grid { grid-template-columns: repeat(2, 1fr); }

  /* Skills */
  .skills-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  /* Portfolio */
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  /* Always show overlay on touch */
  .portfolio-overlay { opacity: 1; background: rgba(6,6,16,.7); }

  /* Why */
  .why-grid  { grid-template-columns: repeat(2, 1fr); }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Float TG — reposition to not overlap back-to-top */
  .tg-float    { bottom: 1.25rem; right: 1.25rem; width: 52px; height: 52px; font-size: 1.3rem; }
  .tg-tooltip  { display: none; }
  .back-to-top { bottom: 1.25rem; left: 1.25rem; }
}

/* ---------- 640px ---------- */
@media (max-width: 640px) {
  .hero-name   { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 300px; justify-content: center; }

  .services-grid { grid-template-columns: 1fr; }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
  }

  .why-grid { grid-template-columns: 1fr; }

  .contact-form { padding: 1.25rem; }
}

/* ---------- 480px ---------- */
@media (max-width: 480px) {
  :root { --nav-h: 62px; }

  .hero-photo,
  .hero-photo-fallback { width: 140px; height: 140px; }
  .hero-photo-ring { inset: -10px; }

  .about-cards { grid-template-columns: 1fr; }

  .portfolio-grid { grid-template-columns: 1fr 1fr; }

  .portfolio-filters { gap: .4rem; }
  .filter-btn { padding: .4rem .85rem; font-size: .78rem; }

  .footer-grid { gap: 1.25rem; }
}

/* ---------- 360px — Minimum ---------- */
@media (max-width: 360px) {
  .hero-photo,
  .hero-photo-fallback { width: 120px; height: 120px; }

  .portfolio-grid { grid-template-columns: 1fr; }

  .btn { font-size: .88rem; padding: .7rem 1.2rem; }

  .hero-stats { gap: .75rem; }

  .services-grid { gap: 1rem; }
  .service-card  { padding: 1.3rem 1rem; }
}

/* ---------- Touch devices — no hover states ---------- */
@media (hover: none) {
  .service-card:hover,
  .about-card:hover,
  .why-card:hover,
  .contact-card:hover { transform: none; }

  .portfolio-overlay { opacity: 1; background: rgba(6,6,16,.72); }
  .portfolio-item:hover .portfolio-img { transform: none; }
}

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

/* ---------- Landscape mobile ---------- */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-h) + 1.5rem);
    padding-bottom: 3rem;
  }
  .hero-content { flex-direction: row; text-align: left; gap: 2rem; }
  .hero-bio    { margin-left: 0; margin-right: 0; }
  .hero-stats  { justify-content: flex-start; }
  .hero-actions { justify-content: flex-start; }
  .hero-roles  { justify-content: flex-start; }
}
