html {
  scroll-behavior: smooth;
}

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

body {
  font-family: "EB Garamond", serif;
  background-color: #fffdf8;
  color: #1b1b1b;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 60px;
}

/* Global hover style for all links */
a {
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease, opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

/* Soft underline animation */
a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 1px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
  z-index: 999;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 80px;
}

.logo:hover::after {
  width: 0 !important;
}

.hamburger {
  display: none;
}

.nav-links {
  display: flex;
  gap: 40px;
}

nav a {
  color: #f02800;
  text-decoration: none;
  font-size: 20px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

nav a:hover {
  opacity: 0.7;
}

.logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* Hero Section */
.hero {
  padding: 0 0 150px;
}

.hero-left {
  max-width: 600px;
  padding-top: 0;
}

.hero-left h1 {
  font-size: 80px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0;
}

.hero-left h1 .name {
  color: #f02800;
  font-style: italic;
}

.hero-left h1 .highlight {
  color: #f02800;
  font-style: italic;
}

.hero-right {
  margin-top: 0px; /* space between text and envelope */
  display: flex;
  justify-content: center;
}

/* HERO ANIMATION */
.hero-intro {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeWave 1s ease-out forwards;
  animation-delay: 0.4s;
}

.hero-subtitle {
  font-family: "Lusitana", serif;
  font-size: 20px;
  font-weight: 400;
  color: #a39e96;
  margin-top: 20px;
  letter-spacing: 0.07em;

  /* animation */
  opacity: 0;
  animation: slideInLeft 0.8s ease-out forwards;
  animation-delay: 1.2s; /* starts AFTER hero-intro finishes */
}

.envelope-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px; /* overall width */
  margin: 0 auto;
  cursor: pointer;
  animation: idleHint 3s ease-in-out infinite; /* tiny bounce hint */
}

.envelope-container {
  width: 100%;
  max-width: 900px;
  position: relative; /* so the letter can be absolutely positioned */
  margin-left: auto;
  margin-right: 0;
}

.envelope-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* envelope */
.envelope-img {
  width: 100%;
  display: block;
}

/* wax-shine overlay as a pseudo-element */
.envelope-container::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 60%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.25),
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0;
  pointer-events: none;
  animation: sealGlow 4s ease-in-out infinite;
}

/* Envelope fades in after subtitle */
.envelope-fade {
  opacity: 0;
  animation: fadeInEnvelope 1.2s ease-out forwards;
  animation-delay: 2s; /* after subtitle (1.2s) finishes */
}

/* Envelope fades in after subtitle */
.envelope-fade {
  opacity: 0;
  animation: fadeInEnvelope 1.2s ease-out forwards;
  animation-delay: 2s; /* after subtitle (1.2s) finishes */
}

@keyframes sealGlow {
  0%,
  60% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeInEnvelope {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeWave {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px); /* tiny overshoot = soft wave */
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* MOBILE */
@media (prefers-reduced-motion: reduce) {
  .hero-intro {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Selected Works Section */
.selected-works {
  padding: 0 0 150px;
}

.selected-works h2 {
  font-size: 20px;
  font-weight: 500;
  color: #a39e96;
  margin-bottom: 30px;
  padding-bottom: 10px;
  border-bottom: 1px solid #a39e96; /* <- move line here */
}

/* Work Cards Grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.work-card {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.work-card:hover {
  transform: translateY(-5px);
}

.work-card a:hover::after {
  width: 0 !important;
}

.work-card-image {
  width: 100%;
  aspect-ratio: 16 / 9; /* or 4/3 if your images are taller */
  object-fit: cover;
  margin-bottom: 5px;
}

.work-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.work-card-title {
  font-size: 20px;
  font-weight: 500;
  color: #1b1b1b;
}

.work-card-category {
  font-size: 20px;
  font-weight: 400;
  color: #a39e96;
}

/* Footer */

footer {
  width: 100%;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 40px 80px; /* full-width spacing like nav */
}

.footer p {
  color: #a39e96;
  font-size: 20px;
}

.footer-links a {
  color: #f02800;
  text-decoration: none;
  margin-left: 24px;
  font-size: 20px;
}

.footer-links a:hover {
  opacity: 0.7;
}

/* Responsive Design */
/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  nav {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fffdf8;
    padding: 24px 20px;
    gap: 24px;
    justify-content: space-between;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
  }

  .hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #f02800;
    transition: all 0.3s ease;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: #fffdf8;
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 32px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 24px;
  }

  /* HERO MOBILE */
  .hero {
    padding: 40px 0 60px;
  }

  .hero-left {
    max-width: 420px;
  }

  .hero-left h1 {
    font-size: 40px; /* bigger title */
    line-height: 1.2;
    max-width: 340px; /* keeps it to ~2 lines */
  }

  .hero-subtitle {
    font-size: 16px;
    margin-top: 16px;
  }

  .hero-right {
    margin-top: 48px; /* space between title and envelope */
    justify-content: center;
    width: 100%;
    overflow: hidden; /* stop any tiny overflow */
  }

  .envelope-container {
    width: 100%; /* fill mobile width */
    max-width: 100%; /* no more 900px on mobile */
    margin: 0 auto;
  }

  .envelope-container img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* SELECTED WORKS */
  .work-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .work-card-image {
    height: auto;
  }

  /* FOOTER MOBILE */
  .footer {
    flex-direction: row;
    align-items: flex-start;
    padding: 24px 20px 32px;
    gap: 8px;
  }

  .footer p {
    font-size: 16px;
  }

  .footer-links {
    margin-top: 4px;
  }

  .footer-links a {
    font-size: 16px;
    margin-left: 0;
    margin-right: 16px;
    display: inline-block;
  }
}
