:root {
  --bg: #0a0f1c;
  --bg-2: #0e1530;
  --surface: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.12);
  --text: #e9edf5;
  --muted: #a7b0c6;
  --gold: #d4af37;
  --violet: #7c3aed;
  --blue: #3b82f6;
  --rose: #ff6b8b;
  --shadow: 0 18px 50px rgba(0,0,0,0.35);
  --radius: 16px;
  --container: 1120px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(124, 58, 237, 0.15), transparent),
    radial-gradient(800px 400px at 110% 0%, rgba(59, 130, 246, 0.12), transparent),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

#stars {
  position: fixed; inset: 0; z-index: -2;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,0.04), transparent), var(--bg-2);
}
#sparkles {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
}

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(10,15,28,0.9), rgba(10,15,28,0.35));
  backdrop-filter: blur(8px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #ffefb7 60%, var(--rose));
  color: #111827; font-weight: 800; box-shadow: var(--shadow);
}
.brand-name {
  font-family: Cinzel, serif; font-weight: 800; letter-spacing: .5px; font-size: 20px;
}
.brand-role {
  color: var(--muted); font-size: 12px; margin-left: 6px;
}
.nav-links { display: flex; gap: 20px; }
.nav-links a {
  color: var(--text); padding: 8px 10px; border-radius: 10px;
}
.nav-links a:hover {
  background: var(--surface); text-decoration: none;
}

/* Hero */
.hero {
  padding: 120px 0 72px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.00));
}
.hero-content { text-align: center; }
h1 {
  font-family: Cinzel, serif;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.1; margin: 0 0 14px;
  background: linear-gradient(90deg, var(--gold), #ffd970, #fff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 8px 30px rgba(212,175,55,0.15);
}
.gold { color: var(--gold); -webkit-text-fill-color: currentColor; }
.lead {
  font-size: clamp(16px, 1.6vw, 18px); color: var(--muted);
  max-width: 68ch; margin: 0 auto 18px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 12px 16px; border-radius: 999px; font-weight: 700; letter-spacing: .2px;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}
.btn.primary {
  background: linear-gradient(135deg, var(--violet), var(--blue)); border-color: transparent; color: #fff;
}
.btn.ghost:hover { background: rgba(255,255,255,0.09); }
.hero-meta {
  list-style: none; padding: 0; margin: 8px 0 0; color: var(--muted);
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

/* Sections */
.section { padding: 72px 0; position: relative; }
.section.alt { background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.00)); }

.section-title {
  text-align: center; margin: 0 0 24px;
  font-family: Cinzel, serif; font-size: clamp(22px, 3.2vw, 34px);
  position: relative; display: inline-block; left: 50%; transform: translateX(-50%);
}
.section-title::after {
  content: "✶ ✶ ✶"; display: block; color: var(--gold);
  font-size: 14px; letter-spacing: 8px; margin-top: 8px; opacity: .9;
}

.eyebrow { color: var(--gold); text-transform: uppercase; font-size: 12px; letter-spacing: .15em; margin: 0 0 10px; }

.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; }

.card {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}

.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.badge {
  padding: 6px 10px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* Portrait card */
.portrait {
  display: grid; gap: 16px; align-content: start; text-align: center; position: relative;
}
.portrait .crest {
  position: absolute; top: -16px; right: -10px; font-size: 28px; color: var(--gold);
  filter: drop-shadow(0 6px 12px rgba(212,175,55,.35));
}
.portrait-circle {
  width: 180px; height: 180px; margin: 8px auto 0; border-radius: 50%;
  background: conic-gradient(from 180deg at 50% 50%, rgba(212,175,55,.25), rgba(124,58,237,.25), rgba(59,130,246,.25), rgba(212,175,55,.25));
  border: 2px solid rgba(255,255,255,0.15);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.portrait-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;      /* чтобы картинка была круглой */
    object-fit: cover;       /* картинка заполнит круг без искажений */
}
.portrait-initials {
  font-family: Cinzel, serif; font-size: 42px; color: #fff;
  text-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.checklist { margin: 0; padding-left: 1.2rem; text-align: left; }
.checklist li { margin: 8px 0; }
.checklist li::marker { content: "✦ "; color: var(--gold); }

/* Skills */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.skill-icon { font-size: 28px; color: var(--gold); }
.skill h3 { margin: 8px 0 6px; font-family: Cinzel, serif; }

/* Projects */
.projects-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.project { display: grid; grid-template-rows: 180px auto; overflow: hidden; transition: transform .2s ease; }
.project:hover { transform: translateY(-3px); text-decoration: none; }
.project-cover {
  display: grid; place-items: center; color: #fff; font-size: 54px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
}
.project-cover.alt {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.project-info { padding: 16px; }
.project-info h3 { margin: 0 0 8px; font-family: Cinzel, serif; }
.link-arrow { color: var(--gold); }

/* Contact */
.contact-cards { display: grid; gap: 12px; margin: 8px 0 0; }
.contact-card {
  display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.contact-card i { color: var(--gold); font-size: 18px; }
.contact-card .label { color: var(--muted); font-size: 12px; }

.contact-form label { display: grid; gap: 6px; margin-bottom: 10px; font-size: 14px; }
input, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.35); color: var(--text);
}
.form-hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: linear-gradient(0deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00)); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 28px 0 8px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.brand.small .brand-name { font-size: 14px; }
.brand.small .brand-mark { width: 28px; height: 28px; }

/* Sparkles */
.sparkle {
  position: fixed; width: 8px; height: 8px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,.2) 60%, transparent 70%);
  box-shadow: 0 0 24px rgba(255,255,255,.6), 0 0 48px rgba(212,175,55,.35);
  animation: sparkle-fade .9s ease-out forwards;
}
@keyframes sparkle-fade {
  0% { transform: translate(-50%,-50%) scale(.8) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%,-50%) translateY(-12px) scale(0.4) rotate(45deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
  .skills-grid, .projects-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .skills-grid, .projects-grid { grid-template-columns: 1fr; }
  .brand-role { display: none; }
}