:root {
  --bg: #fff;
  --fg: #000;
  --border: #e5e7eb;
  --muted: #6b7280;
  --gold: #a68a3f;
  --silver: #9198a1;
  --bronze: #a17650;
}

:root[data-theme="dark"] {
  --bg: #000;
  --fg: #fff;
  --border: #333333;
  --muted: #9ca3af;
  --gold: #c9ad5f;
  --silver: #b7bcc4;
  --bronze: #bd936a;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Spline Sans Mono', 'Courier New', Courier, monospace;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  margin: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 48px 24px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 32px 0;
}

section {
  margin-bottom: 32px;
}

section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 16px 0;
}

section p {
  font-size: 0.9rem;
  margin: 0;
}

.tooltip {
  position: relative;
  border-bottom: 1px dotted var(--fg);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  font-size: 0.75rem;
  padding: 4px 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.tooltip:hover::after {
  opacity: 1;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.filter-tag {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

.filter-tag:hover {
  color: var(--fg);
}

.filter-tag.active {
  color: var(--fg);
  font-weight: 700;
  text-decoration: underline;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.cards.stacked {
  grid-template-columns: 1fr;
}

.card {
  border: 1px solid var(--border);
  padding: 16px;
  min-height: 130px;
  box-sizing: border-box;
}

.card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.card p {
  font-size: 0.85rem;
}

.card a {
  color: var(--fg);
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

.card--extra {
  display: none;
}

.year-tag {
  display: block;
  font-size: 0.55rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.see-more-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 6px;
  cursor: pointer;
}

.see-more-btn:hover {
  border-color: var(--fg);
}

.portfolio-link {
  display: block;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
}

.portfolio-link:hover {
  border-color: var(--fg);
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--fg);
  text-decoration: underline;
}

.term-group {
  margin-bottom: 20px;
}

.term-group:last-child {
  margin-bottom: 0;
}

.term-heading {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px 0;
}

.course-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.course-list li {
  font-size: 0.9rem;
  margin-bottom: 4px;
  padding-left: 16px;
  position: relative;
}

.course-list li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.course-list li:last-child {
  margin-bottom: 0;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: var(--fg);
}

.social-links a:hover {
  color: var(--muted);
}

.icon-btn {
  display: flex;
  background: none;
  border: none;
  padding: 0;
  color: var(--fg);
  cursor: pointer;
  font-family: inherit;
}

.icon-btn:hover {
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  width: calc(100% - 48px);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
}

.modal-close:hover {
  color: var(--muted);
}

.modal-email {
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
  word-break: break-all;
}

footer {
  margin-top: 48px;
  font-size: 0.8rem;
  color: var(--muted);
}

#theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: inherit;
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
}

#theme-toggle:hover {
  border-color: var(--fg);
}
