/* ============================================
   UX Labs — Design System
   ダーク&テック系ラボ
   ============================================ */

:root {
  --bg: #0a0e14;
  --bg-alt: #0f141d;
  --surface: #141b26;
  --surface-2: #1a2332;
  --border: #223047;
  --border-hi: #2f4260;
  --text: #dce4f0;
  --text-dim: #8b98ac;
  --text-faint: #5c6a80;
  --accent: #4fd1c5;      /* teal */
  --accent-2: #7aa2f7;    /* blue */
  --accent-3: #e0af68;    /* amber */
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* subtle grid background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 209, 197, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 209, 197, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo .bracket { color: var(--accent); }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  display: block;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-family: var(--mono);
}
.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 90px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(79, 209, 197, 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(122, 162, 247, 0.06), transparent);
}
.hero .eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(34px, 5.5vw, 58px);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--accent); }
.hero .lede {
  max-width: 640px;
  color: var(--text-dim);
  font-size: 17px;
  margin-bottom: 36px;
}
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--mono);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #06251f; }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(79, 209, 197, 0.35); }
.btn-ghost { border: 1px solid var(--border-hi); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding: 72px 0 48px; border-bottom: 1px solid var(--border); }
.page-hero .eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 0.15em; margin-bottom: 12px; }
.page-hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-bottom: 12px; }
.page-hero p { color: var(--text-dim); max-width: 680px; }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; }
section.block + section.block { border-top: 1px solid var(--border); }
.section-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}
h2.section-title { font-size: clamp(24px, 3vw, 32px); font-weight: 700; margin-bottom: 28px; }
h3 { font-size: 20px; margin: 36px 0 14px; }
p + p { margin-top: 14px; }
.dim { color: var(--text-dim); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-3px); }
.card h3 { margin: 0 0 10px; font-size: 18px; }
.card p { color: var(--text-dim); font-size: 14.5px; }
.card .tag-row { margin-top: 16px; }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-2);
  background: rgba(122, 162, 247, 0.1);
  border: 1px solid rgba(122, 162, 247, 0.25);
  border-radius: 4px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
}
.tag.teal { color: var(--accent); background: rgba(79, 209, 197, 0.08); border-color: rgba(79, 209, 197, 0.25); }
.tag.amber { color: var(--accent-3); background: rgba(224, 175, 104, 0.08); border-color: rgba(224, 175, 104, 0.25); }

/* ---------- Principles (numbered) ---------- */
.principle { display: flex; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.principle:last-child { border-bottom: none; }
.principle .num {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  min-width: 56px;
}
.principle h3 { margin: 0 0 6px; font-size: 18px; }
.principle p { color: var(--text-dim); font-size: 15px; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  text-align: center;
}
.stat .value {
  font-family: var(--mono);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.stat .label { color: var(--text-dim); font-size: 13px; margin-top: 6px; }

/* ---------- Bar chart (commits) ---------- */
.chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px 16px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 200px;
}
.chart-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.chart-bar .bar {
  width: 100%;
  background: linear-gradient(to top, rgba(79, 209, 197, 0.35), var(--accent));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.chart-bar .val { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); margin-bottom: 5px; }
.chart-bar .month { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); margin-top: 8px; white-space: nowrap; }
.chart-caption { color: var(--text-faint); font-size: 12.5px; margin-top: 14px; font-family: var(--mono); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
td { color: var(--text-dim); }
td:first-child { color: var(--text); font-weight: 600; }
tbody tr:hover { background: rgba(79, 209, 197, 0.03); }
td .mono, .mono { font-family: var(--mono); }

/* ---------- Quote / callout ---------- */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  padding: 20px 24px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 15px;
}
.callout strong { color: var(--text); }

/* ---------- Code / ascii ---------- */
pre.ascii {
  background: #0b1018;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}
pre.ascii .hl { color: var(--accent); }

/* ---------- Category headers in projects ---------- */
.cat-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 56px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.cat-head:first-of-type { margin-top: 0; }
.cat-head h2 { font-size: 22px; }
.cat-head .count { font-family: var(--mono); font-size: 13px; color: var(--text-faint); }

/* ---------- Roadmap timeline ---------- */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border-hi);
}
.timeline-item { position: relative; padding-bottom: 36px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -30px; top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-item h3 { margin: 0 0 8px; font-size: 17px; }
.timeline-item p { color: var(--text-dim); font-size: 15px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 0;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-inner .logo { font-family: var(--mono); font-weight: 700; color: var(--text); }
.footer-inner .logo .bracket { color: var(--accent); }
.footer-inner .copy { color: var(--text-faint); font-size: 13px; font-family: var(--mono); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-dim); font-size: 13.5px; font-family: var(--mono); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px;
  }
  .nav-links.open { display: flex; }
  .chart-bar:nth-child(-n+4) { display: none; } /* hide oldest months on mobile */
}
