:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a1d29;
  --text-muted: #666e7d;
  --border: #e2e5ea;
  --accent: #2f6fed;
  --accent-weak: #eaf1ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 14px;

  /* Fibonacci-based spacing scale (approximates golden ratio φ≈1.618) */
  --space-1: 8px;
  --space-2: 13px;
  --space-3: 21px;
  --space-4: 34px;
  --space-5: 55px;
  --space-6: 89px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #eef0f4;
    --text-muted: #97a0b3;
    --border: #2a2e38;
    --accent: #5b8def;
    --accent-weak: #1b2740;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 68px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  position: relative;
}

.topnav-brand {
  display: block;
  line-height: 0;
}

.topnav-logo {
  display: block;
  height: 24px;
  width: auto;
}

.menu {
  position: relative;
}

.menu-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
}

.menu-btn span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 16px;
  height: 1.5px;
  margin: -0.75px 0 0 -8px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease;
}

.menu-btn span:nth-child(1) {
  transform: translateY(-4px);
}

.menu-btn span:nth-child(2) {
  transform: translateY(3px);
}

.menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:nth-child(2) {
  transform: rotate(-45deg);
}

.menu-panel {
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  z-index: 10;
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.menu-panel a:hover {
  background: var(--accent-weak);
  color: var(--accent);
}

.menu-panel a.active {
  background: var(--accent-weak);
  color: var(--accent);
}

.menu-panel-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.toolkit {
  padding: var(--space-3) 0 var(--space-5);
}

.toolkit .eyebrow {
  margin: 0 0 var(--space-3);
  text-align: left;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.tool-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tool-card-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.tool-card-body {
  flex: 1;
  min-width: 0;
}

.tool-card-body h2 {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 700;
}

.tool-card-body p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tool-card-arrow {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 18px;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-2) 20px;
  background: var(--bg);
  text-align: center;
}

.footer-credit {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-credit a {
  color: var(--accent);
  text-decoration: none;
}

.footer-credit a:hover {
  text-decoration: underline;
}
