/* ── TOKENS ── */
:root {
  --bg: #ffffff;
  --fg: #09090b;
  --muted-fg: #71717a;
  --muted-bg: #f4f4f5;
  --border: #e4e4e7;
  --card: #ffffff;
  --card-hover: #fafafa;
  --primary: #1A2744;
  --primary-fg: #ffffff;
  --accent: #94B8D0;
  --tag-bg: #EEF3F9;
  --tag-fg: #2D3F6B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --r: 10px;
  --r-sm: 6px;
  --r-full: 9999px;
  --max: 672px;
  --font: 'Inter', system-ui, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --mono: 'DM Mono', 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #09090b;
  --fg: #fafafa;
  --muted-fg: #a1a1aa;
  --muted-bg: #18181b;
  --border: #27272a;
  --card: #111113;
  --card-hover: #18181b;
  --primary: #94B8D0;
  --primary-fg: #09090b;
  --accent: #1A2744;
  --tag-bg: #1e2b46;
  --tag-fg: #94B8D0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.3);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  transition: background .25s, color .25s;
}

/* ── LAYOUT ── */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 120px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

@media (min-width: 640px) {
  main { padding: 96px 24px 140px; }
}

/* ── BLUR-FADE ANIMATION ── */
.fade {
  opacity: 0;
  filter: blur(5px);
  transform: translateY(-8px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1),
              filter .6s cubic-bezier(.16,1,.3,1),
              transform .6s cubic-bezier(.16,1,.3,1);
}
.fade.in { opacity: 1; filter: blur(0); transform: translateY(0); }
.fade.d1 { transition-delay: .05s; }
.fade.d2 { transition-delay: .1s; }
.fade.d3 { transition-delay: .15s; }
.fade.d4 { transition-delay: .2s; }
.fade.d5 { transition-delay: .25s; }
.fade.d6 { transition-delay: .3s; }
.fade.d7 { transition-delay: .35s; }
.fade.d8 { transition-delay: .4s; }

/* ── TYPOGRAPHY ── */
h1 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.1;
}
h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.015em;
}
.prose {
  font-size: .875rem;
  color: var(--muted-fg);
  line-height: 1.8;
}
.prose + .prose { margin-top: 12px; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* ── SECTION ── */
section { display: flex; flex-direction: column; gap: 12px; }

/* ── HERO ── */
.hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.hero-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.hero-subtitle {
  font-size: clamp(.9rem, 2.5vw, 1.1rem);
  color: var(--muted-fg);
  max-width: 460px;
}
.avatar {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: var(--r-full);
  border: 2px solid var(--border);
  overflow: hidden;
  background: var(--muted-bg);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

@media (min-width: 640px) {
  .avatar { width: 112px; height: 112px; }
}

/* ── LABEL BADGE ── */
.label {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  letter-spacing: .03em;
  width: fit-content;
}

/* ── EXPERIENCE / RESUME CARD ── */
.card-list { display: flex; flex-direction: column; gap: 4px; }

.resume-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px;
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: background .2s;
  cursor: pointer;
}
.resume-card:hover { background: var(--muted-bg); }

.resume-logo {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--muted-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem;
  color: var(--primary);
  overflow: hidden;
}
.resume-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.resume-body { flex: 1; min-width: 0; }
.resume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.resume-name {
  font-size: .85rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  line-height: 1.3;
}
.resume-period {
  font-size: .75rem;
  color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.resume-role {
  font-size: .75rem;
  color: var(--muted-fg);
  margin-top: 2px;
}
.resume-desc {
  font-size: .8rem;
  color: var(--muted-fg);
  margin-top: 6px;
  line-height: 1.7;
  display: none;
}
.resume-card:hover .resume-desc { display: block; }

.badge {
  display: inline-flex;
  align-items: center;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: .65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  letter-spacing: .02em;
}
.badge.now { background: #dcfce7; color: #15803d; }
[data-theme="dark"] .badge.now { background: #14532d; color: #4ade80; }

.chevron {
  width: 14px; height: 14px;
  color: var(--muted-fg);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
  flex-shrink: 0;
}
.resume-card:hover .chevron { opacity: 1; transform: translateX(0); }

/* ── PROJECTS GRID ── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 540px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
}

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--card);
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.project-card-body { padding: 14px 14px 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.project-title { font-size: .85rem; font-weight: 600; line-height: 1.35; }
.project-date { font-size: .7rem; color: var(--muted-fg); font-family: var(--mono); }
.project-desc { font-size: .78rem; color: var(--muted-fg); line-height: 1.7; margin-top: 4px; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 14px 12px; }

.tag {
  display: inline-flex;
  align-items: center;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: .65rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--r-full);
}

/* ── SKILLS ── */
.skills-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: .72rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--r-full);
}

/* ── TECH STACK ── */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 480px) {
  .stack-grid { grid-template-columns: 1fr; }
}

.stack-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  background: var(--card);
}
.stack-card-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.stack-card-header svg { color: var(--primary); flex-shrink: 0; }
.stack-card-title { font-size: .8rem; font-weight: 600; }
.stack-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.stack-tag {
  display: inline-flex;
  align-items: center;
  background: var(--muted-bg);
  color: var(--muted-fg);
  font-size: .7rem;
  padding: 3px 9px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
}

/* ── CONTACT ── */
#contact { text-align: center; align-items: center; padding: 24px 0; }
#contact h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); letter-spacing: -.03em; }
.link-green { color: #16a34a; }
[data-theme="dark"] .link-green { color: #4ade80; }

/* ── DOCK ── */
.dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  transition: background .25s, border-color .25s;
}
[data-theme="dark"] .dock {
  background: rgba(17,17,19,.85);
  border-color: var(--border);
}

.dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 12px;
  color: var(--muted-fg);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.dock-btn:hover { background: var(--muted-bg); color: var(--fg); }
.dock-btn svg { width: 16px; height: 16px; }

.dock-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── SELECTION ── */
::selection { background: var(--accent); color: var(--primary); }

/* ── MOBILE ── */
@media (max-width: 480px) {
  .hero-row { flex-direction: row; }
  .avatar { width: 64px; height: 64px; }
}
