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

html,
html[data-theme='dark'] {
  --bg: #0a0a0a;
  --fg: #e8e4df;
  --fg-muted: #8a8580;
  --fg-subtle: #6c665f;
  --iris: #c4a7e7;
  --foam: #9ccfd8;
  --rose: #f0c9c5;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #f0c9c5;
  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: #f5f0e8;
  --fg: #1a1816;
  --fg-muted: #55504b;
  --fg-subtle: #6c6762;
  --iris: #7c5cbf;
  --foam: #2d8fa0;
  --rose: #c4746e;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #c4746e;
  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family:
    ui-monospace,
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    Segoe UI,
    Roboto,
    Helvetica Neue,
    Arial,
    Noto Sans,
    sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

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

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

#name {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.05s forwards;
}

.title {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.1s forwards;
}

.intro {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  line-height: 1.75;
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.2s forwards;
}

.bio {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  line-height: 1.75;
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.3s forwards;
}

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

.extra {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
  line-height: 1.75;
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.4s forwards;
}

.meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.5s forwards;
}

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

.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: rgba(240, 201, 197, 0.05);
}

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

.experience {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.6s forwards;
}

.projects {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.7s forwards;
}

.contact {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease-out 0.8s forwards;
}

footer {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: clamp(4rem, 10vh, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  animation: fade-up 0.6s ease-out 0.9s forwards;
}

.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-subtle);
  margin-bottom: 0.25rem;
}

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

.item-role a {
  color: var(--fg-subtle);
  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%;
}

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);
  transition:
    transform 0.2s ease,
    color 0.15s ease;
  display: inline-block;
  flex-shrink: 0;
}

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-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.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%;
}

.salient {
  color: var(--accent);
  font-weight: 500;
}

#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;
  opacity: 0;
  animation: fade-up 0.6s ease-out 1s forwards;
}

#theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  background: rgba(240, 201, 197, 0.05);
}

#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;
}

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

@keyframes line-grow-short {
  to {
    width: 3rem;
    opacity: 1;
  }
}

@keyframes line-grow {
  to {
    width: 100%;
    opacity: 1;
  }
}

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

  .icon-github {
    opacity: 0.6;
  }

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