@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter.var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fefefc;
  --fg: #0f1220;
  --accent: #6c5ce7;
  --accent-2: #00d2d3;
  --card: #ffffff;
  --shadow: 0 20px 40px rgba(0,0,0,.12);
  --nav-bg: rgba(254,254,252,.88);
  --border: rgba(15,18,32,.08);
  --muted: #6b7280;
  --nav-h: 56px;
}

[data-theme="dark"] {
  --bg: #010005;
  --fg: #e9ecf1;
  --accent: #a29bfe;
  --accent-2: #00f5d4;
  --card: #12162a;
  --shadow: 0 20px 40px rgba(0,0,0,.45);
  --nav-bg: rgba(1,0,5,.88);
  --border: rgba(233,236,241,.08);
  --muted: #9ca3af;
}

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

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
}

body { overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
}

.nav-logo {
  grid-column: 1;
  justify-self: start;
  font-size: 18px;
  font-weight: 800;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: .01em;
}
.nav-logo:hover { text-decoration: none; }

.nav-links {
  grid-column: 2;
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  opacity: .65;
  text-decoration: none;
  transition: opacity .15s;
}
.nav-links a:hover,
.nav-links a.active { opacity: 1; text-decoration: none; }

.nav-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-icon {
  display: flex;
  align-items: center;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  color: var(--fg);
  opacity: 0.7;
}

.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px; height: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  padding: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform .2s;
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(20px);
}

/* HAMBURGER */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  width: 36px; height: 36px;
}

.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: all .2s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE MENU */
.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 99;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px 16px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  opacity: .8;
  transition: opacity .15s;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover,
.mobile-menu a.active { opacity: 1; text-decoration: none; }

/* BACK TO TOP - top center (как было) */
.icon-btn {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 99;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  font-size: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.icon-btn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.icon-btn:hover { transform: translateX(-50%) translateY(-2px); }
.icon-btn:active { transform: translateX(-50%) scale(.96); }

/* HERO */
.hero {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  align-items: stretch;
}

.hero-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.hero-label {
  font-size: 64px;
  font-weight: 800;
  margin: 0;
  opacity: .75;
  letter-spacing: .02em;
  line-height: 1.1;
}

.hero-right {
  flex: 1;
  background: #000;
  overflow: hidden;
}

.hero-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: contrast(1.05) saturate(1.1);
}

/* BUTTONS */
.main-btn {
  font-family: inherit;
  font-size: 28px;
  font-weight: 800;
  padding: 24px 56px;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  letter-spacing: .04em;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  transition: transform .15s, box-shadow .15s, filter .15s;
}

.main-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 28px 60px rgba(0,0,0,.35);
}

.main-btn:active {
  transform: translateY(0) scale(.97);
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
}

.tg-btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 18px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #0088cc, #00acee);
  box-shadow: 0 14px 32px rgba(0,0,0,.25);
  transition: transform .15s, filter .15s;
}
.tg-btn:hover { transform: translateY(-2px); filter: brightness(1.05); text-decoration: none; }
.tg-btn:active { transform: scale(.96); }

/* PAGE 2 */
.page2 {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 24px;
}

.card {
  max-width: 820px;
  width: 100%;
  background: var(--card);
  padding: 48px 40px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.card p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 24px 0;
}
.card p:last-child { margin-bottom: 0; }

.arrows-down {
  font-size: 24px;
  letter-spacing: 10px;
  opacity: .35;
  margin: 0 0 24px 0;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--fg); text-decoration: none; }

/* CONTENT PAGES */
.content-page {
  padding-top: calc(var(--nav-h) + 28px);
  padding-bottom: 80px;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-page h1 {
  font-size: 38px;
  font-weight: 800;
  margin: 0 0 12px 0;
  line-height: 1.15;
}

.content-page h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 14px 0;
}

.content-page h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 10px 0;
}

.content-page p {
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 20px 0;
}

.content-page ul,
.content-page ol {
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 20px 0;
  padding-left: 28px;
}

.content-page li { margin-bottom: 6px; }

.subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 36px 0;
  line-height: 1.5;
}

/* BLOG LIST */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { border-bottom: 1px solid var(--border); }
.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 20px 0;
  color: var(--fg);
  text-decoration: none;
  gap: 16px;
}
.post-list a:hover { text-decoration: none; }
.post-list a:hover .post-title { color: var(--accent); }

.post-title { font-size: 17px; font-weight: 500; transition: color .15s; }
.post-date { font-size: 14px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* BLOG POST */
.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 28px;
  text-decoration: none;
  transition: color .15s;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.post-meta { font-size: 14px; color: var(--muted); margin: 4px 0 36px 0; }

code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .875em;
  background: var(--card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 0 0 24px 0;
}

pre code { background: none; border: none; padding: 0; font-size: 14px; line-height: 1.65; }

/* PROJECTS */
.project-grid { display: grid; gap: 16px; margin-top: 8px; }

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: var(--fg);
  display: block;
  transition: transform .15s, box-shadow .15s;
}

.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }

.project-card h3 { margin: 0 0 8px 0; font-size: 18px; font-weight: 700; color: var(--accent); }
.project-card p { margin: 0 0 12px 0; font-size: 15px; color: var(--muted); line-height: 1.55; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  margin-right: 4px;
  margin-bottom: 4px;
}

/* CONTACTS */
.contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }

.contact-list li a {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}

.contact-list li a:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.contact-icon { font-size: 22px; flex-shrink: 0; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  font-weight: 500;
  color: var(--muted);
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  user-select: text;
}

/* 404 */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 24px) 24px 24px;
  text-align: center;
}

.error-code {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-page p { font-size: 18px; color: var(--muted); margin: 0 0 32px 0; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero { flex-direction: column; }
  .hero-right { min-height: 50vh; flex: none; }
  .hero-left { flex: none; padding: 40px 32px; }
  .hero-label { font-size: 44px; }
  .main-btn { font-size: 24px; padding: 20px 48px; }
}

@media (max-width: 640px) {
  nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .nav-right { grid-column: 2; }
  .hamburger { display: flex; }

  .content-page { padding-top: calc(var(--nav-h) + 20px); }
  .content-page h1 { font-size: 26px; }
  .content-page h2 { font-size: 19px; margin: 28px 0 10px; }
  .content-page p, .content-page li { font-size: 16px; }

  .card { padding: 28px 18px; }
  .card p { font-size: 16px; }
  .main-btn { font-size: 20px; padding: 18px 36px; }
  .hero-label { font-size: 32px; }
  .hero-left { padding: 28px 18px; }

  .post-list a { flex-direction: column; gap: 4px; }
  .post-date { font-size: 13px; }

  .error-code { font-size: 64px; }
  .container { padding: 0 16px; }
  .contact-list li a { padding: 14px 16px; font-size: 15px; }

  pre { padding: 14px; border-radius: 8px; }
  pre code { font-size: 13px; }
}
