/* ──────────────────────────────────────────────────────────
   LogicLayer Thailand — landing page
   Brand palette: navy → royal blue → sky cyan (from logo)
   Hi-end dark · cyan accent · graph-network vibe
   ────────────────────────────────────────────────────────── */

:root {
  /* Backgrounds — deep navy ladder */
  --ink:      #0A1320;
  --ink-soft: #0F1A2E;
  --ink-mid:  #15233E;
  --ink-line: #1F3052;

  /* Brand colors from logo */
  --navy:        #1E3A5F;  /* logo bottom layer / "LOGIC" wordmark */
  --navy-deep:   #142845;
  --blue:        #4A7BAE;  /* logo middle layer / "LAYER" wordmark */
  --blue-soft:   #6F9BCC;
  --blue-deep:   #2E5887;
  --cyan:        #7FCDDC;  /* logo top layer */
  --cyan-bright: #A5DDE6;
  --cyan-glow:   #C8ECF2;
  --cyan-deep:   #5AA8BC;

  /* Text — paper cream from logo background */
  --ivory:      #F0EBE0;
  --ivory-soft: #F8F4EA;
  --ivory-mute: #94A8BC;

  /* Legacy aliases — keep so we don't have to touch every file */
  --accent:      var(--cyan);
  --accent-deep: var(--cyan-deep);
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(127,205,220,0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(74,123,174,0.05), transparent 60%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ─── Grain overlay ─────────────────────────────────────── */
.grain-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.30; mix-blend-mode: overlay;
  background-image:
    repeating-radial-gradient(circle at 25% 25%, rgba(255,255,255,0.022) 0, rgba(255,255,255,0.022) 1px, transparent 1px, transparent 3px),
    repeating-radial-gradient(circle at 75% 75%, rgba(255,255,255,0.016) 0, rgba(255,255,255,0.016) 1px, transparent 1px, transparent 4px);
}

/* ─── Logo image (replaces text mark) ───────────────────── */
.logo-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ivory-soft);
  box-shadow: 0 0 0 1px rgba(127,205,220,0.35), 0 6px 20px -6px rgba(127,205,220,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
a:hover .logo-img {
  transform: scale(1.05);
  box-shadow: 0 0 0 1px rgba(127,205,220,0.55), 0 8px 28px -6px rgba(127,205,220,0.5);
}
.logo-img-sm { width: 26px; height: 26px; }

/* ─── Nav ───────────────────────────────────────────────── */
.nav-glass {
  background: rgba(10,19,32,0.7);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(127,205,220,0.08);
}
.nav-link {
  position: relative; transition: color 0.2s ease;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--cyan); transform: scaleX(0);
  transform-origin: left; transition: transform 0.3s ease;
}
.nav-link:hover { color: var(--ivory); }
.nav-link:hover::after { transform: scaleX(1); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan) 50%, var(--blue) 100%);
  color: var(--ink); font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 1px rgba(200,236,242,0.35), 0 10px 30px -8px rgba(127,205,220,0.55);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(200,236,242,0.55), 0 16px 40px -8px rgba(127,205,220,0.7);
}
.btn-primary:hover::after { transform: translateX(100%); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px;
  background: rgba(127,205,220,0.04);
  border: 1px solid rgba(127,205,220,0.18);
  color: var(--ivory); font-weight: 500; font-size: 14px;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}
.btn-ghost:hover {
  border-color: rgba(127,205,220,0.6);
  background: rgba(127,205,220,0.08);
}

/* ─── Eyebrow ───────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ivory-mute);
  padding: 6px 14px; border-radius: 999px;
  background: rgba(127,205,220,0.04);
  border: 1px solid rgba(127,205,220,0.1);
}
.eyebrow-center { margin: 0 auto; }
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  min-height: 92vh;
  position: relative;
  display: flex; align-items: center;
}
.hero-canvas {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
}
.hero-canvas canvas {
  width: 100% !important; height: 100% !important;
  display: block;
}
.hero-halo {
  position: absolute; pointer-events: none; z-index: 1;
  border-radius: 50%; filter: blur(90px); opacity: 0.45;
}
.hero-halo-gold {
  width: 600px; height: 600px;
  top: -100px; right: -100px;
  background: radial-gradient(circle, rgba(127,205,220,0.45), transparent 60%);
  animation: float 16s ease-in-out infinite;
}
.hero-halo-cyan {
  width: 500px; height: 500px;
  bottom: -100px; left: -150px;
  background: radial-gradient(circle, rgba(74,123,174,0.30), transparent 60%);
  animation: float 20s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(30px, -40px); }
}

.hero-headline {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--ivory);
  background: linear-gradient(180deg, #FFFFFF 0%, #DDE6EE 60%, #889CB0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-italic {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(120deg, var(--cyan-glow) 0%, var(--cyan) 50%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.65;
  color: var(--ivory-mute);
  letter-spacing: -0.005em;
}

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 2; opacity: 0.5;
}
.scroll-cue-line {
  display: block; width: 1px; height: 56px;
  background: linear-gradient(180deg, transparent, var(--cyan), transparent);
  background-size: 100% 200%;
  animation: scrollCue 2.5s ease-in-out infinite;
}
@keyframes scrollCue {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 200%; }
}

/* ─── Section base ──────────────────────────────────────── */
.section {
  padding: 120px 0;
  position: relative; z-index: 2;
}
.section-alt {
  background:
    linear-gradient(180deg, transparent, rgba(15,26,46,0.6) 20%, rgba(15,26,46,0.6) 80%, transparent);
}
.section-head {
  max-width: 880px;
  margin-bottom: 72px;
}
.section-title {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ivory);
  margin-top: 18px;
}
.section-title .text-ivory-mute {
  color: var(--ivory-mute);
  font-weight: 400;
}
.section-lead {
  margin-top: 20px;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.65;
  color: var(--ivory-mute);
  max-width: 640px;
}

/* ─── Capabilities grid ─────────────────────────────────── */
.cap-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cap-card {
  position: relative;
  padding: 32px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(127,205,220,0.04) 0%, rgba(127,205,220,0.012) 100%);
  border: 1px solid rgba(127,205,220,0.08);
  transition: border-color 0.3s ease, transform 0.3s ease;
  overflow: hidden;
  transform-style: preserve-3d;
}
.cap-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(127,205,220,0.10), transparent 50%);
  opacity: 0; transition: opacity 0.3s ease;
  pointer-events: none;
}
.cap-card:hover { border-color: rgba(127,205,220,0.35); }
.cap-card:hover::before { opacity: 1; }

.cap-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(127,205,220,0.18), rgba(74,123,174,0.08));
  border: 1px solid rgba(127,205,220,0.25);
  color: var(--cyan-bright);
  margin-bottom: 22px;
}
.cap-icon svg { width: 22px; height: 22px; }

.cap-title {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ivory);
  margin-bottom: 10px;
}
.cap-body {
  font-size: 14px; line-height: 1.6;
  color: var(--ivory-mute);
  margin-bottom: 18px;
}
.cap-list {
  display: flex; flex-direction: column; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ivory-mute);
  padding-top: 16px;
  border-top: 1px solid rgba(127,205,220,0.08);
}

/* ─── Work / showcase grid ──────────────────────────────── */
.work-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.work-card-feature { grid-column: span 2; min-width: 100%; }
@media (min-width: 1024px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
  .work-card-feature { grid-column: span 2; }
}

.work-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(127,205,220,0.10);
  background: var(--ink-soft);
  min-height: 320px;
  transition: border-color 0.3s ease, transform 0.3s ease;
  transform-style: preserve-3d;
}
.work-card:hover { border-color: rgba(127,205,220,0.4); }

.work-bg {
  position: absolute; inset: 0;
  z-index: 0; opacity: 0.7;
  transition: opacity 0.4s ease, transform 0.6s ease;
}
.work-card:hover .work-bg { opacity: 0.9; transform: scale(1.05); }

/* Mabel — featured: cyan + sky */
.work-bg-mabel {
  background:
    radial-gradient(800px 400px at 80% 20%, rgba(127,205,220,0.4), transparent 60%),
    radial-gradient(600px 400px at 20% 80%, rgba(74,123,174,0.32), transparent 60%),
    linear-gradient(135deg, #0c1e30, #0a1320);
}
/* BeeMate — sky blue + steel (bee = sky-bound) */
.work-bg-bee {
  background:
    radial-gradient(500px 300px at 70% 30%, rgba(165,221,230,0.30), transparent 60%),
    radial-gradient(400px 300px at 20% 80%, rgba(74,123,174,0.28), transparent 60%),
    linear-gradient(135deg, #0c1a2c, #0a1320);
}
/* CourtPilot — turquoise + teal */
.work-bg-court {
  background:
    radial-gradient(500px 300px at 70% 30%, rgba(94,205,222,0.28), transparent 60%),
    radial-gradient(400px 300px at 20% 80%, rgba(45,148,168,0.22), transparent 60%),
    linear-gradient(135deg, #08202a, #0a1320);
}
/* Poliwish — deep navy + indigo (insurance gravitas) */
.work-bg-poli {
  background:
    radial-gradient(500px 300px at 70% 30%, rgba(99,118,200,0.26), transparent 60%),
    radial-gradient(400px 300px at 20% 80%, rgba(30,58,95,0.40), transparent 60%),
    linear-gradient(135deg, #0c1530, #0a1320);
}
/* OuhOnechat — teal + aqua (chat/messaging) */
.work-bg-ouh {
  background:
    radial-gradient(500px 300px at 70% 30%, rgba(127,205,220,0.32), transparent 60%),
    radial-gradient(400px 300px at 20% 80%, rgba(58,160,178,0.24), transparent 60%),
    linear-gradient(135deg, #082025, #0a1320);
}
/* rooraka — price intelligence: warm amber over deep navy */
.work-bg-rooraka {
  background:
    radial-gradient(500px 300px at 70% 30%, rgba(200,170,110,0.24), transparent 60%),
    radial-gradient(400px 300px at 20% 80%, rgba(74,123,174,0.26), transparent 60%),
    linear-gradient(135deg, #15182c, #0a1320);
}
/* Logic Layer Class — "Neural" learning: violet + cyan */
.work-bg-class {
  background:
    radial-gradient(500px 300px at 70% 30%, rgba(150,120,220,0.26), transparent 60%),
    radial-gradient(400px 300px at 20% 80%, rgba(127,205,220,0.24), transparent 60%),
    linear-gradient(135deg, #14132c, #0a1320);
}

.work-card-inner {
  position: relative; z-index: 1;
  padding: 32px;
  display: flex; flex-direction: column; height: 100%;
  min-height: 320px;
}

.work-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.work-tag {
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
  border: 1px solid;
}
.work-tag-live  { color: var(--cyan-bright); border-color: rgba(165,221,230,0.5); background: rgba(165,221,230,0.08); }
.work-tag-beta  { color: var(--blue-soft);  border-color: rgba(111,155,204,0.5);  background: rgba(111,155,204,0.08); }
.work-tag-alpha { color: var(--ivory-mute); border-color: rgba(148,168,188,0.4);  background: rgba(148,168,188,0.06); }
.work-vertical  { color: var(--ivory-mute); }

.work-title {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-size: 36px; font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ivory);
  margin-bottom: 12px;
}
.work-card-feature .work-title { font-size: 56px; }

.work-sub {
  font-size: 15px; line-height: 1.55;
  color: var(--ivory-mute);
  margin-bottom: 20px;
  max-width: 560px;
}

.work-stack {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
  padding-top: 16px;
}
.work-stack span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(127,205,220,0.06);
  border: 1px solid rgba(127,205,220,0.1);
  color: var(--ivory-mute);
}

.work-link {
  display: inline-flex; margin-top: 20px;
  font-size: 13px; font-weight: 600;
  color: var(--cyan-bright);
  transition: color 0.2s ease, gap 0.2s ease;
  gap: 6px;
}
.work-link:hover { color: var(--cyan-glow); gap: 12px; }

/* ─── Process ───────────────────────────────────────────── */
.process-list {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  list-style: none; padding: 0;
}
.process-step {
  padding: 36px 32px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(127,205,220,0.035) 0%, transparent 100%);
  border: 1px solid rgba(127,205,220,0.08);
  position: relative;
}
.process-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 14px; font-weight: 400;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 32px;
}
.process-title {
  font-size: 26px; font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ivory);
  margin-bottom: 14px;
}
.process-body {
  font-size: 14px; line-height: 1.65;
  color: var(--ivory-mute);
}

/* ─── Stack grid ────────────────────────────────────────── */
.stack-grid {
  display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border: 1px solid rgba(127,205,220,0.08);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(15,26,46,0.4);
}
.stack-cell {
  padding: 28px 24px;
  border-right: 1px solid rgba(127,205,220,0.06);
  border-bottom: 1px solid rgba(127,205,220,0.06);
  display: flex; flex-direction: column; gap: 4px;
  transition: background 0.2s ease;
}
.stack-cell:hover { background: rgba(127,205,220,0.05); }
.stack-name {
  font-size: 16px; font-weight: 600;
  color: var(--ivory);
  letter-spacing: -0.015em;
}
.stack-role {
  font-size: 11px;
  color: var(--ivory-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── Contact ───────────────────────────────────────────── */
.section-contact {
  padding: 140px 0 160px;
  position: relative;
  background:
    radial-gradient(800px 500px at 50% 0%, rgba(127,205,220,0.10), transparent 60%),
    transparent;
}
.contact-headline {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ivory);
}
.contact-sub {
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.6;
  color: var(--ivory-mute);
}
.contact-grid {
  margin-top: 48px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 880px; margin-left: auto; margin-right: auto;
}
.contact-card {
  padding: 28px 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(127,205,220,0.04), rgba(127,205,220,0.01));
  border: 1px solid rgba(127,205,220,0.10);
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
  transform-style: preserve-3d;
}
.contact-card:hover {
  border-color: rgba(127,205,220,0.45);
  transform: translateY(-2px);
}
.contact-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(127,205,220,0.14);
  border: 1px solid rgba(127,205,220,0.25);
  color: var(--cyan-bright);
  margin-bottom: 16px;
}
.contact-icon svg { width: 18px; height: 18px; }
.contact-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ivory-mute);
}
.contact-value {
  font-size: 14px; font-weight: 500;
  color: var(--ivory);
  margin-top: 6px;
  word-break: break-all;
}

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  border-top: 1px solid rgba(127,205,220,0.08);
  background: rgba(10,19,32,0.85);
}
.footer-link { transition: color 0.2s ease; }
.footer-link:hover { color: var(--cyan); }

/* ─── Reveal animations ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { min-height: 78vh; }
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 48px; }
  .work-card-feature { grid-column: span 1; }
  .work-card-feature .work-title { font-size: 36px; }
  nav .hidden.md\:flex { display: none; }

  /* Hero canvas: dim faraway ambient — never compete with the headline.
     A dark veil sits underneath the text so glow can't bleed through. */
  .hero-canvas { opacity: 0.28; }
  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
      radial-gradient(ellipse 130% 90% at 50% 55%, rgba(10,19,32,0.78) 0%, rgba(10,19,32,0.55) 45%, transparent 80%);
    pointer-events: none;
  }

  /* Halos: sized for phone width — no more bleeding off-canvas */
  .hero-halo-gold {
    width: 280px; height: 280px;
    top: -80px; right: -100px;
    filter: blur(70px); opacity: 0.30;
  }
  .hero-halo-cyan {
    width: 240px; height: 240px;
    bottom: -100px; left: -120px;
    filter: blur(70px); opacity: 0.22;
  }

  /* Headline: solid ivory (no gradient that washes out against glow);
     a touch smaller + tighter so it doesn't crush. */
  .hero-headline {
    font-size: clamp(40px, 11vw, 56px);
    line-height: 1.05;
    background: none;
    -webkit-text-fill-color: var(--ivory);
            color: var(--ivory);
  }
  /* Italic accent: solid bright cyan-glow + soft halo so the serif doesn't
     vanish into the dark/glow background. The blue end of the desktop
     gradient was the part going invisible on phones. */
  .hero-italic {
    background: none;
    -webkit-text-fill-color: var(--cyan-glow);
            color: var(--cyan-glow);
    text-shadow: 0 0 18px rgba(127, 205, 220, 0.35);
  }
  .hero-sub {
    font-size: 15px;
    line-height: 1.6;
    color: #C7D3E0;
  }

  /* Hide the scroll cue on mobile — it overlaps the CTA buttons */
  .scroll-cue { display: none; }
}

/* Honor reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-halo, .scroll-cue-line, .eyebrow-dot { animation: none; }
}
