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

/* Animations start at opacity:0, so don't disable them — just make them instant. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Fonts don't change with the theme. */
:root {
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

html,
html[data-theme="dark"] {
  --bg: #080912;
  --fg: #e8e7f0;
  --fg-muted: #9697aa;
  --fg-subtle: #82839a;

  --rose: #e6a8c2;

  --border: rgba(255, 255, 255, 0.08);
  --accent: #b9a7ff;
  --accent-wash: rgba(185, 167, 255, 0.06);

  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eeecf2;
  --fg: #201e27;
  --fg-muted: #5f5c68;
  --fg-subtle: #656170;

  --rose: #b86f8e;

  --border: rgba(0, 0, 0, 0.08);
  --accent: #7057b8;
  --accent-wash: rgba(112, 87, 184, 0.07);

  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* Mono only where it's meant to show. */
.title,
.section-label,
.tag,
.item-role-rested em {
  font-family: var(--font-mono);
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.hero,
.experience,
.projects,
.contact {
  margin-bottom: 3rem;
}

/* Hero */

#name {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;

}

.title {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 2rem;

}

.intro,
.bio,
.extra {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.extra {
  margin-bottom: 2rem;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--fg-subtle);
  margin-bottom: 1rem;
  font-weight: 600;
}

.meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;

}

.meta-info p {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.8;
}

/* Tags */

.enthusiasm-list,
.tech-stack-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  border: 1px solid var(--border);
  padding: 0.15em 0.5em;
  border-radius: 3px;

  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.tag:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  background: var(--accent-wash);
}

.tag i {
  color: var(--rose);
  font-size: 1rem;
}

/* Footer */

footer {
  text-align: center;
  padding: 1.5rem 0 2rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: clamp(4rem, 10vh, 6rem);
  border-top: 1px solid var(--border);

  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Experience & Projects */

.experience-item,
.project-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.experience-item:last-child,
.project-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.icon-github {
  opacity: 0;

  transition:
    opacity 0.15s ease,
    color 0.15s ease;
}

.item-role {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
}

.item-role:hover .icon-github {
  opacity: 0.8;
}

.item-role a {
  color: var(--fg-muted);
  text-decoration: none;
  position: relative;

  transition: color 0.15s ease;
}

.item-role a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);

  transition: width 0.25s ease;
}

.item-role a:hover {
  color: var(--accent);
}

.item-role a:hover::after {
  width: 100%;
}

/* Rested projects — retired but not deleted, kept quiet on purpose. */

.item-role-rested {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-weight: 400;
}

.item-role-rested span {
  font-size: 0.875rem;
  color: var(--fg-subtle);
  text-decoration: line-through;
}

.item-role-rested em {
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  opacity: 0.6;
}

/* Details */

details summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;

  transition: color 0.15s ease;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "→";
  font-size: 0.75rem;
  color: var(--fg-subtle);
  display: inline-block;
  flex-shrink: 0;

  transition:
    transform 0.2s ease,
    color 0.15s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
  color: var(--fg-muted);
}

details summary:hover {
  color: var(--fg);
}

details > div {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

details > div ul {
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

details > div ul li {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.7;
  padding-left: 1rem;
  position: relative;
}

details > div ul li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--fg-subtle);
}

/* Stack */

.stack-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

/* Links */

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

.link {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  position: relative;

  transition: color 0.15s ease;
}

.link::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);

  transition: width 0.25s ease;
}

.link:hover {
  color: var(--accent);
}

.link:hover::after {
  width: 100%;
}

/* Theme Toggle */

#theme-toggle {
  position: fixed;
  top: 1.75rem;
  right: 1.75rem;

  width: 2rem;
  height: 2rem;

  border: 1px solid var(--border);
  background: none;
  color: var(--fg-muted);
  border-radius: 4px;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1rem;

  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;

  z-index: 100;
}

#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--fg-muted);
  background: var(--accent-wash);
}

#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.2s ease;
}

#theme-toggle .icon-sun {
  opacity: 1;
}

#theme-toggle .icon-moon {
  opacity: 0;
}

html[data-theme="light"] #theme-toggle .icon-sun {
  opacity: 0;
}

html[data-theme="light"] #theme-toggle .icon-moon {
  opacity: 1;
}

/* Entrance: one rule, delays listed below. */

#name,
.title,
.intro,
.bio,
.extra,
.meta-info,
.experience,
.projects,
.contact {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out forwards;
}

footer,
#theme-toggle {
  opacity: 0;
  animation: fade-up 0.6s ease-out forwards;
}

#name { animation-delay: 0.05s; }
.title { animation-delay: 0.1s; }
.intro { animation-delay: 0.2s; }
.bio { animation-delay: 0.3s; }
.extra { animation-delay: 0.4s; }
.meta-info { animation-delay: 0.5s; }
.experience { animation-delay: 0.6s; }
.projects { animation-delay: 0.7s; }
.contact { animation-delay: 0.8s; }
footer { animation-delay: 0.9s; }
#theme-toggle { animation-delay: 1s; }

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */

@media (max-width: 640px) {
  .container {
    padding: 3rem 1.25rem;
  }

  .icon-github {
    opacity: 0.6;
  }

  #theme-toggle {
    top: 1.25rem;
    right: 1.25rem;
  }
}
