/*
  - Instrument Serif
  - DM Sans 
*/

:root {
  --cream: #FAF9F7;
  --cream-warm: #FCF8F3;
  --cream-dark: #F2F0ED;
  --charcoal: #1C1C1C;
  --charcoal-soft: #3D3D3D;
  --stone: #6B6B6B;
  --stone-light: #9A9A9A;
  --border: #E5E3E0;
  --accent: #B85C38;
  --accent-soft: #D4A574;

  /* Subtle shadow system */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lifted: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: radial-gradient(ellipse at top center, var(--cream-warm) 0%, var(--cream) 50%);
  color: var(--charcoal);
  line-height: 1.5;
  min-height: 100vh;
}

/* Page load animation */
body:not(.loaded) .page {
  opacity: 0;
}

.page {
  max-width: 540px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.header-intro {
  display: flex;
  align-items: center;
  gap: 14px;
}

.headshot-wrap {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

.headshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transform: scale(1.3);
}

.header h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--charcoal);
}

.header-role {
  font-size: 0.8125rem;
  color: var(--stone);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.header-link:hover {
  color: var(--charcoal);
  background: var(--cream-dark);
}

.header-link svg {
  transition: transform 0.2s ease;
}

.linkedin-icon {
  color: #0A66C2;
}

/* Intro */
.intro {
  margin-bottom: 36px;
}

.intro-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--charcoal-soft);
}

.sidley {
  font-style: italic;
}

/* Sections */
.section {
  margin-bottom: 28px;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone-light);
  margin-bottom: 12px;
}

/* Projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.projects-teaser {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--stone);
  text-align: left;
  margin-top: 20px;
  line-height: 1.6;
}

.projects-teaser a {
  color: var(--charcoal);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

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

.projects > .project {
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Allow expanded card to break out of container */
.projects:has(.project-expandable.expanded) {
  overflow: visible;
}

.project {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--cream);
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.project:hover {
  background: var(--cream-dark);
  box-shadow: var(--shadow-lifted);
  transform: translateY(-2px);
}

.project-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cream-dark);
}

.video-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--charcoal);
}

.play-icon {
  color: var(--cream);
  opacity: 0.9;
}

.project:hover .play-icon {
  opacity: 1;
}

.project-info h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 2px;
}

.project-info p {
  font-size: 0.8125rem;
  color: var(--stone);
  line-height: 1.4;
}

.project-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-light);
  padding: 4px 8px;
  background: var(--cream-dark);
  border-radius: 4px;
  flex-shrink: 0;
}

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

/* Expandable Project Card */
.project-expandable {
  position: relative;
  background: var(--cream);
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  will-change: width, margin;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              border-radius 0.3s ease;
}

.project-expandable.expanded {
  position: relative;
  width: min(900px, calc(100% + 360px));
  margin-left: -180px;
  margin-right: -180px;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.02),
    0 4px 8px rgba(0, 0, 0, 0.03),
    0 16px 32px rgba(0, 0, 0, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.08);
  z-index: 10;
  border: 1px solid var(--border);
  background: var(--cream);
}

.project-trigger {
  cursor: pointer;
}

/* Hero Layout for Project Card */
.project-hero {
  flex-direction: column;
  padding: 0;
  gap: 0;
}

.project-hero-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--charcoal);
  position: relative;
  border-radius: 8px 8px 0 0;
  transition: border-radius 0.3s ease;
}

.project-expandable.expanded .project-hero-video {
  border-radius: 16px 16px 0 0;
}

.project-hero-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.project-hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  width: 100%;
}

.project-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Old thumb video (keep for compatibility) */
.project-thumb-video {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--charcoal);
  position: relative;
}

.project-thumb-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.project-trigger .expand-icon {
  color: var(--stone-light);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.project-expandable.expanded .project-trigger .expand-icon {
  transform: rotate(180deg);
}

.project-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--cream);
  border-top: 0 solid var(--border);
  min-height: 0;
  visibility: hidden;
  height: 0;
}

.project-detail > * {
  min-height: 0;
  overflow: hidden;
}

.project-expandable.expanded .project-detail {
  visibility: visible;
  height: auto;
  grid-template-rows: 1fr;
  border-top-width: 1px;
}

.project-close {
  position: absolute;
  top: 350px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--stone);
  transition: all 0.2s ease;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.project-expandable.expanded .project-close {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.project-close:hover {
  background: var(--cream);
  color: var(--charcoal);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 32px 36px 36px;
  min-height: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease 0.05s, transform 0.35s ease 0.05s;
  background: linear-gradient(180deg, transparent 0%, rgba(242, 240, 237, 0.3) 100%);
}

.project-expandable.expanded .project-detail-grid {
  opacity: 1;
  transform: translateY(0);
}

.project-video {
  width: 100%;
  position: relative;
}

.project-video > div {
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.project-video iframe {
  border-radius: 10px;
}

.project-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
}

.project-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-right {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.project-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--charcoal-soft);
  line-height: 1.75;
  letter-spacing: -0.01em;
}

.project-background {
  position: relative;
  padding: 0;
  background: transparent;
  border-left: none;
}

.project-background h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.project-features h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.project-background p {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 0.9375rem;
  color: var(--charcoal-soft);
  line-height: 1.6;
}

/* AI Note - Editorial Aside */
.project-ai-note {
  position: relative;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(184, 92, 56, 0.04) 0%, rgba(212, 165, 116, 0.06) 100%);
  border-radius: 8px;
  border: 1px solid rgba(184, 92, 56, 0.12);
  overflow: hidden;
}

.project-ai-note::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 100%);
}

.project-ai-note::after {
  content: '';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(184, 92, 56, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.project-ai-note h4 {
  display: flex;
  align-items: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
}

.project-ai-note h4 svg {
  color: var(--accent);
  opacity: 0.8;
}

.project-ai-note p {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 0.9375rem;
  color: var(--charcoal-soft);
  line-height: 1.6;
}

.project-credit {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--stone);
  margin-top: 8px;
}

.project-features {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feature {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 14px 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  opacity: 0;
  transform: translateY(8px);
}

.project-expandable.expanded .feature {
  opacity: 1;
  transform: translateY(0);
}

.feature:nth-child(2) { transition-delay: 0.04s; }
.feature:nth-child(3) { transition-delay: 0.08s; }
.feature:nth-child(4) { transition-delay: 0.12s; }
.feature:nth-child(5) { transition-delay: 0.16s; }
.feature:nth-child(6) { transition-delay: 0.2s; }

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

.feature:hover {
  background: rgba(0, 0, 0, 0.015);
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 6px;
}

.feature-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--accent-soft);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.feature-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.feature-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.feature-desc {
  font-size: 0.75rem;
  color: var(--stone);
  line-height: 1.55;
}

/* Skills */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--charcoal-soft);
  padding: 6px 12px;
  background: var(--cream-dark);
  border-radius: 100px;
  transition: all 0.15s ease;
}

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

/* Inspirations */
.inspirations {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

a.inspiration {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a.inspiration:hover {
  opacity: 0.7;
}

a.inspiration span {
  text-decoration: none;
}

.inspiration-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--charcoal);
}

.inspiration-desc {
  font-size: 0.8125rem;
  color: var(--stone);
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 28px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.footer-text {
  font-size: 0.8125rem;
  color: var(--charcoal-soft);
}

.footer-email {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-email:hover {
  text-decoration: underline;
}

.footer-year {
  font-size: 0.75rem;
  color: var(--stone-light);
}

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for sequential items */
.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* Responsive */
@media (max-width: 480px) {
  .page {
    padding: 36px 20px 28px;
  }

  .header h1 {
    font-size: 1.75rem;
  }

  .intro-text {
    font-size: 1.125rem;
  }

  .project {
    padding: 12px 14px;
  }

  .inspiration {
    flex-direction: row;
    gap: 8px;
  }

  .project-expandable.expanded {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    background: var(--cream);
  }

  .project-detail-grid {
    padding: 24px 20px;
    gap: 24px;
  }

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

  .project-right {
    padding-left: 0;
    border-left: none;
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  .project-desc {
    font-size: 0.9375rem;
  }

  .project-background {
    padding: 0;
  }

  .project-ai-note {
    padding: 16px 20px;
  }

  .feature {
    padding: 12px 0;
  }

  .feature:hover {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .feature-desc {
    display: block;
  }

  .project-close {
    top: 270px;
    right: 16px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .page,
  .header-link,
  .project,
  .project-expandable,
  .project-tag,
  .skill,
  .inspiration,
  .project-detail,
  .project-detail-grid,
  .project-close,
  .feature,
  .expand-icon {
    transition: none;
  }

  /* Disable scroll animations */
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .project-detail-grid,
  .feature {
    opacity: 1 !important;
    transform: none !important;
  }

  .project-close {
    transform: scale(1) !important;
  }
}
