:root {
  --ink: #111;
  --muted: #555;
  --line: #111;
  --bg: #fff;
  --font: "Courier New", Courier, monospace;
  --max: 1180px;
  --gap: 32px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site-header { text-align: center; padding: 56px 16px 72px; }
.site-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3em;
  margin: 0;
  padding-left: 0.3em; /* balance trailing letter-spacing */
}

main { flex: 1; }

/* ---------- home grid (masonry) ---------- */
.grid { display: flex; gap: var(--gap); align-items: flex-start; }
.grid-col { flex: 1; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.card { display: block; position: relative; overflow: hidden; background: #f2f2f2; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, opacity .4s ease; }
.card-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center;
  font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase;
  background: rgba(255,255,255,.82);
  opacity: 0; transition: opacity .3s ease;
}
.card:hover .card-label, .card:focus-visible .card-label { opacity: 1; }
.card:hover img { transform: scale(1.03); }

/* ---------- project page ---------- */
.project-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 64px;
}
.project-title {
  font-size: 18px; font-weight: 700; letter-spacing: 0.12em; margin: 0;
}
.project-text p { margin: 0 0 1em; max-width: 52ch; }
.project-sub { color: var(--muted); }

.media { display: flex; flex-direction: column; gap: var(--gap); }
.media img { width: 100%; height: auto; cursor: zoom-in; background: var(--bg); }
.media video { width: 100%; height: auto; background: #000; }
.embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pager {
  display: flex; justify-content: space-between;
  margin: 64px 0 0; font-size: 13px;
}
.pager a:hover { text-decoration: underline; }

/* ---------- contact ---------- */
.contact { max-width: 360px; margin: 0 auto; }
.contact h2 { font-size: 16px; font-weight: 400; letter-spacing: 0.2em; margin: 0 0 24px; }
.contact p { margin: 0 0 1.5em; }
.contact a:hover { text-decoration: underline; }
.socials { display: flex; gap: 14px; margin-top: 32px; justify-content: center; }
.socials a { display: inline-flex; padding: 4px; }
.socials svg { width: 22px; height: 22px; }
.socials a:hover { opacity: .6; text-decoration: none; }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 96px 16px 40px; font-size: 11px; }
.footer-nav { display: inline-flex; align-items: stretch; margin-bottom: 16px; }
.footer-nav a { padding: 8px 12px; letter-spacing: 0.04em; }
.footer-nav a + a { border-left: 1px solid var(--line); }
.footer-nav a:hover, .footer-nav a[aria-current] { text-decoration: underline; }
.copyright { margin: 0; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(255,255,255,.97);
  display: none; align-items: center; justify-content: center;
  padding: 48px 16px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: 0; font: inherit;
  font-size: 28px; color: var(--ink); cursor: pointer; padding: 12px 16px;
}
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  :root { --gap: 20px; }
  .site-header { padding: 40px 16px 48px; }
  .site-title { font-size: 17px; }
  .project-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  .card-label { opacity: 0; }
}
