/* ─── Design Tokens ─────────────────────────────────────────────────────── */

/* Palette: cool slate neutrals + dusty sage midtones + terracotta/burgundy accent
   Derived from profile photo: limestone whites, muted sea blues, sage greens, deep burgundy */

:root, [data-theme='light'] {
  /* Type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — cool off-white, slightly warm */
  --color-bg:              #f5f4f1;
  --color-surface:         #f8f7f4;
  --color-surface-2:       #fafaf8;
  --color-surface-offset:  #ede9e4;
  --color-divider:         #d8d4ce;
  --color-border:          #ccc8c2;

  /* Text */
  --color-text:         #1e1c18;
  --color-text-muted:   #6b6a65;
  --color-text-faint:   #b2b0aa;
  --color-text-inverse: #f5f4f1;

  /* Primary accent — deep burgundy/terracotta, from profile photo top */
  --color-primary:           #7c2d3a;
  --color-primary-hover:     #5e1f29;
  --color-primary-active:    #44131c;
  --color-primary-highlight: #e8d0d4;

  /* Secondary — dusty sage */
  --color-sage:         #6b7e6a;
  --color-sage-light:   #c5d0c3;

  /* Muted steel blue (sea) */
  --color-blue-muted:   #7a9aaa;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px oklch(0.15 0.01 50 / 0.08);
  --shadow-md: 0 4px 16px oklch(0.15 0.01 50 / 0.1);
  --shadow-lg: 0 12px 40px oklch(0.15 0.01 50 / 0.14);

  /* Content widths */
  --content-narrow:  640px;
  --content-default: 960px;
  --content-wide:    1200px;

  /* Fonts */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'Switzer', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg:              #151412;
  --color-surface:         #1a1917;
  --color-surface-2:       #1f1e1b;
  --color-surface-offset:  #242220;
  --color-divider:         #2e2c29;
  --color-border:          #3a3835;
  --color-text:            #cac8c4;
  --color-text-muted:      #7a7875;
  --color-text-faint:      #524f4c;
  --color-text-inverse:    #1a1917;
  --color-primary:         #c9737e;
  --color-primary-hover:   #e09099;
  --color-primary-active:  #f0b0b7;
  --color-primary-highlight: #3d2227;
  --color-sage:            #8fa08d;
  --color-sage-light:      #3a4a39;
  --color-blue-muted:      #8fb0c0;
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:              #151412;
    --color-surface:         #1a1917;
    --color-surface-2:       #1f1e1b;
    --color-surface-offset:  #242220;
    --color-divider:         #2e2c29;
    --color-border:          #3a3835;
    --color-text:            #cac8c4;
    --color-text-muted:      #7a7875;
    --color-text-faint:      #524f4c;
    --color-text-inverse:    #1a1917;
    --color-primary:         #c9737e;
    --color-primary-hover:   #e09099;
    --color-primary-active:  #f0b0b7;
    --color-primary-highlight: #3d2227;
    --color-sage:            #8fa08d;
    --color-sage-light:      #3a4a39;
    --color-blue-muted:      #8fb0c0;
  }
}

/* ─── Layout Utilities ───────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: clamp(var(--space-6), 5vw, var(--space-16));
}

.container--wide {
  max-width: var(--content-wide);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow var(--transition);
}

.site-header--scrolled {
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: var(--space-8);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

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

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

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
}

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

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) 0 var(--space-6);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav a {
  text-decoration: none;
  font-size: var(--text-base);
  color: var(--color-text-muted);
  padding: var(--space-3) 0;
}

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

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

.hero {
  padding-block: clamp(var(--space-20), 14vw, var(--space-32));
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-12), 6vw, var(--space-20));
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.hero-eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-weight: 500;
}

.hero-name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.05;
  color: var(--color-text);
  font-style: italic;
}

.hero-name em {
  font-style: normal;
  color: var(--color-primary);
}

.hero-tagline {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 300;
  max-width: 48ch;
  line-height: 1.5;
}

.hero-cta-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 500;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

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

.btn--ghost {
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: transparent;
}

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

.hero-image-wrap {
  position: relative;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-lg);
  filter: grayscale(8%) contrast(1.03);
  box-shadow: var(--shadow-lg);
}

.hero-image-accent {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--color-primary-highlight);
  z-index: -1;
  opacity: 0.6;
}

.hero-image-accent-2 {
  position: absolute;
  bottom: -16px;
  left: -16px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-sage-light);
  z-index: -1;
  opacity: 0.5;
}

/* ─── Section Shared ─────────────────────────────────────────────────────── */

section {
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}

.section-label {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  line-height: 1.1;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--color-divider);
  margin: 0;
}

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(var(--space-12), 8vw, var(--space-24));
  align-items: start;
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.about-meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.about-meta-label {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  font-weight: 500;
}

.about-meta-value {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.about-meta-value a {
  color: var(--color-primary);
  text-decoration: none;
}

.about-meta-value a:hover {
  text-decoration: underline;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.about-content p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 62ch;
}

.about-content p strong {
  color: var(--color-text);
  font-weight: 500;
}

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

.work-bg {
  background: var(--color-surface);
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: var(--space-8);
  align-items: start;
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition);
}

.project-item:first-child {
  border-top: 1px solid var(--color-divider);
}

.project-number {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.06em;
  padding-top: 4px;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.project-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.2;
}

.project-org {
  font-size: var(--text-xs);
  color: var(--color-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.project-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-top: var(--space-2);
  max-width: 56ch;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tag {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px var(--space-3);
  letter-spacing: 0.03em;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  text-decoration: none;
}

.project-link:hover {
  text-decoration: underline;
}

.project-year {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-top: 4px;
  font-family: var(--font-body);
}

/* ─── Skills ─────────────────────────────────────────────────────────────── */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.skill-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.skill-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-text-faint);
}

.skill-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.skill-card-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.skill-card-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skill-card-items li {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  padding-left: var(--space-4);
  position: relative;
  max-width: none;
}

.skill-card-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 1px;
  background: var(--color-sage);
}

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

.contact-bg {
  background: var(--color-surface);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-12), 8vw, var(--space-24));
  align-items: start;
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.contact-text p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 46ch;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition);
}

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

.contact-link-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
}

.contact-link:hover .contact-link-icon {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.contact-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-8);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.contact-aside-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-text);
}

.contact-aside p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 42ch;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-sage);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.availability-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-sage);
  flex-shrink: 0;
}

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

.site-footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

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

.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
  letter-spacing: 0.04em;
}

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

/* ─── Scroll Reveal ──────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

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

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .hero-image-wrap {
    order: -1;
    max-width: 320px;
    margin-inline: auto;
  }

  .hero-photo {
    aspect-ratio: 4 / 3;
    object-position: center 20%;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .about-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-6);
  }

  .project-item {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .project-number { display: none; }
  .project-year { order: -1; margin-bottom: var(--space-1); }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
