/* ========================================
   REVSTAY — Base Styles
   Reset, Design Tokens, Typography, Utilities
   ======================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

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

ul, ol {
  list-style: none;
}

/* --- Design Tokens --- */
:root {
  /* Colors */
  --color-primary: #1B9E8C;
  --color-primary-hover: #158A79;
  --color-dark: #1A2E2B;
  --color-sand: #F5ECD7;
  --color-accent: #E85D1E;
  --color-white: #FFFFFF;
  --color-text: #6B7C7A;
  --color-text-dark: #1A2E2B;

  /* Typography */
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-thai: 'Sarabun', sans-serif;

  /* Font Sizes */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  --text-3xl: clamp(1.75rem, 1.4rem + 1.75vw, 2.5rem);
  --text-hero: clamp(2.5rem, 1.8rem + 3.5vw, 4.5rem);
  --text-stat: clamp(2.5rem, 2rem + 2.5vw, 5rem);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 900px;
  --max-width-text: 700px;
  --nav-height: 72px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-pill: 50px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 46, 43, 0.08);
  --shadow-md: 0 4px 12px rgba(26, 46, 43, 0.1);
  --shadow-lg: 0 8px 30px rgba(26, 46, 43, 0.12);
  --shadow-card-hover: 0 12px 40px rgba(26, 46, 43, 0.15);

  /* Transitions */
  --transition-fast: 180ms ease;
  --transition-base: 300ms ease;
}

/* --- Base Typography --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-dark);
  line-height: 1.2;
}

h1 {
  font-size: var(--text-hero);
  font-weight: 800;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 500;
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

/* --- Utility Classes --- */

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--text {
  max-width: var(--max-width-text);
}

/* Sections */
.section {
  padding: var(--space-section) 0;
}

.section--dark {
  background-color: var(--color-dark);
  color: var(--color-sand);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-white);
}

.section--sand {
  background-color: var(--color-sand);
}

.section--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.section--primary h2,
.section--primary h3 {
  color: var(--color-white);
}

/* Section Label */
.section-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.section--dark .section-label {
  color: var(--color-primary);
}

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-white { color: var(--color-white); }
.text-sand { color: var(--color-sand); }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text); }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* Grid */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Scroll Animation */
.reveal {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.reveal.visible {
  opacity: 1;
}

/* Screen reader only */
.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;
}

/* Image Placeholders */
.img-placeholder {
  background-color: var(--color-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-size: var(--text-sm);
  border-radius: var(--border-radius);
  min-height: 200px;
}

.section--dark .img-placeholder {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-sand);
}
