:root{
  --bg:#050505;
  --panel:rgba(255,255,255,.045);
  --border:rgba(255,255,255,.08);
  --text:#f3f3f3;
  --muted:rgba(243,243,243,.66);
  --muted-2:rgba(243,243,243,.46);
  --shadow:0 30px 90px rgba(0,0,0,.45);
  --radius:28px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,system-ui,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.07), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(255,255,255,.05), transparent 20%),
    linear-gradient(180deg,#0b0b0b 0%,#050505 100%);
  min-height:100vh;
  overflow-x:hidden;
}

.wrap{
  width:min(1120px, calc(100% - 32px));
  margin:0 auto;
}

/* БОКОВЫЕ ДЕКОРАТИВНЫЕ ЛИНИИ */
.side-lines{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
}
.side-line{
  position:absolute;
  top:0;
  bottom:0;
  width:1px;
  background:linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255,255,255,.04) 15%,
    rgba(255,255,255,.06) 50%,
    rgba(255,255,255,.04) 85%,
    transparent 100%
  );
}
.side-line-left{ left:calc(50% - 580px); }
.side-line-right{ right:calc(50% - 580px); }
@media(max-width:1200px){
  .side-line-left{ left:8px; }
  .side-line-right{ right:8px; }
}

.noise{
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.045;
  background-image:radial-gradient(circle at 1px 1px,#fff 1px,transparent 0);
  background-size:20px 20px;
  z-index:0;
}

.bg-blur{
  position:fixed;
  width:520px;
  height:520px;
  border-radius:50%;
  filter:blur(60px);
  opacity:.16;
  pointer-events:none;
  z-index:0;
}
.bg-blur-1{ background:rgba(255,255,255,.42); top:-220px; left:-160px; }
.bg-blur-2{ background:rgba(255,255,255,.25); bottom:-240px; right:-180px; }

/* TOPBAR */
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(18px);
  background:rgba(6,6,6,.52);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
  position:relative;
  z-index:1;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.brand-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 18px rgba(255,255,255,.55);
}
.links{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  align-items:center;
}
.links a{
  color:var(--muted);
  text-decoration:none;
  font-size:14px;
  transition:.2s ease;
}
.links a:hover{ color:#fff; }

/* HERO */
.hero{
  position:relative;
  z-index:1;
  padding:32px 0 18px;
}
.hero-layout{
  display:grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap:20px;
}
.hero-main-card,
.panel,
.project-card,
.code-panel{
  background:linear-gradient(180deg, var(--panel), rgba(255,255,255,.02));
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  backdrop-filter:blur(16px);
}
.hero-main-card{
  border-radius:32px;
  padding:28px;
  position:relative;
  overflow:hidden;
}
.hero-main-card::after{
  content:'';
  position:absolute;
  width:380px; height:380px;
  border-radius:50%;
  right:-160px; top:-220px;
  background:radial-gradient(circle, rgba(255,255,255,.12), transparent 65%);
  filter:blur(8px);
  pointer-events:none;
}
.hero-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.eyebrow{
  color:var(--muted-2);
  font-size:12px;
  letter-spacing:.2em;
  text-transform:uppercase;
  min-height:14px;
  margin-bottom:10px;
}
h1{
  margin:0;
  font-size:clamp(52px, 8vw, 90px);
  line-height:.92;
  letter-spacing:-.07em;
}
.status-pill{
  flex:0 0 auto;
  padding:8px 13px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.09);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
}
.lead{
  max-width:720px;
  margin:14px 0 0;
  color:var(--muted);
  font-size:17px;
  line-height:1.7;
}
.hero-actions{
  display:flex;
  gap:10px;
  margin-top:22px;
  flex-wrap:wrap;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 18px;
  border-radius:999px;
  text-decoration:none;
  font-weight:600;
  transition:.2s ease;
  border:1px solid var(--border);
  font-size:14px;
}
.btn:hover{ transform:translateY(-1px); }
.btn-primary{ background:#fff; color:#000; }
.btn-primary:hover{ background:#eaeaea; }
.btn-secondary{ background:rgba(255,255,255,.03); color:var(--text); }

.meta-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:24px;
}
.meta-card{
  padding:14px;
  border-radius:20px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}
.meta-label{
  display:block;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.18em;
  color:var(--muted-2);
  margin-bottom:8px;
}
.meta-value{ display:block; font-size:14px; }

/* CODE PANEL */
.code-panel{
  border-radius:32px;
  padding:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.code-header{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  background:rgba(0,0,0,.7);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.dot{ width:10px; height:10px; border-radius:50%; }
.red{ background:#ff5f57; }
.yellow{ background:#febc2e; }
.green{ background:#28c840; }
.code-title{ margin-left:6px; color:var(--muted-2); font-size:12px; }
.code-body{
  padding:14px 16px 16px;
  font-family:"SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size:13px;
  line-height:1.6;
  color:#e8f5ff;
  background:radial-gradient(circle at top, rgba(0,0,0,.2), transparent 45%);
  max-height:260px;
  overflow:hidden;
  -webkit-mask-image:linear-gradient(to bottom, transparent 0%, black 18%, black 100%);
  mask-image:linear-gradient(to bottom, transparent 0%, black 18%, black 100%);
}
.code-line{ white-space:pre; }
.code-cursor{
  display:inline-block;
  width:8px;
  background:#e8f5ff;
  margin-left:2px;
  animation:blink 1s steps(1) infinite;
}
.c-kw       { color:#c792ea; }
.c-fn       { color:#82aaff; }
.c-str      { color:#c3e88d; }
.c-builtin  { color:#82aaff; }
.c-decorator{ color:#ffcb6b; }
.c-num      { color:#f78c6c; }
.c-comment  { color:#546e7a; font-style:italic; }

/* SECTIONS */
.section{
  position:relative;
  z-index:1;
  border-top:1px solid rgba(255,255,255,.04);
  padding-top:28px;
  padding-bottom:0;
}
.hero + .section{ border-top:none; }
.section-title{
  display:flex;
  align-items:end;
  justify-content:space-between;
  margin-bottom:12px;
}
.section-title h2{ margin:0; font-size:19px; letter-spacing:-.03em; }
.section-title span{ color:var(--muted-2); font-size:13px; }

.panel{ border-radius:26px; padding:22px; }
.about-panel p{
  margin:0;
  max-width:820px;
  color:var(--muted);
  line-height:1.8;
}

/* DISCORD STATS */
.br3d-stats{
  display:flex;
  align-items:center;
  gap:8px;
  margin:8px 0 10px;
  font-size:13px;
  color:var(--muted);
}
.br3d-stat{ display:flex; align-items:center; gap:5px; }
.br3d-stat-sep{ color:var(--muted-2); }
.br3d-dot{ width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.br3d-dot-online{ background:#23d18b; box-shadow:0 0 6px rgba(35,209,139,.6); }

/* PROJECTS */
.projects{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.project-card{
  border-radius:26px;
  padding:18px;
  transition:.22s ease;
  position:relative;
  overflow:hidden;
}
.project-card::before{
  content:'';
  position:absolute;
  inset:auto -25% -55% auto;
  width:220px; height:220px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.08), transparent 68%);
  pointer-events:none;
}
.project-card:hover{
  transform:translateY(-3px);
  border-color:rgba(255,255,255,.16);
  background:linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
}
.project-image{
  width:100%;
  aspect-ratio:16 / 10;
  border-radius:18px;
  overflow:hidden;
  margin-bottom:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
}
.project-image img{ width:100%; height:100%; object-fit:cover; display:block; }
.project-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;
  position:relative;
  z-index:1;
}
.project-index{ color:#fff; font-size:12px; letter-spacing:.16em; }
.project-tag{ color:var(--muted-2); font-size:11px; text-transform:uppercase; letter-spacing:.16em; }
.project-card h3{ margin:0 0 8px; font-size:19px; letter-spacing:-.03em; position:relative; z-index:1; }
.project-card p{ margin:0; color:var(--muted); line-height:1.7; font-size:14px; position:relative; z-index:1; }

.project-link{
  display:inline-flex;
  align-items:center;
  margin-top:16px;
  color:#fff;
  text-decoration:none;
  font-size:14px;
  font-weight:500;
  position:relative;
  z-index:1;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.1);
  transition:.2s ease;
  cursor:pointer;
}
.project-link::after{ content:'↗'; margin-left:6px; opacity:.7; }
.project-link:hover{
  background:rgba(255,255,255,.1);
  border-color:rgba(255,255,255,.22);
  transform:translateY(-1px);
}

/* CONTACT */
.contact-panel{ justify-content:center; display:flex; gap:10px; flex-wrap:wrap; }
.chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:96px;
  padding:11px 16px;
  border-radius:999px;
  text-decoration:none;
  color:var(--text);
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  transition:.2s ease;
  font-size:14px;
}
.chip:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.2);
  box-shadow:0 0 18px rgba(255,255,255,.06);
}

/* FOOTER */
.footer{
  position:relative;
  z-index:1;
  padding:24px 0 38px;
  text-align:center;
  color:var(--muted-2);
  font-size:13px;
}

/* ANIMATIONS */
.fade-up{ opacity:0; transform:translateY(16px); transition:opacity .7s ease, transform .7s ease; }
.fade-up.visible{ opacity:1; transform:translateY(0); }
.delay-1{ transition-delay:.08s; }
.delay-2{ transition-delay:.16s; }
.delay-3{ transition-delay:.24s; }

@keyframes blink{
  0%,50%{opacity:1;}
  50.01%,100%{opacity:0;}
}

@keyframes pulse{
  0%,100%{ box-shadow:0 0 6px rgba(35,209,139,.6); }
  50%{ box-shadow:0 0 12px rgba(35,209,139,.95); }
}
.br3d-dot-online{ animation:pulse 2s ease-in-out infinite; }

/* BROKEN IMAGE */
.project-image.img-missing{
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
}
.project-image.img-missing::after{
  content:'— скоро —';
  color:rgba(255,255,255,.18);
  font-size:13px;
  letter-spacing:.12em;
  text-transform:uppercase;
}

/* BACK TO TOP */
.back-to-top{
  position:fixed;
  bottom:28px; right:28px;
  width:40px; height:40px;
  border-radius:50%;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  font-size:18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transform:translateY(12px);
  transition:opacity .3s, transform .3s, background .2s;
  z-index:50;
}
.back-to-top.visible{ opacity:1; transform:translateY(0); }
.back-to-top:hover{ background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.25); }

/* LANG BUTTON */
.lang-btn{
  padding:6px 13px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.1);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  letter-spacing:.1em;
  cursor:pointer;
  transition:.2s ease;
  font-family:inherit;
}
.lang-btn:hover{ background:rgba(255,255,255,.08); color:#fff; border-color:rgba(255,255,255,.22); }

/* RESPONSIVE */
@media (max-width: 920px){
  .hero-layout{ grid-template-columns:1fr; }
  .code-panel{ order:2; }
  .hero-main-card{ order:1; }
  .meta-grid{ grid-template-columns:1fr; }
  .projects{ grid-template-columns:1fr 1fr; }
}
@media (max-width: 640px){
  .wrap{ width:min(100% - 20px, 1120px); }
  .nav{ gap:10px; }
  .links{ gap:12px; }
  .hero{ padding-top:24px; }
  .hero-main-card{ padding:22px; }
  h1{ font-size:46px; }
  .lead{ font-size:15px; }
  .projects{ grid-template-columns:1fr; }
  .btn{ flex:1 1 auto; justify-content:center; }
  .code-body{ max-height:220px; }
}