/* ---------- base ---------- */
:root {
  --ink: #000;
  --muted: #777;
  --paper: #fff;
  --side-w: 275px;
  --pad: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Tahoma, Verdana, Geneva, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- sidebar ---------- */
.side {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--side-w);
  padding: var(--pad);
  overflow-y: auto;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 34px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nav a.active { text-decoration: underline; }

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
}
.projects li { margin: 0 0 6px; }
.projects a {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.projects a.active { text-decoration: underline; }
.projects .year {
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}

/* ---------- main ---------- */
.main {
  margin-left: var(--side-w);
  min-height: 100vh;
  padding: var(--pad);
  font-size: 16px;
}

/* home */
.home {
  min-height: calc(100vh - 2 * var(--pad));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.home .name {
  font-size: clamp(1.7rem, 4.4vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-transform: uppercase;
  margin: 0;
}

/* Centre the name against the viewport, not against the column
   that starts after the sidebar. */
@media (min-width: 801px) {
  .home {
    margin-left: calc(-1 * (var(--side-w) + var(--pad)));
    width: calc(100% + var(--side-w) + 2 * var(--pad));
  }
}

/* fireworks canvas, behind the navigation and above the page */
.fireworks {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}
.side { z-index: 2; }
.home .name.clickable { cursor: pointer; }
.home .name.clickable:active { opacity: 0.75; }

/* project */
.project header { max-width: 720px; margin-bottom: 40px; }
.project h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}
.project .meta { color: var(--muted); margin: 0 0 14px; }
.project .text p { margin: 0 0 12px; max-width: 620px; }

.works {
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.work img {
  max-height: 82vh;
  width: auto;
  max-width: 100%;
  cursor: zoom-in;
}
.caption {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 560px;
}
.caption .t { color: var(--ink); font-weight: 700; }

/* Centring moves the image only; captions stay on the left margin. */
.work.center img { margin-left: auto; margin-right: auto; }
.work-text { max-width: 560px; margin-top: 12px; font-size: 15px; }
.work-text p { margin: 0 0 8px; }

/* about */
.about { max-width: 600px; }
.about h1 { font-size: 24px; margin: 0 0 24px; }
.about p { margin: 0 0 14px; }
.about .contact { margin-top: 36px; }
.about .cv { margin-top: 28px; }
.cv-button {
  display: inline-block;
  margin-top: 10px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  font-size: 14px;
}
.cv-button:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.97);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  z-index: 10;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; }

/* ---------- mobile ---------- */
@media (max-width: 800px) {
  :root { --pad: 20px; }
  .side {
    position: static;
    width: auto;
    padding-bottom: 0;
  }
  .nav { margin-bottom: 24px; }
  .projects { display: none; }
  .projects.open { display: block; margin-bottom: 8px; }
  .main { margin-left: 0; min-height: 0; }
  .home { min-height: 60vh; }
  .home .name { font-size: clamp(1.5rem, 7.5vw, 2.7rem); }
  .work img { max-height: none; }
  .mobile-projects { display: block; margin-top: 40px; }
}
@media (min-width: 801px) {
  .mobile-projects { display: none; }
}
