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

html { overflow-y: scroll; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: #1c1c1c;
  color: #d4d0c8;
  overflow-x: hidden;
}

body.project-site {
  background: #1c1c1c;
}

/* ── Hero ── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: -10%;

  /* tiny blurred placeholder first, full image second */
  background-image:
    url('website_hero-small.jpg'),
    url('website_hero.webp');

  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;

  transform: scale(1.12);
  transform-origin: center center;
  transition: transform 0.05s linear;
  will-change: transform;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('website_hero.webp');
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: heroImageFade 900ms ease-out forwards;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

@keyframes heroImageFade {
  to { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.name {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(3rem, 10vw, 9rem);
  letter-spacing: 0.12em;
  color: #f0ece4;
  text-transform: none;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(240, 236, 228, 0.5);
  font-size: 1.4rem;
  animation: bob 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ── About ── */
.about {
  position: relative;
  min-height: 100vh;
  background: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
}

.about-inner {
  max-width: 640px;
  text-align: center;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 300;
  line-height: 1.8;
  color: #c8c4bc;
  letter-spacing: 0.02em;
}

/* ── Hotty Toddy! ── */
.hotty-toddy {
  text-decoration: none;
  color: inherit;
}

.hotty, .toddy {
  transition: color 0.3s ease, font-weight 0.3s ease, font-size 0.3s ease;
}

.hotty-toddy:hover .hotty {
  color: #CE2029;
  font-weight: 640000;
  font-size: 1.03em;
}

.hotty-toddy:hover .toddy {
  color: #003087;
  font-weight: 640000;
  font-size: 1.03em;
}

/* ── Resume link in about me paragraph ── */
.resume-link {
  display: inline-block;
  margin-top: 2rem;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: rgba(240, 236, 228, 0.45);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.resume-link:hover {
  color: #f0ece4;
}

/* ── Social icons — fixed top right ── */
.social-links {
  position: fixed;
  top: 1.75rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  gap: 1.1rem;
  align-items: center;
}

.social-links a {
  color: rgba(240, 236, 228, 0.45);
  text-decoration: none;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}

.social-links a:hover {
  color: #f0ece4;
}

.social-links svg {
  width: 1.3rem;
  height: 1.3rem;
}

.github-link {
  position: relative;
  box-sizing: border-box;
  width: 1.3rem;
  height: 1.3rem;
  border: 0;
  border-radius: 0;
  overflow: visible;
  justify-content: center;
  align-items: center;
  background: transparent;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.github-link:hover,
.github-link:focus-visible {
  color: #f0ece4;
}

.github-static,
.github-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.2s ease;
}

.github-static img,
.github-hover-video,
.github-hover-gif {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: brightness(0) saturate(100%) invert(0.52);
}

.github-hover {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.github-hover-gif {
  opacity: 0;
}

.github-link.is-hovering .github-static {
  opacity: 0;
}

.github-link.is-hovering .github-hover {
  display: grid;
  opacity: 1;
  pointer-events: auto;
}

.github-link.is-hovering.github-gif-fallback .github-hover-video {
  display: none;
}

.github-link.is-hovering.github-gif-fallback .github-hover-gif {
  opacity: 1;
}

/* ── Instagram gradient animation ── */
@keyframes igGradient {
  0%   { color: #f58529; }
  25%  { color: #dd2a7b; }
  50%  { color: #8134af; }
  75%  { color: #515bd4; }
  100% { color: #f58529; }
}

.social-links a[aria-label="Instagram"] svg {
  transition: color 0.3s ease;
}

.social-links a[aria-label="Instagram"]:hover svg {
  animation: igGradient 3s linear infinite;
}

/* -- Linkedin fill animation -- */
.social-links a[aria-label="LinkedIn"] svg {
  transition: color 0.4s ease, background 0.4s ease;
  border-radius: 3px;
}

.social-links a[aria-label="LinkedIn"] svg rect {
  transition: fill 0.4s ease, stroke 0.4s ease;
}

.social-links a[aria-label="LinkedIn"] svg line,
.social-links a[aria-label="LinkedIn"] svg path {
  transition: stroke 0.4s ease;
}

.social-links a[aria-label="LinkedIn"]:hover svg {
  color: #0077B5;
  background: #0077B5;
}

.social-links a[aria-label="LinkedIn"]:hover svg rect {
  fill: #0077B5;
  stroke: #0077B5;
}

.social-links a[aria-label="LinkedIn"]:hover svg line,
.social-links a[aria-label="LinkedIn"]:hover svg path {
  stroke: #ffffff;
}

/* -- Email flip open animation */
.social-links a[aria-label="Email"] svg {
  overflow: visible;
}

.social-links a[aria-label="Email"] svg polyline {
  transform-origin: center center;
  transition: transform 0.3s ease;
}

.social-links a[aria-label="Email"]:hover svg polyline {
  transform: translateY(-16px) rotateX(180deg);
}

/* ──------------------------ Resume page ──----------------- */
.resume-page {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #1c1c1c;
}

.resume-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.resume-download {
  position: fixed;
  top: 1.75rem;
  right: 2rem;
  z-index: 100;
  color: rgba(240, 236, 228, 0.45);
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}

.resume-download:hover {
  color: #f0ece4;
}

.resume-download svg {
  width: 1.3rem;
  height: 1.3rem;
}


/* ── Download icon animation ── */
.dl-icon {
  width: 1.3rem;
  height: 1.3rem;
  overflow: visible;
}

/* Ring starts as just the bottom arc (like a tray), expands to full circle on hover */
.dl-ring {
  stroke-dasharray: 56.5; /* full circumference of r=9 circle */
  stroke-dashoffset: 42.4; /* hides ~75% so only bottom arc shows */
  transform-origin: center;
  transform: rotate(-45deg);
  transition: stroke-dashoffset 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.dl-shaft {
  transition: transform 0.3s ease;
  transform-origin: center;
}

.dl-arrow {
  transition: transform 0.3s ease;
  transform-origin: center;
}

/* On hover: arrow drops down, ring completes */
.resume-download:hover .dl-shaft {
  transform: translateY(2px);
}

.resume-download:hover .dl-arrow {
  transform: translateY(2px);
}

.resume-download:hover .dl-ring {
  stroke-dashoffset: 0;
  transform: rotate(-45deg);
}


/* ──----------------- Protein toggle (main page)──------------------- */
.protein-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  color: rgba(240, 236, 228, 0.45);
  transition: color 0.3s ease;
}

.protein-toggle:hover {
  color: #f0ece4;
}

.protein-toggle img {
  width: 1.3rem;
  height: 1.3rem;
  opacity: 0.45;
  filter: invert(1);
  transition: filter 1.5s ease, opacity 0.3s ease;
}

.protein-toggle:hover img {
  filter: invert(0);
  opacity: 1;
}

.protein-toggle.active img {
  filter: invert(0);
  opacity: 1;
}

.protein-toggle svg {
  width: 1.3rem;
  height: 1.3rem;
}
/* ── Protein viewer (animation)── */
.protein-viewer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
  z-index: 0;
}

.about.protein-active .protein-viewer,
body.protein-active .protein-viewer {
  opacity: 1;
  pointer-events: auto;
}

/* ── Projects index ── */
.projects-index {
  position: relative;
  min-height: 100vh;
  padding: 2rem 2rem 4rem;
  background: transparent;
  color: #d4d0c8;
  z-index: 1;
}

.projects-header {
  max-width: 980px;
  margin: 4rem auto 2.5rem;
  text-align: center;
}

.projects-intro {
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 1.8rem;
  line-height: 1.7;
  color: rgba(240, 236, 228, 0.75);
  font-weight: 600;
}

.project-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 1.5rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(240, 236, 228, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  min-height: 520px;
}

.project-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #1c1c1c;
  overflow: hidden;
}

.project-card-poster,
.project-card-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.project-card-poster {
  object-fit: cover;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.project-card-hover {
  border: 0;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  background: #1c1c1c;
}

.project-card-hover-gif {
  display: none;
  object-fit: cover;
}

.project-card:hover .project-card-poster,
.project-card:focus-visible .project-card-poster {
  opacity: 0;
  transform: scale(1.02);
}

.project-card:hover .project-card-hover,
.project-card:focus-visible .project-card-hover {
  opacity: 1;
  transform: scale(1.02);
}

.project-card--gif-preview .project-card-hover-gif {
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.project-card--gif-preview.is-hovering .project-card-poster {
  opacity: 0;
  transform: scale(1.02);
}

.project-card--gif-preview.is-hovering .project-card-hover-gif {
  display: block;
  opacity: 1;
  transform: scale(1.02);
}

.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.4rem 1.4rem 1.5rem;
}

.project-card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: #f0ece4;
}

.project-card-description {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  line-height: 1.55;
  color: rgba(240, 236, 228, 0.76);
}

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

.project-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(240, 236, 228, 0.14);
  background: rgba(255, 255, 255, 0.03);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 236, 228, 0.72);
}

/* ── Project detail page ── */
.project-page {
  position: relative;
  min-height: 100vh;
  padding: 2rem 2rem 4rem;
  background: transparent;
  color: #d4d0c8;
  z-index: 1;
}

.project-back {
  display: inline-block;
  color: rgba(240, 236, 228, 0.45);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.project-back:hover {
  color: #f0ece4;
}

.project-hero {
  max-width: 920px;
  margin: 4rem auto 2.5rem;
}

.project-kicker {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 236, 228, 0.45);
  margin-bottom: 0.85rem;
  text-align: center;
  font-style: italic;
}

.project-title {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  letter-spacing: 0.04em;
  color: #f0ece4;
  line-height: 1.02;
  width: 100%;
  max-width: none;
  text-align: center;
}

.project-description {
  max-width: 920px;
  margin-top: 1.4rem;
}

.project-link {
  color: #f0ece4;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.project-figures {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  align-items: start;
}

.project-figures--two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.figure-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.figure-frame {
  width: 100%;
  border: 1px solid rgba(240, 236, 228, 0.12);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}

.figure-frame--media {
  height: clamp(320px, 42vw, 560px);
}

.figure-frame--interactive {
  aspect-ratio: 16 / 9;
}

.figure-embed {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 0;
  display: block;
  background: #ffffff;
}

.figure-image {
  width: 100%;
  height: auto;
  display: block;
}

.figure-frame--media .figure-image {
  height: 100%;
  object-fit: contain;
}

.figure-caption {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  line-height: 1.5;
  color: rgba(240, 236, 228, 0.72);
  max-width: 100ch;
}

@media (max-width: 900px) {
  .projects-index,
  .project-page {
    padding-inline: 1.2rem;
  }

  .projects-header,
  .project-hero {
    margin-top: 2.5rem;
  }

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

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

  .figure-frame--media {
    height: 320px;
  }

  .project-card {
    min-height: 480px;
  }

  .figure-embed {
    min-height: 480px;
  }
}

@media (max-width: 640px) {
  .projects-index,
  .project-page {
    padding-top: 1.2rem;
  }

  .project-title {
    max-width: none;
  }

  .project-card {
    min-height: 440px;
  }

  .figure-embed {
    min-height: 360px;
  }
}

/* ── Reduced motion (last block always)── */

@media (prefers-reduced-motion: reduce) {
  .hero-bg { transition: none; }
  .scroll-hint { animation: none; }
  .social-links a[aria-label="Instagram"] svg { animation: none; }
}
