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

:root {
  --bg:           #F5F5F7;
  --card-bg:      #FFFFFF;
  --text:         #1D1D1F;
  --text-muted:   #86868B;
  --accent:       #1D1D1F;
  --accent-fg:    #FFFFFF;
  --border:       #D2D2D7;
  --shadow:       0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.13);
  --radius:       8px;
  --font:         -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --max-w:        480px;
}

[data-theme="dark"] {
  --bg:           #1C1C1E;
  --card-bg:      #2C2C2E;
  --text:         #F5F5F7;
  --text-muted:   #98989D;
  --accent:       #F5F5F7;
  --accent-fg:    #1C1C1E;
  --border:       #58585C;
  --shadow:       0 2px 12px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.5);
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Theme toggle ───────────────────────────── */
.theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s;
  z-index: 10;
}

.theme-toggle:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-hover);
  color: var(--text);
}

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

.theme-toggle .icon-dark { display: block; }
.theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-light { display: block; }

/* ── Container ─────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px 28px;
  background: var(--card-bg);
  min-height: 100vh;
  position: relative;
}

@media (min-width: 600px) {
  body {
    padding: 36px 20px 60px;
  }

  .container {
    min-height: auto;
    border-radius: 22px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 24px 64px rgba(0,0,0,0.10);
  }
}

/* ── Profile ────────────────────────────────── */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 0;
  text-align: center;
}

.profile-img-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 18px;
  background: #E5E5EA;
  position: relative;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--border);
  flex-shrink: 0;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-img-wrap.placeholder .profile-img {
  display: none;
}

.profile-img-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -1px;
}

.profile-img-wrap.placeholder .profile-img-fallback {
  display: flex;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
}

.profile-handle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 3px;
}

.profile-divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  margin-bottom: 0;
}

.profile-tagline {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 260px;
  line-height: 1.4;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-hover);
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Tabs ───────────────────────────────────── */
.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  margin-bottom: 28px;
}

.tabs-filter {
  display: flex;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  background: #EBEBF0;
  color: var(--text-muted);
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tab.active {
  background: #C7C7CC;
  color: var(--text);
  box-shadow: none;
}

[data-theme="dark"] .tab {
  background: #2C2C2E;
  color: var(--text-muted);
}

[data-theme="dark"] .tab.active {
  background: #48484A;
  color: var(--text);
}

.tab:hover:not(.active) {
  color: var(--text);
}

.view-toggle {
  display: flex;
  gap: 4px;
}

.view-btn {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border: none;
  border-radius: var(--radius);
  background: #EBEBF0;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  box-sizing: border-box;
}

.view-btn svg {
  width: 15px;
  height: 15px;
}

.view-btn.active {
  background: #C7C7CC;
  color: var(--text);
}

.view-btn:hover:not(.active) {
  color: var(--text);
}

[data-theme="dark"] .view-btn {
  background: #2C2C2E;
  color: var(--text-muted);
}

[data-theme="dark"] .view-btn.active {
  background: #48484A;
  color: var(--text);
}

/* ── Grid ───────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hidden {
  display: none !important;
}

/* ── Card ───────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 5/8;
  background: var(--ph-bg, #EAE4DC);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}


.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover .card-img {
  transform: scale(1.04);
}

.card-img-wrap.img-error .card-img {
  display: none;
}

.card-img-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.card-img-wrap.img-error .card-img-placeholder {
  display: flex;
}

.card-img-placeholder svg {
  width: 44%;
  height: 44%;
  opacity: 0.6;
}

.badge {
  position: absolute;
  top: 80%;
  right: 0;
  background: #B45309;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-body {
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  position: relative;
}

.card-link-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.2s;
}

.card:hover .card-link-icon {
  opacity: 1;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
  line-height: 1.3;
}

.card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}


/* ── List View ──────────────────────────────── */
.grid.list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}

.grid.list-view .card {
  flex-direction: row;
  align-items: stretch;
  position: relative;
}

/* Linker Leerraum */
.grid.list-view .card::before {
  content: '';
  width: 30px;
  flex-shrink: 0;
  order: 0;
  background: var(--card-bg);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Rechter Icon-Bereich als Hintergrundfläche */
.grid.list-view .card::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  pointer-events: none;
}

[data-theme="dark"] .grid.list-view .card::after {
  background: #3A3A3C;
}

.grid.list-view .card-img-wrap {
  order: 1;
  width: 60px;
  flex-shrink: 0;
  aspect-ratio: 5/8;
  border-radius: 0;
  overflow: hidden;
  position: static;
}

.grid.list-view .card-body {
  order: 2;
  flex: 1;
  padding: 10px 50px 10px 14px;
  justify-content: center;
  gap: 3px;
  position: static;
}

.grid.list-view .card-title {
  font-size: 13px;
}

.grid.list-view .card-desc {
  font-size: 11.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grid.list-view .card-link-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #007AFF;
  opacity: 0.7;
  background: none;
  z-index: 1;
}

.grid.list-view .card:hover .card-link-icon {
  opacity: 1;
  background: none;
}

.grid.list-view .badge {
  position: absolute;
  left: auto;
  right: calc(100% - 30px);
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-lr;
  white-space: nowrap;
  width: auto;
  font-size: 8.5px;
  padding: 8px 4px;
  border-radius: 0 4px 4px 0;
  letter-spacing: 0.4px;
}

/* ── Footer ─────────────────────────────────── */
.footer {
  margin-top: 48px;
  padding-top: 14px;
  padding-bottom: 8px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer .social-links {
  justify-content: center;
  margin-bottom: 24px;
}

.footer-name {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-links .dot {
  color: var(--text-muted);
  font-size: 11px;
}

.footer-credit {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

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

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

/* ── Subpages (Impressum / Datenschutz) ─────── */
.subpage {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  background: #FFFFFF;
  min-height: 100vh;
}

@media (min-width: 700px) {
  .subpage {
    min-height: auto;
    margin: 36px auto 60px;
    border-radius: 22px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 24px 64px rgba(0,0,0,0.10);
  }
}

.subpage-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.subpage-back:hover {
  color: var(--text);
}

.subpage h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 32px;
}

.subpage h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--text);
}

.subpage p,
.subpage li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

.subpage ul {
  padding-left: 18px;
  margin-top: 4px;
}

.subpage a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Responsive ─────────────────────────────── */
@media (min-width: 500px) {
  .grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 768px) {
  :root {
    --max-w: 540px;
  }

  .container {
    padding: 0 24px 32px;
  }

  .profile {
    padding: 32px 0 0;
  }

  .card-title {
    font-size: 14px;
  }

  .card-desc {
    font-size: 12px;
  }
}
