/* ── Reset & base ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0a1628;
  --bg:     #ffffff;
  --surface:#f7f8fa;
  --card:   #ffffff;
  --border: #e8eaed;
  --text:   #1a1a2e;
  --muted:  #6b7280;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --radius: 12px;
  --soon-opacity: 0.45;
}

html.dark {
  --bg:     #0d1117;
  --surface:#0d1117;
  --card:   #161b22;
  --border: #30363d;
  --text:   #e6edf3;
  --muted:  #8b949e;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.25s, color 0.25s;
}

/* ── Layout ──────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ──────────────────────────────────────── */
header {
  background: var(--navy);
  color: #fff;
  padding: 56px 0 48px;
  position: relative;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-controls {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
  position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,0.22); }
.icon-btn:active { background: rgba(255,255,255,0.30); }

.icon-btn.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tooltip */
.icon-btn .tooltip {
  display: none;
  position: absolute;
  top: 46px;
  right: 0;
  background: #1a1a2e;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 99;
}
.icon-btn .tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 10px;
  border: 5px solid transparent;
  border-top: none;
  border-bottom-color: #1a1a2e;
}
.icon-btn:focus .tooltip,
.icon-btn.show-tip .tooltip { display: block; }

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.bio {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.72);
  max-width: 520px;
}

/* ── Toast ───────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Main sections ───────────────────────────────── */
main { padding: 52px 0 40px; }

section + section { margin-top: 52px; }

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 20px;
}
html.dark .section-label { color: #58a6ff; }

/* ── Card grid ───────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

/* ── Card ────────────────────────────────────────── */
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.card:not(.soon):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(10,22,40,0.13);
  border-color: var(--navy);
}
html.dark .card:not(.soon):hover { border-color: #58a6ff; }

.card-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
}

.card-name {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
}
html.dark .card-name { color: #e6edf3; }

.card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Coming soon variant */
.card.soon {
  opacity: var(--soon-opacity);
  cursor: default;
  pointer-events: none;
}

.card.soon .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
}
html.dark .card.soon .badge { background: #30363d; color: #8b949e; }

/* ── Footer ──────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 32px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

footer a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
html.dark footer a { color: #58a6ff; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  header { padding: 52px 0 36px; }
}

@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
