/* Light theme */
:root, [data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f2f2f2;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --border: #e0e0e0;
  --accent: #c8102e;
  --accent-hover: #a00d24;
  --link: #c8102e;
  --link-hover: #a00d24;
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 10px;
  --toggle-bg: #e4e4e4;
  --toggle-fg: #1a1a1a;
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #111111;
  --bg-secondary: #181818;
  --bg-card: #1e1e1e;
  --text-primary: #e5e5e5;
  --text-secondary: #8a8a8a;
  --border: #2c2c2c;
  --accent: #d42040;
  --accent-hover: #ef3a55;
  --link: #d42040;
  --link-hover: #ef3a55;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
  --toggle-bg: #2c2c2c;
  --toggle-fg: #e5e5e5;
}

/* Auto: system preference */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg-primary: #111111;
    --bg-secondary: #181818;
    --bg-card: #1e1e1e;
    --text-primary: #e5e5e5;
    --text-secondary: #8a8a8a;
    --border: #2c2c2c;
    --accent: #d42040;
    --accent-hover: #ef3a55;
    --link: #d42040;
    --link-hover: #ef3a55;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
    --toggle-bg: #2c2c2c;
    --toggle-fg: #e5e5e5;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
  font-style: italic;
}

.logo-reg {
  font-size: 0.65rem;
  vertical-align: super;
  color: var(--accent);
  font-style: normal;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--toggle-bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.3rem;
  cursor: pointer;
}

.theme-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.theme-toggle button:hover {
  color: var(--text-primary);
}

.theme-toggle button.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.theme-toggle button svg {
  width: 16px;
  height: 16px;
}

main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.section:hover {
  box-shadow: var(--shadow-hover);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.section-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.link-list li {
  display: flex;
  align-items: center;
}

.link-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  color: var(--link);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 450;
  transition: background 0.15s ease, color 0.15s ease;
}

.link-list a:hover {
  background: var(--bg-secondary);
  color: var(--link-hover);
}

.link-list a::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.5;
}

.link-list a:hover::before {
  opacity: 1;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  text-align: center;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--link-hover);
}

@media (max-width: 700px) {
  .columns {
    grid-template-columns: 1fr;
  }
  main {
    margin: 1.5rem auto;
  }
  .section {
    padding: 1.25rem 1.25rem;
  }
  header {
    padding: 1rem 1.25rem;
  }
  .header-subtitle {
    display: none;
  }
}
