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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Source Sans 3", "Arial", sans-serif;
  font-weight: 400;
  letter-spacing: 0.15px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(92, 255, 176, 0.08), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(255, 255, 255, 0.035), transparent 60%),
    #0a0a0a;
  color: #f5f5f5;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

:root {
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --muted: #b8b8b8;
  --accent: #5cffb0;
  --accent-rgb: 92, 255, 176;
  --card: #141414;
  --border: #232323;
  --radius: 18px;
  --transition: 0.3s ease;
}

.container {
  width: min(1200px, 90%);
  margin: 0 auto;
}

.section {
  padding: 90px 0;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  background: url("../images/bg-pattern.svg") center/420px repeat;
  opacity: 0.26;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
}

.logo {
  font-weight: 700;
  font-family: "Playfair Display", serif;
}

.nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 18px rgba(var(--accent-rgb), 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent {
  background: var(--accent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 60px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  margin: 16px 0 20px;
  font-family: "Playfair Display", serif;
}

.hero h1::after {
  content: "";
  display: block;
  width: 84px;
  height: 3px;
  margin-top: 18px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.lead {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--accent);
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.avatar {
  width: min(320px, 80vw);
  border-radius: 24px 24px 80px 24px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.section-head {
  margin-bottom: 32px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 12px;
  font-family: "Playfair Display", serif;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 60px;
  height: 2px;
  background: var(--accent);
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 24px;
}

.projects-grid {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.card-media {
  height: 200px;
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 20px;
  display: grid;
  gap: 10px;
}

.card-link-wrapper {
  display: block;
  height: 100%;
  color: inherit;
}

.card-link {
  color: var(--accent);
  font-weight: 600;
}

.placeholder-media {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
  height: 200px;
}

.placeholder-icon {
  font-size: 42px;
  color: var(--accent);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
}

.about-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.checklist {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.checklist li::before {
  content: "•";
  color: var(--accent);
  margin-right: 10px;
}

.highlight-badge {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 90, 90, 0.45);
  font-weight: 700;
}

.skills-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skills-grid li {
  padding: 22px 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(92, 255, 176, 0.04);
}

.skill-title {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.skill-desc {
  color: var(--muted);
  font-size: 14px;
}

.consult-cta {
  text-align: center;
  padding: 40px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(92, 255, 176, 0.08), rgba(20, 20, 20, 0.6));
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.contact-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f0f0f;
  color: var(--text);
  font-family: inherit;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
}

.form-consent a {
  color: var(--accent);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-center {
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Blog styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blog-card {
  min-height: 220px;
}

.blog-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.back-to-blog {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent);
}

.blog-post {
  max-width: 800px;
  margin: 0 auto;
}

.blog-post h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: 20px;
  font-family: "Playfair Display", serif;
  background: linear-gradient(120deg, var(--accent), #b87cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-post-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.meta-chip {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
}

.blog-post-content {
  line-height: 1.8;
  font-size: 1.1rem;
}

.blog-post-content h2 {
  font-size: 1.8rem;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--text);
}

.blog-post-content h3 {
  font-size: 1.4rem;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text);
}

.blog-post-content p {
  margin-bottom: 20px;
  color: var(--muted);
}

.blog-post-content ul,
.blog-post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--muted);
}

.blog-post-content li::marker {
  color: var(--accent);
}

.blog-post-content pre {
  background: #1a1a1a;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border);
}

.blog-post-content code {
  font-family: "Fira Code", monospace;
}

.blog-post-content :not(pre) > code {
  background: rgba(92, 255, 176, 0.1);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.blog-post-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: rgba(92, 255, 176, 0.05);
  border-left: 4px solid var(--accent);
  color: var(--muted);
}

.blog-spinner-wrapper {
  text-align: center;
  padding: 60px 20px;
}

.blog-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 3px solid rgba(92, 255, 176, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.blog-error {
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: 16px;
}

@media (max-width: 900px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid,
  .skills-grid,
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav {
    flex-wrap: wrap;
  }
  .projects-grid,
  .skills-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 70px 0;
  }
  /* Стили для таблиц в статьях */
.blog-post-content .table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.blog-post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.blog-post-content th {
  background: rgba(92, 255, 176, 0.15);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.blog-post-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.blog-post-content tr:last-child td {
  border-bottom: none;
}

.blog-post-content tr:hover td {
  background: rgba(92, 255, 176, 0.05);
}
}