:root {
  --page-bg: #f2f1ec;
  --card-bg: #ffffff;
  --text: #1a1d1f;
  --muted: #5b6470;
  --shadow: 0 20px 50px -20px rgba(20, 25, 35, 0.25), 0 6px 16px -8px rgba(20, 25, 35, 0.12);
  --ring: #e0672a;
  --toggle-bg: #eceae2;
  --toggle-icon: #1a1d1f;
  --surface: #f5f4ef;
  --surface-border: #e6e4da;

  --work: #16233f;
  --readings: #e0672a;
  --thoughts: #2f6690;
  --devotional: #1f4b46;
  --spotify: #2f7a4f;
  --instagram: #5b6470;
  --contact: #23262b;
}

html[data-theme="dark"] {
  --page-bg: #12151a;
  --card-bg: #1b1f26;
  --text: #f2f3f0;
  --muted: #9aa3ad;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6), 0 6px 16px -8px rgba(0, 0, 0, 0.4);
  --toggle-bg: #262b33;
  --toggle-icon: #f2f3f0;
  --surface: #20242c;
  --surface-border: #2b303a;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --page-bg: #12151a;
    --card-bg: #1b1f26;
    --text: #f2f3f0;
    --muted: #9aa3ad;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6), 0 6px 16px -8px rgba(0, 0, 0, 0.4);
    --toggle-bg: #262b33;
    --toggle-icon: #f2f3f0;
    --surface: #20242c;
    --surface-border: #2b303a;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  justify-content: center;
  padding: 56px 16px;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

.card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--toggle-bg);
  color: var(--toggle-icon);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  padding: 3px;
  background: var(--ring);
}

.name {
  font-size: 26px;
  font-weight: 700;
  margin: 16px 0 12px;
}

.bio {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 12px;
}

.bio-secondary {
  color: var(--muted);
  margin: 0 0 24px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 96px;
  gap: 14px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-row: span 1;
  border-radius: 22px;
  color: #fff;
  text-decoration: none;
  padding: 16px 10px;
  overflow: hidden;
  box-shadow: 0 10px 20px -12px rgba(20, 20, 30, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 28px -14px rgba(20, 20, 30, 0.5);
}

.tile-tall {
  grid-row: span 2;
}

.tile-tall .tile-icon {
  font-size: 34px;
}

.tile-tall .tile-label {
  font-size: 14px;
}

.tile-icon {
  font-size: 28px;
  line-height: 1;
}

.tile-label {
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
}

.badge {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 13px;
  opacity: 0.75;
  z-index: 1;
}

.tile-work { background: var(--work); }
.tile-readings { background: var(--readings); }
.tile-thoughts { background: var(--thoughts); }
.tile-devotional { background: var(--devotional); }
.tile-spotify { background: var(--spotify); }
.tile-instagram { background: var(--instagram); }

.passions {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.passions-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.passions-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.passion-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--text);
  text-decoration: none;
}

.tile-contact {
  margin-top: 14px;
  flex-direction: row;
  background: var(--contact);
  padding: 16px 20px;
}

.tile-contact .tile-icon {
  font-size: 22px;
}

.tile-contact .badge {
  top: 50%;
  transform: translateY(-50%);
}

.share-card {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.qr-box {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  background: #ffffff;
  border-radius: 18px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ring);
  box-shadow: 0 10px 20px -10px rgba(224, 103, 42, 0.35);
}

.share-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.share-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.share-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--ring);
  border-radius: 999px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.share-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.share-btn:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .share-btn:hover {
    filter: brightness(1.08);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: rgba(26, 29, 31, 0.94);
  color: #fff;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 24px;
}

@media (max-width: 420px) {
  .card { padding: 28px 20px 20px; }
}
