:root {
  --bg: #f4f4f2;
  --card: #ffffff;
  --fg: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --accent: #0a66c2;
  --chip: #f4f4f5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --card: #18181b;
    --fg: #f4f4f5;
    --muted: #a1a1aa;
    --border: #27272a;
    --accent: #4d9be6;
    --chip: #232326;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.avatar {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--border);
}

h1 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.title {
  margin: 0.3rem 0 1.5rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.bio {
  margin: 0.6rem 0 0.6rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

.prev {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.also-label {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* "also ____" rotator */
.also {
  margin-bottom: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.also-line {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  min-height: 1.3em;
}
/* Longest role wraps on small phones — reserve two lines so the card doesn't jump */
@media (max-width: 420px) {
  .also-line { min-height: 2.6em; }
}
#role { color: var(--fg); }

.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.also-note {
  margin: 0.25rem 0 0;
  min-height: 1.5em;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.3s;
}
.also-note.visible { opacity: 1; transform: none; }

/* Emoji chips */
.chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}
.chip {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.2rem;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--chip);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, filter 0.15s;
  filter: grayscale(0.6);
}
.chip:hover { transform: translateY(-2px); filter: none; }
.chip.active {
  filter: none;
  border-color: var(--accent);
  transform: scale(1.12);
}

/* Toolkit (collapsible) */
.toolkit {
  margin-bottom: 1rem;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.toolkit summary {
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
}
.toolkit summary::-webkit-details-marker { display: none; }
.toolkit summary::after { content: "+"; color: var(--muted); }
.toolkit[open] summary::after { content: "−"; }
.toolkit dl {
  margin: 0;
  padding: 0 1rem 1rem;
  font-size: 0.85rem;
}
.toolkit dt { font-weight: 600; margin-top: 0.6rem; }
.toolkit dd { margin: 0.1rem 0 0; color: var(--muted); line-height: 1.45; }

/* Buttons */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .chip, .btn, .also-note { transition: none; }
}
