:root {
  --ink: #000;
  --paper: #fff;
  --muted: #666;
  --rule: #000;
  --sidebar-w: 260px;
  --pad: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Courier Prime", "Courier New", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--ink);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------- Sidebar ---------- */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: var(--pad) 24px var(--pad) var(--pad);
  border-right: 1px solid var(--ink);
  overflow-y: auto;
}

.studio-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 32px 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.studio-name a { display: inline-block; }

.menu, .menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu > li {
  margin-bottom: 6px;
}

.menu a {
  display: block;
  padding: 2px 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.menu ul {
  margin: 4px 0 10px 16px;
  border-left: 1px solid var(--ink);
  padding-left: 10px;
  display: none;
}
.menu li.open > ul { display: block; }

.menu ul a {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--muted);
}
.menu ul a:hover,
.menu ul a.active { color: var(--ink); }

.menu a.active { font-weight: 700; text-decoration: underline; }

/* ---------- Main ---------- */
main {
  margin-left: var(--sidebar-w);
  padding: var(--pad) var(--pad) 96px var(--pad);
}
main > section { max-width: 820px; }
main > section.wide { max-width: none; }
main > section.detail { max-width: 1080px; }

section h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 24px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
}

section h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 28px 0 10px 0;
}

section p { margin: 0 0 14px 0; }

.index {
  list-style: none;
  padding: 0;
  margin: 0;
}
.index li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--ink);
}
.index li:first-child { border-top: 1px dashed var(--ink); }

.plain {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
}
.plain li { padding: 4px 0; }
.plain li p {
  margin: 4px 0 6px 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 680px;
}

/* ---------- Project grid (section pages) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 1080px;
}
.project-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--ink);
}
.project-thumb .ph,
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.project-thumb .ph {
  background:
    repeating-linear-gradient(45deg, #000 0 1px, transparent 1px 14px),
    var(--paper);
  mix-blend-mode: multiply;
}
.project-thumb:hover .ph,
.project-thumb:hover img {
  transform: scale(1.03);
  filter: brightness(0.85);
}

@media (max-width: 900px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* ---------- Project detail page ---------- */
.project-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 32px;
}
.img-link {
  display: block;
  cursor: zoom-in;
  background: var(--paper);
  border: 1px solid var(--ink);
  overflow: hidden;
}
.img-link .ph,
.img-link img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}
.img-link .ph {
  background:
    repeating-linear-gradient(45deg, #000 0 1px, transparent 1px 14px),
    var(--paper);
  mix-blend-mode: multiply;
}
.img-link:hover .ph,
.img-link:hover img { filter: brightness(0.9); }

.project-text h2 {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px 0;
  border: none;
  padding: 0;
}
.project-text p { margin: 0 0 10px 0; }

@media (max-width: 720px) {
  .project-images { grid-template-columns: 1fr; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: zoom-out;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  display: block;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.lightbox .ph {
  width: min(80vmin, 900px);
  height: min(80vmin, 900px);
  border: 1px solid var(--ink);
  background:
    repeating-linear-gradient(45deg, #000 0 1px, transparent 1px 14px),
    var(--paper);
  mix-blend-mode: multiply;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: "Courier Prime", monospace;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 6px 12px;
  cursor: pointer;
}

/* ---------- Home / edge-to-edge image grid ---------- */
.home-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  width: 100%;
}
.home-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--paper);
}
.home-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1100px) { .home-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 800px)  { .home-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px)  { .home-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Misc ---------- */
blockquote {
  margin: 0 0 20px 0;
  padding: 8px 0 8px 16px;
  border-left: 2px solid var(--ink);
}
blockquote p { margin: 0 0 6px 0; }
blockquote cite { font-style: normal; color: var(--muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  #sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--ink);
    padding: 24px;
  }
  main {
    margin-left: 0;
    padding: 24px 24px 64px 24px;
  }
}


/* ---------- Video grid (4-across) ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1320px;
}
.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--ink);
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.video-thumb:hover img {
  transform: scale(1.03);
  filter: brightness(0.85);
}
.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 22px solid #fff;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  pointer-events: none;
  opacity: 0.85;
}
.video-thumb.is-active {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.video-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 6px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
  pointer-events: none;
}
.video-player-wrap {
  max-width: 1320px;
  margin: 0 0 24px 0;
}
.video-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--ink);
}
.video-player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-player-title {
  margin-top: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
@media (max-width: 1100px) {
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
}


/* ---------- Reviews table ---------- */
.reviews-table {
  width: 100%;
  max-width: 1100px;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
  border: 2px solid var(--ink);
}
.reviews-table thead th {
  background: var(--ink);
  color: #fff;
  font-weight: 400;
  text-align: center;
  padding: 14px 12px;
  text-transform: none;
  letter-spacing: 0.3px;
  font-size: 14px;
}
.reviews-table tbody td {
  padding: 28px 16px;
  text-align: center;
  border-top: 1px solid #ddd;
  vertical-align: middle;
  color: #555;
}
.reviews-table tbody tr:nth-child(even) td {
  background: #f5f5f5;
}
.reviews-table tbody tr:hover td {
  background: #ffd;
}
.reviews-table a {
  color: #555;
  text-decoration: none;
  border-bottom: 1px dotted #aaa;
}
.reviews-table a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
@media (max-width: 700px) {
  .reviews-table { font-size: 13px; }
  .reviews-table tbody td { padding: 16px 8px; }
}
