/* =========================================================================
   Discord BOT Portfolio / Status — shared stylesheet
   構成: index.html（紹介ページ）, status.html（ステータスページ）で共有
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --bg: #f5f7fa;
  --bg-elevated: #ffffff;
  --bg-sunken: #eef1f5;
  --border: #e2e6ec;
  --text: #171b21;
  --text-dim: #63697b;
  --text-faint: #9aa1b2;

  --accent: #2563eb;
  --accent-dim: #dbe6fe;
  --ok: #16a34a;
  --ok-dim: #dcf5e5;
  --warn: #d97706;
  --warn-dim: #fdeecb;
  --danger: #dc2626;
  --danger-dim: #fbdede;
  --maint: #7c3aed;
  --maint-dim: #ece5fd;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 32, 0.06), 0 1px 1px rgba(20, 24, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 24, 32, 0.08), 0 2px 8px rgba(20, 24, 32, 0.04);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
    'Yu Gothic UI', 'Noto Sans JP', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-sunken: #0a0d12;
  --border: #2a313c;
  --text: #e7eaf0;
  --text-dim: #98a1b3;
  --text-faint: #6b7484;

  --accent: #5b9dff;
  --accent-dim: #16233f;
  --ok: #3ddc84;
  --ok-dim: #123321;
  --warn: #f5a524;
  --warn-dim: #3a2a0c;
  --danger: #f5566a;
  --danger-dim: #3a1420;
  --maint: #a78bfa;
  --maint-dim: #241d3d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1117;
    --bg-elevated: #161b22;
    --bg-sunken: #0a0d12;
    --border: #2a313c;
    --text: #e7eaf0;
    --text-dim: #98a1b3;
    --text-faint: #6b7484;

    --accent: #5b9dff;
    --accent-dim: #16233f;
    --ok: #3ddc84;
    --ok-dim: #123321;
    --warn: #f5a524;
    --warn-dim: #3a2a0c;
    --danger: #f5566a;
    --danger-dim: #3a1420;
    --maint: #a78bfa;
    --maint-dim: #241d3d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* ---------- Reset ---------- */
* , *::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-sans);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
code, .mono { font-family: var(--font-mono); }

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1040px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  flex: none;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}
.main-nav a:hover { color: var(--text); background: var(--bg-sunken); }
.main-nav a[aria-current='page'] { color: var(--accent); background: var(--accent-dim); }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-left: 6px;
  transition: transform .15s ease, color .15s ease;
}
.theme-toggle:hover { color: var(--text); transform: translateY(-1px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }

/* ---------- Hero ---------- */
.hero {
  padding: 84px 0 56px;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.25;
  max-width: 760px;
  margin: 0 auto;
}
.hero p.lead {
  margin: 18px auto 0;
  max-width: 560px;
  color: var(--text-dim);
  font-size: 16.5px;
}
.hero-actions {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Section heading ---------- */
.section-head { margin: 0 0 28px; text-align: center; }
.section-head h2 { font-size: 26px; }
.section-head p { color: var(--text-dim); margin-top: 8px; }

section.page-section { padding: 40px 0; }

/* ---------- Bot cards ---------- */
.bot-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 28px;
}
.bot-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.bot-emblem {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex: none;
  color: #fff;
}
.bot-emblem.route { background: linear-gradient(150deg, #2563eb, #0ea5e9); }
.bot-emblem.vatjpn { background: linear-gradient(150deg, #16a34a, #0d9488); }

.bot-title-group { flex: 1; min-width: 180px; }
.bot-title-group h3 { font-size: 21px; }
.bot-title-group .tagline { color: var(--text-dim); font-size: 14px; margin-top: 3px; }

.bot-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge.on { background: var(--ok-dim); color: var(--ok); border-color: transparent; }

.bot-desc { margin-top: 18px; color: var(--text-dim); font-size: 15px; }

.bot-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.feature-item {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.feature-item .fi-title {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feature-item .fi-desc {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.cmd-table {
  margin-top: 20px;
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.cmd-table th, .cmd-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.cmd-table th {
  background: var(--bg-sunken);
  font-size: 12.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table td.cmd-name { font-family: var(--font-mono); font-weight: 600; color: var(--accent); white-space: nowrap; }
.cmd-table td.cmd-example { font-family: var(--font-mono); color: var(--text-dim); white-space: nowrap; }

.meta-row {
  margin-top: 20px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-dim);
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}
.meta-row strong { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 3px; font-weight: 700; }

.bot-card-foot {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.note-inline {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- Airport chips (VATJPN) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ---------- Status page: banner ---------- */
.status-banner {
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
}
.status-banner .icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: none;
  background: rgba(255,255,255,0.35);
}
.status-banner h2 { font-size: 19px; }
.status-banner .sub { font-size: 13.5px; opacity: 0.85; margin-top: 3px; }

.status-banner.ok { background: var(--ok-dim); color: var(--ok); }
.status-banner.warn { background: var(--warn-dim); color: var(--warn); }
.status-banner.danger { background: var(--danger-dim); color: var(--danger); }
.status-banner.maint { background: var(--maint-dim); color: var(--maint); }
.status-banner strong { color: var(--text); }

.last-checked {
  margin-top: 14px;
  text-align: right;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- Service list ---------- */
.service-list {
  margin-top: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.service-row:last-child { border-bottom: none; }
.service-name { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; }
.service-name .service-desc {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 3px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 4px transparent;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-dim); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-dim); }
.dot.danger { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-dim); }
.dot.maint { background: var(--maint); box-shadow: 0 0 0 4px var(--maint-dim); }
.dot.unknown { background: var(--text-faint); box-shadow: 0 0 0 4px var(--bg-sunken); }

.status-pill {
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.ok { background: var(--ok-dim); color: var(--ok); }
.status-pill.warn { background: var(--warn-dim); color: var(--warn); }
.status-pill.danger { background: var(--danger-dim); color: var(--danger); }
.status-pill.maint { background: var(--maint-dim); color: var(--maint); }
.status-pill.unknown { background: var(--bg-sunken); color: var(--text-faint); }

.group-label {
  padding: 14px 24px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-sunken);
}

/* ---------- Incidents ---------- */
.incident-list { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.incident-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.incident-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.incident-title { font-weight: 700; font-size: 15px; }
.incident-date { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; font-family: var(--font-mono); }
.incident-body { margin-top: 10px; font-size: 14px; color: var(--text-dim); }
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-faint);
  font-size: 14px;
}

/* ---------- Disclaimer callout ---------- */
.callout {
  margin-top: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-sunken);
}
.callout .ic { flex: none; font-size: 16px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 28px 0 48px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text-faint);
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .main-nav a { padding: 8px 10px; font-size: 13px; }
  .hero { padding: 56px 0 36px; }
  .bot-card { padding: 22px; }
  .service-row { padding: 14px 16px; }
  .status-banner { padding: 20px; }
  .meta-row { gap: 16px; }
}

/* ---------- Skeleton / loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--border) 37%, var(--bg-sunken) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
