/* ===== Design tokens ===== */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f5f8fe;
  --surface: #ffffff;
  --text: #17202e;
  --text-muted: #5d6a7e;
  --border: #e3e9f3;
  --accent: #2f5fd0;
  --accent-strong: #244cae;
  --accent-soft: #e8efff;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(23, 32, 46, 0.04), 0 6px 20px rgba(47, 95, 208, 0.07);
  --shadow-hover: 0 2px 4px rgba(23, 32, 46, 0.05), 0 12px 28px rgba(47, 95, 208, 0.16);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1420;
    --bg-subtle: #151c2b;
    --surface: #161e2e;
    --text: #e8edf6;
    --text-muted: #98a4b8;
    --border: #253047;
    --accent: #6f9bff;
    --accent-strong: #93b3ff;
    --accent-soft: #1c2a4a;
    --on-accent: #0f1420;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(111, 155, 255, 0.18);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1420;
  --bg-subtle: #151c2b;
  --surface: #161e2e;
  --text: #e8edf6;
  --text-muted: #98a4b8;
  --border: #253047;
  --accent: #6f9bff;
  --accent-strong: #93b3ff;
  --accent-soft: #1c2a4a;
  --on-accent: #0f1420;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(111, 155, 255, 0.18);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ===== Layout ===== */
.page {
  max-width: 720px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ===== Header ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ===== Hero ===== */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.hero-lead {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
}

/* ===== Sections ===== */
.section { margin-top: 44px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== Rooms ===== */
.rooms {
  display: grid;
  gap: 14px;
}

.room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.room:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.room-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.room-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.room-url {
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.room-arrow {
  flex: none;
  color: var(--accent);
  transition: transform 0.2s ease;
}

a.room:hover .room-arrow { transform: translateX(4px); }

.room.is-disabled {
  background: var(--bg-subtle);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
}

.room.is-disabled .room-name { color: var(--text-muted); }

.badge {
  flex: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ===== News ===== */
.news {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.news li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 4px 16px;
  padding: 16px 22px;
}

.news li + li { border-top: 1px solid var(--border); }

.news-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.news-title { font-weight: 600; }

.news-body {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.news-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news li.news-empty {
  display: block;
  color: var(--text-muted);
  text-align: center;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 64px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.contact { margin: 0; }

.contact-link {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}

a.contact-link {
  color: var(--accent);
  border-color: var(--accent);
  transition: background-color 0.2s, color 0.2s;
}

a.contact-link:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.contact-link.is-disabled {
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-style: dashed;
  cursor: not-allowed;
}

.copyright {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .page { padding: 0 16px; }
  .hero { padding: 36px 0 28px; }
  .section { margin-top: 36px; }
  .room { padding: 18px; }
  .news li {
    grid-template-columns: 1fr;
    padding: 14px 18px;
  }
  .news-body { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  a.room:hover { transform: none; }
}
