:root {
  --bg: #121212;
  --bg-2: #1a1a1a;
  --line: #262626;
  --text: #8a8a8a;
  --text-dim: #5a5a5a;
  --white: #ececec;
  --accent: #ffffff;
  --side: 240px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 "Source Sans 3", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
h1 { color: var(--white); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; font-size: clamp(1.8rem, 3vw, 2.6rem); }
strong { color: var(--white); font-weight: 600; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  padding: 44px 32px 32px;
  display: flex; flex-direction: column;
  z-index: 20;
}
.brand { display: block; margin-bottom: 36px; }
.brand-name { display: block; color: var(--white); font-size: 1.25rem; font-weight: 700; letter-spacing: .01em; }
.brand-role { display: block; color: var(--text-dim); font-size: .95rem; }
.sidebar-body { display: flex; flex-direction: column; flex: 1; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.nav a { position: relative; width: fit-content; font-size: 1.05rem; color: var(--text); transition: color .25s; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 3px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav a:hover { color: var(--white); }
.nav a.active { color: var(--accent); font-weight: 600; }
.nav a.active::after, .nav a:hover::after { transform: scaleX(1); }

.filters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; transition: opacity .3s, transform .3s var(--ease); }
.filters.off { opacity: 0; pointer-events: none; transform: translateX(-8px); }
.filters button { font-size: .95rem; color: var(--text); transition: color .2s, transform .25s var(--ease); }
.filters button:hover { color: var(--white); transform: translateX(4px); }
.filters button.active { color: var(--white); font-weight: 600; }

.sidebar-foot { margin-top: auto; font-size: .82rem; color: var(--text-dim); }
.sidebar-foot p { margin: 10px 0 0; }
.socials { display: flex; flex-direction: column; gap: 2px; }
.socials a { width: fit-content; transition: color .2s; }
.socials a:hover { color: var(--accent); }
.menu-toggle { display: none; }

/* Language toggle */
.lang { position: relative; display: inline-flex; margin-top: 14px; border: 1px solid var(--line); border-radius: 20px; padding: 2px; }
.lang button { position: relative; z-index: 1; width: 38px; padding: 2px 0; font-size: .75rem; font-weight: 600; letter-spacing: .08em; color: var(--text-dim); transition: color .3s; }
.lang button:hover { color: var(--white); }
.lang button.active { color: #111; }
.lang-pill { position: absolute; top: 2px; bottom: 2px; left: 2px; width: 38px; border-radius: 20px; background: var(--accent); transition: transform .35s var(--ease); }
.lang[data-active="en"] .lang-pill { transform: translateX(38px); }
.i18n-fade { animation: langFade .35s var(--ease); }
@keyframes langFade { from { opacity: 0; } }
.contact-ico { margin: 30px 0 0; font-size: .85rem; color: var(--text-dim); }

/* ---------- Main ---------- */
.main { margin-left: var(--side); padding: 44px 44px 80px 0; min-height: 100vh; }
.view { animation: viewIn .5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Work grid */
.grid { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.card {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 1180 / 300; background: var(--bg-2);
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.card.in { opacity: 1; transform: none; }
.card.hide { display: none; }
.card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease), filter .5s;
  filter: saturate(.92) brightness(.92);
}
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.15) 45%, transparent 70%);
  opacity: 0; transition: opacity .45s;
}
.card-info {
  position: absolute; left: 30px; bottom: 24px; z-index: 1;
  transform: translateY(12px); opacity: 0;
  transition: transform .45s var(--ease), opacity .45s;
}
.card-info h2 { margin: 0; color: #fff; font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.card-info span { font-size: .9rem; color: #c8c8c8; }
.card-info .arrow { display: inline-block; margin-left: 8px; color: var(--accent); transition: transform .35s var(--ease); }
.card-count {
  position: absolute; right: 18px; top: 16px; z-index: 1;
  font-size: .78rem; color: #ddd; letter-spacing: .05em;
  background: rgba(0,0,0,.45); padding: 2px 9px; border-radius: 20px;
  opacity: 0; transition: opacity .4s;
}
.card:hover img, .card:focus-visible img { transform: scale(1.045); filter: none; }
.card:hover::after, .card:focus-visible::after { opacity: 1; }
.card:hover .card-info, .card:focus-visible .card-info { opacity: 1; transform: none; }
.card:hover .card-count { opacity: 1; }
.card:hover .arrow { transform: translateX(5px); }
.card:active img { transform: scale(1.02); transition-duration: .2s; }

/* Project detail */
.back { display: inline-block; margin-bottom: 22px; font-size: .95rem; transition: color .2s, transform .25s var(--ease); }
.back:hover { color: var(--white); transform: translateX(-4px); }
.project-head { max-width: 1180px; }
.project-hero { overflow: hidden; background: var(--bg-2); view-transition-name: hero; }
.project-hero img { width: 100%; max-height: 78vh; object-fit: cover; cursor: zoom-in; }
.project-meta { padding: 30px 0 10px; max-width: 720px; }
.project-meta > * { animation: viewIn .6s var(--ease) both; }
.project-meta > *:nth-child(2) { animation-delay: .06s; }
.project-meta > *:nth-child(3) { animation-delay: .12s; }
.project-meta > *:nth-child(4) { animation-delay: .18s; }
.project-sub { margin: 0 0 14px; color: var(--accent); font-size: .95rem; }
.project-desc { margin: 0 0 18px; color: #a9a9a9; }
.project-images { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; margin-top: 18px; }
.project-images figure {
  margin: 0; overflow: hidden; background: var(--bg-2); cursor: zoom-in;
  opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.project-images figure.in { opacity: 1; transform: none; }
.project-images img { width: 100%; transition: transform .8s var(--ease); }
.project-images figure:hover img { transform: scale(1.015); }
.project-nav { display: flex; justify-content: space-between; gap: 20px; max-width: 1180px; margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--line); }
.project-nav a { display: flex; flex-direction: column; transition: color .2s, transform .3s var(--ease); }
.project-nav a:last-child { text-align: right; }
.project-nav small { color: var(--text-dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.project-nav span { color: var(--white); font-size: 1.15rem; }
.project-nav a:first-child:hover { transform: translateX(-5px); }
.project-nav a:last-child:hover { transform: translateX(5px); }
.project-nav a:hover span { color: var(--accent); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tags li { font-size: .82rem; padding: 3px 11px; border: 1px solid var(--line); border-radius: 20px; color: #a0a0a0; transition: border-color .2s, color .2s; }
.tags li:hover { border-color: var(--accent); color: var(--white); }

/* Reveal helper (about / contact) */
.reveal { animation: viewIn .65s var(--ease) both; }
.view .reveal:nth-child(2) { animation-delay: .07s; }
.view .reveal:nth-child(3) { animation-delay: .14s; }
.view .reveal:nth-child(4) { animation-delay: .21s; }
.view .reveal:nth-child(5) { animation-delay: .28s; }

/* About */
.about, .contact { max-width: 720px; padding-top: 6px; }
.contact { max-width: 860px; }
.about-top { display: flex; align-items: center; gap: 26px; margin-bottom: 28px; }
.avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex-shrink: 0; filter: grayscale(.3); transition: filter .4s, transform .5s var(--ease); }
.avatar:hover { filter: none; transform: rotate(-4deg) scale(1.04); }
.lead { font-size: 1.15rem; color: #a9a9a9; margin: 0; }
.about-text p { margin: 0 0 1em; color: #a0a0a0; }
.about-cols { margin: 30px 0 34px; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; padding: 15px 0;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--white); font-weight: 600; transition: color .2s;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 300; font-size: 1.4rem; line-height: 1; color: var(--text); transition: transform .35s var(--ease), color .2s; }
details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
summary:hover { color: var(--accent); }
details > :not(summary) { padding-bottom: 18px; animation: viewIn .4s var(--ease) both; }
.reel { position: relative; aspect-ratio: 16/9; background: #111 url("img/vzDLya/01.webp") center/cover; }
.reel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.5); color: #fff; font-size: 1.05rem; letter-spacing: .03em; transition: background .3s;
}
.reel-play:hover { background: rgba(0,0,0,.3); }

/* Alkemy */
.alkemy { max-width: 860px; padding-top: 6px; }
.alk-head { display: flex; align-items: center; gap: 26px; margin-bottom: 28px; }
.alk-logo { width: 96px; height: 96px; flex-shrink: 0; opacity: .92; transition: transform .6s var(--ease), opacity .3s; }
.alk-logo:hover { transform: rotate(-8deg) scale(1.05); opacity: 1; }
.alk-text p { margin: 0 0 1em; color: #a0a0a0; max-width: 720px; }
.alk-text p:first-child { color: #c4c4c4; font-size: 1.08rem; }
.alk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin: 30px 0 10px; }
.alk-link { color: var(--white); font-weight: 600; opacity: .75; transition: opacity .3s, transform .3s var(--ease); }
.alk-link:hover { opacity: 1; transform: translateX(5px); }
.alk-note { margin: 0 0 34px; font-size: .85rem; color: var(--text-dim); }
.alk-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.alk-shots figure { margin: 0; overflow: hidden; background: var(--bg-2); cursor: zoom-in; }
.alk-shots img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; transition: transform .8s var(--ease), filter .5s; filter: saturate(.92) brightness(.92); }
.alk-shots figure:hover img { transform: scale(1.03); filter: none; }
.alk-art-title { margin: 46px 0 16px; font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.alk-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 34px; }
.alk-art figure { margin: 0; overflow: hidden; background: #fff; cursor: zoom-in; }
.alk-art img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .8s var(--ease), filter .5s; filter: brightness(.94); }
.alk-art figure:hover img { transform: scale(1.04); filter: none; }
.alk-small { margin: 0; color: #a0a0a0; font-size: .95rem; }
.alk-small a { color: var(--white); border-bottom: 1px solid var(--line); transition: border-color .2s; }
.alk-small a:hover { border-color: var(--accent); }

/* Buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; min-width: 170px; overflow: hidden;
  border: 1px solid var(--accent); color: var(--accent); font-weight: 600;
  transition: color .35s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: translateY(101%); transition: transform .35s var(--ease); z-index: -1;
}
.btn { isolation: isolate; }
.btn:hover { color: #111; }
.btn:hover::before { transform: none; }
.btn:disabled { opacity: .6; cursor: progress; }

/* Contact form */
.contact .lead { margin-bottom: 34px; }
.big-quote {
  font-size: clamp(2.6rem, 6.5vw, 5.6rem); font-weight: 700; line-height: .95;
  text-transform: uppercase; letter-spacing: -.02em; margin-bottom: .45em;
}
.all-work {
  display: inline-block; margin-top: 26px; color: var(--white); font-weight: 600;
  transition: transform .3s var(--ease), opacity .3s; opacity: .75;
}
.all-work:hover { opacity: 1; transform: translateX(5px); }
.all-work[hidden] { display: none; }
.form { display: flex; flex-direction: column; gap: 22px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 22px 0 8px; background: transparent;
  border: 0; border-bottom: 1px solid #333; color: var(--white);
  font: inherit; font-size: 1.05rem; outline: none; resize: vertical;
  transition: border-color .3s;
}
.field input:-webkit-autofill, .field input:-webkit-autofill:hover, .field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--white);
  caret-color: var(--white);
  transition: background-color 9999s;
}
.field input:-webkit-autofill + label { transform: translateY(-20px) scale(.8); color: var(--accent); }
.field label {
  position: absolute; left: 0; top: 20px; color: var(--text-dim); pointer-events: none;
  transform-origin: left; transition: transform .3s var(--ease), color .3s;
}
.field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.field:focus-within::after { transform: scaleX(1); }
.field textarea { padding-top: 26px; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-20px) scale(.8); color: var(--accent); }
.field.invalid input, .field.invalid textarea { border-bottom-color: #e0645a; }
.field.invalid label { color: #e0645a; }
.field.invalid { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.form .btn { align-self: flex-start; margin-top: 6px; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; min-height: 1.6em; font-size: .95rem; transition: opacity .3s; }
.form-status.ok { color: #6cc28a; }
.form-status.err { color: #e0645a; }
.form.sent .field, .form.sent .btn { opacity: .35; pointer-events: none; transition: opacity .5s; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(12,12,12,.96);
  display: grid; place-items: center; animation: fade .3s both;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 90vh; object-fit: contain; animation: zoomIn .35s var(--ease) both; }
.lightbox button { position: absolute; color: #bbb; font-size: 2.6rem; line-height: 1; padding: 14px; transition: color .2s, transform .25s var(--ease); }
.lightbox button:hover { color: #fff; }
.lb-close { top: 10px; right: 18px; }
.lb-prev { left: 10px; top: 50%; translate: 0 -50%; }
.lb-next { right: 10px; top: 50%; translate: 0 -50%; }
.lb-prev:hover { transform: translateX(-4px); }
.lb-next:hover { transform: translateX(4px); }
.lb-count { position: absolute; bottom: 18px; left: 50%; translate: -50% 0; font-size: .85rem; color: #888; }
@keyframes fade { from { opacity: 0; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.96); } }

::view-transition-old(hero), ::view-transition-new(hero) { animation-duration: .5s; animation-timing-function: cubic-bezier(.22,.61,.36,1); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .sidebar { position: sticky; top: 0; width: auto; padding: 16px; background: rgba(18,18,18,.94); backdrop-filter: blur(10px); flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .brand { margin: 0; }
  .menu-toggle { display: flex; flex-direction: column; gap: 6px; width: 30px; padding: 8px 0; }
  .menu-toggle span { height: 2px; background: var(--white); transition: transform .3s var(--ease); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .sidebar-body { flex-basis: 100%; display: block; max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
  .sidebar.open .sidebar-body { max-height: 520px; }
  .nav { margin-top: 20px; }
  .filters.off { display: none; }
  .sidebar-foot { margin-top: 24px; }
  .main { margin: 0; padding: 12px 16px 60px; }
  .card { aspect-ratio: 16 / 7; }
  .card-info { opacity: 1; transform: none; left: 16px; bottom: 12px; }
  .card-info h2 { font-size: 1.15rem; }
  .card::after { opacity: 1; }
  .about-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .alk-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .alk-logo { width: 72px; height: 72px; }
  .alk-shots { grid-template-columns: 1fr; }
  .alk-art { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
