/* ===========================
   DESIGN TOKENS
   =========================== */
:root {
  --bg:       #06060e;
  --bg-2:     #090918;
  --bg-3:     #0e0e24;
  --bg-card:  #0b0b1e;
  --fg:       #dce3f5;
  --fg-mid:   #8890b8;
  --fg-dim:   #454870;
  --accent:   #68afff;
  --accent-soft: #b0d0ff;
  --border:   #181838;

  /* flyer logo palette */
  --flyer-white:  #ffffff;
  --flyer-cyan:   #00b2ec;
  --flyer-yellow: #fff226;
  --flyer-pink:   #e62389;
  --flyer-purple: #b085ba;

  /* school colors */
  --c-musabi:   #7eb4ff;
  --c-tamagawa: #ffb07a;
  --c-tpu:      #85d4a0;

  --sans:   'Noto Sans JP', sans-serif;
  --nav-h:  64px;
  --max-w:  1080px;
  --radius: 4px;
}

/* ===========================
   BASE RESET
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}
a {
  color: var(--accent);
  transition: color 0.2s;
}
a:hover { color: var(--accent-soft); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}
img { max-width: 100%; display: block; }
ul[role="list"], ol[role="list"] { list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===========================
   DOME CANVAS
   =========================== */
#dome-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===========================
   NAVIGATION
   =========================== */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.75rem;
  background: rgba(6, 6, 14, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  text-decoration: none;
  line-height: 1;
}
.nav-logo-main {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
}
.nav-logo-sub {
  display: block;
  font-size: 0.65rem;
  color: var(--fg-mid);
  margin-top: 2px;
}
.nav-menu {
  display: flex;
  gap: 2.25rem;
  list-style: none;
}
.nav-menu a {
  font-size: 0.875rem;
  color: var(--fg-mid);
  text-decoration: none;
}
.nav-menu a:hover { color: var(--fg); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===========================
   HERO
   =========================== */
#hero {
  position: relative;
  z-index: 1;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* transparent — Three.js canvas shows through */
}
.hero-inner {
  text-align: center;
  padding: 0 1.5rem;
  margin-top: var(--nav-h);
  user-select: none;
}
.hero-title {
  font-size: clamp(2rem, 7.5vw, 5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.85);
  text-wrap: balance;
}
.ttl-white  { color: var(--flyer-white); }
.ttl-cyan   { color: var(--flyer-cyan); }
.ttl-yellow { color: var(--flyer-yellow); }
.ttl-pink   { color: var(--flyer-pink); }
.ttl-purple { color: var(--flyer-purple); }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  list-style: none;
  font-size: 0.875rem;
  color: var(--fg-mid);
  margin-bottom: 3rem;
}
.hero-scroll {
  display: inline-flex;
  color: var(--fg-mid);
  text-decoration: none;
  animation: bounce 2.2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

/* ===========================
   SECTIONS (shared)
   =========================== */
section:not(#hero) {
  position: relative;
  z-index: 1;
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}
#about    { background: rgba(9, 9, 24, 0.85); }
#works    { background: transparent; }
#schedule { background: var(--bg-2); }
#program  { background: transparent; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.75rem;
}
.section-heading {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}
.sub-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-soft);
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

/* ===========================
   ABOUT
   =========================== */
.info-list {
  display: flex;
  gap: 3rem;
  padding-left: 1.5rem;
  margin-bottom: 3rem;
}
.info-col {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  flex: 1;
}
.info-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
dt {
  font-size: 0.72rem;
  color: var(--fg-mid);
  letter-spacing: 0.08em;
  padding-top: 0.1em;
}
dd {
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.6;
}
.info-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--fg-mid);
  margin-top: 0.2rem;
}
.dd-line {
  display: block;
}
.dd-line + .dd-line {
  margin-top: 0.3rem;
}
.day-sat { color: #7eb4ff; }
.day-sun { color: #ff7e7e; }

.about-schools {
  margin-top: 2.5rem;
}
.about-schools-label {
  font-size: 0.72rem;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.85rem;
  font-weight: 400;
}
.school-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ===========================
   ABOUT — PROGRAMS (見どころ)
   =========================== */
.about-programs {
  margin-top: 2.5rem;
}
.program-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 1.5rem;
}
.program-card {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  align-content: start;
  background: rgba(22, 22, 68, 0.4);
  border: 1px solid var(--border);
  padding: 1.5rem;
}
.program-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}
.program-card-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-content: start;
}
.program-card-text--with-image {
  flex-direction: row;
  align-items: flex-start;
}
.program-card-text--with-image p {
  flex: 1;
  min-width: 0;
}
.program-card-text-img {
  flex: 0 0 auto;
  width: 6rem;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.program-card-text-img:hover {
  opacity: 0.85;
}
.program-card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent-soft);
  border: none;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.program-card p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--fg-mid);
}
.program-card-images {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.program-card-images img {
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: calc(50% - 0.375rem);
  max-height: 140px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.program-card-images img:hover {
  opacity: 0.85;
}
.program-card-venue {
  font-size: 0.78rem;
  color: var(--fg-mid);
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

/* ===========================
   BADGE (school)
   =========================== */
.badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid;
  font-weight: 400;
  white-space: nowrap;
}
.badge-musabi   { color: var(--c-musabi);   border-color: var(--c-musabi); }
.badge-tamagawa { color: var(--c-tamagawa); border-color: var(--c-tamagawa); }
.badge-tpu      { color: var(--c-tpu);      border-color: var(--c-tpu); }
.badge-other    { color: var(--fg-mid);     border-color: var(--fg-dim); }

/* ===========================
   WORKS GRID
   =========================== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.loading {
  color: var(--fg-mid);
  font-size: 0.875rem;
  grid-column: 1 / -1;
}

/* Work card */
.work-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(22, 22, 68, 0.55);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: border-color 0.4s, box-shadow 0.4s;
}
.work-card:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(104, 175, 255, 0.18);
}

/* Domemaster circular image */
.work-visual { display: flex; flex-direction: column; gap: 0.75rem; }

.dome-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.dome-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dome-no-image {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-dim);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

/* サムネイルストリップ（最大5枚） */
.work-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.work-thumb {
  flex: 0 0 calc((100% - 1.8rem) / 5); /* 5枚で1行に収まる */
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s;
}
.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.work-thumb:hover       { border-color: var(--fg-mid); }
.work-thumb.is-active   { border-color: var(--accent); }
.work-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Work text */
.work-info { display: flex; flex-direction: column; gap: 0.4rem; }

/* 作品インデックス */
.work-index {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  border-left: 2px solid var(--accent);
  padding-left: 0.45rem;
  margin-bottom: 0.2rem;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.work-dept {
  font-size: 0.8rem;
  color: var(--fg-mid);
  font-weight: 500;
}
.work-seminar {
  font-size: 0.78rem;
  color: var(--fg-mid);
  font-weight: 500;
}
.work-duration {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--accent-soft);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  background: rgba(104, 175, 255, 0.08);
  border: 1px solid rgba(104, 175, 255, 0.22);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.work-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}
.work-author {
  font-size: 0.95rem;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.work-desc {
  font-size: 0.875rem;
  color: var(--fg);
  line-height: 1.75;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  opacity: 0.85;
}
.work-credits {
  font-size: 0.78rem;
  color: var(--fg-mid);
  line-height: 1.65;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}
.work-website {
  display: inline-block;
  font-size: 0.78rem;
  margin-top: 0.25rem;
  word-break: break-all;
}

/* ===========================
   PROGRAM
   =========================== */
.placeholder-text {
  font-size: 0.95rem;
  color: var(--fg-mid);
}
.program-external {
  max-width: 32rem;
}
.program-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  transition: opacity 0.2s;
}
.program-image:hover {
  opacity: 0.85;
}
.program-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

/* ===========================
   SCHEDULE
   =========================== */
.schedule-block {
  margin-bottom: 3rem;
}
.schedule-block:last-child {
  margin-bottom: 0;
}
.schedule-days-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.schedule-days-grid .schedule-block {
  margin-bottom: 0;
}
.schedule-block-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.schedule-time-range {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--fg-mid);
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  margin-left: 0.65rem;
  vertical-align: middle;
}
.schedule-note {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--fg-mid);
  margin-top: 0.75rem;
}
.schedule-note strong {
  color: var(--fg);
  font-weight: 700;
}

/* 1ターンの流れ */
.turn-flow {
  margin-top: 1.5rem;
}
.turn-flow-bar {
  display: flex;
  height: 2.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.turn-flow-seg {
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.4rem;
}
.turn-flow-seg--title {
  background: var(--bg-3);
}
.turn-flow-seg--workshop {
  background: rgba(0, 178, 236, 0.22);
  color: var(--flyer-cyan);
  font-weight: 700;
}
.turn-flow-seg--work {
  background: rgba(230, 35, 137, 0.2);
  color: var(--flyer-pink);
  font-weight: 700;
}
.turn-flow-list {
  display: flex;
  flex-direction: column;
  margin-top: 1.25rem;
}
.turn-flow-list li {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.turn-flow-list li:first-child {
  border-top: 1px solid var(--border);
}
.turn-flow-time {
  color: var(--fg-mid);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.turn-flow-label em {
  font-style: normal;
  color: var(--fg-mid);
  font-size: 0.8rem;
}
.turn-flow-dur {
  color: var(--accent-soft);
  font-size: 0.78rem;
  white-space: nowrap;
}
.ws-yes,
.ws-no {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
}
.ws-yes::before,
.ws-no::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-yes {
  color: var(--flyer-cyan);
}
.ws-yes::before {
  background: var(--flyer-cyan);
  box-shadow: 0 0 6px rgba(0, 178, 236, 0.7);
}
.ws-no {
  color: var(--fg-mid);
}
.ws-no::before {
  border: 1.5px solid var(--fg-mid);
}
.schedule-table-wrap {
  overflow-x: auto;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.schedule-table th,
.schedule-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.schedule-table th {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  word-break: keep-all;
}
.schedule-table td:first-child {
  color: var(--fg-mid);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 9rem;
}
.schedule-table--full td:nth-child(2) {
  color: var(--fg-mid);
  width: 8rem;
}
.schedule-table--full .badge {
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  margin-right: 0.4rem;
}
.schedule-table-divider td {
  padding-top: 1.1rem;
  padding-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent-soft);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.schedule-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.schedule-group {
  background: rgba(22, 22, 68, 0.4);
  border: 1px solid var(--border);
  padding: 1.25rem;
}
.schedule-group-label.badge {
  border: none;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}
.schedule-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.schedule-group-list li {
  display: flex;
  flex-direction: column;
}
.schedule-group-name {
  font-size: 0.82rem;
  color: var(--fg);
}
.schedule-group-name--long {
  font-size: 0.72rem;
}
.schedule-group-work {
  font-size: 0.75rem;
  color: var(--fg-mid);
}

/* ===========================
   LIGHTBOX
   =========================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 4, 10, 0.92);
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  cursor: zoom-out;
}
.lightbox.is-open {
  display: flex;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ===========================
   FOOTER
   =========================== */
footer {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}
.footer-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.footer-venue {
  font-size: 0.78rem;
  color: var(--fg-mid);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 720px) {
  /* Mobile nav */
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(6, 6, 14, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { font-size: 1.25rem; color: var(--fg); }

  /* Sections */
  section:not(#hero) { padding: 3.5rem 0; }
  .program-cards { grid-template-columns: 1fr; gap: 1.25rem; }
  .works-grid { grid-template-columns: 1fr; gap: 3rem; }
  .schedule-days-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .schedule-groups { grid-template-columns: 1fr; gap: 1.25rem; }
  .schedule-table { font-size: 0.8rem; }
  .schedule-table td:first-child { width: auto; }
  .turn-flow-list li { grid-template-columns: 1fr; gap: 0.2rem; }
  .turn-flow-time { order: -1; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(1.75rem, 10vw, 3rem); }
  .container { padding: 0 1rem; }
  .info-list { flex-direction: column; gap: 1.5rem; }
  .nav-inner { padding: 0 1rem; }
  .nav-logo-main { font-size: 0.78rem; }
  .work-card { padding: 1rem; }
  .work-meta { flex-wrap: wrap; }
  .work-duration { margin-left: 0; }
  .program-card-text--with-image { flex-direction: column; }
  .program-card-text-img { width: 8rem; align-self: center; }
}
