/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg: #FAF7F2;
  --bg-alt: #F1EDE6;
  --surface: hwb(0 100% 0%);
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #999;
  --border: #e5e1da;
  --accent: #1a1a1a;

  /* project card palettes */
  --green: #e8f5e9;
  --green-fg: #2e7d32;
  --blue: #e3f2fd;
  --blue-fg: #1565c0;
  --violet: #ede7f6;
  --violet-fg: #5e35b1;
  --amber: #fff8e1;
  --amber-fg: #f57f17;

  --font: 'Albert Sans', system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'Consolas', 'Courier New', monospace;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --max-w: 860px;
}

[data-theme="dark"] {
  --bg: #141414;
  --bg-alt: #1c1c1c;
  --surface: #222;
  --text: #ededed;
  --text-secondary: #aaa;
  --text-muted: #666;
  --border: #2e2e2e;
  --accent: #ededed;

  --green: #1b3d1e;
  --green-fg: #66bb6a;
  --blue: #0d2a45;
  --blue-fg: #64b5f6;
  --violet: #1e1433;
  --violet-fg: #b39ddb;
  --amber: #2e2400;
  --amber-fg: #ffd54f;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; cursor: none; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-secondary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
  cursor: none;
}

/* Custom cursor */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1a1a;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s var(--ease), height 0.2s var(--ease), background 0.2s var(--ease), border 0.2s var(--ease);
}

.cursor.hovering {
  width: 18px;
  height: 18px;
  background: transparent;
  border: 2px solid #1a1a1a;
}

[data-theme="dark"] .cursor {
  background: #ededed;
}

[data-theme="dark"] .cursor.hovering {
  background: transparent;
  border-color: #ededed;
}

a, button { cursor: none; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
strong { color: var(--text); font-weight: 600; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* serif italic utility */
.serif-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

/* ============================================
   HERO BANNER IMAGE
   ============================================ */
.hero-banner {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 360px;
  overflow: hidden;
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-banner-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to bottom, transparent 0%, #FAF7F2 100%);
  pointer-events: none;
}

[data-theme="dark"] .hero-banner-fade {
  background: linear-gradient(to bottom, transparent 0%, #141414 100%);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 20px 0;
  transition: background 0.3s var(--ease), padding 0.3s var(--ease);
}

.nav.scrolled {
  padding: 14px 0;
  background: rgba(250, 247, 242, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(20, 20, 20, 0.7);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.2px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}

[data-theme="dark"] .nav-name {
  background: rgba(40, 40, 40, 0.6);
}

.nav.scrolled .nav-name {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.2s, background 0.3s var(--ease), backdrop-filter 0.3s var(--ease), padding 0.3s var(--ease);
}

[data-theme="dark"] .nav-links a {
  background: rgba(40, 40, 40, 0.6);
}

/* Remove pills once scrolled */
.nav.scrolled .nav-links a {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-links a:hover {
  color: var(--text);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 60px 0 100px;
}

.hero-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
}

.hero-text {
  flex: 1;
}

.hero-greeting {
  font-family: var(--font);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-greeting .serif-italic {
  font-size: 1.05em;
}

/* cycling titles */
.hero-titles {
  position: relative;
  height: 28px;
  margin-bottom: 20px;
  overflow: hidden;
}

.hero-title-item {
  position: absolute;
  left: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.hero-title-item.active {
  opacity: 1;
  transform: translateY(0);
}

.hero-title-item.exiting {
  opacity: 0;
  transform: translateY(-8px);
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 4px;
  transition: opacity 0.2s;
}

.hero-cta--secondary {
  color: var(--text-muted);
  border-bottom-color: var(--text-muted);
}

.hero-cta:hover { opacity: 0.6; }

.hero-cta .arrow {
  font-size: 1rem;
  transition: transform 0.2s;
}

.hero-cta:hover .arrow { transform: translateY(3px); }
.hero-cta--secondary:hover .arrow { transform: translateY(-3px); }

/* avatar placeholder */
.hero-visual {
  flex-shrink: 0;
}

.hero-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  transition: border-color 0.35s var(--ease);
}

/* ============================================
   SECTION SHARED
   ============================================ */
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.section-heading {
  font-family: var(--font);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 48px;
  max-width: 500px;
}

/* ============================================
   PRINCIPLES
   ============================================ */
.principles {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.principles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.principle-card {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.principle-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

[data-theme="dark"] .principle-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.principle-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.principle-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.principle-card p {
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.project-card {
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

[data-theme="dark"] .project-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.project-card-inner {
  padding: 32px;
}

.project-card--green { background: var(--green); }
.project-card--green h3, .project-card--green .project-tag { color: var(--green-fg); }

.project-card--blue { background: var(--blue); }
.project-card--blue h3, .project-card--blue .project-tag { color: var(--blue-fg); }

.project-card--violet { background: var(--violet); }
.project-card--violet h3, .project-card--violet .project-tag { color: var(--violet-fg); }

.project-card--amber { background: var(--amber); }
.project-card--amber h3, .project-card--amber .project-tag { color: var(--amber-fg); }

.projects-cta {
  margin-top: 40px;
  text-align: center;
}

.project-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.project-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.project-card p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,0.06);
  color: var(--text-secondary);
}

[data-theme="dark"] .project-meta span {
  background: rgba(255,255,255,0.08);
}

/* ============================================
   ABOUT
   ============================================ */
.about {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.about-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-lead {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-body p {
  margin-bottom: 14px;
  line-height: 1.8;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 8px;
}

.stat {
  border-left: 2px solid var(--border);
  padding-left: 20px;
  transition: border-color 0.2s;
}

.stat:hover {
  border-color: var(--text);
}

.stat-num {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 2px;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   EXPERIENCE / TIMELINE
   ============================================ */
.experience {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 28px;
}

/* Vertical line */
.timeline-track {
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding-bottom: 40px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Circle marker */
.timeline-marker {
  position: absolute;
  left: -28px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  z-index: 1;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}

/* Hollow state when scrolled into view */
.timeline-item.visible .timeline-marker {
  border-color: var(--text);
  background: var(--bg);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 2px;
  letter-spacing: 0.5px;
}

.timeline-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.timeline-body ul {
  padding-left: 0;
}

.timeline-body li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  font-size: 0.88rem;
  line-height: 1.65;
}

.timeline-body li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ============================================
   SKILLS
   ============================================ */
.skills {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.skill-group h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.skill-group li {
  font-size: 0.88rem;
  padding: 6px 0;
  color: var(--text-secondary);
}

/* ============================================
   CONNECT
   ============================================ */
.connect {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.connect-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 40px;
}

.connect-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.connect-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.25s var(--ease);
}

.connect-link:first-child {
  border-top: 1px solid var(--border);
}

.connect-link:hover {
  padding-left: 12px;
}

.connect-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.connect-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s, background 0.35s var(--ease), border-color 0.35s var(--ease);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.t-icon { width: 18px; height: 18px; }

.t-icon--sun { display: block; }
.t-icon--moon { display: none; }

[data-theme="dark"] .t-icon--sun { display: none; }
[data-theme="dark"] .t-icon--moon { display: block; }

/* ============================================
   REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero { padding: 120px 0 60px; }

  .hero-layout {
    flex-direction: column-reverse;
    gap: 32px;
    text-align: center;
  }

  .hero-title-item {
    left: 0;
    right: 0;
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-avatar {
    width: 120px;
    height: 120px;
  }

  .avatar-text { font-size: 2rem; }

  .principles-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }

  .stat { flex: 1; min-width: 120px; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .timeline-date {
    padding-bottom: 4px;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .nav-links { gap: 20px; }

  .theme-toggle {
    bottom: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }

  .t-icon { width: 16px; height: 16px; }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    flex-direction: column;
  }
}