/* 
   НОВЫЙ СТИЛЬ: MODERN DARK (Premium Editorial)
   Цвета: Глубокий антрацит, Снейк-грей, Серебро.
*/

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

:root {
  --bg:     #0a0a0c;
  --bg2:    #121214;
  --bg3:    #1a1a1c;
  --text:   #ffffff;
  --text-dim: #a0a0a5;
  --border: rgba(255, 255, 255, 0.08);
  --glass:  rgba(10, 10, 12, 0.75);
  
  --fh: 'Montserrat', sans-serif;
  --fb: 'Inter', sans-serif;
  --fs: 'Caveat', cursive;
}

html { scroll-behavior: smooth; }

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

body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 8000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 300px;
  mix-blend-mode: overlay;
  opacity: 0.45;
}

body::before {
  content: '';
  position: fixed;
  top: -20%; left: -10%;
  width: 70%; height: 70%;
  background: radial-gradient(circle, rgba(100, 110, 140, 0.08) 0%, rgba(10, 10, 12, 0) 70%);
  pointer-events: none;
  z-index: 1;
}

.glow-2 {
  position: fixed;
  bottom: -20%; right: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(140, 110, 100, 0.05) 0%, rgba(10, 10, 12, 0) 70%);
  pointer-events: none;
  z-index: 1;
}

nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 500; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3rem;
  background: var(--glass);
  backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--border);
}
.nav-id { font-size: 1rem; letter-spacing: .12em; color: var(--text-dim); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 1rem; letter-spacing: .14em; color: var(--text-dim);
  text-decoration: none; text-transform: lowercase; transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-tag { font-size: 1rem; letter-spacing: .1em; color: var(--text-dim); }

.wm {
  position: absolute;
  font-family: var(--fh); font-weight: 900; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.08);
  pointer-events: none; user-select: none; line-height: 1; white-space: nowrap;
  z-index: 0;
}

.s { position: relative; overflow: hidden; }
.s-inner {
  position: relative; z-index: 2;
  max-width: 1200px; margin: 0 auto; padding: 7rem 3rem;
}
.s-hr { height: 1px; background: var(--border); max-width: 100%; }

.eyebrow {
  font-size: .85rem; letter-spacing: .26em; color: var(--text-dim);
  text-transform: lowercase; margin-bottom: 1rem;
}
h2.sh {
  font-family: var(--fh); font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  font-weight: 900; text-transform: uppercase; letter-spacing: -.03em;
  line-height: .92; margin-bottom: 3.5rem;
}

#about { padding-top: 54px; min-height: 100vh; display: flex; align-items: center; }
.hero-wm-1 { font-size: clamp(9rem,17vw,17rem); bottom: -1.5rem; left: -1rem; letter-spacing: -.04em; }
.hero-wm-2 { font-size: clamp(4rem,7vw,7rem); top: 12%; right: -1rem; transform: rotate(-90deg); transform-origin: right top; letter-spacing: .1em; }

.hero-inner {
  position: relative; z-index: 2; width: 100%;
  max-width: 1200px; margin: 0 auto; padding: 5rem 3rem;
  display: grid; grid-template-columns: 420px 1fr; gap: 6rem; align-items: center;
}

.polaroid-wrap { position: relative; display: flex; justify-content: center; }
.polaroid-wrap::after {
  content: '';
  position: absolute;
  width: 400px; height: 530px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  top: 20px; left: 55%;
  transform: translateX(-50%) rotate(0deg);
  z-index: 0;
}

.polaroid {
  position: relative; background: #ffffff;
  padding: 15px 15px 65px; transform: rotate(0deg);
  box-shadow: 30px 50px 100px rgba(0,0,0,0.5), 0 5px 15px rgba(0,0,0,0.3);
  max-width: 400px; width: 100%;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
  z-index: 1;
}
.polaroid:hover { transform: rotate(0deg) scale(1.02); }
.polaroid::before {
  content: ''; position: absolute;
  top: -25px; left: 50%; transform: translateX(-50%) rotate(0deg);
  width: 110px; height: 36px; background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}
.polaroid img {
  display: block; width: 100%; height: 460px;
  object-fit: cover; object-position: top center;
}
.pol-sig {
  position: absolute; bottom: 15px; left: 0; right: 0;
  text-align: center; font-family: var(--fs); font-size: 1.8rem;
  font-weight: 700; color: #111; transform: rotate(0deg);
}

h1.hero-h {
  font-family: var(--fh); font-size: clamp(4.5rem, 8vw, 8.5rem);
  font-weight: 900; text-transform: uppercase; line-height: .9; margin-bottom: 2.2rem;
}
.hero-bio { font-size: 1rem; color: var(--text-dim); max-width: 480px; margin-bottom: 2.8rem; }
.hero-contacts { display: flex; flex-direction: column; gap: .6rem; }
.contact-line { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.c-key { font-family: var(--fh); font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--text); min-width: 80px; }
.c-val { font-size: .95rem; color: var(--text-dim); }

.ticker-wrap {
  background: var(--glass); 
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); 
  overflow: hidden; padding: .85rem 0;
}
.ticker-track { display: flex; width: max-content; animation: ticker 36s linear infinite; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
  display: flex; align-items: center; gap: 2.2rem; padding: 0 2.2rem;
  font-size: 1rem; font-weight: 600; text-transform: uppercase; color: var(--text-dim);
}
.ticker-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }

.stats-grid { display: grid; grid-template-columns: repeat(5,1fr); border: 1px solid var(--border); }
.stat-card {
  position: relative; padding: 3rem 2rem;
  border-right: 1px solid var(--border); background: var(--bg);
}
.stat-card:last-child { border-right: none; }
.stat-ghost {
  position: absolute; bottom: -.8rem; right: -.5rem;
  font-family: var(--fh); font-weight: 900; font-size: 5.5rem;
  color: rgba(255, 255, 255, 0.015); pointer-events: none;
}
.stat-n { font-family: var(--fh); font-size: clamp(1.5rem,2.2vw,2.4rem); font-weight: 900; margin-bottom: .5rem; color: var(--text); position: relative; }
.stat-d { font-size: .83rem; color: var(--text-dim); position: relative; }

.circles-row { display: flex; justify-content: center; margin-bottom: 5rem; }
.ring-wrap { margin-right: -30px; position: relative; }
.ring {
  width: 175px; height: 175px; border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--bg2); transition: all .4s ease;
}
.ring-wrap:hover .ring { border-color: #fff; transform: translateY(-10px); }
.ring-name { font-family: var(--fh); font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--text); }

.skill-cat-row { display: flex; align-items: flex-start; gap: 1.8rem; padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.cat-label { font-size: .85rem; letter-spacing: .22em; color: var(--text-dim); text-transform: uppercase; min-width: 120px; }
.pills { display: flex; flex-wrap: wrap; gap: .55rem; }

/* ПЛАШКИ НАВЫКОВ (С КРАСИВЫМ ХОВЕРОМ) */
.pill { 
  border: 1px solid var(--border); 
  border-radius: 50px; 
  padding: .35rem 1rem; 
  font-size: .78rem; 
  color: var(--text-dim); 
  background: var(--bg2); 
  transition: all .35s cubic-bezier(.25,.46,.45,.94);
  cursor: default;
}
.pill:hover { 
  background: #ffffff !important; 
  color: #000000 !important; 
  border-color: #ffffff !important; 
  transform: translateY(-2px); 
  box-shadow: 0 10px 25px rgba(255,255,255,0.15);
}

#niches { background: var(--bg2); }
.niches-wm { font-size: clamp(10rem,17vw,15rem); bottom: -1rem; right: -2rem; }
.niches-grid { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--border); }
.niche-card { padding: 3.5rem 2.5rem; border-right: 1px solid var(--border); background: var(--bg2); position: relative; overflow: hidden; }
.niche-card:last-child { border-right: none; }
.niche-idx { font-family: var(--fs); font-size: 6.5rem; color: rgba(255, 255, 255, 0.02); position: absolute; top: -.5rem; right: 1rem; }
.niche-t { font-family: var(--fh); font-size: .75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 2rem; color: var(--text); position: relative; }
.niche-m { font-size: .88rem; color: var(--text-dim); padding-left: 1rem; border-left: 2px solid rgba(255,255,255,0.05); margin-bottom: 1rem; position: relative; }

.tabs-nav { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 4rem; overflow-x: auto; scrollbar-width: none; }
.tb {
  background: none; border: none; color: var(--text-dim);
  font-family: var(--fh); font-size: 1rem; font-weight: 700;
  text-transform: uppercase; padding: 1rem 2rem; cursor: pointer; position: relative; white-space: nowrap;
}
.tb.active { color: var(--text); }
.tb.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: #fff; }

/* ФИКС КЕЙСОВ */
.tab-p { display: none !important; opacity: 0; }
.tab-p.active { 
  display: grid !important; 
  grid-template-columns: 1fr 1.1fr; 
  gap: 6rem; 
  animation: tabFade .5s ease forwards; 
  opacity: 1;
}
@keyframes tabFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.cp { background: #fff; padding: 12px 12px 55px; transform: rotate(0deg); box-shadow: 0 30px 60px rgba(0,0,0,0.5); position: relative; }
.cp img { width: 100%; height: 300px; object-fit: cover; filter: contrast(1.05); }
.cp-cap { font-family: var(--fs); font-size: 1.2rem; color: #111; text-align: center; margin-top: .5rem; }

h3.case-t { font-family: var(--fh); font-size: clamp(2rem,3.5vw,3.5rem); font-weight: 900; text-transform: uppercase; line-height: .95; margin-bottom: 2.8rem; }
.case-mr { display: flex; align-items: baseline; gap: 1.5rem; padding: 1.2rem 0; border-bottom: 1px solid var(--border); }
.case-v { font-family: var(--fh); font-size: 1.8rem; font-weight: 900; color: var(--text); min-width: 120px; }

#education { position: relative; }
.edu-wm { font-size: clamp(6rem, 11vw, 11rem); right: -2rem; top: 30%; }
.edu-grid { display: grid !important; grid-template-columns: 1fr 1fr 1.4fr !important; gap: 4rem; width: 100%; }
.edu-col-h { font-size: .63rem; letter-spacing: .22em; color: var(--text-dim); text-transform: uppercase; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.edu-it { padding-bottom: 1.6rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--border); position: relative; }
.edu-n { font-family: var(--fs); font-size: 2.2rem; font-weight: 700; color: rgba(255,255,255,0.05); float: right; }
.edu-name { font-size: .94rem; font-weight: 600; color: var(--text); }
.edu-sub { font-size: .8rem; color: var(--text-dim); }
.books-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }

.ach-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.ach-card { background: var(--bg); padding: 3rem 2rem; transition: background .3s; }
.ach-card:hover { background: var(--bg2); }
.ach-icon { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; }
.ach-icon svg { width: 24px; height: 24px; stroke: var(--text-dim); fill: none; }
.ach-title { font-family: var(--fh); font-size: .94rem; font-weight: 700; margin-bottom: .5rem; }
.ach-desc { font-size: .8rem; color: var(--text-dim); }

/* ── КОНТАКТЫ (2 Колонки) ── */
#contacts { background: var(--bg); position: relative; }
.contacts-wm { font-size: clamp(8rem, 14vw, 14rem); top: 15%; right: -2rem; }
.contacts-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 6rem; align-items: start; }
.contacts-left h3 { font-family: var(--fh); font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 2rem; }
.contact-entry {
  display: flex; align-items: center; gap: 1.4rem; padding: 1.3rem 0; border-bottom: 1px solid var(--border);
  text-decoration: none; transition: all .25s; color: var(--text);
}
.contact-entry:first-child { border-top: 1px solid var(--border); }
.contact-entry:hover { transform: translateX(10px); background: rgba(255,255,255,0.02); }
.contact-entry-icon { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.contact-entry-icon svg { width: 20px; height: 20px; stroke: var(--text-dim); fill: none; stroke-width: 1.5; }
.contact-entry-label { font-size: .65rem; color: var(--text-dim); text-transform: uppercase; font-weight: 600; }
.contact-entry-val { font-size: 1rem; color: var(--text); font-weight: 500; }

.cta-block {
  border: 1px solid var(--border); padding: 4rem;
  display: flex; flex-direction: column; gap: 2.2rem;
  background: var(--bg2); box-shadow: 0 40px 100px rgba(0,0,0,0.4);
}
.cta-text { font-size: 1.1rem; color: var(--text-dim); line-height: 1.8; }
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 1rem;
  font-family: var(--fh); font-size: 1rem; font-weight: 800; text-transform: uppercase;
  color: #000; background: #fff; padding: 1rem 3rem; text-decoration: none; transition: all .3s;
  min-height: 48px; /* Touch target */
}
.cta-btn:hover { background: var(--text-dim); transform: translateY(-5px); }
.cta-btn svg { width: 18px; height: 18px; fill: #000; }

footer { border-top: 1px solid var(--border); padding: 3.5rem 3rem; display: flex; justify-content: space-between; background: var(--bg); }
.ft-sig { font-family: var(--fs); font-size: 2rem; color: var(--text); }
.ft-copy { font-size: .7rem; color: var(--text-dim); }
.ft-right a { font-size: .75rem; color: var(--text-dim); text-decoration: none; margin-left: 2rem; }

.rv { opacity: 0; transform: translateY(30px); transition: all .8s ease; }
.rv.on { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: .1s; } .d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; }

/* ══ АДАПТИВНОСТЬ (STRICT MOBILE ISOLATION) ══ */

@media (max-width: 1024px) {
  .s-inner { padding: 5rem 2rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 4rem; text-align: center; }
  .hero-bio { margin: 0 auto 2.8rem; }
  .hero-contacts { align-items: center; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .ach-cards { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { overflow-x: hidden; } /* Safety for watermarks on mobile */
  
  nav { padding: 0 1.5rem; }
  .nav-links { display: none; }
  
  h2.sh { margin-bottom: 2.5rem; font-size: clamp(2.4rem, 8vw, 3.5rem) !important; }
  
  /* Background Watermarks Scaling */
  .hero-wm-1, .hero-wm-2, .niches-wm, .cases-wm, .edu-wm, .contacts-wm, .ach-wm { 
    opacity: 0.04; font-size: 5rem !important; 
  }
  
  .polaroid-wrap::after { width: 300px; height: 400px; top: 15px; }
  .polaroid { max-width: 320px; padding: 12px 12px 50px; transform: rotate(0deg) !important; }
  .polaroid img { height: 320px; }
  .pol-sig { font-size: 1.4rem; bottom: 10px; }

  .circles-row { display: none !important; } /* Hidden on mobile per user request */

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 2rem 1.5rem; }

  /* Niches */
  .niches-grid { grid-template-columns: 1fr; }
  .niche-card { border-right: none; border-bottom: 1px solid var(--border); padding: 2.5rem 1.5rem; }
  .niche-card:last-child { border-bottom: none; }

  /* Cases */
  .tab-p.active { grid-template-columns: 1fr; gap: 3.5rem; }
  .case-cnt { order: -1; }
  h3.case-t { font-size: 1.8rem; margin-bottom: 1.5rem; }
  .case-v { font-size: 1.3rem; min-width: auto; }
  .case-mr { flex-direction: column; gap: 0.2rem; align-items: flex-start; padding: 1rem 0; }
  .cp { transform: rotate(0deg) !important; padding: 10px 10px 45px; }
  .cp img { height: auto; max-height: 350px; }

  /* Education */
  .edu-grid { grid-template-columns: 1fr !important; gap: 3.5rem; }
  .books-grid { grid-template-columns: 1fr; }

  /* Contacts & Achievements */
  .ach-cards { grid-template-columns: 1fr; }
  .ach-card { padding: 2rem; border-right: none; border-bottom: 1px solid var(--border); }
  .contacts-grid { grid-template-columns: 1fr; gap: 4rem; }
  
  .cta-block { 
    padding: 2.5rem 1.5rem; 
    text-align: center; 
    align-items: center;
    display: flex;
    flex-direction: column;
  }
  .cta-btn { width: 100%; }
  
  footer { flex-direction: column; gap: 2rem; text-align: center; padding: 3rem 1.5rem; }
  .ft-right { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
  .ft-right a { margin-left: 0; }
}

@media (max-width: 480px) {
  .s-inner { padding: 4rem 1.2rem; }
  h1.hero-h { font-size: 2.6rem !important; }
  
  .stats-grid { grid-template-columns: 1fr; }
  .stat-ghost { font-size: 4rem; }
  
  .pill { font-size: 0.72rem; padding: 0.3rem 0.8rem; }
  .cat-label { min-width: 80px; font-size: 0.55rem; margin-bottom: 0.3rem; }
  .skill-cat-row { flex-direction: column; gap: 0.8rem; }
  
  .tb { padding: 0.8rem 1rem; font-size: 0.6rem; }
  
  .cta-text { font-size: 0.95rem; }
}

/* ══ HIGH-RESOLUTION OPTIMIZATION (2K / 4K) ══ */

@media (min-width: 1800px) {
  html { font-size: 110%; }
  .s-inner, .hero-inner { max-width: 1500px; }
  .stat-card { padding: 4rem 3rem; }
  .niche-card { padding: 4rem 3rem; }
}

@media (min-width: 2500px) {
  html { font-size: 125%; }
  .s-inner, .hero-inner { max-width: 1750px; }
  h1.hero-h { font-size: clamp(5.5rem, 8vw, 10.5rem); }
  h2.sh { font-size: clamp(3.5rem, 5.5vw, 7.5rem); }
  .polaroid-wrap::after { width: 450px; height: 600px; }
  .polaroid { max-width: 450px; }
  .cp img { height: 400px; }
}
