/* =============================================================================
   Rayee public marketing site — design system
   Single-file stylesheet. Mobile-first. No framework.
   Sections:
     1. Tokens (CSS custom properties)
     2. Reset + base
     3. Utilities (container, sections, grid)
     4. Typography scale
     5. Components (button, card, badge, nav, hero, FAQ)
     6. Section compositions
     7. Footer
     8. Breakpoints (min-width: 768px, 1024px)
   ============================================================================= */

/* 1. Tokens ------------------------------------------------------------------------ */
:root {
  /* Color — primary */
  --primary:        #1d4ed8;
  --primary-hover:  #1e40af;
  --primary-light:  #dbeafe;
  --primary-text:   #ffffff;

  /* Color — neutrals */
  --bg:          #ffffff;
  --bg-alt:      #f9fafb;
  --bg-section:  #f3f4f6;
  --border:      #e5e7eb;
  --border-strong: #d1d5db;

  /* Color — text */
  --text:        #111827;
  --text-body:   #374151;
  --text-muted:  #6b7280;
  --text-on-primary: #ffffff;

  /* Color — accents */
  --success: #10b981;
  --warning: #f59e0b;

  /* Type scale (1.250 — major third) — fluid via clamp */
  --fs-xs:   clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);  /* 12-13px */
  --fs-sm:   clamp(0.875rem, 0.84rem + 0.18vw, 0.9375rem); /* 14-15px */
  --fs-base: 1rem;
  --fs-lg:   clamp(1.125rem, 1.07rem + 0.27vw, 1.25rem);   /* 18-20px */
  --fs-xl:   clamp(1.25rem, 1.18rem + 0.36vw, 1.5rem);     /* 20-24px */
  --fs-2xl:  clamp(1.5rem, 1.36rem + 0.71vw, 1.875rem);    /* 24-30px */
  --fs-3xl:  clamp(1.875rem, 1.61rem + 1.34vw, 2.5rem);    /* 30-40px */
  --fs-4xl:  clamp(2.25rem, 1.86rem + 1.96vw, 3.25rem);    /* 36-52px */
  --fs-5xl:  clamp(2.75rem, 2.07rem + 3.39vw, 4.5rem);     /* 44-72px */

  /* Spacing scale (4px base, fluid via clamp on the upper end) */
  --sp-1:   0.25rem;   /* 4 */
  --sp-2:   0.5rem;    /* 8 */
  --sp-3:   0.75rem;   /* 12 */
  --sp-4:   1rem;      /* 16 */
  --sp-5:   1.5rem;    /* 24 */
  --sp-6:   2rem;      /* 32 */
  --sp-7:   clamp(2rem, 1.5rem + 2.5vw, 3rem);     /* 32-48 */
  --sp-8:   clamp(3rem, 2.25rem + 3.75vw, 4.5rem); /* 48-72 */
  --sp-9:   clamp(4rem, 3rem + 5vw, 6rem);         /* 64-96 */
  --sp-10:  clamp(5rem, 3.75rem + 6.25vw, 7.5rem); /* 80-120 */

  /* Container */
  --container: 1200px;
  --container-narrow: 800px;
  --container-pad: var(--sp-5);

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06), 0 1px 3px rgb(15 23 42 / 0.05);
  --shadow-md: 0 4px 6px rgb(15 23 42 / 0.05), 0 2px 4px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 10px 15px rgb(15 23 42 / 0.06), 0 4px 6px rgb(15 23 42 / 0.04);
  --shadow-xl: 0 20px 25px rgb(15 23 42 / 0.08), 0 10px 10px rgb(15 23 42 / 0.03);
  --shadow-primary: 0 8px 24px rgb(29 78 216 / 0.25);

  /* Transitions */
  --t-fast: 120ms ease-out;
  --t-base: 200ms ease-out;

  /* Font stack */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* 2. Reset + base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-5xl); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: var(--fs-4xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h3 { font-size: var(--fs-xl); font-weight: 700; }
h4 { font-size: var(--fs-lg); font-weight: 600; }

p { color: var(--text-body); }

/* 3. Utilities --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.section { padding-block: var(--sp-9); }
.section--alt { background: var(--bg-alt); }
.section--primary { background: var(--primary); color: var(--text-on-primary); }
.section--primary h2, .section--primary p { color: var(--text-on-primary); }

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--sp-3);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--sp-8);
}
.section-head h2 { margin-bottom: var(--sp-3); }
.section-head p { font-size: var(--fs-lg); color: var(--text-muted); }

/* 4. Components -------------------------------------------------------------------- */

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--fs-base);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast);
  border: 1px solid transparent;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-text); }
.btn-secondary {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover { background: var(--primary-light); color: var(--primary-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-section); color: var(--text); }
.btn-large {
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-lg);
  border-radius: var(--r-lg);
}
.btn-arrow::after {
  content: '→';
  transition: transform var(--t-fast);
  display: inline-block;
}
.btn-arrow:hover::after { transform: translateX(2px); }

/* Card */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.card-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: var(--sp-4);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: var(--sp-2); }
.card p { font-size: var(--fs-sm); color: var(--text-muted); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-body);
}
.badge-check {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-body);
}
.badge-check::before {
  content: '';
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  background: var(--success);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='20 6 9 17 4 12'/%3e%3c/svg%3e");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Site header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255 255 255 / 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 64px;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  font-size: var(--fs-xl);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--text); }
.site-logo__mark {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: var(--primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.site-nav {
  display: none;
  align-items: center;
  gap: var(--sp-6);
}
.site-nav a {
  color: var(--text-body);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-sm);
  transition: color var(--t-fast);
}
.site-nav a:hover { color: var(--text); }
.site-header__cta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Hero */
.hero {
  position: relative;
  padding-block: var(--sp-9) var(--sp-10);
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(29 78 216 / 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(59 130 246 / 0.05) 0%, transparent 50%),
    var(--bg);
}
.hero__inner { text-align: center; max-width: 880px; margin-inline: auto; }
.hero h1 { margin-bottom: var(--sp-5); }
.hero__subhead {
  font-size: var(--fs-xl);
  color: var(--text-muted);
  margin-bottom: var(--sp-7);
  max-width: 720px;
  margin-inline: auto;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
  margin-bottom: var(--sp-6);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  justify-content: center;
}

/* Social proof bar */
.social-proof {
  padding-block: var(--sp-7);
  border-block: 1px solid var(--border);
  background: var(--bg);
}
.social-proof__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
}
.social-proof__label {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.social-proof__industries {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2) var(--sp-5);
  list-style: none;
  color: var(--text-body);
  font-weight: 500;
}
.social-proof__industries li {
  position: relative;
  padding-right: var(--sp-5);
}
.social-proof__industries li:not(:last-child)::after {
  content: '·';
  position: absolute;
  right: calc(var(--sp-2) * -1);
  color: var(--border-strong);
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
.step {
  position: relative;
  padding: var(--sp-6);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  text-align: left;
}
.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
  font-size: var(--fs-base);
  margin-bottom: var(--sp-4);
}
.step h3 { margin-bottom: var(--sp-2); }
.step p { color: var(--text-muted); font-size: var(--fs-sm); }

/* Features grid */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

/* Callout (image + text side-by-side) */
.callout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
  align-items: center;
}
.callout__media {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(255 255 255 / 0) 100%);
  border-radius: var(--r-xl);
  padding: var(--sp-7);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.callout__media svg { width: 100%; height: auto; max-width: 480px; }
.callout__body h2 { margin-bottom: var(--sp-4); }
.callout__body p { font-size: var(--fs-lg); color: var(--text-muted); margin-bottom: var(--sp-5); }
.callout__list { list-style: none; display: grid; gap: var(--sp-3); }
.callout__list li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.callout__list svg { width: 22px; height: 22px; color: var(--success); flex-shrink: 0; margin-top: 2px; }

/* Pricing */
.pricing {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  align-items: stretch;
}
.tier {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  position: relative;
}
.tier__name { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: var(--sp-3); }
.tier__price { font-size: var(--fs-4xl); font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1; }
.tier__price-period { font-size: var(--fs-base); font-weight: 500; color: var(--text-muted); margin-left: var(--sp-1); }
.tier__desc { color: var(--text-muted); font-size: var(--fs-sm); margin-top: var(--sp-3); margin-bottom: var(--sp-5); }
.tier__features { list-style: none; display: grid; gap: var(--sp-3); margin-bottom: var(--sp-6); flex-grow: 1; }
.tier__features li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-body); }
.tier__features svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; margin-top: 2px; }
.tier .btn { width: 100%; }
.tier--featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 30%);
}
.tier__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  background: var(--primary);
  color: var(--primary-text);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.pricing-footnote { text-align: center; margin-top: var(--sp-6); color: var(--text-muted); font-size: var(--fs-sm); }

/* Local (Built for Singapore) */
.local-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
.local-item { display: flex; gap: var(--sp-4); align-items: flex-start; }
.local-item__icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--bg-alt);
  color: var(--primary);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.local-item__icon svg { width: 22px; height: 22px; }
.local-item h3 { margin-bottom: var(--sp-1); font-size: var(--fs-lg); }
.local-item p { color: var(--text-muted); font-size: var(--fs-sm); }

/* FAQ */
.faq-list { display: grid; gap: var(--sp-3); }
.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-2) var(--sp-5);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.faq-item[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-lg);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: var(--fs-2xl);
  color: var(--text-muted);
  line-height: 1;
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item__answer {
  padding: 0 0 var(--sp-4) 0;
  color: var(--text-muted);
}
.faq-item__answer p + p { margin-top: var(--sp-3); }

/* Final CTA */
.final-cta {
  padding-block: var(--sp-10);
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: var(--text-on-primary);
}
.final-cta h2 { color: var(--text-on-primary); margin-bottom: var(--sp-4); }
.final-cta p { color: rgba(255 255 255 / 0.85); font-size: var(--fs-lg); margin-bottom: var(--sp-7); }
.final-cta__contact {
  margin-top: var(--sp-5);
  color: rgba(255 255 255 / 0.85);
  font-size: var(--fs-sm);
}

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
}
.contact-info { display: grid; gap: var(--sp-5); }
.contact-info h2 { margin-bottom: var(--sp-3); font-size: var(--fs-2xl); }
.contact-info__item h3 { font-size: var(--fs-base); margin-bottom: var(--sp-2); color: var(--text); }
.contact-info__item p { color: var(--text-muted); font-size: var(--fs-sm); }
.contact-info__item a { color: var(--primary); text-decoration: none; }
.contact-info__item a:hover { text-decoration: underline; }

/* Legal pages */
.legal-content h2 { font-size: var(--fs-2xl); margin-bottom: var(--sp-4); }
.legal-content h3 { font-size: var(--fs-lg); margin-top: var(--sp-6); margin-bottom: var(--sp-3); color: var(--text); }
.legal-content p { margin-bottom: var(--sp-4); }
.legal-content ul { margin-bottom: var(--sp-4); padding-left: var(--sp-5); }
.legal-content li { margin-bottom: var(--sp-2); }
.legal-content em { color: var(--text-muted); font-size: var(--fs-sm); display: block; margin-bottom: var(--sp-5); }

/* 7. Footer ------------------------------------------------------------------------ */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: var(--sp-8) var(--sp-6);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-7);
}
.footer-col h4 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}
.footer-col ul { list-style: none; display: grid; gap: var(--sp-2); }
.footer-col a {
  color: var(--text-body);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--primary); }
.footer-brand p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: var(--sp-3);
  max-width: 280px;
}
.site-footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: center;
}

/* 8. Breakpoints ------------------------------------------------------------------- */
@media (min-width: 640px) {
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .local-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
  .site-footer__bottom { flex-direction: row; justify-content: space-between; text-align: left; }
  .site-footer__bottom > *:first-child { text-align: left; }
}

@media (min-width: 768px) {
  .site-nav { display: flex; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .callout { grid-template-columns: 1fr 1fr; }
  .callout--reverse .callout__media { order: 2; }
}

@media (min-width: 1024px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .pricing { grid-template-columns: repeat(3, 1fr); }
  .local-grid { grid-template-columns: repeat(4, 1fr); }
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
