@font-face {
  font-family: 'ZagolovochnayaW01';
  src: url('../assets/fonts/Zagolovochnaya-Book.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'CodeSaver';
  src: url('../assets/fonts/CodeSaver-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #12169C;
  --cream: #F0EDE6;
  --white: #FAFAF8;
  --black: #0C0C0C;
  --muted: #5A5A5A;
  --border: #D8D4CC;
  --blue-light: #E8E9F8;
  --sidebar-w: 240px;
}

html, body { height: 100%; }

body {
  font-family: 'CodeSaver', monospace;
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'ZagolovochnayaW01', serif;
  font-weight: 400;
  letter-spacing: -0.5px;
}

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

/* ── LAYOUT ── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.sidebar .logomark {
  width: 48px;
  display: block;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 22px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--black);
}

.sidebar nav.primary a {
  display: block;
  color: var(--muted);
  padding: 4px 0;
  font-size: 14px;
}
.sidebar nav.primary a.active,
.sidebar nav.primary a:hover {
  color: var(--black);
}

.sidebar .projects-label {
  margin-top: 28px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 12px;
}

.sidebar nav.projects {
  display: flex;
  flex-direction: column;
}
.sidebar nav.projects a {
  color: var(--muted);
  padding: 4px 0;
  font-size: 13.5px;
}
.sidebar nav.projects a.active,
.sidebar nav.projects a:hover {
  color: var(--blue);
}

.sidebar .socials {
  margin-top: auto;
  display: flex;
  gap: 16px;
  padding-top: 24px;
}
.sidebar .socials a {
  color: var(--muted);
  display: flex;
  align-items: center;
}
.sidebar .socials a:hover { color: var(--blue); }
.sidebar .socials svg { width: 20px; height: 20px; }

/* ── MAIN ── */
.main {
  flex: 1;
  padding: 48px 56px 80px;
  min-width: 0;
}

/* Homepage grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
}
.grid-item { display: block; }
.grid-item .thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--cream);
  border-radius: 4px;
}
.grid-item .thumb img,
.grid-item .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.grid-item:hover .thumb img,
.grid-item:hover .thumb video { transform: scale(1.03); }
.grid-item .thumb .play-badge {
  position: absolute;
}
.grid-item h2 {
  margin-top: 16px;
  text-align: center;
  font-size: 22px;
}
.grid-item { position: relative; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-top { margin-bottom: 0; }
  .hamburger { display: flex; }
  .sidebar-links {
    display: none;
    margin-top: 24px;
  }
  .sidebar.nav-open .sidebar-links { display: flex; }
  .sidebar .socials { margin-top: 24px; }
  .main { padding: 32px 24px 64px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
}

/* ── ABOUT / CONTACT ── */
.page-title {
  text-align: center;
  font-size: 48px;
  margin-bottom: 40px;
}
.prose {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
}
.prose p { margin-bottom: 20px; line-height: 1.8; }

.about-logo {
  display: block;
  width: 33%;
  height: auto;
  margin: 40px auto 0;
}

.contact-info {
  text-align: center;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 40px;
}
.contact-info p { margin-bottom: 18px; line-height: 1.7; }
.contact-info .divider {
  color: var(--border);
  margin: 24px 0;
  font-size: 20px;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
}
.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 13px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: 'CodeSaver', monospace;
  font-size: 14px;
  margin-bottom: 22px;
  background: var(--white);
  color: var(--black);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--blue);
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form button {
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-family: 'CodeSaver', monospace;
  font-size: 14px;
  cursor: pointer;
}
.contact-form button:hover { background: var(--blue); }
.form-status { margin-top: 16px; font-size: 13.5px; color: var(--muted); }

/* ── EVENT DETAIL PAGE ── */
.event-header {
  margin-bottom: 36px;
}
.event-header .back-link {
  color: var(--muted);
  font-size: 13px;
  display: inline-block;
  margin-bottom: 18px;
}
.event-header .back-link:hover { color: var(--blue); }
.event-header h1 { font-size: 40px; margin-bottom: 10px; }
.event-header p { color: var(--muted); max-width: 640px; }

/* Justified rows: each figure's flex-grow equals its own aspect ratio (w/h),
   with flex-basis:0, so every item in a row renders at the SAME height and
   a width proportional to its real aspect ratio — the row always fills the
   container width exactly, and nothing is ever cropped. */
.event-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.event-row figure {
  overflow: hidden;
  border-radius: 6px;
  background: var(--cream);
  cursor: zoom-in;
  position: relative;
  margin: 0;
  min-width: 0;
}
.event-row figure img,
.event-row figure video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.event-row figure.is-video { cursor: default; }
.event-row figure.is-video video { cursor: pointer; }

/* A lone leftover item doesn't stretch to the full row width. */
.event-row.solo figure {
  flex-grow: 0 !important;
  flex-basis: auto !important;
  max-height: 480px;
  width: auto;
}
.event-row.solo figure img,
.event-row.solo figure video { width: auto; max-width: 100%; }

@media (max-width: 700px) {
  .event-row { flex-wrap: wrap; }
  .event-row figure { flex-basis: 45% !important; flex-grow: 1 !important; }
}
@media (max-width: 460px) {
  .event-row { flex-direction: column; }
  .event-row figure { width: 100%; }
}

/* ── LIGHTBOX ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12,12,12,0.92);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}
.lightbox .close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: var(--white);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  font-family: 'CodeSaver', monospace;
}
