#layout-host { position: relative; z-index: 1; }
.router-error { padding: 4rem; color: var(--accent); font-size: 1.1rem; }

#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg); border-bottom: none;
}
#site-header .brand {
  font-family: 'GT-Pressura', sans-serif; font-weight: 400; font-synthesis: none; letter-spacing: 0.04em;
  font-size: 1.65rem; color: var(--fg); text-decoration: none; white-space: nowrap;
}
#site-header .brand:hover { color: var(--accent); }
#site-header .spacer { flex: 1; }
#site-header .nav-link {
  font-size: 0.78rem; color: var(--fg); text-decoration: none;
  border: 1px solid var(--border-strong); padding: 0.35rem 0.6rem;
}
#site-header .nav-link:hover { border-color: var(--accent); color: var(--accent); }

#site-footer {
  position: relative; z-index: 1;
  background: var(--bg); border-top: none;
}
#site-footer.footer-hidden { display: none; }
#site-footer .footer-bar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
}
#site-footer .brand {
  font-family: 'GT-Pressura', sans-serif; font-weight: 400; letter-spacing: 0.04em;
  font-size: 1.65rem; color: var(--fg); text-decoration: none; white-space: nowrap;
}
#site-footer .brand:hover { color: var(--accent); }
#site-footer .footer-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: 'GT-Pressura', sans-serif; font-weight: 400; letter-spacing: 0.04em;
  font-size: 1.65rem; color: var(--fg); white-space: nowrap;
}
#site-footer .footer-toggle:hover { color: var(--accent); }
#site-footer .spacer { flex: 1; }
#site-footer .nav-link {
  font-size: 0.78rem; color: var(--fg); text-decoration: none;
  border: 1px solid var(--border-strong); padding: 0.35rem 0.6rem;
}
#site-footer .nav-link:hover { border-color: var(--accent); color: var(--accent); }
#site-footer .footer-accordion {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms ease;
}
#site-footer .footer-accordion.open { grid-template-rows: 1fr; }
#site-footer .footer-accordion > div { overflow: hidden; }
#site-footer .footer-bio {
  font-family: 'GT-Pressura', sans-serif; font-weight: 300; font-synthesis: none; letter-spacing: 0.04em;
  font-size: 0.55rem; color: var(--fg-muted); line-height: 1.5;
  padding: 0 0 1rem; margin-left: 3.35rem; max-width: 560px;
}

.detail-content {
  background: var(--bg); border: none;
  padding: 1.25rem; position: relative;
  cursor: url('../data/cursor-32.png') 2 2, auto;
}
.detail-head h2 { font-family: 'GT-Pressura', sans-serif; font-size: 1.1rem; font-weight: 400; font-synthesis: none; margin-bottom: 0.25rem; }
.detail-meta { font-family: 'GT-Pressura-Mono', monospace; font-size: 0.6rem; color: var(--fg-muted); margin-bottom: 0.6rem; letter-spacing: 0.02em; font-weight: 400; font-synthesis: none; }
.detail-desc { font-family: 'GT-Pressura', sans-serif; font-size: 0.88rem; line-height: 1.55; color: var(--fg-desc); margin-bottom: 1rem; font-weight: 300; font-synthesis: none; }
.detail-meta { margin-top: 0.45rem; margin-bottom: 0; }
.detail-desc:empty { display: none; }
.detail-media { width: 100%; height: auto; display: block; max-height: 60vh; object-fit: contain; background: var(--bg); }
.detail-media-link { display: block; cursor: pointer; }
.detail-media-link:hover .detail-media { opacity: 0.85; }
.detail-gallery { display: flex; gap: 0.6rem; width: 100%; }
.detail-gallery-img { flex: 1 1 0; min-width: 0; width: 0; height: auto; max-height: 55vh; object-fit: contain; }
.detail-yt-wrap { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden; background: var(--bg); }
.detail-yt-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.detail-media-wrap { margin-bottom: 0.9rem; }
.detail-links a { font-size: 0.82rem; color: var(--accent); text-decoration: none; }
.detail-links a:hover { text-decoration: underline; }
.detail-close {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 32px; height: 32px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); font-size: 1.2rem; cursor: pointer; line-height: 1;
}
.detail-external-btn {
  display: inline-block; padding: 0.6rem 0.9rem; border: 1px solid var(--accent);
  color: var(--accent); text-decoration: none; font-size: 0.85rem;
}
.detail-external-btn:hover { background: var(--accent); color: #000; }

#project-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 1.5rem;
  background: var(--bg);
}
#project-overlay[hidden] { display: none !important; }
#project-overlay .overlay-inner { width: min(760px, 100%); max-height: 90vh; overflow: auto; }

.layout-tiling .tiling-canvas-wrap { position: fixed; inset: 0; z-index: 0; }
.layout-tiling .tiling-hint { position: fixed; bottom: 0.6rem; left: 50%; transform: translateX(-50%);
  font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.35; z-index: 5; pointer-events: none; }

.layout-index { padding-top: 56px; background: var(--bg); }
.index-list { list-style: none; width: 100%; max-width: none; margin: 0; padding: 0 1rem 0.7rem; }
.index-row {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.85rem 0; border-bottom: none;
}
.index-row,
.index-row:has(.index-title-inner:hover, .index-type:hover, .index-thumb:hover),
.index-row.open,
.index-row.open:has(.index-title-inner:hover, .index-type:hover, .index-thumb:hover) { background: transparent !important; }
.index-row.open { border-bottom: none; }

.index-type:hover { color: var(--accent); }
.index-thumb:hover { border-color: var(--accent); }
.index-num { display: block; width: 2rem; flex-shrink: 0; visibility: hidden; pointer-events: none; }
.index-title { flex: 1; font-size: 1rem; font-family: 'GT-Pressura', sans-serif; font-weight: 300; font-synthesis: none; display: flex; }
.index-title-inner { cursor: pointer; }
.index-title-inner:hover { color: var(--accent); }
.index-type { font-family: 'GT-Pressura-Mono', monospace; font-size: 0.52rem; letter-spacing: 0.02em; color: var(--fg-muted); align-self: flex-end; font-weight: 400; font-synthesis: none; }
.index-thumb { width: 52px; height: 52px; object-fit: cover; flex-shrink: 0; background: var(--surface); border: 1px solid transparent; align-self: flex-end; }
.index-thumb.placeholder { opacity: 0.25; }
.index-accordion { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms ease; }
.index-accordion.open { grid-template-rows: 1fr; }
.index-accordion > div { overflow: hidden; }
.index-accordion .detail-content { margin: -0.15rem 0 0.9rem 2.9rem; padding: 0; max-width: 860px; }

.objects-host { background: var(--bg); padding: 56px 0 0.7rem; margin-left: 2.1rem; }
.objects-section { border-top: none; padding-top: 0; margin-top: 0; }
.objects-title {
  font-family: 'GT-Pressura', sans-serif; font-size: 1.65rem; font-weight: 200; font-synthesis: none; letter-spacing: 0.04em;
  color: var(--fg); background: none; border: none; cursor: pointer; padding: 0.4rem 1.25rem;
}
.objects-title:hover { color: var(--accent); }
.objects-accordion { display: block; max-height: 0; overflow: hidden; transition: max-height 280ms ease; }
.objects-accordion.open { max-height: 8000px; }
.objects-accordion .layout-index { padding-top: 0; min-height: 0; }
.objects-accordion .index-list { padding-bottom: 0; }

.teaching-host { background: var(--bg); padding: 0 0 3rem; margin-left: 2.1rem; }
.teaching-section { border-top: none; padding-top: 0; margin-top: 0; }
.teaching-title {
  font-family: 'GT-Pressura', sans-serif; font-size: 1.65rem; font-weight: 200; font-synthesis: none; letter-spacing: 0.04em;
  color: var(--fg); background: none; border: none; cursor: pointer; padding: 0.4rem 1.25rem;
}
.teaching-title:hover { color: var(--accent); }
.teaching-accordion { display: block; max-height: 0; overflow: hidden; transition: max-height 280ms ease; }
.teaching-accordion.open { max-height: 4000px; }
.teaching-accordion > div { overflow: hidden; min-height: 0; }
.teaching-courses { list-style: none; margin: 0 0 0 2.9rem; padding: 0.6rem 0 0; min-height: 0; }
.teaching-course { border-bottom: none; padding: 0.2rem 0; min-height: 0; }
.teaching-course-title {
  font-family: 'GT-Pressura', sans-serif; font-size: 1rem; font-weight: 400; font-synthesis: none;
  color: var(--fg); background: none; border: none; cursor: pointer; padding: 0.6rem 0; text-align: left; width: 100%;
}
.teaching-course-title:hover { color: var(--accent); }
.teaching-course-accordion { display: block; max-height: 0; overflow: hidden; transition: max-height 260ms ease; }
.teaching-course-accordion.open { max-height: 3000px; }
.teaching-course-accordion > div { overflow: hidden; min-height: 0; }
.teaching-course-accordion:not(.open) > div { visibility: hidden; }
.teaching-course-accordion.open > div { visibility: visible; }
.teaching-course-inner { padding: 0 0 0.6rem; min-height: 0; }
.teaching-course-desc { font-family: 'GT-Pressura', sans-serif; font-weight: 300; font-size: 0.84rem; line-height: 1.5; color: rgba(255,255,255,0.7); margin: 0 0 0.6rem; max-width: 70ch; white-space: normal; overflow: visible; word-break: break-word; }
.teaching-projects { list-style: none; margin: 0; padding: 0 1rem 0; }
.index-row.open .index-thumb { display: none; }
.teaching-projects .index-title { font-size: 0.95rem; }
.teaching-projects .detail-content { max-width: 720px; }

.layout-scatter { background: var(--bg); min-height: 100vh; position: relative; }
.scatter-stage { position: relative; width: 100%; min-height: calc(100vh - 56px); padding-top: 56px; overflow: hidden; }
.scatter-card {
  position: absolute; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1); background: #111; overflow: hidden;
}
.scatter-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scatter-card:hover { border-color: var(--accent); z-index: 10 !important; }

.layout-strip { background: var(--bg); min-height: 100vh; padding-top: 56px; }
.strip-track {
  display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 1rem; scrollbar-width: thin; scroll-behavior: smooth;
}
.strip-track::-webkit-scrollbar { height: 6px; }
.strip-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }
.strip-cell {
  flex: 0 0 320px; scroll-snap-align: start; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1); background: #0a0a0a; overflow: hidden;
}
.strip-cell:hover { border-color: var(--accent); }
.strip-cell.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.strip-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #111; }
.strip-caption { padding: 0.55rem 0.6rem; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-detail-host { padding: 0 1rem 2rem; max-width: 860px; margin: 0 auto; }
@media (max-width: 700px) {
  .strip-track { flex-direction: column; overflow-x: visible; scroll-snap-type: none; }
  .strip-cell { flex-basis: auto; }
}

.layout-table { background: var(--bg); min-height: 100vh; padding-top: 56px; }
.archive-table { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1rem 3rem; }
.archive-head, .archive-row {
  display: grid; grid-template-columns: 3rem 1fr 6rem 52px;
  gap: 0.5rem; align-items: center; font-size: 0.82rem;
}
.archive-head { color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; padding: 0.6rem 0; border-bottom: none; }
.archive-row { padding: 0.7rem 0; border-bottom: none; }
.archive-row:has(.cell-title-inner:hover, .cell-type:hover, .cell-thumb:hover) { background: rgba(255,255,255,0.04); }
.archive-row.open { background: var(--border-light); }
.cell-title-inner { cursor: pointer; }
.cell-title-inner:hover { color: var(--accent); }
.archive-row .cell-type:hover { color: var(--accent); }
.archive-row .cell-thumb:hover { border-color: var(--accent); }
.archive-row .cell-title { font-family: 'GT-Pressura', sans-serif; font-weight: 400; font-synthesis: none; }
.archive-row .cell-thumb { width: 40px; height: 40px; object-fit: cover; background: #111; border: 1px solid transparent; align-self: end; }
.archive-row .cell-type { font-family: 'GT-Pressura-Mono', monospace; font-weight: 400; font-synthesis: none; align-self: end; }
.strip-caption { font-family: 'GT-Pressura', sans-serif; font-weight: 400; font-synthesis: none; }
.archive-head { font-family: 'GT-Pressura', sans-serif; font-weight: 400; font-synthesis: none; }
.archive-accordion { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms ease; grid-column: 1 / -1; }
.archive-accordion.open { grid-template-rows: 1fr; }
.archive-accordion > div { overflow: hidden; }
.archive-accordion .detail-content { margin: 0.6rem 0 0.8rem; }
@media (max-width: 700px) {
  .archive-head, .archive-row { grid-template-columns: 2.2rem 1fr 52px; }
  .archive-head .h-type, .archive-row .cell-type { display: none; }
}
