/* main.css — Homepage styles */

/* ── Decorative shapes ──────────────────────────────────────────────────── */
.deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Large solid circle — bottom-left, partially off-screen */
.deco-1 {
  width: 480px;
  height: 480px;
  background: #6dcb9a;
  bottom: -120px;
  left: -80px;
}

/* Ring outline — top-right, shifted down so not perfectly diagonal */
.deco-2 {
  width: 340px;
  height: 340px;
  background: transparent;
  border: 32px solid #3da872;
  top: 60px;
  right: -90px;
}

/* Small solid dot — left side, mid height */
.deco-3 {
  width: 56px;
  height: 56px;
  background: rgba(255, 248, 235, 0.55);
  top: 42%;
  left: 7%;
}

/* Small solid dot — bottom-right */
.deco-4 {
  width: 36px;
  height: 36px;
  background: #3da872;
  bottom: 14%;
  right: 9%;
}

/* ── Grain overlay ──────────────────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grain-drift 0.4s steps(1) infinite;
}
@keyframes grain-drift {
  0%  { transform: translate(0,    0);   }
  25% { transform: translate(-3%, -4%); }
  50% { transform: translate( 5%,  2%); }
  75% { transform: translate(-2%,  5%); }
}

/* ── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
}

.nav-logo {
  font-family: var(--ff-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.nav-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.nav-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52b352;
  flex-shrink: 0;
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  letter-spacing: 0.01em;
}
.nav-links a:hover { opacity: 1; }

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

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
  width: 100%;
}

/* ── Photo card ─────────────────────────────────────────────────────────── */
.photo-card {
  width: 240px;
  height: 310px;
  border-radius: 22px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 2px 4px  rgba(0, 0, 0, 0.04),
    0 8px 20px rgba(0, 0, 0, 0.09),
    0 24px 48px rgba(0, 0, 0, 0.07);
  transform: rotate(-2deg);
  margin-bottom: 28px;
  overflow: hidden;
  position: relative;
  isolation: isolate;          /* fix: clip video within border-radius during transform */
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari fix */
  transition:
    transform    0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow   0.4s ease;
}
.photo-card:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow:
    0 4px 8px   rgba(0, 0, 0, 0.06),
    0 16px 40px rgba(0, 0, 0, 0.13),
    0 40px 80px rgba(0, 0, 0, 0.09);
}

/* Video fills the card */
.card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Shown until video loads */
.card-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, #c8d8e4 0%, #b0c4d2 60%, #a4bccc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.photo-placeholder-text {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 28, 39, 0.28);
}

/* Sound toggle button */
.sound-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(26, 28, 39, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.18);
}
.sound-btn:hover {
  background: rgba(26, 28, 39, 0.72);
  transform: scale(1.1);
}
.sound-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}
.sound-btn .icon-unmuted          { display: none; }
.sound-btn.is-unmuted .icon-muted   { display: none; }
.sound-btn.is-unmuted .icon-unmuted { display: block; }

/* ── Greeting ───────────────────────────────────────────────────────────── */
.greeting {
  font-size: 1.05rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  font-weight: 400;
}

/* ── Headline ───────────────────────────────────────────────────────────── */
.headline {
  font-family: var(--ff-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  font-style: normal;
  line-height: 1.28;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin-bottom: 22px;
}

/* ── Subtitle ───────────────────────────────────────────────────────────── */
.subtitle {
  font-size: 1.05rem;
  line-height: 1.78;
  color: var(--ink-soft);
  max-width: 460px;
  font-weight: 300;
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.divider {
  width: 160px;
  border: none;
  border-top: 1.5px dashed rgba(26, 28, 39, 0.2);
  margin: 26px 0;
}

/* ── Scroll indicator — mouse icon ──────────────────────────────────────── */
.scroll-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mouse {
  width: 26px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
  opacity: 0.45;
}

.mouse-wheel {
  width: 3px;
  height: 7px;
  background: var(--ink);
  border-radius: 2px;
  animation: wheel-scroll 1.6s ease-in-out infinite;
}

@keyframes wheel-scroll {
  0%   { transform: translateY(0);   opacity: 1; }
  60%  { transform: translateY(9px); opacity: 0; }
  61%  { transform: translateY(0);   opacity: 0; }
  100% { transform: translateY(0);   opacity: 1; }
}

/* ── Projects section ───────────────────────────────────────────────────── */
.projects {
  background: #3d9e72;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 48px 100px;
  gap: 48px;
}

.projects-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.projects-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.projects-title {
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* ── Projects row ───────────────────────────────────────────────────────── */
.proj-row {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.proj-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: background 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.proj-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

/* Empty placeholder cards keep 4:3 shape */
.proj-card:empty {
  aspect-ratio: 4 / 3;
}

.proj-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.proj-info {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-title {
  font-family: var(--ff-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.proj-desc {
  font-size: 0.8rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 300;
}

/* ── Page-load stagger animations ───────────────────────────────────────── */
.fi-1, .fi-2, .fi-3, .fi-4, .fi-5, .fi-6 {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-up 0.72s var(--ease-out) forwards;
}
.fi-1 { animation-delay: 0.08s; }
.fi-2 { animation-delay: 0.20s; }
.fi-3 { animation-delay: 0.32s; }
.fi-4 { animation-delay: 0.43s; }
.fi-5 { animation-delay: 0.51s; }
.fi-6 { animation-delay: 0.59s; }

@keyframes hero-up {
  to { opacity: 1; transform: translateY(0); }
}

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

/* ── Tablet (640px – 1023px) ────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .nav-status {
    display: none;
  }
  .proj-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile (≤ 639px) ───────────────────────────────────────────────────── */
@media (max-width: 639px) {
  /* Nav */
  .nav {
    padding: 16px 20px;
  }
  .nav-links {
    gap: 20px;
  }

  /* Hero — use svh so mobile browser chrome doesn't clip */
  .hero {
    padding: 80px 20px 60px;
    min-height: 100svh;
    height: 100svh;
  }

  /* Deco circles — scale down so they don't overwhelm the viewport */
  .deco-1 {
    width: 260px;
    height: 260px;
    bottom: -70px;
    left: -60px;
  }
  .deco-2 {
    width: 190px;
    height: 190px;
    border-width: 20px;
    top: 40px;
    right: -55px;
  }
  .deco-3 {
    width: 38px;
    height: 38px;
  }
  .deco-4 {
    width: 22px;
    height: 22px;
  }

  /* Photo card */
  .photo-card {
    width: 170px;
    height: 220px;
    margin-bottom: 20px;
    border-radius: 16px;
  }

  /* Greeting */
  .greeting {
    font-size: 0.92rem;
    margin-bottom: 10px;
  }

  /* Headline */
  .headline {
    font-size: clamp(22px, 7vw, 28px);
    margin-bottom: 14px;
  }

  /* Subtitle */
  .subtitle {
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 100%;
  }

  /* Divider */
  .divider {
    margin: 18px 0;
  }

  /* Projects section */
  .projects {
    padding: 60px 20px 80px;
    gap: 32px;
  }

  /* Single-column stack on mobile */
  .proj-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ── Small phones (≤ 380px) ─────────────────────────────────────────────── */
@media (max-width: 380px) {
  .photo-card {
    width: 148px;
    height: 192px;
  }
  .headline {
    font-size: clamp(20px, 7vw, 24px);
  }
  .subtitle {
    font-size: 0.82rem;
  }
}
