/* ==========================================================================
   FONMA.app — "Launching Soon" Official Landing Page
   Aesthetic: Minimalist, High-Tech, Precision Dark Theme
   Typography: K2D (Headlines), UID Cloudy (Brand), Caveat (.app)
   Colors: Pitch Black (#000000), Amber Gold (#FEBA52), Rust Red (#9F2D20)
   ========================================================================== */

/* Local & Custom Font Support for UID Cloudy */
@font-face {
  font-family: 'UID Cloudy';
  src: local('UID Cloudy'),
       local('UIDCloudy'),
       local('UID-Cloudy'),
       local('UID_Cloudy'),
       url('assets/fonts/UIDCloudy.woff2') format('woff2'),
       url('assets/fonts/UIDCloudy.woff') format('woff'),
       url('assets/fonts/UIDCloudy.ttf') format('truetype'),
       url('assets/fonts/UID-Cloudy.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-black: #000000;
  --text-white: #ffffff;
  --text-silver: rgba(255, 255, 255, 0.88);
  --text-muted: rgba(255, 255, 255, 0.45);
  --accent-amber: #feba52;
  --accent-amber-glow: rgba(254, 186, 82, 0.35);
  --accent-red: #9f2d20;
  --accent-red-glow: rgba(159, 45, 32, 0.4);
  --card-bg: rgba(18, 18, 20, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(254, 186, 82, 0.5);

  /* Typography Design Tokens */
  --font-heading: 'K2D', sans-serif;
  --font-brand: 'UID Cloudy', 'UIDCloudy', 'K2D', system-ui, sans-serif;
  --font-main: 'K2D', 'Outfit', system-ui, -apple-system, sans-serif;
  --font-script: 'Caveat', 'Comfortaa', cursive, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background: var(--accent-amber);
  color: #000000;
}

/* Background Southeast Asia Isobar Weather Map */
.isobar-background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-black);
}

.isobar-bg-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  filter: contrast(1.15) brightness(0.95);
  animation: isobarBreathe 12s ease-in-out infinite alternate;
}

@keyframes isobarBreathe {
  0% {
    opacity: 0.65;
    transform: scale(1);
  }
  100% {
    opacity: 0.85;
    transform: scale(1.015);
  }
}

/* Interactive Raindrop Trail Canvas */
.pixel-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 15;
}

/* Ambient Canvas Background Glow */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle 800px at 50% 48%, rgba(254, 186, 82, 0.045) 0%, rgba(159, 45, 32, 0.035) 40%, transparent 75%);
  transition: opacity 0.8s ease;
}

/* Interactive Cursor Glow */
.cursor-light {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(254, 186, 82, 0.055) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  opacity: 0;
}

body:hover .cursor-light {
  opacity: 1;
}

/* Main Layout Wrapper */
.page-wrapper {
  position: relative;
  z-index: 20;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 2rem;
}

/* Top Navigation Bar */
.top-bar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: flex-end; /* Coming Soon badge removed */
  align-items: center;
  animation: fadeInDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-silver);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  backdrop-filter: blur(8px);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-amber);
  border-color: rgba(254, 186, 82, 0.3);
  transform: translateY(-1px);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Center Stage Hero */
.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 960px;
  width: 100%;
  margin: auto 0;
  padding: 1.5rem 1rem;
}

/* Subtitle: "OUR NEW HOMEPAGE IS" (K2D font) */
.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 1.5vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-silver);
  margin-bottom: clamp(1.2rem, 2.6vw, 2.2rem);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Headline: "Launching Soon!" (K2D font) */
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 7.5vw, 5.8rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: clamp(2.5rem, 5.5vw, 4.75rem);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
  user-select: none;
}

.word-launching {
  color: var(--text-white);
  display: inline-block;
  transition: var(--transition-smooth);
}

.word-soon {
  color: var(--accent-amber);
  display: inline-block;
  position: relative;
  transition: var(--transition-smooth);
  text-shadow: 0 0 25px rgba(254, 186, 82, 0.2);
}

.hero-title:hover .word-soon {
  text-shadow: 0 0 35px rgba(254, 186, 82, 0.6), 0 0 12px rgba(254, 186, 82, 0.8);
  transform: translateY(-1px);
}

/* Brand Lockup: [Logo] FONMA.app */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.26s both;
}

.brand-lockup:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.brand-logo-wrap {
  width: clamp(34px, 4.2vw, 44px);
  height: clamp(34px, 4.2vw, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(159, 45, 32, 0.4));
  transition: filter 0.3s ease;
}

.brand-lockup:hover .brand-logo-wrap {
  transform: rotate(15deg) scale(1.08);
}

.brand-lockup:hover .brand-logo-img {
  filter: drop-shadow(0 0 16px rgba(159, 45, 32, 0.8));
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

/* FONMA (UID Cloudy font) */
.brand-name {
  font-family: var(--font-brand);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.02em;
  transition: var(--transition-fast);
}

/* .app (Script / Caveat font) */
.brand-tld {
  font-family: var(--font-script);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  color: var(--accent-red);
  letter-spacing: -0.01em;
  margin-left: 2px;
  transition: var(--transition-fast);
}

.brand-lockup:hover .brand-name {
  text-shadow: 0 0 16px rgba(254, 186, 82, 0.4);
}

.brand-lockup:hover .brand-tld {
  text-shadow: 0 0 16px rgba(159, 45, 32, 0.5);
}

/* Interactive Action Section (Email Notification & Waitlist) */
.action-section {
  position: relative;
  z-index: 25;
  margin-top: clamp(2rem, 4vw, 3rem);
  width: 100%;
  max-width: 480px;
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.34s both;
}

.waitlist-form {
  position: relative;
  z-index: 26;
  display: flex;
  align-items: center;
  background: rgba(22, 22, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.35rem 0.4rem 0.35rem 1.25rem;
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Glow ONLY on mouse hover */
.waitlist-form:hover {
  border-color: rgba(254, 186, 82, 0.65);
  box-shadow: 0 0 26px rgba(254, 186, 82, 0.35), 0 8px 30px rgba(0, 0, 0, 0.7);
}

.waitlist-form:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 28px rgba(254, 186, 82, 0.45), 0 8px 30px rgba(0, 0, 0, 0.8);
}

.waitlist-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-white);
  -webkit-appearance: none;
}

.waitlist-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.waitlist-btn {
  position: relative;
  z-index: 30;
  background: var(--accent-amber);
  color: #000000;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
  white-space: nowrap;
  -webkit-appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.waitlist-btn:hover {
  background: #ffc76d;
  box-shadow: 0 0 16px rgba(254, 186, 82, 0.6);
  transform: scale(1.02);
}

.waitlist-btn:active {
  transform: scale(0.98);
}

.waitlist-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.waitlist-btn:hover svg {
  transform: translateX(2px);
}

/* Success Message */
.form-success-message {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-amber);
  background: rgba(254, 186, 82, 0.08);
  border: 1px solid rgba(254, 186, 82, 0.25);
  border-radius: 9999px;
  padding: 0.65rem 1.25rem;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease forwards;
}

.form-success-message.active {
  display: flex;
}

/* Bottom Bar */
.bottom-bar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both;
}

.footer-copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.social-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.social-link:hover {
  color: var(--accent-amber);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 36, 0.95);
  border: 1px solid rgba(254, 186, 82, 0.4);
  color: var(--text-white);
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  /* Center weather map background onto the Gulf of Thailand (อ่าวไทย: ~101°E, 11°N) */
  .isobar-bg-svg {
    object-position: 20% 45%;
    transform-origin: 20% 45%;
  }

  .page-wrapper {
    padding: 1.25rem 1rem;
  }

  .hero-container {
    padding: 2rem 0.5rem;
  }

  .bottom-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .waitlist-form {
    padding-left: 1rem;
  }

  .waitlist-input {
    font-size: 0.85rem;
  }

  .waitlist-btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.8rem;
  }
}
