/* ============================================
   umathip.love — style.css
   ============================================ */

/* --- Fonts --- */

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Design tokens --- */

:root {
  --bg-deep: #0a0a0f;
  --bg-section: #0d0d14;
  --bg-warm: #100e0a;
  --gold: #c8a050;
  --gold-soft: #b8924a;
  --gold-dim: rgba(200, 160, 80, 0.4);
  --text-primary: #c8a050;
  --text-secondary: rgba(200, 160, 80, 0.7);
  --white-soft: rgba(255, 255, 255, 0.85);

  --font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font-light: 300;
  --font-regular: 400;
  --font-semi: 600;

  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-breathe: cubic-bezier(0.37, 0, 0.63, 1);
  --duration-fade: 1.8s;
  --duration-slow: 3s;

  --section-padding: clamp(2rem, 5vw, 4rem);
}

/* --- Reset --- */

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

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

body {
  font-family: var(--font-family);
  font-weight: var(--font-light);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

::selection {
  background: var(--gold-dim);
  color: var(--white-soft);
}

/* --- Scroll container --- */

.scroll-container {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

/* --- Section base --- */

.section {
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* --- Reveal system --- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-fade) var(--ease-smooth),
              transform var(--duration-fade) var(--ease-smooth);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Section 0: Landing --- */

.section--landing {
  background-color: var(--bg-deep);
  cursor: pointer;
  z-index: 10;
}

.landing__greeting {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: var(--font-light);
  letter-spacing: 0.08em;
  color: var(--text-primary);
  opacity: 0;
  animation: landing-fadein 2s var(--ease-smooth) 1.2s forwards;
}

@keyframes landing-fadein {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section--landing.fading {
  animation: landing-fadeout 1.2s var(--ease-smooth) forwards;
  pointer-events: none;
}

@keyframes landing-fadeout {
  to {
    opacity: 0;
  }
}

/* --- Section 1: Video --- */

.section--video {
  background-color: var(--bg-deep);
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.video-wrapper {
  width: 100%;
  max-width: 720px;
  padding: 0 var(--section-padding);
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(200, 160, 80, 0.06);
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
}

.video-container:hover .video-controls,
.video-container:focus-within .video-controls,
.video-controls.visible {
  opacity: 1;
}

.video-controls button {
  background: none;
  border: none;
  color: var(--gold-soft);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.3s;
}

.video-controls button:hover {
  color: var(--gold);
}

.progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.2s var(--ease-smooth);
}

.progress-bar__filled {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  width: 0%;
}

.progress-bar:hover {
  height: 5px;
}

.video-tagline {
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  font-weight: var(--font-light);
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  text-align: center;
}

/* --- Section 2: December in Bangkok --- */

.section--bangkok {
  background-color: var(--bg-warm);
}

.bangkok__bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/bangkok.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.35) saturate(0.8);
  transform: scale(1.08);
  animation: bg-drift 25s var(--ease-breathe) infinite alternate;
}

@keyframes bg-drift {
  0% {
    transform: scale(1.08) translate(0, 0);
  }
  100% {
    transform: scale(1.12) translate(-1.5%, -1%);
  }
}

.bangkok__content {
  position: relative;
  z-index: 1;
}

.bangkok__title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: var(--font-light);
  letter-spacing: 0.06em;
  color: var(--white-soft);
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

/* --- Section 3: Koh Kood --- */

.section--kohkood {
  background-color: var(--bg-deep);
}

.kohkood__bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/kohkood.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.3) saturate(0.7);
  transform: scale(1.05);
  animation: bg-drift 30s var(--ease-breathe) infinite alternate;
}

.kohkood__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.kohkood__title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: var(--font-light);
  letter-spacing: 0.08em;
  color: var(--white-soft);
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.audio-toggle {
  background: none;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gold-soft);
  transition: all 0.4s var(--ease-smooth);
}

.audio-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.audio-toggle.playing {
  border-color: var(--gold);
  color: var(--gold);
  animation: pulse-ring 2s var(--ease-breathe) infinite;
}

@keyframes pulse-ring {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(200, 160, 80, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(200, 160, 80, 0);
  }
}

.audio-toggle.playing .wave-icon {
  animation: wave-motion 1.5s ease-in-out infinite;
}

@keyframes wave-motion {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-3px);
  }
}

/* --- Section 4: 2011 --- */

.section--2011 {
  background-color: var(--bg-deep);
}

.section-2011__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.section-2011__year {
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: var(--font-semi);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
  text-shadow: 0 0 80px rgba(200, 160, 80, 0.15);
}

.section-2011__text {
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  font-weight: var(--font-light);
  letter-spacing: 0.15em;
  color: var(--text-secondary);
}

/* --- Section 5: I love you --- */

.section--love {
  background-color: var(--bg-deep);
}

.love__text {
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  font-weight: var(--font-light);
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.love__text.visible {
  animation: breathe 4s var(--ease-breathe) infinite;
}

@keyframes breathe {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .video-wrapper {
    max-width: 100%;
  }

  .video-controls {
    padding: 8px 12px;
    opacity: 1;
  }

  .audio-toggle {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .landing__greeting {
    font-size: 1.6rem;
  }
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: opacity 0.4s ease;
    transform: none !important;
  }

  .reveal.visible {
    transform: none !important;
  }

  .bangkok__bg,
  .kohkood__bg {
    animation: none;
    transform: scale(1);
  }

  .love__text.visible {
    animation: none;
    opacity: 1;
  }

  .audio-toggle.playing {
    animation: none;
    box-shadow: 0 0 0 4px rgba(200, 160, 80, 0.2);
  }

  .audio-toggle.playing .wave-icon {
    animation: none;
  }

  .landing__greeting {
    animation: none;
    opacity: 1;
  }

  .section--landing.fading {
    animation: none;
    opacity: 0;
  }
}
