:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #999999;
  --hover: #111111;
  --rule: #e6e6e6;
  --sidebar-w: 240px;
  --gap: 8px;
  --font: "Jost", "Futura", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

img { display: block; max-width: 100%; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg);
  overflow-y: auto;
  z-index: 10;
}

.logo {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-bottom: 40px;
}

nav ul { list-style: none; margin: 0 0 36px; padding: 0; }
nav li { margin: 6px 0; }

nav a { color: var(--muted); transition: color 0.15s; }
nav a:hover, nav a.active { color: var(--hover); }

.nav-section {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* ---------- Main ---------- */

main {
  margin-left: var(--sidebar-w);
  padding: 48px 48px 24px 0;
  min-height: calc(100vh - 80px);
}

/* Home: square cover grid */
.covers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.cover {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f2f2f2;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.3s;
}

.cover span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s;
}

.cover:hover img { transform: scale(1.03); }
.cover:hover span, .cover:focus-visible span { opacity: 1; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Gallery: justified rows */
.gallery-title {
  margin: 0 0 24px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.justified .row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.justified button {
  flex-basis: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #f2f2f2;
  cursor: zoom-in;
  overflow: hidden;
}

.justified img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}
.justified button:hover img { opacity: 0.85; }

.gallery-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gallery-pager a { color: var(--muted); }
.gallery-pager a:hover { color: var(--text); }

/* Contact */
.contact { max-width: 560px; }
.contact p { color: #555; line-height: 1.6; margin: 0 0 28px; }
.contact label { display: block; font-size: 14px; margin: 0 0 6px; }
.contact input, .contact textarea {
  width: 100%;
  margin-bottom: 20px;
  padding: 12px 14px;
  font: inherit;
  border: 1px solid var(--rule);
  background: #fafafa;
  color: var(--text);
}
.contact textarea { min-height: 160px; resize: vertical; }
.contact input:focus, .contact textarea:focus { outline: none; border-color: var(--text); background: #fff; }
.contact button {
  padding: 12px 32px;
  font: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--text);
  border: 0;
  cursor: pointer;
}

/* ---------- Footer ---------- */

footer {
  margin-left: var(--sidebar-w);
  padding: 24px 48px 40px 0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
footer a:hover { color: var(--text); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.97);
}
.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 80px);
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  opacity: 0.6;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 16px; right: 24px; font-size: 40px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 64px; padding: 16px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-count { position: absolute; bottom: 20px; font-size: 13px; color: var(--muted); }

/* ---------- Mobile ---------- */

.menu-toggle { display: none; }

@media (max-width: 800px) {
  :root { --gap: 6px; }

  .sidebar {
    position: static;
    width: auto;
    padding: 24px 16px 20px;
    overflow: visible;
  }
  .logo { font-size: 22px; margin: 0; text-align: left; }
  .sidebar nav { display: none; margin-top: 24px; }
  body.menu-open .sidebar nav { display: block; }

  .menu-toggle {
    display: block;
    position: absolute;
    top: 26px;
    right: 16px;
    width: 32px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    z-index: 20;
  }
  .menu-toggle span {
    display: block;
    height: 2px;
    margin: 6px 0;
    background: var(--text);
    transition: transform 0.2s;
  }
  body.menu-open .menu-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  body.menu-open .menu-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

  main, footer { margin-left: 0; padding-left: 16px; padding-right: 16px; }
  main { padding-top: 0; }
  .justified .row { flex-direction: column; }
  .justified button { flex-basis: auto; }
  footer { flex-direction: column; gap: 8px; text-align: center; }

  .lightbox img { max-width: 100vw; max-height: calc(100vh - 120px); }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; font-size: 48px; }
}
