/**
 * PrinaO Talk — Canonical Public Website Stylesheet V1
 * Authority: Owner PAO
 * Design System: Light Premium Friendly Theme · Desktop/Tablet Canonical Lock & Responsive Mobile Reflow
 */

:root {
  /* Color Palette */
  --bg-page: #f8fafc;
  --bg-gradient: radial-gradient(circle at 75% 18%, rgba(219, 234, 254, 0.45) 0%, rgba(243, 232, 255, 0.25) 35%, rgba(248, 250, 252, 1) 75%);
  --bg-card: #ffffff;
  --bg-card-eco: rgba(255, 255, 255, 0.92);
  --border-light: rgba(226, 232, 240, 0.85);
  --border-card: rgba(226, 232, 240, 0.7);
  --border-hover: rgba(59, 130, 246, 0.35);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --blue-primary: #0066ff;
  --blue-hover: #0052cc;
  --blue-glow: rgba(0, 102, 255, 0.2);
  --pill-bg: rgba(224, 242, 254, 0.85);
  --pill-border: rgba(186, 230, 253, 0.7);
  --pill-text: #0284c7;

  --gradient-talk: linear-gradient(135deg, #0066ff 0%, #8b5cf6 50%, #ec4899 100%);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", "Noto Sans Thai", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 8px 24px -2px rgba(37, 99, 235, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-phone: 0 20px 40px -10px rgba(15, 23, 42, 0.25), 0 8px 16px -6px rgba(15, 23, 42, 0.15);

  /* Layout */
  --container-max: 1200px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--blue-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 32px);
}

.gradient-text {
  background: var(--gradient-talk);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ==========================================================================
   1. SITE HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: clamp(56px, 7vh, 64px);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: clamp(34px, 4.5vh, 40px);
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.brand-link:hover .brand-logo-img {
  transform: translateY(-1px);
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.8vw, 24px);
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: clamp(13px, 1.1vw, 14px);
  font-weight: 500;
  padding: 6px 2px;
  position: relative;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--blue-primary);
}

.nav-item.active {
  color: var(--blue-primary);
  font-weight: 600;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue-primary);
  border-radius: var(--radius-full);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
  flex-shrink: 0;
}

.btn-icon-nav {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-icon-nav:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  transition: var(--transition);
}
.lang-selector:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}
.lang-text {
  font-weight: 600;
}

/* Button Component Standards */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-outline-staff {
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.22);
  color: var(--text-main);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}
.btn-outline-staff:hover {
  border-color: var(--text-main);
  background: rgba(15, 23, 42, 0.04);
}

.btn-primary-user {
  background: var(--blue-primary);
  color: #fff;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.btn-primary-user:hover {
  background: var(--blue-hover);
  box-shadow: 0 4px 12px var(--blue-glow);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==========================================================================
   2. HERO SECTION (Desktop & Tablet Canonical Composition)
   ========================================================================== */
.hero-section {
  padding: clamp(14px, 2.5vh, 28px) 0 clamp(16px, 2.5vh, 28px) 0;
  position: relative;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2.5vw, 36px);
}

/* Hero Left Column */
.hero-content {
  flex: 1 1 48%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text);
  font-size: clamp(11px, 1vw, 12px);
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: clamp(10px, 1.5vh, 16px);
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: clamp(10px, 1.5vh, 16px);
}

.hero-brand {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.hero-tagline {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.hero-desc {
  font-size: clamp(13px, 1.2vw, 15px);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: clamp(14px, 2vh, 22px);
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: clamp(14px, 2vh, 22px);
}

.btn-primary-cta {
  background: var(--blue-primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
}
.btn-primary-cta:hover {
  background: var(--blue-hover);
  box-shadow: 0 6px 16px var(--blue-glow);
  transform: translateY(-1px);
}

.btn-outline-cta {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.2);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.btn-outline-cta:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
  transform: translateY(-1px);
}

.btn-mobile-staff {
  display: none; /* Appears only on mobile below buttons */
}

/* Supporting Benefits Row */
.hero-benefits {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.8vw, 22px);
  flex-wrap: wrap;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(12px, 1.1vw, 13px);
  font-weight: 600;
  color: var(--text-main);
}
.benefit-icon {
  font-size: 15px;
}

/* Hero Right Column: Woman & Phone Mockup Composed */
.hero-visual-col {
  flex: 1 1 52%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: clamp(10px, 1.5vw, 18px);
  position: relative;
}

.hero-woman-wrap {
  flex: 0 1 clamp(240px, 28vw, 350px);
  max-height: clamp(280px, 42vh, 420px);
  display: flex;
  align-items: flex-end;
}

.hero-woman-img {
  width: 100%;
  height: 100%;
  max-height: clamp(280px, 42vh, 420px);
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

/* Phone Mockup Trigger & Device */
.hero-phone-wrap {
  flex: 0 0 clamp(160px, 19vw, 235px);
  max-height: clamp(300px, 48vh, 480px);
  position: relative;
  cursor: pointer;
  border-radius: 36px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  outline: none;
}

.hero-phone-img {
  width: 100%;
  height: auto;
  max-height: clamp(300px, 48vh, 480px);
  object-fit: contain;
  display: block;
  border-radius: 36px;
  box-shadow: var(--shadow-phone);
  transition: transform 0.25s ease;
}

.hero-phone-wrap:hover {
  transform: translateY(-4px);
}
.hero-phone-wrap:hover .hero-phone-img {
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}
.hero-phone-wrap:focus-visible {
  box-shadow: 0 0 0 3px var(--blue-primary);
}

.phone-hover-badge {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.hero-phone-wrap:hover .phone-hover-badge {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* ==========================================================================
   3. SHARED SECTION STYLES (Features & Ecosystem 4-Column Rhythm)
   ========================================================================== */
.section-features,
.section-ecosystem {
  padding: clamp(14px, 2vh, 24px) 0;
}

.section-header {
  margin-bottom: clamp(12px, 1.8vh, 18px);
}

.section-header.text-center {
  text-align: center;
}

.section-title {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: clamp(12px, 1.1vw, 14px);
  color: var(--text-muted);
}

/* 4-COLUMN ALIGNED CARDS GRID (LOCKED FOR DESKTOP & TABLET) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.5vw, 20px);
}

/* Feature Cards */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 1.6vh, 20px) clamp(14px, 1.4vw, 18px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

.card-icon-wrap {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.card-title {
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.card-desc {
  font-size: clamp(11px, 1vw, 12.5px);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Ecosystem Cards */
.ecosystem-card {
  background: var(--bg-card-eco);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 1.5vh, 16px) clamp(12px, 1.3vw, 16px);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  gap: 8px;
}

.ecosystem-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

.eco-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.eco-icon-wrap {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.eco-card-text {
  flex: 1;
  min-width: 0;
}

.eco-card-title {
  font-size: clamp(13px, 1.15vw, 15px);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.eco-card-desc {
  font-size: clamp(10.5px, 0.95vw, 11.5px);
  color: var(--text-muted);
  line-height: 1.4;
  white-space: normal;
}

.eco-card-arrow {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: rgba(0, 102, 255, 0.08);
  color: var(--blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.ecosystem-card:hover .eco-card-arrow {
  background: var(--blue-primary);
  color: #fff;
  transform: translateX(2px);
}

/* ==========================================================================
   4. INTERACTIVE PHONE MOCKUP LIGHTBOX MODAL
   ========================================================================== */
.phone-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 13, 22, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.phone-modal-dialog {
  position: relative;
  max-height: 88vh;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-modal-backdrop.open .phone-modal-dialog {
  transform: scale(1);
}

/* Small, thin, elegant close button in upper-right */
.phone-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #0f172a;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  z-index: 10;
}

.phone-modal-close:hover {
  background: #ffffff;
  color: #ef4444;
  transform: scale(1.08);
}

.phone-modal-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop/PC: Realistic iPhone 17 Pro Max size */
.phone-modal-img {
  width: auto;
  max-width: clamp(280px, 32vw, 390px);
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 44px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   5. TABLET RESPONSIVE RULES (768px - 1024px)
   LOCKED TO SAME CANONICAL COMPOSITION AS DESKTOP
   ========================================================================== */
@media (max-width: 1024px) and (min-width: 768px) {
  .hero-container {
    gap: 16px;
  }
  .hero-content {
    flex: 1 1 48%;
  }
  .hero-visual-col {
    flex: 1 1 52%;
    gap: 10px;
  }
  .hero-woman-wrap {
    flex: 0 1 240px;
  }
  .hero-phone-wrap {
    flex: 0 0 170px;
  }
  /* Keep 4-column cards rhythm on Tablet */
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .feature-card {
    padding: 12px 10px;
  }
  .ecosystem-card {
    padding: 10px 8px;
    gap: 4px;
  }
  .eco-card-left {
    gap: 8px;
  }
  .eco-icon-wrap {
    width: 34px;
    height: 34px;
  }
  .eco-icon-img {
    width: 34px;
    height: 34px;
  }
  .eco-card-title {
    font-size: 13px;
  }
  .eco-card-desc {
    font-size: 10px;
  }
}

/* ==========================================================================
   6. MOBILE RESPONSIVE RULES (< 768px)
   REFERENCE B CANONICAL MOBILE REFLOW
   ========================================================================== */
@media (max-width: 767px) {
  .site-header {
    height: 56px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    flex-direction: column;
    padding: 16px 24px;
    gap: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-item {
    font-size: 15px;
    padding: 6px 0;
    width: 100%;
  }

  .nav-item.active::after {
    display: none;
  }

  .btn-outline-staff {
    display: none; /* Relocated into mobile hero button stack */
  }

  .btn-primary-user {
    display: none; /* Relocated into mobile hero button stack */
  }

  .menu-toggle {
    display: flex;
  }

  /* Mobile Hero: Vertical Touch-First Reflow */
  .hero-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .hero-content {
    max-width: 100%;
    align-items: center;
  }

  .hero-title {
    align-items: center;
  }

  .hero-brand {
    font-size: 34px;
  }

  .hero-tagline {
    font-size: 24px;
  }

  .hero-desc {
    font-size: 14px;
    max-width: 360px;
  }

  /* Mobile Full-Width CTA Stack */
  .hero-cta-group {
    width: 100%;
    max-width: 340px;
    flex-direction: column;
    gap: 10px;
  }

  .btn-primary-cta {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
  }

  .btn-outline-cta {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
  }

  .btn-mobile-staff {
    display: inline-flex;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.22);
    color: var(--text-main);
    padding: 8px 24px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
  }

  /* Mobile Hero Visual: Centered Woman + Tap Affordance */
  .hero-visual-col {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  .hero-woman-wrap {
    flex: 0 1 auto;
    max-width: 320px;
    max-height: 280px;
  }

  .hero-woman-img {
    max-height: 280px;
  }

  /* Phone Mockup on Mobile acts as tap card */
  .hero-phone-wrap {
    flex: 0 1 auto;
    max-width: 180px;
    max-height: 320px;
    margin: 8px auto 0 auto;
  }

  .hero-benefits {
    justify-content: center;
    gap: 14px;
    margin-top: 10px;
  }

  /* Mobile Feature Cards: 2x2 Grid (Reference B) */
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .feature-card {
    padding: 16px 14px;
  }

  .card-icon-wrap {
    width: 38px;
    height: 38px;
    margin-bottom: 8px;
  }
  .card-icon-img {
    width: 38px;
    height: 38px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-desc {
    font-size: 11px;
  }

  /* Mobile Ecosystem Cards: Vertical List (Reference B) */
  .ecosystem-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ecosystem-card {
    padding: 14px 16px;
  }

  .eco-icon-wrap {
    width: 42px;
    height: 42px;
  }
  .eco-icon-img {
    width: 42px;
    height: 42px;
  }

  .eco-card-title {
    font-size: 15px;
  }

  .eco-card-desc {
    font-size: 12px;
  }

  .eco-card-arrow {
    width: 30px;
    height: 30px;
  }

  /* Mobile Phone Modal: Viewport Adaptive with Safe Margins */
  .phone-modal-dialog {
    max-width: 92vw;
    max-height: 88vh;
  }

  .phone-modal-img {
    max-width: min(88vw, 340px);
    max-height: 84vh;
    border-radius: 36px;
  }

  .phone-modal-close {
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
  }
}
