:root {
  --brand: #f58220;
  --brand-dark: #d66e12;
  --ink: #f2f2f0;
  --muted: #9a9aa3;
  --line: rgba(255, 255, 255, 0.08);
  --bg-base-0: #0f1412;
  --bg-base-1: #1b2621;
  --bg-base-2: #101614;
  --bg-glow-a: #2d6a4f;
  --bg-glow-b: #9c4a1f;
  --white: #ffffff;
  --font: "Kanit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-base-0);
  line-height: 1.55;
  position: relative;
  min-height: 100%;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, var(--bg-glow-a) 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 0%, var(--bg-glow-b) 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-base-0), var(--bg-base-1) 45%, var(--bg-base-2));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #1a1a1a;
  text-decoration: none;
}
.brand:visited,
.brand:hover,
.brand:active {
  color: #1a1a1a;
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 40px;
  line-height: 1.05;
}
.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.brand-tagline {
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.01em;
  color: #4a4a52;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
}
.nav a {
  color: #5c5c66;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav a:visited { color: #5c5c66; }
.nav a:hover { color: var(--brand); }
.lang-switch {
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  font-size: 0.85rem;
  color: #1a1a1a;
  text-decoration: none;
}
.lang-switch:visited { color: #1a1a1a; }
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }

.hero {
  position: relative;
  min-height: min(78vh, 640px);
  background: transparent;
  overflow: hidden;
}

.logo-marquee {
  background: #ffffff;
  overflow: hidden;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  --logo-h: 120px;
  --logo-speed: 3s;
  --logo-row-gap: 12px;
  --logo-fade: 48px;
  display: flex;
  flex-direction: column;
  gap: var(--logo-row-gap, 12px);
}
.logo-marquee-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 var(--logo-fade, 48px),
    #000 calc(100% - var(--logo-fade, 48px)),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 var(--logo-fade, 48px),
    #000 calc(100% - var(--logo-fade, 48px)),
    transparent
  );
}
.logo-marquee-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
}
.logo-marquee.is-smooth .logo-marquee-track {
  animation: logo-marquee-scroll var(--logo-speed, 35s) linear infinite;
  transition: none;
}
.logo-marquee-track img {
  height: var(--logo-h, 120px);
  width: auto;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
}
@keyframes logo-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-marquee-track { transition: none !important; }
  .logo-marquee.is-smooth .logo-marquee-track { animation: none; }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 130, 32, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 130, 32, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.5;
}

.carousel {
  position: relative;
  min-height: min(78vh, 640px);
}
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  display: grid;
  align-items: end;
  padding: 4rem 1.5rem 5rem;
  background-size: cover;
  background-position: center;
}
.carousel-slide.is-active { opacity: 1; z-index: 1; }
.carousel-slide.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 10, 14, 0.85), rgba(8, 10, 14, 0.35) 50%, transparent);
}
.carousel-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
}
.carousel-slide h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.carousel-slide p {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  max-width: 36rem;
  color: rgba(242, 242, 240, 0.85);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn:hover { background: var(--brand-dark); }
.carousel-dots {
  position: absolute;
  z-index: 3;
  left: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  gap: 0.45rem;
}
.carousel-dots button {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
}
.carousel-dots button.is-active {
  background: var(--brand);
  width: 1.4rem;
}

.section {
  padding: 4.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
}
.section .lead {
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

.section-split {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 800px) {
  .section-split {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .section-split.reverse {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .section-split.reverse .section-copy { order: 2; }
  .section-split.reverse .section-media { order: 1; }
}
.section-media img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 360px;
  border: 1px solid var(--line);
}

.section-carousel {
  position: relative;
  width: 100%;
  min-height: 240px;
  height: 360px;
  max-height: 360px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.section-carousel .section-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  background-size: cover;
  background-position: center;
  padding: 0;
}
.section-carousel .section-carousel-slide.is-active { opacity: 1; z-index: 1; }
.section-carousel .section-carousel-slide.has-image::after { display: none; }
.section-carousel .carousel-dots {
  left: 0.75rem;
  bottom: 0.75rem;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.service-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}

.expertise-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.expertise-grid h3 {
  margin: 0 0 0.75rem;
  color: var(--brand);
  font-size: 1.1rem;
}
.expertise-grid ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.work-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.work-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}
.work-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
}
.contact-meta {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}

.site-footer {
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 720px) {
  .nav { display: none; }
  .mobile-nav {
    display: flex;
    gap: 0.75rem;
    padding: 0.35rem 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  .mobile-nav a { color: #5c5c66; text-decoration: none; }
  .mobile-nav a:visited { color: #5c5c66; }
  .mobile-nav a:hover { color: var(--brand); }
}
@media (min-width: 721px) {
  .mobile-nav { display: none; }
}
