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

:root {
  --bg-gradient: linear-gradient(0deg, #d3d7dc 0%, #eef0f3 100%);
  --text: #1f2733;
  --muted: #5b6672;
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.4);
  --accent-soft: rgba(37, 99, 235, 0.07);
  --track-bg: rgba(31, 40, 51, 0.08);
  --track-border: rgba(31, 40, 51, 0.06);
  --btn-bg: #ffffff;
  --btn-border: rgba(31, 40, 51, 0.1);
  --btn-shadow: 0 1px 2px rgba(31, 40, 51, 0.06);
  --toggle-track: #f2f5f9;
  --toggle-border: rgba(31, 40, 51, 0.12);
  --toggle-knob: #ffffff;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --bg-gradient: linear-gradient(0deg, #101620 0%, #1d2733 100%);
  --text: #f1f5f9;
  --muted: rgba(241, 245, 249, 0.55);
  --accent: #60a5fa;
  --accent-dim: rgba(96, 165, 250, 0.5);
  --accent-soft: rgba(96, 165, 250, 0.08);
  --track-bg: rgba(255, 255, 255, 0.07);
  --track-border: rgba(255, 255, 255, 0.05);
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-border: rgba(255, 255, 255, 0.09);
  --btn-shadow: none;
  --toggle-track: #1b2430;
  --toggle-border: rgba(255, 255, 255, 0.08);
  --toggle-knob: #0d1117;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
}

a { color: inherit; }
.container { max-width: 900px; margin-inline: auto; padding-inline: 28px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.005em;
  color: var(--text);
}
p { font-family: var(--font-body); }

.accent { color: var(--accent); }
.muted { color: var(--muted); }

.hero { padding-top: 96px; padding-bottom: 48px; }
.hero-inner {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.hero h1 {
  font-size: clamp(40px, 6.5vw, 64px);
  margin-left: clamp(0px, 6vw, 90px);
}
.profile {
  width: clamp(220px, 34vw, 520px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  flex-shrink: 0;
}

.section { padding-top: 4.5rem; scroll-margin-top: 24px; }
.display {
  text-align: center;
  font-weight: 600;
  font-size: clamp(28px, 4.5vw, 40px);
  margin-bottom: 2.4rem;
}
.display::after {
  content: "";
  display: block;
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  margin: 14px auto 0;
}

.p-center {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
.p-center strong, .p-short strong { font-weight: 700; }
.p-short {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: 26px;
}

.skills-grid {
  max-width: 620px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 52px;
}
.skill-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 7px;
  padding-left: 1px;
}
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--track-bg);
  border: 1px solid var(--track-border);
  overflow: hidden;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background-color: var(--color);
  background-image: linear-gradient(to bottom, var(--color), color-mix(in srgb, var(--color) 80%, #000));
  box-shadow: 0 0 10px color-mix(in srgb, var(--color) 25%, transparent);
}
.reveal.visible .progress-fill {
  width: var(--w);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.skills-grid .skill:nth-child(1) .progress-fill { transition-delay: 0.05s; }
.skills-grid .skill:nth-child(2) .progress-fill { transition-delay: 0.2s; }
.skills-grid .skill:nth-child(3) .progress-fill { transition-delay: 0.35s; }
.skills-grid .skill:nth-child(4) .progress-fill { transition-delay: 0.5s; }
.skills-grid .skill:nth-child(5) .progress-fill { transition-delay: 0.65s; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 60px;
  text-align: center;
}
.project h3 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 8px; }
.project p {
  font-size: 15px;
  color: var(--muted);
  max-width: 380px;
  margin-inline: auto;
  margin-bottom: 16px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  color: var(--text);
  text-decoration: none;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  font: 600 14.5px/1.4 var(--font-body);
  box-shadow: var(--btn-shadow);
  transition: border-color 0.2s, color 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.pill-btn:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.pill-btn:active { transform: translateY(0); }
.pill-btn.copied { color: var(--accent); border-color: var(--accent-dim); }

.pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  width: 72px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-track);
  cursor: pointer;
  padding: 0;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tt-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--toggle-knob);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s cubic-bezier(0.22, 1.2, 0.36, 1), background 0.35s ease;
}
html[data-theme="dark"] .tt-knob { transform: translateX(36px); }

.tt-sun,
.tt-moon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  transition: opacity 0.3s ease, transform 0.35s ease;
}
.tt-sun { color: #f59e0b; }
.tt-moon { color: #dbe4f0; opacity: 0; transform: rotate(-90deg) scale(0.4); }
html[data-theme="dark"] .tt-sun { opacity: 0; transform: rotate(90deg) scale(0.4); }
html[data-theme="dark"] .tt-moon { opacity: 1; transform: rotate(0) scale(1); }

footer { margin-top: 6rem; padding: 2rem 0 3rem; }
.footer-line {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.visible .progress-fill { width: var(--w); transition-delay: 0s; }
  * { transition: none !important; }
}

@media (max-width: 760px) {
  .hero { padding-top: 56px; padding-bottom: 40px; }
  .hero-inner { flex-direction: column; text-align: center; justify-content: center; gap: 32px; }
  .hero h1 { margin-left: 0; }
  .profile { width: min(62vw, 320px); }
  .skills-grid { grid-template-columns: 1fr; gap: 22px; }
  .project-grid { grid-template-columns: 1fr; gap: 40px; }
  .pills { justify-content: center; }
  .section { padding-top: 3.5rem; }
}
