/* Reset, app shell, nav, responsive breakpoints. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
}

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

img { max-width: 100%; display: block; }

input, textarea, select, button { font: inherit; color: inherit; }

code, pre, .mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

/* --- Shell --- */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.shell-main {
  flex: 1;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-header .sub {
  color: var(--text-dim);
  font-size: 13.5px;
  margin-top: 2px;
}

/* --- Nav --- */
.nav {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.wordmark {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text) !important;
}
.wordmark:hover { text-decoration: none; }
.wordmark .tick { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { color: var(--text-dim); font-size: 13.5px; font-family: var(--mono); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .shell-main { padding: 16px 16px 40px; }
  .nav-inner { padding: 0 16px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-right { margin-left: auto; }
}
