/* ==========================================================================
   GenLabs Brand CSS — shared across all public pages
   Source of truth: landing.html (homepage)
   ========================================================================== */

/* Design Tokens */
:root {
  --fire:       #E84B1A;
  --fire-b:     #f97316;
  --fire-c:     #fbbf24;
  --fire-dark:  #cc3d10;
  --bg:         #080808;
  --bg-2:       #0d0d0d;
  --bg-3:       #141414;
  --bg-4:       #1a1a1a;
  --text:       #ffffff;
  --text-muted: #8a8480;
  --text-dim:   #5a5550;
  --border:     rgba(255,255,255,0.07);
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --sp-xs:  8px;
  --sp-sm:  16px;
  --sp-md:  24px;
  --sp-lg:  48px;
  --sp-xl:  80px;
  --sp-2xl: 120px;
  --r-sm:  10px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-pill: 100px;
}

/* Skip Navigation Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--fire);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* Grain overlay — shared across all pages */
.gl-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: .02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Thai Language Typography */
body.lang-th,
body.lang-th h1, body.lang-th h2, body.lang-th h3, body.lang-th h4,
body.lang-th p, body.lang-th a, body.lang-th button,
body.lang-th .nav-logo, body.lang-th .nav-link,
body.lang-th .mobile-menu-link, body.lang-th .btn {
  font-family: 'Kanit', system-ui, sans-serif;
}

/* Thai requires more line-height — diacritics stack above consonants */
body.lang-th h1,
body.lang-th h2,
body.lang-th h3 {
  line-height: 1.35;
  letter-spacing: 0;
}

/* Remove negative letter-spacing — it collapses Thai consonants */
body.lang-th .section-title,
body.lang-th .hero-h1,
body.lang-th .cta-title {
  letter-spacing: 0;
  line-height: 1.3;
}

/* Body text in Thai — Kanit needs slightly more breathing room */
body.lang-th p,
body.lang-th .hero-sub,
body.lang-th .section-sub {
  line-height: 1.85;
}

/* Buttons — Thai text is typically longer, allow wrapping on mobile */
body.lang-th .btn {
  white-space: normal;
  text-align: center;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fire);
  color: #fff;
  box-shadow: 0 0 24px rgba(232,75,26,.35);
}
.btn-primary:hover {
  background: var(--fire-dark);
  box-shadow: 0 0 44px rgba(232,75,26,.6);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.18);
}
.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.04);
  transform: translateY(-2px);
}
.btn-sm {
  padding: 10px 22px;
  font-size: 13.5px;
}

.btn-orbit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-orbit .btn-primary { position: relative; z-index: 2; }

@property --orbit-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes orbit-spin { to { --orbit-angle: 360deg; } }

.btn-orbit::before,
.btn-orbit::after {
  content: '';
  position: absolute;
  border-radius: var(--r-pill);
  border-style: solid;
  border-color: transparent;
  pointer-events: none;
  z-index: 1;
}
.btn-orbit::before {
  inset: -5px;
  border-width: 1.5px;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    conic-gradient(
      from var(--orbit-angle),
      transparent 0deg,
      rgba(232,75,26,.0)  20deg,
      rgba(232,75,26,.9)  80deg,
      rgba(249,115,22,1) 120deg,
      rgba(251,191,36,.9) 160deg,
      rgba(232,75,26,.0) 200deg,
      transparent 360deg
    ) border-box;
  animation: orbit-spin 2.2s linear infinite;
}
.btn-orbit::after {
  inset: -10px;
  border-width: 1px;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    conic-gradient(
      from calc(var(--orbit-angle) + 180deg),
      transparent 0deg,
      rgba(232,75,26,.4)  90deg,
      rgba(249,115,22,.6) 130deg,
      rgba(232,75,26,.0) 170deg,
      transparent 360deg
    ) border-box;
  animation: orbit-spin 2.2s linear infinite reverse;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid transparent;
  transition: padding .3s, background .3s, border-color .3s;
}
.nav.scrolled {
  padding: 12px 48px;
  background: rgba(8,8,8,.92);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.3px;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-link {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  border-radius: var(--r-sm);
  transition: color .18s, background .18s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lang-toggle {
  display: flex;
  background: rgba(255,255,255,.07);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.4);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  transition: all .2s;
}
.lang-btn.active {
  background: var(--fire);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,75,26,.4);
}
.lang-btn:not(.active):hover { color: #fff; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 11px;
  border-radius: var(--r-sm);
  transition: background .2s;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.nav-hamburger:hover { background: rgba(255,255,255,.06); }
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 490;
  background: rgba(8,8,8,.97);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }

.mobile-menu-link {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  padding: 12px 40px;
  border-radius: var(--r-md);
  transition: color .2s, background .2s;
  letter-spacing: -.4px;
}
.mobile-menu-link:hover { color: #fff; background: rgba(255,255,255,.05); }

.mobile-menu-cta {
  margin-top: 20px;
  background: var(--fire);
  color: #fff;
  padding: 14px 48px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 0 28px rgba(232,75,26,.4);
  display: inline-block;
}
.mobile-menu-cta:hover { background: var(--fire-dark); }

.mobile-lang-wrap {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.mobile-lang-btn {
  padding: 10px 28px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.15);
  background: transparent;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.mobile-lang-btn.active {
  background: var(--fire);
  border-color: var(--fire);
  color: #fff;
}

/* Mobile nav — show hamburger, hide desktop links/buttons */
@media(max-width: 768px) {
  .nav-links { display: none; }
  .lang-toggle { display: none; }
  .nav-right .nav-link--login { display: none; }
  .nav-right .btn { display: none; }
  .nav-hamburger { display: flex; }
}

.nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(255,255,255,.06);
}

/* Global focus states */
:focus-visible {
  outline: 2px solid var(--fire);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }
.nav-link:focus-visible,
.nav-hamburger:focus-visible,
.lang-btn:focus-visible {
  outline: 2px solid var(--fire);
  outline-offset: 2px;
}

/* ==========================================================================
   Footer styles are now self-contained in views/partials/footer.html
   ========================================================================== */

/* ==========================================================================
   Shared layout utilities
   ========================================================================== */
.page-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--sp-md);
}
.section {
  padding: var(--sp-xl) var(--sp-md);
}

/* Overflow safety — prevent horizontal scroll from overflowing children */
section, .page-wrap, [class*="max-w-"] { overflow-x: clip; }

.free-badge { display: inline-block; background: #dcfce7; color: #16a34a; font-size: 10px; font-weight: 800; letter-spacing: .3px; padding: 2px 7px; border-radius: 6px; }
.free-badge--sm { font-size: 9px; padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
