/* ============================================================
   HERO.CSS — Hero Section & Intro Screen
   KKN Digital Journal "JEJAK"
   ============================================================ */

/* ── INTRO SCREEN ─────────────────────────────────────────── */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-top);
  background-color: #0F0D0B;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);

  /* State transitions */
  opacity: 1;
  pointer-events: auto;
  transition: opacity var(--duration-slow) var(--ease-out);
}

.intro-screen.is-done {
  opacity: 0;
  pointer-events: none;
}

/* Logo di intro */
.intro-screen__logo {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 8vw, var(--text-7xl));
  font-weight: 700;
  color: var(--text-on-dark);
  letter-spacing: var(--tracking-tight);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity   800ms var(--ease-out),
    transform 800ms var(--ease-out);
}

.intro-screen__logo.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.intro-screen__logo span {
  color: var(--accent-sage);
}

/* Quote di intro */
.intro-screen__quote {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: clamp(var(--text-base), 2.5vw, var(--text-xl));
  color: rgba(245, 240, 232, 0.55);
  text-align: center;
  max-width: 480px;
  padding: 0 var(--space-5);
  line-height: var(--leading-relaxed);
  opacity: 0;
  transition: opacity 800ms var(--ease-out) 800ms;
}

.intro-screen__quote.is-visible {
  opacity: 1;
}

/* Loading line */
.intro-screen__loader {
  position: absolute;
  bottom: var(--space-12);
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background-color: rgba(245, 240, 232, 0.15);
  overflow: hidden;
  border-radius: var(--radius-full);
}

.intro-screen__loader-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent-sage);
  border-radius: var(--radius-full);
  transition: width 2s var(--ease-in-out);
}

.intro-screen__loader-bar.is-loading {
  width: 100%;
}

/* ── HERO SECTION ─────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100svh;          /* safe viewport height untuk mobile */
  min-height: 600px;
  max-height: 1080px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* ── HERO IMAGE / BACKGROUND ──────────────────────────────── */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg-image {
  width: 100%;
  height: 115%;          /* lebih tinggi untuk parallax */
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.05); /* zoom out awal */
  transition: transform 1200ms var(--ease-out);
  filter: contrast(1.05) brightness(0.92) saturate(0.88);
}

.hero__bg-image.is-loaded {
  transform: scale(1.0);
}

/* Overlay gradient */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-hero);
  z-index: 1;
}

/* Noise texture overlay — film grain effect */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 180px;
  pointer-events: none;
}

/* ── HERO CONTENT ─────────────────────────────────────────── */
.hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 0 var(--px-mobile) var(--space-16);
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .hero__content {
    padding: 0 var(--px-tablet) var(--space-20);
  }
}

@media (min-width: 1280px) {
  .hero__content {
    padding: 0 var(--px-desktop) var(--space-24);
  }
}

/* Eyebrow / chapter label */
.hero__eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent-sage-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);

  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity   600ms var(--ease-out) 200ms,
    transform 600ms var(--ease-out) 200ms;
}

.hero__eyebrow.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background-color: var(--accent-sage-light);
}

/* Main title */
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-6xl), 14vw, var(--text-9xl));
  font-weight: 700;
  color: var(--text-on-dark);
  line-height: 0.9;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-6);

  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity   700ms var(--ease-out) 350ms,
    transform 700ms var(--ease-out) 350ms;
}

.hero__title.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Subtitle */
.hero__subtitle {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: clamp(var(--text-lg), 3vw, var(--text-3xl));
  color: rgba(245, 240, 232, 0.75);
  line-height: var(--leading-snug);
  max-width: 560px;
  margin-bottom: var(--space-8);

  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity   700ms var(--ease-out) 500ms,
    transform 700ms var(--ease-out) 500ms;
}

.hero__subtitle.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Meta info — durasi, tempat (abstrak) */
.hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;

  opacity: 0;
  transition: opacity 700ms var(--ease-out) 650ms;
}

.hero__meta.is-visible {
  opacity: 1;
}

.hero__meta-item {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: rgba(245, 240, 232, 0.55);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero__meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent-sage-light);
}

.hero__meta-sep {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background-color: rgba(245, 240, 232, 0.25);
}

/* ── SCROLL INDICATOR ─────────────────────────────────────── */
.hero__scroll {
  position: absolute;
  bottom: var(--space-8);
  right: var(--px-mobile);
  z-index: 3;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);

  opacity: 0;
  transition: opacity 800ms var(--ease-out) 1000ms;
}

@media (min-width: 768px) {
  .hero__scroll {
    right: var(--px-tablet);
  }
}

@media (min-width: 1280px) {
  .hero__scroll {
    right: var(--px-desktop);
  }
}

.hero__scroll.is-visible {
  opacity: 1;
}

.hero__scroll-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.4);
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(
    to bottom,
    var(--accent-sage-light),
    transparent
  );
  border-radius: var(--radius-full);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); transform-origin: top; }
  50%       { opacity: 0.4; }
}

/* Hide scroll indicator when user starts scrolling */
.hero__scroll.is-scrolled {
  opacity: 0;
  pointer-events: none;
}

/* ── READING PROGRESS — "Vine" ────────────────────────────── */
.progress-vine {
  position: fixed;
  left: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-above);

  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

@media (min-width: 1280px) {
  .progress-vine {
    display: flex;
  }
}

.progress-vine__track {
  width: 1px;
  height: 120px;
  background-color: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-vine__fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, var(--accent-sage), var(--accent-sage-light));
  transition: height 100ms linear;
  border-radius: var(--radius-full);
}

/* ── HERO PARALLAX WRAPPER ────────────────────────────────── */
/* Gambar bergerak lebih lambat dari scroll */
.hero__bg-parallax {
  will-change: transform;
}
