@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #070707f0;
  --text: #d7d0d0;
  --text-muted: #e0e0e0;
  --hero-body: #e0e0e0;
  --link: #f0f0f0;
  --tag-border: #2a2a2a;
  --tag-bg: #f5f5f5;
  --tag-hover-bg: #ffffff;
  --tag-text: #0b0b0b;
  --tag-shadow: rgba(0,0,0,0.22);
  --nav-bg: rgba(20,20,20,0.92);
  --nav-border: rgba(255,255,255,0.1);
  --nav-hover: rgba(255,255,255,0.07);
  --nav-icon: #c0c0c0;
  --nav-icon-active: #ffffff;
  --tooltip-bg: #f5f5f5;
  --tooltip-text: #0b0b0b;
  --theme-hover: rgba(255,255,255,0.12);
  --accent: #4a90d9;
}

body.light {
  --bg: #f9efef;
  --text: #1a1613;
  --text-muted: #4a4640;
  --hero-body: #0b0b0b;
  --link: #2d2926;
  --tag-border: rgba(26,22,19,0.12);
  --tag-bg: #1a1613;
  --tag-hover-bg: #2d2926;
  --tag-text: #fffaf4;
  --tag-shadow: rgba(26,22,19,0.2);
  --nav-bg: rgba(245,243,237,0.92);
  --nav-border: rgba(0,0,0,0.1);
  --nav-hover: rgba(0,0,0,0.06);
  --nav-icon: #5a5450;
  --nav-icon-active: #1a1613;
  --tooltip-bg: #1a1613;
  --tooltip-text: #fffaf4;
  --theme-hover: rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
  padding-bottom: 120px;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero */
#home {
  padding-top: 8vh;
  min-height: 50vh;
}

.hero-name {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.1s;
}

.hero-body {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.9;
  color: var(--hero-body);
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.hero-body:nth-child(2) { animation-delay: 0.2s; }
.hero-body:nth-child(3) { animation-delay: 0.3s; }
.hero-body:nth-child(4) { animation-delay: 0.4s; }

.hero-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 2rem 0;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.5s;
}

.hero-links a {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.15);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.hero-links a:hover {
  color: var(--text);
  text-decoration-color: rgba(255,255,255,0.4);
}

.hero-links .dot {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.hero-closing {
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.6s;
}

/* Divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--tag-border);
  margin: 5rem 0 3.5rem;
  transition: border-color 0.3s;
}

/* Skills */
#skills {
  padding-top: 1rem;
}

.section-label {
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.15s;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.25s;
}

.tag {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.48rem 0.82rem;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 0.45rem;
  color: var(--tag-text);
  background: var(--tag-bg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.45) inset;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  cursor: default;
}

.tag:hover {
  background: var(--tag-hover-bg);
  box-shadow: 0 5px 16px var(--tag-shadow);
  transform: translateY(-2px);
}

/* Projects */
#projects {
  padding-top: 1rem;
}

.project-list {
  display: grid;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.25s;
}

.project-item {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--tag-border);
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s, border-color 0.2s;
}

.project-item:hover {
  color: var(--link);
  border-color: var(--text-muted);
  transform: translateX(4px);
}

.project-name {
  font-size: 1rem;
  font-weight: 700;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Say hello section */
#contact {
  padding-top: 5rem;
  padding-bottom: 2rem;
  text-align: center;
}

.hello-text {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.1s;
}

.hello-text a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.hello-text a:hover { opacity: 0.75; }

.hello-indicator {
  width: 32px;
  height: 5px;
  background: var(--tag-border);
  border-radius: 3px;
  margin: 1.5rem auto 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.05s;
}

body.light .hello-indicator {
  background: #0b0b0b;
}

/* Bottom nav */
.dock {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: 2rem;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
  transition: background 0.3s, border-color 0.3s;
}

.dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--nav-icon);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  position: relative;
}

.dock-btn:hover {
  background: var(--nav-hover);
  color: var(--nav-icon-active);
  transform: translateY(-2px);
}

.dock-btn::before {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.7rem);
  transform: translate(-50%, 0.35rem);
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: opacity 0.15s, transform 0.15s;
}

.dock-btn:hover::before,
.dock-btn:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dock-btn.active {
  color: var(--nav-icon-active);
}

.dock-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock-btn .icon-x {
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  fill: none;
  stroke: none;
  color: currentColor;
}

.dock-separator {
  width: 1px;
  height: 22px;
  background: var(--nav-border);
  margin: 0 0.25rem;
  flex-shrink: 0;
  border-radius: 1px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#theme-toggle {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.light #theme-toggle {
  color: #0b0b0b;
}

body.light #theme-toggle svg {
  stroke: #0b0b0b;
}

#theme-toggle:hover svg {
  animation: spin 0.6s linear;
  transform-origin: center;
}

#theme-toggle:hover {
  background: var(--theme-hover) !important;
  color: var(--nav-icon-active);
  transform: scale(1.1) !important;
}

@media (max-width: 500px) {
  #home { padding-top: 14vh; }
  .dock { bottom: 1.2rem; padding: 0.5rem 0.6rem; gap: 0; }
  .dock-btn { width: 34px; height: 34px; }
}
