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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #111;
  background: #fff;
}

a {
  color: inherit;
}

header {
  padding: 1rem 2rem;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.header-home {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logoBar {
  display: flex;
  line-height: 0;
}

#placeholderLogo {
  display: none;
}

.canvasHolder {
  display: none;
  width: 50px;
  height: 100px;
  flex-shrink: 0;
}

.canvasHolder canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.holderLeft {
  border-right: 1px solid #111;
}

.svgLogo {
  width: 130px;
  height: auto;
}

/* ── Project page (standalone) ── */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Split layout (index page) ── */

body:has(.layout) {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.sidebar {
  overflow-y: auto;
  border-right: 1px solid #e8e8e8;
  padding: 1.5rem;
}

.sidebar .project-list {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-top: 0;
  gap: 1rem;
}

.detail {
  overflow-y: auto;
  padding: 2rem;
}

.detail-placeholder {
  color: #888;
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* ── Project grid ── */

.project-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  display: block;
  text-decoration: none;
}

.project-card img,
.project-card .no-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}

.project-card h2 {
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.4rem;
}

.project-card:hover h2,
.project-card.active h2 {
  text-decoration: underline;
}

/* ── Project detail ── */

.project h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.project-body {
  max-width: 680px;
}

.project-body p {
  margin-bottom: 1rem;
}

.project-body p:has(img) {
  margin: 0;
}

.project-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

.project-body h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin: 2.5rem 0 0.75rem;
}

.project-body ul {
  list-style: none;
  padding: 0;
}

.project-body ul li {
  padding: 0.1rem 0;
}

.project-body ul li a {
  text-decoration: none;
  border-bottom: 1px solid #ddd;
}

.project-body ul li a:hover {
  border-bottom-color: #111;
}

/* ── Video embeds ── */

.embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  background: #000;
}

.embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Back link ── */

.back-link {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: #888;
}

.back-link:hover {
  color: #111;
}

/* ── Responsive ── */

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid #e8e8e8;
    max-height: 40vh;
  }

  .sidebar .project-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 600px) {
  main {
    padding: 1.25rem;
  }
}
