/* ============================================
   Arthur Hertweck — Personal Site
   Dark default, light option
   ============================================ */

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

/* --- Theme Variables --- */

/* Dark themes */
:root,
[data-theme="dark"],
[data-theme="dark"][data-color="slate"] {
  --bg: #141418;
  --bg-surface: #1c1c22;
  --bg-hover: #22222a;
  --border: #2a2a32;
  --text: #c8c8cc;
  --text-heading: #e8e8ec;
  --text-bright: #f2f2f5;
  --text-muted: #6a6a72;
  --accent: #8aadcf;
  --accent-hover: #a3c1de;
  --accent-muted: rgba(138, 173, 207, 0.12);
  --series-badge: #c9a96e;
  --series-badge-bg: rgba(201, 169, 110, 0.1);
  --code-bg: #0e0e12;
  --code-text: #d4d4d8;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --nav-bg: rgba(20, 20, 24, 0.85);
  --color-dot: #8aadcf;
  color-scheme: dark;
}

[data-theme="dark"][data-color="midnight"] {
  --bg: #0C1120;
  --bg-surface: #131a2e;
  --bg-hover: #1a2238;
  --border: #1e2a42;
  --text: #d0d6e0;
  --text-heading: #e8ecf4;
  --text-bright: #f0f4fa;
  --text-muted: #6878a0;
  --accent: #3a82ff;
  --accent-hover: #5a9aff;
  --accent-muted: rgba(58, 130, 255, 0.12);
  --series-badge: #5a9aff;
  --series-badge-bg: rgba(58, 130, 255, 0.1);
  --code-bg: #080d18;
  --code-text: #c8d0e0;
  --shadow: 0 1px 3px rgba(0,0,0,0.5);
  --nav-bg: rgba(12, 17, 32, 0.85);
  --color-dot: #3a82ff;
}

[data-theme="dark"][data-color="ember"] {
  --bg: #1C1917;
  --bg-surface: #252220;
  --bg-hover: #2e2a27;
  --border: #3a3530;
  --text: #d4cfc8;
  --text-heading: #ece6de;
  --text-bright: #faf4ec;
  --text-muted: #8a8078;
  --accent: #d4a574;
  --accent-hover: #e0b88a;
  --accent-muted: rgba(212, 165, 116, 0.12);
  --series-badge: #d4a574;
  --series-badge-bg: rgba(212, 165, 116, 0.1);
  --code-bg: #141210;
  --code-text: #ccc6be;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --nav-bg: rgba(28, 25, 23, 0.85);
  --color-dot: #d4a574;
}

[data-theme="dark"][data-color="forest"] {
  --bg: #0f1610;
  --bg-surface: #161e18;
  --bg-hover: #1e2820;
  --border: #263028;
  --text: #c4ccc6;
  --text-heading: #dce6de;
  --text-bright: #eef6f0;
  --text-muted: #62786a;
  --accent: #4ade80;
  --accent-hover: #6ae898;
  --accent-muted: rgba(74, 222, 128, 0.1);
  --series-badge: #4ade80;
  --series-badge-bg: rgba(74, 222, 128, 0.08);
  --code-bg: #0a100c;
  --code-text: #bcc8be;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --nav-bg: rgba(15, 22, 16, 0.85);
  --color-dot: #4ade80;
}

[data-theme="dark"][data-color="violet"] {
  --bg: #16111c;
  --bg-surface: #1e1828;
  --bg-hover: #261f32;
  --border: #302840;
  --text: #ccc8d4;
  --text-heading: #e4def0;
  --text-bright: #f0ecf8;
  --text-muted: #7a6e96;
  --accent: #a78bfa;
  --accent-hover: #b9a2fb;
  --accent-muted: rgba(167, 139, 250, 0.12);
  --series-badge: #a78bfa;
  --series-badge-bg: rgba(167, 139, 250, 0.1);
  --code-bg: #100c16;
  --code-text: #c4beda;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --nav-bg: rgba(22, 17, 28, 0.85);
  --color-dot: #a78bfa;
}

/* Light themes */
[data-theme="light"],
[data-theme="light"][data-color="paper"] {
  --bg: #fafaf8;
  --bg-surface: #f0efed;
  --bg-hover: #e8e7e4;
  --border: #dcdbd8;
  --text: #3a3a3a;
  --text-heading: #1a1a1a;
  --text-bright: #111111;
  --text-muted: #8a8a8a;
  --accent: #4a7ca5;
  --accent-hover: #3a6a90;
  --accent-muted: rgba(74, 124, 165, 0.08);
  --series-badge: #8a6a2e;
  --series-badge-bg: rgba(138, 106, 46, 0.08);
  --code-bg: #eeedea;
  --code-text: #2a2a2a;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --nav-bg: rgba(250, 250, 248, 0.85);
  --color-dot: #4a7ca5;
  color-scheme: light;
}

[data-theme="light"][data-color="snow"] {
  --bg: #f8fafc;
  --bg-surface: #eef2f6;
  --bg-hover: #e2e8f0;
  --border: #d4dce6;
  --text: #334155;
  --text-heading: #0f172a;
  --text-bright: #020617;
  --text-muted: #7e8fa6;
  --accent: #3a82ff;
  --accent-hover: #2468e0;
  --accent-muted: rgba(58, 130, 255, 0.08);
  --series-badge: #2468e0;
  --series-badge-bg: rgba(36, 104, 224, 0.08);
  --code-bg: #e8edf4;
  --code-text: #1e293b;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --nav-bg: rgba(248, 250, 252, 0.85);
  --color-dot: #3a82ff;
}

[data-theme="light"][data-color="sand"] {
  --bg: #faf8f0;
  --bg-surface: #f0ece0;
  --bg-hover: #e8e2d4;
  --border: #dcd4c4;
  --text: #3d3529;
  --text-heading: #1c1810;
  --text-bright: #0e0c08;
  --text-muted: #968a72;
  --accent: #b8860b;
  --accent-hover: #9a7009;
  --accent-muted: rgba(184, 134, 11, 0.08);
  --series-badge: #9a7009;
  --series-badge-bg: rgba(154, 112, 9, 0.08);
  --code-bg: #eee8d8;
  --code-text: #3d3529;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --nav-bg: rgba(250, 248, 240, 0.85);
  --color-dot: #b8860b;
}

[data-theme="light"][data-color="sage"] {
  --bg: #f4f8f4;
  --bg-surface: #e6ede6;
  --bg-hover: #dce5dc;
  --border: #c8d8c8;
  --text: #2a3a2a;
  --text-heading: #142014;
  --text-bright: #0a140a;
  --text-muted: #6a886a;
  --accent: #2d8a4e;
  --accent-hover: #227a3e;
  --accent-muted: rgba(45, 138, 78, 0.08);
  --series-badge: #227a3e;
  --series-badge-bg: rgba(34, 122, 62, 0.08);
  --code-bg: #dfe8df;
  --code-text: #2a3a2a;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --nav-bg: rgba(244, 248, 244, 0.85);
  --color-dot: #2d8a4e;
}

[data-theme="light"][data-color="lavender"] {
  --bg: #f8f4fc;
  --bg-surface: #eee8f6;
  --bg-hover: #e4dcee;
  --border: #d4c8e2;
  --text: #2d1f3d;
  --text-heading: #1a1028;
  --text-bright: #0e0818;
  --text-muted: #7e6a9a;
  --accent: #7c3aed;
  --accent-hover: #6828d4;
  --accent-muted: rgba(124, 58, 237, 0.08);
  --series-badge: #6828d4;
  --series-badge-bg: rgba(104, 40, 212, 0.08);
  --code-bg: #e8e0f2;
  --code-text: #2d1f3d;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --nav-bg: rgba(248, 244, 252, 0.85);
  --color-dot: #7c3aed;
}

/* --- Base --- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent-muted);
  color: var(--text-bright);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.45rem; margin-top: 2.5rem; margin-bottom: 0.8rem; }
h3 { font-size: 1.15rem; margin-top: 2rem; margin-bottom: 0.6rem; }

p { margin-bottom: 1.2rem; }

strong {
  color: var(--text-heading);
  font-weight: 600;
}

em { font-style: italic; }

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.2rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* --- Layout --- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 800px;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

.nav__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav__name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav__name:hover {
  color: var(--text-bright);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__link {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__link:hover,
.nav__link--active {
  color: var(--text);
}

.theme-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
  padding: 0;
  background: none;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot[aria-pressed="true"] {
  border-color: var(--text);
}

.color-dot--slate { background-color: #8aadcf; }
.color-dot--midnight { background-color: #3a82ff; }
.color-dot--ember { background-color: #d4a574; }
.color-dot--forest { background-color: #4ade80; }
.color-dot--violet { background-color: #a78bfa; }
.color-dot--paper { background-color: #4a7ca5; }
.color-dot--snow { background-color: #3a82ff; }
.color-dot--sand { background-color: #b8860b; }
.color-dot--sage { background-color: #2d8a4e; }
.color-dot--lavender { background-color: #7c3aed; }

/* --- Hero (Home) --- */
.hero {
  padding: 4rem 0 3rem;
}

.hero__name {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.hero__title {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  font-weight: 400;
}

.hero__bio {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

/* --- Section Headers --- */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

/* --- Series Card --- */
.series-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.8rem;
  margin-bottom: 3rem;
}

.series-card__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--series-badge);
  background: var(--series-badge-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.8rem;
}

.series-card__title {
  font-size: 1.35rem;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.series-card__desc {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.series-card__toc {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.series-card__toc li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.series-card__toc-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.series-card__toc a {
  font-size: 0.92rem;
  color: var(--accent);
}

.series-card__toc .upcoming {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* --- Article Cards --- */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 3rem;
}

.article-card {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}

.article-card:first-child {
  padding-top: 0;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.article-card__date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.article-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.article-card__title a {
  color: var(--text-heading);
  text-decoration: none;
}

.article-card__title a:hover {
  color: var(--accent);
}

.article-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Article Page --- */
.article-header {
  padding: 3rem 0 2rem;
}

.article-header__back {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: inline-block;
}

.article-header__back:hover {
  color: var(--accent);
}

.article-header__series {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--series-badge);
  background: var(--series-badge-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.8rem;
}

.article-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.article-header__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1rem;
}

.article-header__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-body {
  font-size: 1.06rem;
  line-height: 1.78;
}

.article-body h2 {
  font-size: 1.4rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body p {
  margin-bottom: 1.3rem;
}

.article-body strong {
  color: var(--text-heading);
}

.article-footer {
  margin-top: 3rem;
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--border);
}

.article-footer__series-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.series-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.series-nav a {
  font-size: 0.92rem;
  font-weight: 500;
}

/* --- About Page --- */
.about-header {
  padding: 3.5rem 0 2rem;
}

.about-header h1 {
  font-size: 2rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.about-header__role {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.about-section {
  margin-bottom: 3rem;
}

.about-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.about-bio {
  font-size: 1.02rem;
  line-height: 1.75;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.2rem;
  border-left: 2px solid var(--border);
}

.timeline-item__dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.timeline-item__company {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.1rem;
}

.timeline-item__role {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.timeline-item__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-item__highlights {
  list-style: none;
  margin-top: 0.5rem;
}

.timeline-item__highlights li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.3rem;
}

.timeline-item__highlights li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Education & Certs */
.credentials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.credential {
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.credential__institution {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.2rem;
}

.credential__detail {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

/* --- Footer --- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 1.2rem;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--text);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  html { font-size: 15px; }

  .hero__name { font-size: 1.8rem; }
  .hero { padding: 2.5rem 0 2rem; }

  .article-header h1 { font-size: 1.7rem; }
  .article-body { font-size: 1rem; }

  .nav__inner { padding: 0 1rem; }
  .nav__links { gap: 0.8rem; }
  .container { padding: 0 1rem; }

  .color-dot { width: 12px; height: 12px; }
  .color-picker { gap: 0.25rem; }

  .credentials-grid {
    grid-template-columns: 1fr;
  }

  .series-nav {
    flex-direction: column;
  }

  .footer__inner {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
}
