/* ==========================================================================
   Somchit — one-page marketing site
   Light surface + brand red accent · English · GSAP/Lenis progressive enhancement
   Brand tokens mirror /www/wwwroot/somchit.la/lib/constants/app_colors.dart
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand (from AppColors) */
  --red: #F5393A;          /* AppColors.primary / brandRed */
  --red-dark: #A31518;     /* AppColors.primaryDark — gradient end */
  --red-050: #FFF3F3;
  --red-100: #FFE1E1;
  --gold: #D4AF37;         /* AppColors.accent */

  /* Surfaces */
  --bg: #FFFFFF;
  --bg-alt: #FBF9F9;
  --card: #FFFFFF;
  --ink-950: #121212;      /* AppColors.backgroundDark — used for dark bands */
  --ink-900: #1E1E1E;      /* AppColors.cardBgDark */

  /* Text */
  --ink: #1A1A1A;          /* AppColors.textPrimaryLight */
  --text: #4A4A4A;
  --muted: #666666;        /* AppColors.textSecondaryLight */
  --faint: #909090;        /* AppColors.textLightLight */
  --on-dark: #EAEAEA;      /* AppColors.textPrimaryDark */
  --on-dark-muted: #B0B0B0;

  /* Lines & status */
  --line: #E0E0E0;         /* AppColors.dividerLight */
  --line-soft: #EFEFEF;
  --success: #4CAF50;
  --warning: #FFAA00;
  --info: #2196F3;

  --grad-red: linear-gradient(135deg, var(--red), var(--red-dark));

  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --section-pad: clamp(3.5rem, 9vw, 6.5rem);
  --shadow-sm: 0 1px 2px rgba(18, 18, 18, .05), 0 2px 8px rgba(18, 18, 18, .04);
  --shadow-md: 0 6px 28px rgba(18, 18, 18, .09);
  --shadow-red: 0 8px 26px rgba(245, 57, 58, .28);

  --fs-h1: clamp(2.05rem, 4.4vw + 1rem, 3.2rem);
  --fs-h2: clamp(1.55rem, 2.4vw + .6rem, 2.35rem);
  --fs-lead: clamp(1.05rem, .8vw + .85rem, 1.25rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* Lenis (from docs) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 800; letter-spacing: -.015em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: 1.12rem; line-height: 1.4; }
p { max-width: 66ch; }
ul, ol { list-style: none; }
a { color: var(--red); text-decoration: none; }
img, svg { max-width: 100%; height: auto; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
strong { color: var(--ink); font-weight: 700; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--red); color: #fff; }

.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.narrow { max-width: 780px; }

.skip-link {
  position: absolute;
  top: -48px; left: 12px;
  z-index: 200;
  padding: .6rem 1.2rem;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Shared components ---------- */
.section { padding-block: var(--section-pad); }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--ink-950); color: var(--on-dark-muted); }
.section-dark h2, .section-dark h3 { color: #fff; }

.section-head { max-width: 720px; margin-bottom: clamp(2.25rem, 5vw, 3.5rem); }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head.center p { margin-inline: auto; }
.section-sub { color: var(--muted); margin-top: .8rem; font-size: var(--fs-lead); }
.section-dark .section-sub { color: var(--on-dark-muted); }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .9rem;
}
.section-dark .eyebrow { color: #FF8A8A; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .85rem 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.4;
  transition: transform .2s, box-shadow .2s, background-color .2s, border-color .2s, color .2s;
}
.btn-icon { width: 20px; height: 20px; flex: none; }
.btn-small { padding: .55rem 1.15rem; font-size: var(--fs-small); }

.btn-red { background: var(--grad-red); color: #fff; box-shadow: var(--shadow-sm); }
.btn-red:hover { transform: translateY(-2px); box-shadow: var(--shadow-red); }

.btn-ghost { border: 1.5px solid var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }

.btn-on-dark { border: 1.5px solid rgba(255, 255, 255, .3); color: #fff; }
.btn-on-dark:hover { border-color: #fff; background: rgba(255, 255, 255, .1); transform: translateY(-2px); }

.text-link { font-weight: 700; }
.text-link:hover { text-decoration: underline; }

.icon-stroke {
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  transition: background-color .3s, box-shadow .3s;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 1.5rem; }

.brand { display: inline-flex; align-items: center; gap: .55rem; }
/* The mark is the app icon: red globe on its own white tile. On the white page
   the tile vanishes into the background; on the dark footer the rounding makes
   it read as a deliberate app badge rather than a stray white square. */
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 7px; }
.brand-name { font-weight: 800; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; }

.site-nav { margin-left: auto; }
.nav-list { display: flex; gap: .15rem; }
.nav-link {
  display: inline-block;
  padding: .5rem .75rem;
  color: var(--muted);
  font-weight: 600;
  font-size: .93rem;
  border-radius: 8px;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--red); }

.header-cta { flex: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 10px;
  z-index: 120;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .3s, opacity .3s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 979px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; margin-left: 0; }
  .header-cta { margin-left: auto; }
}
@media (max-width: 559px) {
  .header-cta { display: none; }
  .nav-toggle { margin-left: auto; }
}

/* ---------- Mobile nav overlay ---------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(255, 255, 255, .98);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav-list { display: grid; gap: .35rem; margin-bottom: 2rem; }
.mobile-nav-link {
  display: inline-block;
  padding: .6rem 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}
.mobile-nav-link:hover { color: var(--red); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem));
  padding-bottom: var(--section-pad);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -22%; right: -12%;
  width: min(760px, 85vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(245, 57, 58, .13), rgba(245, 57, 58, 0) 68%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-title { margin-bottom: 1.1rem; }
.hero-title .accent {
  background: var(--grad-red);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead { font-size: var(--fs-lead); color: var(--muted); margin-bottom: 1.9rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; }

.hero-points { display: grid; gap: .6rem; }
.hero-point {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: var(--fs-small);
  color: var(--muted);
}
.hero-point svg { width: 18px; height: 18px; flex: none; margin-top: .22rem; }

/* Phone mock */
.hero-visual { display: flex; justify-content: center; }
.phone {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 9 / 18.5;
  border-radius: 34px;
  background: var(--ink-950);
  padding: 9px;
  box-shadow: 0 24px 60px rgba(18, 18, 18, .22), 0 2px 0 rgba(255, 255, 255, .5) inset;
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 26px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone-notch {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 20px;
  border-radius: 0 0 12px 12px;
  background: var(--ink-950);
  z-index: 3;
}
.phone-head {
  background: var(--grad-red);
  color: #fff;
  padding: 2.1rem 1rem .95rem;
  text-align: center;
}
.phone-head-title { font-size: .95rem; font-weight: 700; }
.phone-head-sub { font-size: .68rem; opacity: .85; }
/* Flex, not grid: the status chip and CTA use margin-top:auto to sit at the
   bottom of the screen while the rest stacks from the top. */
.phone-body { flex: 1; padding: .9rem .85rem; display: flex; flex-direction: column; gap: .6rem; }
.phone-label { font-size: .62rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.code-boxes { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.code-box {
  aspect-ratio: 1 / 1.35;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
}
.code-box.filled { border-color: var(--red); background: var(--red-050); }
.phone-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .6rem;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
}
.phone-row-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--red-050); flex: none; display: grid; place-items: center; }
.phone-row-dot svg { width: 14px; height: 14px; }
.phone-row-text { min-width: 0; }
.phone-row-title { display: block; font-size: .74rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.phone-row-sub { display: block; font-size: .64rem; color: var(--faint); line-height: 1.3; }
.phone-status {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  align-self: flex-start;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: rgba(76, 175, 80, .12);
  color: #2E7D32;
  font-size: .64rem;
  font-weight: 700;
}
.phone-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.phone-cta {
  margin-top: .5rem;
  padding: .55rem;
  border-radius: 9px;
  background: var(--grad-red);
  color: #fff;
  text-align: center;
  font-size: .74rem;
  font-weight: 700;
}

/* The forced title breaks only fit once the copy column is wide enough;
   below this the headline wraps on its own. */
@media (max-width: 1199px) {
  .br-lg { display: none; }
}

/* Between the two-column threshold and 1200px the hero copy column is at its
   narrowest while --fs-h1 is already pinned at its ceiling, which wraps the
   headline to four ragged lines. Track the viewport instead across that band. */
@media (min-width: 900px) and (max-width: 1199px) {
  :root { --fs-h1: 4.4vw; }
}

@media (max-width: 899px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-lead, .hero-points { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-point { text-align: left; }
  /* Copy stays first: the headline is the message and the LCP element, and a
     tall phone mock above it would push it off a short screen entirely. */
  .hero-visual { order: 1; margin-top: 1rem; }
  .phone { width: min(258px, 66vw); }
}

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.5vw, 1.75rem); counter-reset: step; }
.step {
  position: relative;
  padding: 1.6rem 1.25rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: .9rem;
  border-radius: 50%;
  background: var(--grad-red);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
}
.step h3 { margin-bottom: .45rem; }
.step p { font-size: var(--fs-small); color: var(--muted); }
@media (max-width: 979px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 539px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.4vw, 1.6rem); }
.card {
  padding: 1.6rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--red-100); }
.card-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--red-050);
}
.card-icon svg { width: 23px; height: 23px; }
.card h3 { margin-bottom: .45rem; }
.card p { font-size: var(--fs-small); color: var(--muted); }
@media (max-width: 899px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 559px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Services ---------- */
.svc-live { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.4vw, 1.6rem); margin-bottom: clamp(2.5rem, 6vw, 3.5rem); }
.svc {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.svc-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--red-050); display: grid; place-items: center; }
.svc-icon svg { width: 22px; height: 22px; }
.svc h3 { margin-bottom: .4rem; }
.svc p { font-size: var(--fs-small); color: var(--muted); }
@media (max-width: 699px) { .svc-live { grid-template-columns: 1fr; } }

.soon-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem; margin-bottom: 1.25rem; }
.soon-head h3 { font-size: 1.05rem; }
.soon-note { font-size: var(--fs-small); color: var(--faint); }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.soon-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem .85rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--faint);
  font-size: var(--fs-small);
  font-weight: 600;
}
.soon-item svg { width: 16px; height: 16px; flex: none; stroke: var(--faint); }

/* ---------- Trust ---------- */
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 3vw, 2.25rem); }
.trust-item { display: flex; gap: 1rem; }
.trust-icon {
  width: 42px; height: 42px; flex: none;
  border-radius: 11px;
  background: rgba(245, 57, 58, .14);
  display: grid; place-items: center;
}
.trust-icon svg { width: 21px; height: 21px; stroke: #FF8A8A; }
.trust-item h3 { margin-bottom: .35rem; font-size: 1.05rem; }
.trust-item p { font-size: var(--fs-small); color: var(--on-dark-muted); }
@media (max-width: 699px) { .trust-grid { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-list { max-width: 800px; margin-inline: auto; display: grid; gap: .7rem; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  width: 10px; height: 10px;
  flex: none;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .25s;
}
.faq-item[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq-item[open] summary { color: var(--red); }
.faq-answer { padding: 0 1.25rem 1.15rem; }
.faq-answer p { font-size: var(--fs-small); color: var(--muted); max-width: none; }
.faq-answer p + p { margin-top: .7rem; }

/* ---------- Get the app ---------- */
.app-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-md);
}
.qr {
  width: 168px; height: 168px;
  flex: none;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.app-panel h2 { margin-bottom: .6rem; }
.app-panel p { color: var(--muted); margin-bottom: 1.35rem; }
.app-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.app-meta { margin-top: 1.1rem; font-size: var(--fs-small); color: var(--faint); }
@media (max-width: 699px) {
  .app-panel { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .app-panel p { margin-inline: auto; }
  .app-actions { justify-content: center; }
}

/* ---------- Contact ---------- */
/* The list is short (phone + email) against a much taller copy block — centring
   it keeps the two columns balanced instead of leaving the right one adrift. */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.contact-list { display: grid; gap: .9rem; }
.contact-row { display: flex; gap: .85rem; align-items: flex-start; }
.contact-row svg { width: 20px; height: 20px; flex: none; margin-top: .18rem; }
.contact-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; }
.contact-value { color: var(--ink); font-weight: 600; }
a.contact-value:hover { color: var(--red); }
.contact-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
@media (max-width: 799px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-950);
  color: var(--on-dark-muted);
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.75rem;
}
.footer-top { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; margin-bottom: 2rem; }
.footer-brand .brand-name { color: #fff; }
.footer-tagline { margin-top: .75rem; font-size: var(--fs-small); color: var(--on-dark-muted); max-width: 42ch; }
.footer-nav { display: grid; grid-auto-flow: column; grid-template-rows: repeat(4, auto); gap: .45rem 3rem; }
.footer-nav a { color: var(--on-dark-muted); font-size: var(--fs-small); }
.footer-nav a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .8rem;
  color: var(--faint);
}
.footer-legal { max-width: 60ch; }
@media (max-width: 599px) {
  .footer-nav { grid-auto-flow: row; grid-template-rows: none; }
}

/* ---------- Motion gate ----------
   Elements are pre-hidden ONLY when html.motion-ok is set (see the inline gate
   in <head>). With JS off, prefers-reduced-motion, or GSAP unavailable the
   class is never added / is removed, and everything renders at full opacity. */
.motion-ok .reveal { opacity: 0; transform: translateY(22px); }
.motion-ok .hero-anim { opacity: 0; transform: translateY(16px); }
