/*
 * base.css
 * Layout, Struktur und theme-unabhängige Stile.
 * Hier werden KEINE Farben definiert – nur in themes.css.
 */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── TYPOGRAPHY ───────────────────────────────────── */
.font-serif   { font-family: 'Instrument Serif', Georgia, serif; }
.font-mono    { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* ── LAYOUT ───────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── NAV ──────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  transition: background 0.3s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--accent-dim);
}

/* ── THEME SWITCHER ───────────────────────────────── */
.theme-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
}

.theme-btn {
  background: none;
  border: none;
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
  font-family: 'JetBrains Mono', monospace;
}

.theme-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ── MAIN CONTENT ─────────────────────────────────── */
main {
  padding: 2.5rem 0 4rem;
}

/* ── BENTO GRID ───────────────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-rows: auto;
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.3s;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
}

/* Bento card placement */
.card-identity { grid-column: 1; grid-row: 1; }
.card-skills   { grid-column: 2 / 4; grid-row: 1; }
.card-articles { grid-column: 1 / 3; grid-row: 2; }
.card-links    { grid-column: 3; grid-row: 2; }
.card-garden   { grid-column: 1 / 4; grid-row: 3; }

/* ── CARD LABELS ──────────────────────────────────── */
.card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  margin-bottom: 1rem;
}

/* ── IDENTITY CARD ────────────────────────────────── */
.identity-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.identity-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.identity-name em {
  font-style: italic;
  color: var(--accent);
}

.identity-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.identity-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.identity-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 500;
}

.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--accent-dim);
  color: var(--text);
  border-color: var(--border-hover);
}

/* ── SKILLS CARD ──────────────────────────────────── */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
}

.skill-tag:hover,
.skill-tag.highlight {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── ARTICLES CARD ────────────────────────────────── */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.article-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.article-item:last-child { border-bottom: none; }

.article-item:hover {
  background: var(--accent-dim);
}

.article-source-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.article-source-dot.li { background: var(--li-color); }

.article-item-content { flex: 1; min-width: 0; }

.article-item-title {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.article-item-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.article-source-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
}

.article-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-subtle);
}

.article-arrow {
  font-size: 0.8rem;
  color: var(--text-subtle);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  margin-top: 2px;
}

.article-item:hover .article-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* ── SOCIAL LINKS CARD ────────────────────────────── */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.2s;
}

.social-link:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-card-alt);
}

.social-icon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 3px 7px;
  border-radius: 4px;
  min-width: 36px;
  text-align: center;
}

/* ── GARDEN CARD ──────────────────────────────────── */
.garden-card-inner {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: center;
}

.garden-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.garden-title em { font-style: italic; color: var(--accent); }

.garden-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  max-width: 420px;
}

.garden-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.garden-stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  color: var(--accent);
  display: block;
}

.garden-stat-label {
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.garden-preview-nodes {
  position: relative;
  height: 120px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.garden-node-mini {
  position: absolute;
  border: 1px solid var(--border-hover);
  border-radius: 6px;
  background: var(--bg-card-alt);
  padding: 5px 8px;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}

/* ── FOOTER ───────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}

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

.footer-copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-subtle);
}

/* ── RETRO OVERRIDES ──────────────────────────────── */
[data-theme="retro"] body {
  font-family: 'Courier New', Courier, monospace;
}

[data-theme="retro"] .card {
  box-shadow: var(--shadow);
  border: 2px solid #000;
}

[data-theme="retro"] .identity-name,
[data-theme="retro"] .garden-title {
  font-family: 'Courier New', Courier, monospace;
  font-style: normal;
}

[data-theme="retro"] .identity-name em,
[data-theme="retro"] .garden-title em {
  font-style: normal;
  color: #000080;
  text-decoration: underline;
}

[data-theme="retro"] .btn-primary {
  background: #000080;
  color: #ffffff;
  border-color: #000080;
  border-radius: 0;
}

[data-theme="retro"] .nav {
  border-bottom: 2px solid #000;
  backdrop-filter: none;
  background: #c0c0c0;
}

[data-theme="retro"] .skill-tag {
  border-radius: 0;
  border: 1px solid #888;
}

[data-theme="retro"] .skill-tag.highlight {
  background: #000080;
  color: #ffffff;
  border-color: #000080;
}

/* ── PAGE LOAD ANIMATION ──────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeUp 0.4s ease both;
}

.card-identity { animation-delay: 0.05s; }
.card-skills   { animation-delay: 0.1s; }
.card-articles { animation-delay: 0.15s; }
.card-links    { animation-delay: 0.2s; }
.card-garden   { animation-delay: 0.25s; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 860px) {
  .bento {
    grid-template-columns: 1fr 1fr;
  }
  .card-identity { grid-column: 1 / 3; }
  .card-skills   { grid-column: 1 / 3; }
  .card-articles { grid-column: 1 / 3; }
  .card-links    { grid-column: 1 / 3; }
  .card-garden   { grid-column: 1 / 3; }
  .garden-card-inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { padding: 0 1rem; }
  .bento { grid-template-columns: 1fr; gap: 10px; }
  .card-identity,
  .card-skills,
  .card-articles,
  .card-links,
  .card-garden { grid-column: 1; }
  .identity-name { font-size: 1.6rem; }
  .nav-links { display: none; }
}
