/* ============================================
   MOREMINIMORE - LIGHT EDITORIAL DESIGN SYSTEM
   Light bg + yellow accent + dark text
   Audited for color conflicts (no button matches bg)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES — LIGHT THEME
   ============================================ */

:root {
  /* Brand Colors */
  --color-primary: #fed400;        /* yellow accent */
  --color-primary-dark: #e6c100;   /* hover state */
  --color-primary-light: #fff5b3;  /* tint for subtle backgrounds */
  --color-primary-soft: #fff4b3;   /* bento tile surface */

  /* Accent palette — for bento tile variety */
  --color-purple: #7c3aed;
  --color-purple-soft: #ede9fe;
  --color-teal: #0d9488;
  --color-teal-soft: #bae6fd;
  --color-mint: #10b981;
  --color-mint-soft: #d1fae5;
  --color-coral: #f97316;

  --color-black: #0a0a0a;          /* primary text */
  --color-white: #ffffff;          /* pure white */
  --color-bg: #ffffff;             /* default page bg */
  --color-bg-alt: #fafafa;         /* alt section bg (was gray-100) */
  --color-bg-soft: #f5f5f5;        /* card bg (was gray-100) */

  --color-gray-100: #f5f5f5;
  --color-gray-200: #e5e5e5;       /* subtle borders */
  --color-gray-300: #d1d5db;       /* stronger borders */
  --color-gray-400: #9ca3af;       /* muted icons */
  --color-gray-500: #6b7280;       /* secondary text */
  --color-gray-600: #4b5563;       /* body text (slightly lighter than black) */
  --color-gray-700: #374151;       /* strong body text */

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: 96px;
  --space-3xl: 128px;

  /* Layout */
  --container-max: 1600px;
  --gutter: 32px;
  --section-padding: 120px;

  /* Animation */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.5, 1.5, 0.5, 1);

  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.8s;
  --duration-slower: 1.2s;

  /* Shadows (tuned for light bg) */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(254, 212, 0, 0.3);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography — Kanit is the only font (handles Latin + Thai natively).
     Use --font-display for headings, --font-body for paragraphs.
     Thai characters need ~1.4x line-height to avoid ascender/descender clipping. */
  --font-display: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-black);
  background: var(--color-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none !important;
  color: inherit;
}

a:hover {
  text-decoration: none !important;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  /* Thai characters need extra leading to avoid descender clipping. */
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--color-black);
}

p {
  color: var(--color-gray-700);
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================
   SECTION VARIANTS (light-first)
   ============================================ */

.section {
  padding: var(--section-padding) 0;
  position: relative;
  background: var(--color-white); /* default light */
}

/* Explicit variants — call them with class on the section */
.section--light { background: var(--color-white); }
.section--soft  { background: var(--color-bg-alt); }
.section--yellow { background: var(--color-primary); }
.section--yellow .section-title,
.section--yellow .cta-title { color: var(--color-black); }
.section--yellow p { color: rgba(0, 0, 0, 0.7); }

/* ============================================
   BUTTONS — all light-bg safe (no same-color conflicts)
   ============================================ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 36px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s var(--ease-out-expo);
  text-decoration: none;
  white-space: nowrap;
}

/* Primary: YELLOW bg, BLACK text — works on white/light/soft/dark
   (yellow is the brand; never matches the background) */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-black);
  border-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(254, 212, 0, 0.25);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(254, 212, 0, 0.4);
}

/* Dark: BLACK bg, WHITE text — for accent on yellow/light
   (BLACK never matches yellow, never matches white bg) */
.btn-dark {
  background: var(--color-black);
  color: var(--color-white);
  border-color: var(--color-black);
}
.btn-dark:hover {
  background: var(--color-gray-700);
  border-color: var(--color-gray-700);
  transform: translateY(-2px);
}

/* Outline-dark: transparent, BLACK border + text — on white/yellow
   (never same color as bg since transparent) */
.btn-outline-dark {
  background: transparent;
  color: var(--color-black);
  border-color: var(--color-black);
}
.btn-outline-dark:hover {
  background: var(--color-black);
  color: var(--color-white);
}

/* Outline-light: transparent, WHITE border + text — for use on dark only
   ⚠️ ONLY use on dark sections; never on white/light bg */
.btn-outline-light {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}
.btn-outline-light:hover {
  background: var(--color-white);
  color: var(--color-black);
}

/* Outline-yellow: transparent, YELLOW border + text — on dark sections */
.btn-outline-yellow {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline-yellow:hover {
  background: var(--color-primary);
  color: var(--color-black);
}

.btn-lg {
  padding: 22px 48px;
  font-size: 16px;
}

.btn-sm {
  padding: 12px 24px;
  font-size: 13px;
  letter-spacing: 1.5px;
}

/* ============================================
   BADGES & LABELS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-black);
}

/* Ghost badge — used on light bg; transparent + dark text + border */
.badge-ghost {
  background: transparent;
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-300);
}

/* ============================================
   CARDS — light theme (works on every light bg)
   ============================================ */

.card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: all 0.3s var(--ease-out-expo);
  box-shadow: var(--shadow-sm);
}
.card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   FORM ELEMENTS — light theme (no dark form)
   ============================================ */

.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-gray-700);
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--color-white);
  color: var(--color-black);
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  outline: none;
  font-weight: 400;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-gray-400);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(254, 212, 0, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%230a0a0a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: 48px;
}

.form-submit {
  width: 100%;
  margin-top: 8px;
}

/* ============================================
   NAVIGATION — light theme
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  transition: all 0.3s var(--ease-out-expo);
}

.nav.scrolled {
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}

.nav-link {
  position: relative;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-black);
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary-dark);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--color-primary);
  transition: width 0.3s var(--ease-out-expo);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  background: var(--color-primary);
  color: var(--color-black) !important;
  border-radius: var(--radius-md);
  margin-left: 16px;
  padding: 12px 24px;
  border: 2px solid var(--color-primary);
}

.nav-cta:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(254, 212, 0, 0.3);
}

.nav-cta::after { display: none; }

/* ============================================
   FOOTER — light theme
   ============================================ */

.footer {
  background: var(--color-white);
  color: var(--color-black);
  padding: 80px 0 40px;
  border-top: 1px solid var(--color-gray-200);
}

.footer-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-black);
  margin-bottom: 24px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--color-gray-600);
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: var(--color-primary-dark);
}

.footer-link:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

.link-arrow {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

/* ============================================
   REVEAL ANIMATIONS (used by lib/animations.ts)
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Variants */
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger container — children fade in sequentially */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}
.stagger-children > *.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Kinetic headline — words animate in */
.kinetic-title {
  display: block;
  /* Thai descenders need extra space when word slides up from translateY(100%). */
  line-height: 1.3;
}
.kinetic-title .word-wrapper {
  display: inline-block;
  vertical-align: top;
  /* Padding instead of overflow:hidden so Thai vowels stay visible during reveal. */
  padding: 0.05em 0.02em;
  margin: -0.05em -0.02em;
}
.kinetic-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%) skewY(8deg);
  animation: wordReveal 0.85s var(--ease-out-expo) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes wordReveal {
  0%   { opacity: 0; transform: translateY(110%) skewY(8deg); }
  60%  { opacity: 1; transform: translateY(-5%) skewY(-2deg); }
  100% { opacity: 1; transform: translateY(0) skewY(0); }
}

/* Counter — used for stats, animated by lib/animations */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Magnetic button transition */
[data-magnetic] {
  transition: transform 0.3s var(--ease-out-expo);
  will-change: transform;
}

/* Scroll progress — paired with scrollProgress() in animations.ts */
.scroll-indicator {
  --scroll-progress: 0%;
  /* CSS that uses it: e.g. width: var(--scroll-progress); */
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger-children > *,
  .kinetic-title .word {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
  [data-parallax] { transform: none !important; }
}

/* ============================================
   ICON WRAPPERS — for SVG icons replacing emojis
   Used by problem cards, value cards, channel cards, etc.
   All wrappers are square, centered, and use a subtle yellow tint
   to keep visual interest without competing with content.
   ============================================ */

.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Problem cards: red-tinted warning style on white card */
.problem-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  border-radius: 16px;
  color: var(--color-black);
  margin-bottom: 20px;
}
.problem-icon :global(svg) { width: 28px; height: 28px; }

/* Value cards: dark icon on light bg */
.value-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-black);
  color: var(--color-primary);
  border-radius: 16px;
  margin-bottom: 20px;
}
.value-icon :global(svg) { width: 28px; height: 28px; }

/* Channel picker (contact page): large icon */
.channel-pick-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-black);
  border-radius: 50%;
  margin-bottom: 20px;
}
.channel-pick-icon :global(svg) { width: 32px; height: 32px; }

/* Info column (contact page) */
.info-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
  color: var(--color-black);
  border-radius: 12px;
  flex-shrink: 0;
}
.info-icon :global(svg) { width: 22px; height: 22px; }

/* Channel card (FAQ page) */
.channel-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-black);
  border-radius: 50%;
  margin-bottom: 16px;
}
.channel-icon :global(svg) { width: 28px; height: 28px; }

/* Category (FAQ page) */
.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: var(--color-black);
  border-radius: 8px;
  margin-right: 12px;
  vertical-align: middle;
}
.category-icon :global(svg) { width: 20px; height: 20px; }

/* Feature card (services page) */
.feature-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-black);
  border-radius: 14px;
  margin-bottom: 20px;
}
.feature-icon :global(svg) { width: 28px; height: 28px; }

/* Target card */
.target-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-black);
  color: var(--color-primary);
  border-radius: 14px;
  margin-bottom: 20px;
}
.target-icon :global(svg) { width: 28px; height: 28px; }

/* Success icon (form) */
.success-icon {
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d1fae5;
  color: #059669;
  border-radius: 50%;
  margin: 0 auto 24px;
}
.success-icon :global(svg) { width: 44px; height: 44px; }

/* Footer contact icons (inline) */
.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-gray-600);
}
.contact-icon :global(svg) { width: 16px; height: 16px; }

/* Button-leading icon (paired with .btn) */
.btn-icon {
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 2px;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-primary { color: var(--color-primary); }
.text-black { color: var(--color-black); }
.text-muted { color: var(--color-gray-500); }

.bg-primary { background: var(--color-primary); }
.bg-light { background: var(--color-white); }
.bg-soft { background: var(--color-bg-alt); }

.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; letter-spacing: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  :root {
    --section-padding: 80px;
    --gutter: 24px;
  }
}

@media (max-width: 640px) {
  :root {
    --section-padding: 60px;
    --gutter: 16px;
  }
  .btn {
    width: 100%;
    padding: 16px 28px;
  }
}


/* ============================================
   BENTO TILE — global override (unscoped)
   Forces equal-width tiles regardless of content
   ============================================ */
.bento-tile {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

/* Invisible overlay link — makes the whole tile clickable
   without breaking the bento-grid layout (no <a> wrapping) */
.tile-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  text-decoration: none;
  color: inherit;
}
.bento-tile > *:not(.tile-link-overlay) {
  position: relative;
  z-index: 2;
}
.bento-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* Make tile-body grow to push CTA to bottom */
.bento-tile .tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.bento-tile .tile-body > .mega-cta,
.bento-tile .tile-body > .btn,
.bento-tile .tile-body > a:last-child {
  margin-top: auto;
}
