/* ===== Variables ===== */
:root {
  --color-bg: #faf9f7;
  --color-bg-alt: #f2efe9;
  --color-text: #1a1918;
  --color-text-muted: #5c5a57;
  --color-accent: #c45c3e;
  --color-accent-hover: #a84d33;
  --color-border: #e5e2dc;
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* ===== Header & Nav ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-lg) var(--space-xl);
  background: rgba(250, 249, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header.scrolled {
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  max-width: 72rem;
  margin: 0 auto;
}

.hero-layout {
  display: flex;
  align-items: center;
  gap: var(--space-3xl);
  flex-wrap: wrap;
}

.hero-content {
  flex: 1;
  min-width: 280px;
}

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

.hero-tagline {
  font-size: 1rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: var(--space-sm);
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-subtitle .highlight {
  color: var(--color-text);
  font-style: italic;
}

.hero-subtitle a {
  font-weight: 600;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.3s forwards;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  border: 2px solid var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

/* ===== Sections ===== */
.section {
  padding: var(--space-3xl) var(--space-xl);
  max-width: 72rem;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  margin-bottom: var(--space-2xl);
  letter-spacing: -0.02em;
}

/* ===== Projects ===== */
.projects {
  background: var(--color-bg-alt);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
}

.project-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.project-card--featured {
  border-color: var(--color-accent);
  border-width: 2px;
}

.project-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.project-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

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

.project-info h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
}

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

.project-links {
  display: flex;
  gap: var(--space-lg);
}

.project-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Contact ===== */
.contact-intro {
  max-width: 36rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
}

.constellation {
  position: relative;
  width: 300px;
  height: 300px;
  aspect-ratio: 1;
}

.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.constellation-lines line {
  stroke: var(--color-border);
  stroke-width: 1.5;
  transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.constellation-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.constellation-center img {
  width: 180px;
  min-width: 180px;
  height: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-border);
  transition: border-color 0.3s ease;
}

.constellation-node {
  position: absolute;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
  font-size: 1.2rem;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  z-index: 2;
}

/* Brand colors */
.constellation-node[data-index="0"] { color: #0A66C2; } /* LinkedIn */
.constellation-node[data-index="1"] { color: #333; }    /* GitHub */
.constellation-node[data-index="2"] { color: #000; }    /* Medium */
.constellation-node[data-index="3"] { color: #E1306C; } /* Photography/Instagram pink */
.constellation-node[data-index="4"] { color: #4a7c59; } /* Barkscapes/tree green */
.constellation-node[data-index="5"] { color: #553B08; } /* Goodreads */
.constellation-node[data-index="6"] { color: #FC4C02; } /* Strava */

.constellation-node:hover {
  border-color: currentColor;
  background: var(--color-bg-alt);
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.contact-links-mobile {
  display: none;
}

.contact-link {
  font-weight: 500;
  padding: var(--space-sm) 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}

.contact-link:hover {
  border-bottom-color: var(--color-accent);
}

.contact-link i {
  margin-right: var(--space-xs);
}

/* ===== Footer ===== */
.footer {
  padding: var(--space-xl);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--color-border);
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80%;
    max-width: 300px;
    background: var(--color-bg);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-2xl);
    transform: translateX(100%);
    transition: transform var(--transition);
    border-left: 1px solid var(--color-border);
  }

  .nav-links.open {
    transform: translateX(0);
  }

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

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

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

  .hero {
    padding-top: calc(var(--space-3xl) + 4rem);
  }

  .hero-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .hero-avatar {
    order: -1;
    flex-shrink: 0;
    padding-top: var(--space-sm);
  }

  .hero-content {
    min-width: 0;
  }

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

  .constellation {
    width: auto;
    height: auto;
    margin: 0 auto;
  }

  .constellation-center {
    position: static;
    transform: none;
  }

  .constellation-center img {
    width: 80px;
    min-width: 80px;
    height: 80px;
  }

  .constellation-node,
  .constellation-lines {
    display: none;
  }

  .contact-links-desktop {
    display: none;
  }

  .contact-links-mobile {
    display: flex;
  }
}
