  :root{
    --bg:#070707;
    --fg:#eaeaea;
    --muted:#9b9b9b;
    --card:#0f0f0f;
    --border:#1f1f1f;
    --accent:#ffffff;
    --glow: 0 6px 24px rgba(255,255,255,0.04);
    --max-width:1100px;
    --gap:28px;
    --radius:12px;
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  }

  html,body{height:100%;}
  body{
    margin:0;
    background:var(--bg);
    color:var(--fg);
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    line-height:1.45;
    display:flex;
    justify-content:center;
    padding:36px 18px;
  }

  .wrap{
    width:100%;
    max-width:var(--max-width);
    display:grid;
    grid-template-columns: 1fr 360px;
    gap:var(--gap);
    align-items:start;
  }

  header{
    grid-column:1 / -1;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:6px;
  }

  .brand{display:flex; gap:18px; align-items:center;}
  .logo{
    width:64px;height:64px;border-radius:14px;
    display:flex;align-items:center;justify-content:center;
    font-weight:700;font-size:22px;
    background:linear-gradient(180deg,#222,#111);
    border:1px solid var(--border); box-shadow:var(--glow);
  }
  .title h1{margin:0;font-size:20px;}
  .title p{margin:2px 0 0 0;color:var(--muted);font-size:13px;}

  nav{display:flex; gap:12px; align-items:center;}
  nav a{ text-decoration:none; color:var(--muted); font-size:14px; padding:8px 10px; border-radius:8px; transition:0.18s;}
  nav a:hover{ color:var(--fg); background:#121212; }

  main{min-width:0;}
  .hero{display:flex; gap:18px; align-items:center; margin-bottom:18px;}
  .role{ color:var(--muted); text-transform:uppercase; font-size:12px; letter-spacing:1px; margin-bottom:8px;}
  .big{ font-size:28px; margin:0 0 8px 0; }
  .lead{ margin:0; color:var(--muted); }

  .section-title{ margin:28px 0 12px 0; font-size:16px; color:var(--fg); display:flex; align-items:center; justify-content:space-between; gap:12px; }

  /* FILTERS */
  .filter-container {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px; 
    margin:6px 0 18px 0;
  }
  .filters{ display:flex; gap:10px; align-items:center; }
  .filter-btn{
    background:transparent;
    border:1px solid var(--border);
    color:var(--muted);
    padding:8px 12px;
    border-radius:10px;
    cursor:pointer;
    font-size:13px;
    transition:all .22s;
  }
  .filter-btn.active{ background:#151515; color:var(--fg); border-color:#333; box-shadow:0 6px 18px rgba(255,255,255,0.02); }

  /* Projects grid */
  .projects{ display:grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap:16px; }
  .card{
    border:1px solid var(--border);
    border-radius:12px;
    overflow:hidden;
    background:var(--card);
    box-shadow:var(--glow);
    display:flex;
    flex-direction:column;
    transform:translateY(0);
    transition:transform .36s cubic-bezier(.2,.9,.2,1), box-shadow .28s;
    will-change:transform, opacity;
    opacity:0; /* will be revealed via JS */
  }
  .card.visible{ opacity:1; }
  .card:hover{ transform: translateY(-6px) scale(1.01); box-shadow: 0 18px 50px rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }

  .thumb{ width:100%; padding-top:62%; position:relative; overflow:hidden; background:#0b0b0b; cursor: pointer; }
  .thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; filter:brightness(.86); transition:transform .5s ease, filter .3s; }
  .card:hover .thumb img{ transform:scale(1.04); filter:brightness(1); }
  .meta{ padding:14px; display:flex; flex-direction:column; gap:8px; flex:1; }
  .meta h3{ margin:0; font-size:15px; color:var(--fg); }
  .meta p{ margin:0; color:var(--muted); font-size:13px; flex:1; }
  .meta .tools{ font-size:12px; color:var(--muted); margin-top:8px; }

  /* Sidebar */
  aside{ position:sticky; top:28px; align-self:start; }
  .card-contacts{ padding:18px; border-radius:12px; border:1px solid var(--border); box-shadow:var(--glow); background:linear-gradient(180deg,#0b0b0b,#0d0d0d); }
  .contacts-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:10px; }
  .contacts-item{ display:flex; gap:10px; align-items:center; font-size:14px; color:var(--muted); }
  .contacts-item strong{ color:var(--fg); font-weight:600; width:84px; display:inline-block; }

  form{ margin-top:12px; display:flex; flex-direction:column; gap:10px; }
  input[type="text"], input[type="email"], textarea{ width:100%; padding:10px 12px; border-radius:8px; border:1px solid #222; background:#0c0c0c; color:var(--fg); font-size:14px; resize:vertical; }
  button.submit{ padding:10px 14px; border-radius:10px; border:0; cursor:pointer; font-weight:700; background:var(--accent); color:#000; }

  .muted{ color:var(--muted); font-size:13px; }
  a.plain{ color:inherit; text-decoration:none; }

  @keyframes fadeIn { from{ opacity:0; transform:translateY(10px);} to{opacity:1; transform:none;} }

  /* Preloader */
  #preloader{ position:fixed; inset:0; background:var(--bg); z-index:10000; display:flex; align-items:center; justify-content:center; }
  .spinner{ width:46px; height:46px; border-radius:50%; border:4px solid rgba(255,255,255,0.08); border-top-color:var(--accent); animation:spin .8s linear infinite; }
  @keyframes spin{ from{transform:rotate(0);} to{transform:rotate(360deg);} }

  /* Responsive */
  @media (max-width:980px){
    .wrap{ grid-template-columns:1fr; padding-bottom:30px; }
    aside{ position:static; }
    nav{ display:none; }
  }
  
  .header-contacts{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
}

.contact-link{
  color:var(--fg);
  text-decoration:none;
  font-size:14px;
  font-weight:600;
}

@media (max-width:980px){
  .header-contacts{
    align-items:flex-start;
    margin-top:10px;
  }

  header{
    flex-direction:column;
    align-items:flex-start;
  }
}
@media (max-width: 768px){
  .hero-image{
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
}