:root {
  --color-bg: #faf8f5;
  --color-bg-card: #f3ede7;
  --color-text: #2d2d2d;
  --color-text-muted: #6b6560;
  --color-accent: #c4704b;
  --color-accent-hover: #a85d3c;
  --color-border: #e0d8d0;
  --color-white: #ffffff;
  --color-button-text: #ffffff;
  --color-shadow: rgba(0, 0, 0, 0.1);
  --color-shadow-strong: rgba(0, 0, 0, 0.12);

  --font-heading: 'DM Sans', sans-serif;
  --font-body: 'Inter', sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  --max-width: 1100px;
  --nav-height: 72px;
}

[data-theme="dark"] {
  --color-bg: #1a1a1a;
  --color-bg-card: #242424;
  --color-text: #e8e4e0;
  --color-text-muted: #9a9590;
  --color-border: #333333;
  --color-white: #1e1e1e;
  --color-accent-hover: #d4825e;
  --color-button-text: #1e1e1e;
  --color-shadow: rgba(0, 0, 0, 0.4);
  --color-shadow-strong: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: 2.75rem;
  margin-bottom: var(--space-sm);
}

h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

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

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.hero-image { opacity: 0; animation: fadeInScale 0.6s ease-out forwards; }
.hero-content h1 { opacity: 0; animation: fadeInUp 0.6s ease-out 0.1s forwards; }
.hero-title { opacity: 0; animation: fadeInUp 0.6s ease-out 0.2s forwards; }
.hero-location { opacity: 0; animation: fadeInUp 0.6s ease-out 0.3s forwards; }
.hero-intro { opacity: 0; animation: fadeInUp 0.6s ease-out 0.4s forwards; }
.hero-actions { opacity: 0; animation: fadeInUp 0.6s ease-out 0.5s forwards; }

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.section {
  padding-top: calc(var(--nav-height) + var(--space-2xl));
  padding-bottom: var(--space-2xl);
}

.section h1::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background-color: var(--color-accent);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.contact h1::after {
  margin-left: auto;
  margin-right: auto;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--color-text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  position: relative;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

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

.nav-links a.active {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 5px;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle--open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 110;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: none;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

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

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

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

.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.footer-social .button-icon {
  width: 32px;
  height: 32px;
}

.footer-social .button-icon svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-accent);
  color: var(--color-button-text);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.button-primary:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-button-text);
  text-decoration: none;
  transform: translateY(-1px);
}

.button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.button-outline:hover {
  background-color: var(--color-accent);
  color: var(--color-button-text);
  text-decoration: none;
  transform: translateY(-1px);
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.button-icon:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-color: var(--color-bg-card);
  text-decoration: none;
}

.hero {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.hero-container {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
  width: 100%;
}

.hero-image {
  flex-shrink: 0;
}

.hero-image img {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 30px var(--color-shadow-strong);
}

.hero-content {
  flex: 1;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.hero-location {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: var(--space-lg);
}

.hero-intro {
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: var(--space-lg);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.about-story {
  max-width: 720px;
  margin-bottom: var(--space-xl);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.skill-tag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--color-text);
  transition: background-color 0.3s ease;
}

.skill-tag:hover {
  background-color: var(--color-border);
}

.about-interests {
  color: var(--color-text-muted);
  font-style: italic;
}

.timeline {
  max-width: 720px;
}

.timeline-entry {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-lg);
  padding-bottom: var(--space-xl);
}

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

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.timeline-date {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.timeline-meta {
  color: var(--color-text-muted);
  font-size: 0.925rem;
  margin-bottom: var(--space-sm);
}

.timeline-entry ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: var(--space-sm);
}

.timeline-entry li {
  margin-bottom: var(--space-xs);
}

.section-subheading {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
}

.resume-download {
  text-align: center;
  margin-top: var(--space-2xl);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.project-card {
  position: relative;
  background-color: var(--color-bg-card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--color-accent);
  border-radius: 12px 0 0 12px;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.project-card:hover::before {
  transform: scaleY(1);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--color-shadow);
}

.project-card-body {
  padding: var(--space-lg);
}

.project-card-body h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.project-card-body p {
  color: var(--color-text-muted);
  font-size: 0.925rem;
  margin-bottom: var(--space-md);
}

.project-card-body .skill-tags {
  margin-bottom: var(--space-md);
}

.project-card-body .skill-tag {
  font-size: 0.8rem;
  padding: 0.25rem 0.625rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.925rem;
  text-decoration: none;
}

.project-link:hover {
  color: var(--color-accent-hover);
  text-decoration: none;
}

.contact {
  text-align: center;
}

.contact .container {
  max-width: 600px;
}

.contact-intro {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.contact-email {
  display: block;
  font-size: 1.5rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.contact-email:hover {
  color: var(--color-accent-hover);
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

.contact-social .button-icon {
  width: 48px;
  height: 48px;
}

.photo-intro {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  margin-bottom: var(--space-xl);
}

.photo-grid {
  column-count: 3;
  column-gap: var(--space-md);
}

.photo-grid img {
  width: 100%;
  margin-bottom: var(--space-md);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-grid img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px var(--color-shadow);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: none;
}

.project-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 769px) and (max-width: 1024px) {
  .photo-grid { column-count: 2; }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .section {
    padding-top: calc(var(--nav-height) + var(--space-xl));
    padding-bottom: var(--space-xl);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    background-color: var(--color-white);
    z-index: 105;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-links--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 1.25rem;
  }

  .hero {
    min-height: auto;
    padding-top: var(--nav-height);
    padding-bottom: var(--space-xl);
  }

  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-lg);
    padding-top: var(--space-xl);
  }

  .hero-image img {
    width: 200px;
    height: 200px;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .hero-intro {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }

  .timeline-header {
    flex-direction: column;
    gap: var(--space-xs);
  }

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

  .photo-grid { column-count: 1; }

  .footer-content {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}
