/* ===========================================================
   พาส อินโนเวชั่น ระบบปรับอากาศ VRV/VRF
   Path B (Claude Code) creative example Aesop + Stripe remix
   =========================================================== */

:root {
  --blue: #0097e0;
  --blue-deep: #0077b3;
  --navy: #004199;
  --navy-deep: #002c68;
  --white: #ffffff;
  --text: #0b2545;
  --text-soft: #4e6079;
  --bg-tint: rgba(0, 151, 224, 0.06);
  --bg-tint-strong: rgba(0, 151, 224, 0.12);
  --line: rgba(0, 65, 153, 0.14);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --space-1: clamp(0.5rem, 0.4rem + 0.4vw, 0.75rem);
  --space-2: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
  --space-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.75rem);
  --space-4: clamp(3rem, 2.2rem + 3vw, 5.5rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: "Noto Sans Thai", "Leelawadee UI", "Segoe UI", system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.6; margin: 0; font-weight: 800; overflow-wrap: anywhere; word-break: break-word; }

p { margin: 0; }

/* ---------------------------------------------------------
   Accessibility: skip link + focus visibility
   --------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--navy-deep);
  color: var(--white);
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

a, button, input, select, textarea, [tabindex] { outline: none; }

a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------
   Scroll progress
   --------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), #7fe3ff, var(--navy));
  box-shadow: 0 0 12px rgba(0, 151, 224, 0.6);
  z-index: 100;
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-1) var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  color: var(--navy);
  font-size: 1.05rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
}

.logo-mark img {
  display: block;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  gap: var(--space-1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.primary-nav.is-open { max-height: 320px; }

.primary-nav a {
  padding: 0.6rem 0;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.primary-nav a:last-child { border-bottom: none; }

.nav-cta {
  background: var(--navy);
  color: var(--white) !important;
  text-align: center;
  border-radius: 999px;
  padding: 0.7rem 1rem !important;
  margin-top: var(--space-1);
}

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    max-height: none;
    padding: 0;
    border: none;
    background: transparent;
    gap: var(--space-3);
  }
  .primary-nav a:not(.nav-cta) {
    position: relative;
    padding: 0;
    border: none;
    font-size: 0.95rem;
  }
  .primary-nav a:not(.nav-cta)::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--navy));
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
  }
  .nav-cta { margin-top: 0; padding: 0.55rem 1.3rem !important; }
}

@media (min-width: 860px) and (hover: hover) and (pointer: fine) {
  .primary-nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6rem) var(--space-2) clamp(6.5rem, 11vw, 9.5rem);
  min-height: clamp(420px, 58vw, 640px);
  background: linear-gradient(155deg, var(--blue) 0%, var(--navy) 62%, var(--navy-deep) 100%);
  overflow: hidden;
  isolation: isolate;
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 20, 48, 0.55) 0%, rgba(0, 20, 48, 0.28) 32%, rgba(0, 20, 48, 0.12) 55%, rgba(0, 20, 48, 0.32) 100%);
  z-index: -1;
}

.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;
}

.hero-grid { display: none; }

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
  animation: float 9s ease-in-out infinite;
}
.hero-orb-a {
  width: 340px; height: 340px;
  background: #7fe3ff;
  opacity: 0.45;
  top: -90px; right: -70px;
}
.hero-orb-b {
  width: 240px; height: 240px;
  background: var(--white);
  opacity: 0.18;
  bottom: -50px; left: -50px;
  animation-delay: -4s;
}
.hero-orb-c {
  width: 160px; height: 160px;
  background: var(--navy-deep);
  opacity: 0.35;
  top: 30%; left: 8%;
  animation-delay: -2s;
  animation-duration: 12s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-22px) scale(1.06); }
}

.hero-wave {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  line-height: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-wave svg { width: 100%; height: clamp(48px, 9vw, 96px); display: block; }
.hero-wave path { fill: var(--white); }

.hero-inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; text-align: center; }

.eyebrow, .section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--navy);
  background: var(--bg-tint-strong);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

.section-eyebrow.light { background: rgba(255,255,255,0.16); color: var(--white); }

.hero .eyebrow {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(6px);
}

.hero-headline {
  font-size: clamp(1.6rem, 1.1rem + 2.1vw, 2.5rem);
  color: var(--white);
  letter-spacing: 0;
  line-height: 1.7;
  text-shadow: 0 14px 34px rgba(0, 20, 60, 0.28);
  overflow-wrap: normal;
  word-break: normal;
}

.hero-sub {
  margin-top: var(--space-1);
  font-size: clamp(1rem, 0.92rem + 0.4vw, 1.2rem);
  font-weight: 600;
  color: var(--white);
  text-shadow: 0 10px 26px rgba(0, 20, 48, 0.55);
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

.hero .btn-primary {
  background: var(--white);
  color: var(--navy-deep);
  box-shadow: 0 16px 32px -14px rgba(0, 12, 40, 0.5);
}

.hero .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (hover: hover) and (pointer: fine) {
  .hero .btn-primary:hover { box-shadow: 0 20px 38px -14px rgba(0, 12, 40, 0.6); }
  .hero .btn-secondary:hover { background: rgba(255, 255, 255, 0.18); border-color: var(--white); }
}

.cta-group {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 14px 30px -12px rgba(0, 65, 153, 0.55);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--line);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -12px rgba(0, 65, 153, 0.65); }
  .btn-secondary:hover { transform: translateY(-3px); border-color: var(--navy); }
}

/* ---------------------------------------------------------
   Trust strip
   --------------------------------------------------------- */

.trust-strip {
  position: relative;
  z-index: 3;
  margin-top: clamp(-5.5rem, -8vw, -4rem);
  padding: 0 var(--space-2);
  margin-bottom: var(--space-1);
}

.trust-strip-inner {
  max-width: 1080px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy) 55%, var(--blue-deep));
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 60px -26px rgba(0, 44, 104, 0.5), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  color: var(--white);
  text-align: center;
}

@media (min-width: 720px) {
  .trust-strip-inner { grid-template-columns: repeat(4, 1fr); }
}

.trust-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: var(--space-3) var(--space-2);
}

.trust-item:not(:nth-child(2n))::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  right: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.16);
}

@media (min-width: 720px) {
  .trust-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 22%;
    bottom: 22%;
    right: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.16);
  }
}

.trust-item:nth-child(n+3)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

@media (min-width: 720px) {
  .trust-item:nth-child(n+3)::before { display: none; }
}

.trust-icon {
  width: 26px;
  height: 26px;
  color: var(--blue);
}

.trust-number-row { display: flex; align-items: baseline; gap: 2px; }

.trust-number {
  font-size: clamp(1.8rem, 1.45rem + 1.4vw, 2.5rem);
  font-weight: 800;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.trust-suffix { font-size: 1.2rem; font-weight: 800; color: var(--blue); }

.trust-label { font-size: 0.82rem; color: rgba(255, 255, 255, 0.78); max-width: 15ch; }

/* ---------------------------------------------------------
   Section head shared
   --------------------------------------------------------- */

.section-head { text-align: center; max-width: 640px; margin: 0 auto var(--space-3); }
.section-head h2 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.3rem); color: var(--navy-deep); }

section { padding: var(--space-4) var(--space-2); }

.services { background: linear-gradient(180deg, var(--bg-tint-strong), var(--white)); }

/* ---------------------------------------------------------
   About us
   --------------------------------------------------------- */

.about-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 860px) {
  .about-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); align-items: stretch; }
}

.about-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.about-card-title {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--navy-deep);
}

.about-card-sub {
  margin-top: -0.8rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-deep);
}

.about-card p { color: var(--text-soft); line-height: 1.75; }

.about-card .scope-list { margin-top: 0.2rem; }
.about-card .scope-list em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* ---------------------------------------------------------
   Why us
   --------------------------------------------------------- */

.services-grid {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-1);
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
  }
}

.service-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  transition: opacity 0.8s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.08s);
}

.service-card--tint { background: linear-gradient(160deg, var(--bg-tint) 0%, var(--white) 65%); }

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--blue), var(--navy) 55%, transparent 85%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.service-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--navy));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.service-ghost {
  position: absolute;
  top: -0.3em;
  right: 0.5rem;
  font-size: clamp(3rem, 2.5rem + 2vw, 4.6rem);
  font-weight: 800;
  color: var(--navy);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.service-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--blue), var(--navy));
  color: var(--white);
  box-shadow: 0 18px 32px -14px rgba(0, 65, 153, 0.55);
  transition: transform 0.4s var(--ease);
}
.service-icon svg { width: 34px; height: 34px; }

.service-icon::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 151, 224, 0.35), transparent 72%);
  opacity: 0.6;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.service-card h3 {
  margin-top: var(--space-2);
  font-size: 1.05rem;
  color: var(--navy-deep);
  transition: color 0.3s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .service-card:hover {
    transition-delay: 0s;
    transform: translateY(-8px);
    box-shadow: 0 30px 50px -26px rgba(0, 65, 153, 0.32);
    border-color: transparent;
  }
  .service-card:hover::after { opacity: 1; }
  .service-card:hover::before { transform: scaleX(1); }
  .service-card:hover .service-icon { transform: scale(1.08) rotate(-4deg); }
  .service-card:hover .service-icon::before { opacity: 1; transform: scale(1.15); }
  .service-card:hover h3 { color: var(--blue-deep); }
}

@media (max-width: 639px) {
  .service-card {
    padding: var(--space-2) var(--space-1);
  }
  .service-icon { width: 52px; height: 52px; }
  .service-icon svg { width: 24px; height: 24px; }
  .service-card h3 { margin-top: 0.6rem; font-size: 0.88rem; }
  .service-ghost { font-size: 2.4rem; top: -0.2em; right: 0.3rem; }
}

.why { position: relative; isolation: isolate; }

.why::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
}

.why-grid {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 0.3rem 0.3rem 0.9rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.why-grid::-webkit-scrollbar { height: 5px; }
.why-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

@media (min-width: 720px) {
  .why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    overflow: visible;
    padding: 0;
  }
}

.why-card {
  position: relative;
  overflow: hidden;
  flex: 0 0 68%;
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

@media (min-width: 720px) {
  .why-card { flex: unset; }
}

.why-card--featured { background: linear-gradient(160deg, var(--bg-tint) 0%, var(--white) 60%); }

.why-ghost {
  position: absolute;
  top: -0.4em;
  right: 0.4rem;
  font-size: clamp(3.5rem, 3rem + 2vw, 5.5rem);
  font-weight: 800;
  color: var(--navy);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
}

.why-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: linear-gradient(155deg, var(--blue), var(--navy));
  color: var(--white);
  box-shadow: 0 12px 22px -12px rgba(0, 65, 153, 0.55);
  transition: transform 0.35s var(--ease);
}
.why-badge svg { width: 26px; height: 26px; }

.why-card h3 {
  position: relative;
  margin-top: var(--space-2);
  font-size: 1.15rem;
  color: var(--navy-deep);
}
.why-card p { position: relative; margin-top: 0.6rem; color: var(--text-soft); max-width: 42ch; }

@media (max-width: 719px) {
  .why-card { flex-basis: 78%; padding: var(--space-2); border-radius: var(--radius-md); }
  .why-ghost { font-size: 2.6rem; top: -0.2em; right: 0.3rem; }
  .why-badge { width: 42px; height: 42px; }
  .why-badge svg { width: 20px; height: 20px; }
  .why-card h3 { margin-top: 0.8rem; font-size: 0.98rem; }
  .why-card p { margin-top: 0.4rem; font-size: 0.82rem; line-height: 1.55; }
}

/* ---------------------------------------------------------
   Portfolio gallery
   --------------------------------------------------------- */

.portfolio { background: linear-gradient(180deg, #ffffff, #f4fbff); }

.gallery-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-1);
}

@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.image-slot {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.32) 1px, transparent 0) 0 0 / 20px 20px,
    linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-1);
  border: none;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.image-slot:focus-visible {
  transform: scale(1.015);
  box-shadow: 0 20px 40px -20px rgba(0, 65, 153, 0.5);
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.image-slot::before,
.image-slot::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(255, 255, 255, 0.85);
  border-style: solid;
  border-width: 0;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.image-slot::before { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; border-radius: 4px 0 0 0; }
.image-slot::after { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; border-radius: 0 0 4px 0; }

@media (hover: hover) and (pointer: fine) {
  .image-slot:hover {
    transform: scale(1.015);
    box-shadow: 0 20px 40px -20px rgba(0, 65, 153, 0.5);
  }
  .image-slot:hover::before,
  .image-slot:hover::after { opacity: 1; }
}

.image-slot.ratio-1-1 { aspect-ratio: 1 / 1; }

.slot-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.slot-hint {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(0, 33, 79, 0.45);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.image-slot:focus-visible .slot-hint { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .image-slot:hover .slot-hint { opacity: 1; }
}

.slot-caption {
  position: relative;
  z-index: 2;
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(0, 44, 104, 0.55);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.image-slot:focus-visible .slot-caption { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .image-slot:hover .slot-caption { opacity: 1; }
}

/* ---------------------------------------------------------
   Project detail pages (pages/portfolio-*.html)
   --------------------------------------------------------- */

.project-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 860px) {
  .project-page { flex-direction: row; align-items: flex-start; gap: var(--space-3); }
}

/* Sidebar: switch between work categories */

.project-sidebar {
  flex: 0 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2);
}

@media (min-width: 860px) {
  .project-sidebar { flex: 0 0 240px; position: sticky; top: 96px; }
}

.project-sidebar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
  margin: 0 0 var(--space-1);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--line);
}

.project-sidebar-list {
  display: flex;
  flex-direction: column;
}

.project-sidebar-link {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.72rem 0.15rem;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.project-sidebar-list > :last-child { border-bottom: none; }

.project-sidebar-index {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.project-sidebar-arrow {
  margin-left: auto;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

/* Current page: shown in the same list, not linked, marked as active */
.project-sidebar-link.is-current {
  color: var(--navy);
  background: var(--bg-tint-strong);
  font-weight: 700;
  border-left-color: var(--blue-deep);
  padding-left: 0.55rem;
  border-radius: 4px;
  cursor: default;
}
.project-sidebar-link.is-current .project-sidebar-index { color: var(--blue-deep); }

@media (hover: hover) and (pointer: fine) {
  .project-sidebar-link:not(.is-current):hover {
    color: var(--navy);
    border-left-color: var(--navy);
    padding-left: 0.55rem;
  }
  .project-sidebar-link:not(.is-current):hover .project-sidebar-index { color: var(--blue-deep); }
  .project-sidebar-link:not(.is-current):hover .project-sidebar-arrow { opacity: 1; transform: translateX(0); }
}

/* Main column */

.project-main { flex: 1 1 auto; min-width: 0; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: var(--space-3);
}
.breadcrumb a { color: var(--blue-deep); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .breadcrumb a:hover { color: var(--navy); }
}
.breadcrumb [aria-current="page"] { color: var(--navy-deep); font-weight: 700; }

.project-page .section-head { text-align: left; margin: 0; max-width: 68ch; }
.project-page .section-head h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.3rem); color: var(--navy-deep); }
.project-desc { margin-top: var(--space-1); color: var(--text-soft); }

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.gallery-stage {
  position: relative;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tint);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 260px;
}

.gallery-stage-img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  transition: opacity 0.2s var(--ease);
}

/* Photos keep their full original resolution (some are several MB), so a
   click needs an immediate loading cue while the big image downloads. */
.gallery-stage::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid var(--bg-tint-strong);
  border-top-color: var(--blue);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.project-gallery.is-loading .gallery-stage-img { opacity: 0.35; }
.project-gallery.is-loading .gallery-stage::after {
  opacity: 1;
  animation: gallery-spin 0.8s linear infinite;
}

@keyframes gallery-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .project-gallery.is-loading .gallery-stage::after { animation: none; }
}

.gallery-thumbs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: 96px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: none;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--blue); }
.gallery-thumb:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .gallery-thumb:not(.is-active):hover { border-color: var(--line); transform: translateY(-2px); }
}

@media (min-width: 640px) {
  .gallery-thumb { width: 128px; }
  .gallery-stage-img { max-height: 620px; }
}

.image-slot.ratio-16-9 { aspect-ratio: 16 / 9; }

.image-slot--static { cursor: default; }
.image-slot--static:focus { outline: none; }
@media (hover: hover) and (pointer: fine) {
  .image-slot--static:hover { transform: none; box-shadow: none; }
  .image-slot--static:hover::before,
  .image-slot--static:hover::after { opacity: 0; }
}

.project-cta { margin-top: var(--space-3); text-align: center; }

@media (min-width: 860px) {
  .project-cta { text-align: left; }
}

/* ---------------------------------------------------------
   Service detail pages (pages/service-*.html)
   --------------------------------------------------------- */

.service-hero { max-width: 68ch; }

.service-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--blue), var(--navy));
  color: var(--white);
  box-shadow: 0 18px 32px -14px rgba(0, 65, 153, 0.55);
  margin-bottom: var(--space-2);
}
.service-hero-icon svg { width: 30px; height: 30px; }

.service-hero h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.3rem);
  color: var(--navy-deep);
}

.service-detail-block { margin-top: var(--space-3); max-width: 68ch; }

.service-detail-title {
  font-size: clamp(1.1rem, 0.98rem + 0.5vw, 1.3rem);
  color: var(--navy-deep);
  margin-bottom: var(--space-2);
}

.service-block-desc { color: var(--text-soft); line-height: 1.75; }
.service-block-desc + .service-block-desc { margin-top: var(--space-1); }
.service-block-desc + .system-tag-grid { margin-top: 0.7rem; }

.scope-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.scope-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--line);
}
.scope-list li:last-child { border-bottom: none; }

.scope-list svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  color: var(--blue);
}

.scope-list span { color: var(--text); line-height: 1.65; }

.process-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.process-steps > li {
  position: relative;
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  padding-bottom: var(--space-3);
}
.process-steps > li:last-child { padding-bottom: 0; }

/* connecting timeline line between step numbers */
.process-steps > li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--blue) 0, var(--blue) 5px, transparent 5px, transparent 11px);
  opacity: 0.4;
}

.process-step-num {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--blue), var(--navy));
  color: var(--white);
  font-weight: 800;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px var(--white), 0 10px 20px -10px rgba(0, 65, 153, 0.5);
}

.process-steps > li > div {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  margin-top: -0.2rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .process-steps > li > div:hover {
    border-color: var(--blue);
    box-shadow: 0 16px 32px -20px rgba(0, 65, 153, 0.45);
    transform: translateY(-2px);
  }
}

.process-steps h3 { font-size: 1rem; color: var(--navy-deep); }
.process-steps p { margin-top: 0.25rem; color: var(--text-soft); font-size: 0.9rem; line-height: 1.65; }

.service-hero-subtitle {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.system-tag-grid {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.system-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-tint-strong);
  color: var(--navy-deep);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.service-highlight {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--bg-tint) 0%, var(--white) 60%);
}

.service-highlight svg {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--blue);
  margin-top: 0.15rem;
}

.service-highlight p { color: var(--text); line-height: 1.75; }
.service-highlight strong { color: var(--navy-deep); }

.subsystem-grid {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.8rem;
}
.service-block-desc + .subsystem-grid { margin-top: 0.7rem; }

.subsystem-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .subsystem-card:hover {
    border-color: var(--blue);
    box-shadow: 0 16px 32px -20px rgba(0, 65, 153, 0.45);
    transform: translateY(-2px);
  }
}

.subsystem-card h3 { font-size: 1rem; color: var(--navy-deep); }
.subsystem-card p { margin-top: 0.25rem; color: var(--text-soft); font-size: 0.9rem; line-height: 1.65; }

.service-flow {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.service-flow-step {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--bg-tint-strong);
  color: var(--navy-deep);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.service-flow-arrow {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--blue);
  opacity: 0.6;
}

.service-flow + .service-block-desc { margin-top: var(--space-2); }

.service-quote {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--blue);
  background: var(--bg-tint);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--navy-deep);
  font-weight: 700;
  font-style: italic;
  line-height: 1.7;
}

/* ---------------------------------------------------------
   Partner (Thermobreak distributor)
   --------------------------------------------------------- */

.partner-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(160deg, var(--bg-tint) 0%, var(--white) 60%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
}

.partner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: var(--bg-tint-strong);
  color: var(--navy-deep);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.partner-badge svg { width: 16px; height: 16px; flex: 0 0 auto; }

.partner-logo {
  display: block;
  margin: var(--space-3) auto 0;
  width: 100%;
  max-width: 260px;
  height: auto;
}

.partner-lead {
  margin: var(--space-3) auto 0;
  max-width: 56ch;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-deep);
  line-height: 1.65;
}

.partner-desc {
  margin: var(--space-1) auto 0;
  max-width: 60ch;
  color: var(--text-soft);
  line-height: 1.75;
}

.partner-highlight {
  margin: var(--space-2) auto 0;
  max-width: 56ch;
  padding: var(--space-1) var(--space-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--navy-deep);
  font-weight: 700;
  line-height: 1.6;
}

/* ---------------------------------------------------------
   Contact CTA
   --------------------------------------------------------- */

.contact-cta {
  position: relative;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.contact-cta h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); color: var(--navy-deep); }
.contact-cta p { margin-top: var(--space-1); color: var(--text-soft); }

.contact-channels {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.channel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.channel-link svg { width: 18px; height: 18px; color: var(--blue-deep); }
@media (hover: hover) and (pointer: fine) {
  .channel-link:hover { background: var(--bg-tint); transform: translateY(-2px); border-color: var(--blue); }
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
  position: relative;
  padding: var(--space-4) var(--space-2) var(--space-2);
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.88rem;
  background: var(--bg-tint);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}

.footer-bar {
  max-width: 1240px;
  margin: 0 auto;
}

.footer-bar--home {
  max-width: 1080px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  row-gap: 0.5rem;
}
.footer-row + .footer-row {
  margin-top: 0.6rem;
}

.footer-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.9rem;
  border-right: 1px solid var(--line);
  line-height: 1;
  white-space: nowrap;
}
.footer-row .footer-item:last-child { border-right: none; }

.footer-brand-item {
  font-weight: 800;
  color: var(--navy-deep);
}
.footer-brand-item .logo-mark { color: var(--blue); display: inline-flex; }

.footer-link { color: var(--text-soft); transition: color 0.25s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .footer-link:hover { color: var(--navy); }
}

.footer-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--blue);
}

@media (max-width: 719px) {
  .footer-item { white-space: normal; padding: 0 0.6rem; font-size: 0.82rem; }
  .footer-icon { width: 13px; height: 13px; }
}

.footer-bottom {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.78rem;
}
.footer-bottom p { margin: 0; }

/* cnc-404 */
.cnc-404 { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px 20px; font-family: "Noto Sans Thai", "Leelawadee UI", "Segoe UI", system-ui, sans-serif; background: var(--white); color: var(--text); }
.cnc-404__code { font-size: 64px; font-weight: 800; margin: 0; color: var(--blue); }
.cnc-404__title { font-size: 24px; margin: 0; color: var(--navy-deep); }
.cnc-404__text { opacity: .7; margin: 0; }
.cnc-404__home { margin-top: 16px; padding: 12px 24px; text-decoration: none; font-weight: 700; border-radius: 999px; color: var(--white); background: var(--navy); }

/* cnc-style tokens (web-style) */
[data-cnc-style]{
  --cs-accent: #004199;
  --cs-accent-d: #002c68;
  --cs-ink: #0b2545;
  --cs-bg: #ffffff;
  --cs-radius: 10px;
}

/* cnc-style:heading:rule */
h1[data-cnc-style="heading:rule"] {
  padding-left: 16px;
  border-left: 4px solid var(--cs-accent);
}
/* end cnc-style:heading:rule */

/* cnc-style:badge:solid */
.service-hero-subtitle[data-cnc-style] {
  display: inline-flex;
  align-items: center;
  background: var(--cs-accent);
  color: #fff;
  padding: 6px 13px;
  border-radius: 999px;
}
/* end cnc-style:badge:solid */

/* cnc-style:card:shadow */
.about-card[data-cnc-style] {
  background: var(--bg-tint);
  border: 1px solid color-mix(in srgb, var(--cs-ink) 8%, transparent);
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--cs-ink) 50%, transparent);
}
/* end cnc-style:card:shadow */
