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

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-900: #171717;
  --primary: #008446;
  --success: #00c853;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --text-primary: var(--black);
  --text-secondary: var(--gray-600);
  --border-color: var(--gray-200);
  --nav-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
  --bg-primary: var(--gray-900);
  --bg-secondary: #0a0a0a;
  --text-primary: var(--white);
  --text-secondary: var(--gray-400);
  --border-color: #2a2a2a;
  --nav-bg: rgba(23, 23, 23, 0.8);
  --gray-100: #1a1a1a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
}

button, input, select, textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--text-primary);
  color: var(--bg-primary);
}

/* ── Nav ────────────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

nav .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

nav .logo {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin-right: auto;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  transition: color 0.2s;
}

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

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  transition: color 0.2s;
  margin-right: auto;
}

.back-link:hover {
  color: var(--text-primary);
}

/* Page without hero: offset fixed nav */
.page-intro {
  padding-top: 10rem;
  padding-left: 3rem;
  padding-right: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Project detail content */
.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 3rem 6rem;
}

.content h2 {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  color: var(--text-primary);
}

.content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  transition: color 0.3s ease;
}

.project-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
}

.meta-value {
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.featured-image {
  max-width: 1400px;
  margin: 0 auto 4rem;
  padding: 0 3rem;
}

.featured-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--gray-100);
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.featured-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Experience timeline */
.timeline {
  display: flex;
  flex-direction: column;
  max-width: 700px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  transition: border-color 0.3s ease;
}

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

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.timeline-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--primary);
  border-radius: 4px;
}

.timeline-role {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.timeline-company {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 0.625rem;
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--text-primary);
}

.theme-icon {
  width: 16px;
  height: 16px;
  stroke: var(--text-secondary);
  transition: stroke 0.2s;
}

.theme-toggle:hover .theme-icon {
  stroke: var(--text-primary);
}

/* ── Hero ───────────────────────────────────────────── */

.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10rem 3rem 8rem;
}

.hero h1 {
  font-size: 56px;
  line-height: 60px;
  letter-spacing: -1.1px;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  max-width: 900px;
  transition: color 0.3s ease;
}

.hero .subtitle {
  font-size: clamp(1.0625rem, 2.25vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 28px;
  font-weight: 400;
  margin-bottom: 2.75rem;
  transition: color 0.3s ease;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  transition: color 0.3s ease;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.links a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* ── Main ───────────────────────────────────────────── */

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem 6rem;
}

main > section {
  margin-bottom: 7rem;
  scroll-margin-top: 100px;
}

main > section > h2 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  transition: color 0.3s ease;
}

/* ── Projects ───────────────────────────────────────── */

.projects-grid {
  display: grid;
  gap: 5rem;
}

.project {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 5rem;
  padding-bottom: 5rem;
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.project:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 120px;
  height: fit-content;
}

.project-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.project-type {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.project-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--gray-100);
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.project-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-link:hover .project-image-wrapper img {
  transform: scale(1.02);
}

.project-content h3 {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.875rem;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.project:hover .project-content h3 {
  color: var(--primary);
}

.project-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  transition: color 0.3s ease;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

/* ── Services ───────────────────────────────────────── */

.services-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 700px;
}

.service {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.service:last-child {
  border-bottom: none;
}

.service h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.625rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.service p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ── About ──────────────────────────────────────────── */

.about-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-content {
  max-width: 700px;
}

.about-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  transition: color 0.3s ease;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.profile-container {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Contact ────────────────────────────────────────── */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.contact-card {
  padding: 2rem;
}

.contact-card:first-child {
  border-right: 1px solid var(--border-color);
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.field {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.field label {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  padding: 0.9rem 1rem;
  min-height: 48px;
  transition: border-color 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text-primary);
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 2px;
  text-decoration: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-size: 0.9375rem;
}

.button:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* ── Footer ─────────────────────────────────────────── */

footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3.5rem 3rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s ease;
}

footer p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

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

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 768px) {
  .hero {
    padding: 8rem 1.5rem 5rem;
  }

  .hero h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
  }

  main {
    padding: 0 1.5rem 4rem;
  }

  nav .container {
    padding: 16px 1.5rem;
  }

  nav ul {
    display: none;
  }

  .project {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-info {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-card:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    padding: 2.5rem 1.5rem;
  }
}
