:root {
  --red: #c40000;
  --red-dark: #8d0000;
  --navy: #061523;
  --navy-soft: #09243b;
  --ink: #06111d;
  --muted: #66717d;
  --line: #e3e6ea;
  --panel: #ffffff;
  --soft: #f3f5f7;
  --shadow: 0 16px 36px rgba(2, 12, 22, .12);
  --radius: 6px;
}

@font-face {
  font-family: "Noto Sans Thai";
  src: url("assets/fonts/NotoSansThai-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "Noto Sans Thai", Tahoma, Arial, sans-serif;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 74px;
  padding: 0 40px;
  color: #fff;
  background: linear-gradient(90deg, #06111d, #09243b);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 5px solid var(--red);
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at center, transparent 48%, #fff 49%, #fff 54%, transparent 55%),
    #a10000;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  animation: markPulse 4.8s ease-in-out infinite;
}

.brand strong {
  display: block;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.05;
}

.brand small {
  display: block;
  color: #dce5ee;
  font-size: 13px;
}

.main-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.main-nav a {
  position: relative;
  padding: 27px 18px 24px;
  color: #f4f7fb;
  font-weight: 700;
  white-space: nowrap;
  transition: color .22s ease;
}

.main-nav a::after {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  background: transparent;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: background .22s ease, transform .22s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: #ff2020;
}

.main-nav a.active::after {
  background: var(--red);
  transform: scaleX(1);
}

.main-nav a:hover::after {
  background: var(--red);
  transform: scaleX(1);
}

.socials {
  display: flex;
  gap: 14px;
}

.social,
.big {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
}

.social {
  width: 34px;
  height: 34px;
  font-size: 20px;
  transition: transform .22s ease, filter .22s ease;
}

.social:hover {
  filter: brightness(1.15);
  transform: translateY(-2px) scale(1.06);
}

.fb {
  background: #1d65b7;
}

.line {
  background: #03bc26;
  font-size: 10px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 7px 6px;
  background: #fff;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 455px;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: #05080b;
}

.inner-hero {
  min-height: 335px;
}

.image-crop::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("assets/cnc-parts-collage.png");
  background-size: 1600px auto;
  background-repeat: no-repeat;
  filter: saturate(.85) contrast(1.1);
  content: "";
  transform: scale(1.04);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.image-crop::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .96) 0%, rgba(0, 0, 0, .76) 38%, rgba(0, 0, 0, .2) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .05));
  content: "";
}

.pos-a::before { background-position: center 13%; }
.pos-b::before { background-position: center 56%; }
.pos-c::before { background-position: center 24%; }
.pos-d::before { background-position: right 44%; }
.pos-e::before { background-position: center 76%; }
.pos-f::before { background-position: right 18%; }

.hero-content {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  animation: heroTextIn .75s ease-out both;
}

.eyebrow {
  margin: 0 0 8px;
  color: #cfd8e3;
  font-weight: 700;
}

.hero h1 {
  max-width: 720px;
  margin: 0 0 18px;
  font-size: clamp(48px, 7vw, 78px);
  line-height: .98;
  letter-spacing: 0;
  text-shadow: 0 4px 12px rgba(0, 0, 0, .7);
}

.hero h1 span {
  color: #f20d0d;
}

.hero h1::after,
.section-heading h2::after,
.map-section h2::after {
  display: block;
  width: 116px;
  height: 3px;
  margin-top: 18px;
  background: var(--red);
  content: "";
}

.lead {
  max-width: 630px;
  margin: 0 0 26px;
  font-size: clamp(20px, 2.7vw, 30px);
  font-weight: 700;
}

.lead strong {
  color: #ff1717;
}

.hero-actions,
.wide-contact div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  transform: translateZ(0);
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .26);
}

.btn:active {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(#d20000, #9f0000);
}

.btn-secondary {
  background: linear-gradient(#123b63, #08243e);
}

.btn-line {
  background: linear-gradient(#08d12f, #038d22);
}

.btn-muted {
  background: linear-gradient(#6a6f76, #424950);
}

.btn.compact {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.section {
  padding: 34px clamp(20px, 5vw, 50px);
}

.section-heading {
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.section-heading h2,
.section-title-line h2,
.map-section h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.1;
}

.section-heading h2::after {
  width: 52px;
  margin: 12px auto 0;
}

.service-grid,
.category-grid,
.product-grid,
.process-grid,
.contact-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.service-card,
.category-card,
.product-card,
.process-grid article,
.contact-cards article {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform .28s ease, box-shadow .28s ease;
}

.service-card:hover,
.category-card:hover,
.product-card:hover,
.process-grid article:hover,
.contact-cards article:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 44px rgba(2, 12, 22, .2);
}

.service-card {
  position: relative;
  padding-bottom: 24px;
  text-align: center;
}

.service-card img,
.category-card img,
.product-card img,
.gallery-grid img,
.work-strip img {
  height: 166px;
  object-fit: cover;
  filter: grayscale(.55) contrast(1.08);
  transition: filter .32s ease, transform .32s ease;
}

.service-card:hover img,
.category-card:hover img,
.product-card:hover img,
.gallery-grid figure:hover img,
.work-strip figure:hover img {
  filter: grayscale(.22) contrast(1.16);
  transform: scale(1.045);
}

.service-card:nth-child(1) img,
.category-card:nth-child(1) img,
.product-card:nth-child(6) img { object-position: 10% 8%; }
.service-card:nth-child(2) img,
.category-card:nth-child(2) img,
.product-card:nth-child(4) img { object-position: 50% 8%; }
.service-card:nth-child(3) img,
.gallery-grid figure:nth-child(10) img { object-position: 90% 42%; }
.service-card:nth-child(4) img,
.category-card:nth-child(6) img { object-position: 10% 84%; }

.service-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: -29px auto 12px;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-size: 22px;
  font-weight: 900;
  position: relative;
  transition: transform .25s ease, background .25s ease;
}

.service-card:hover .service-icon {
  background: #e00000;
  transform: rotate(10deg) scale(1.06);
}

.service-card h2,
.category-card strong,
.product-card h3,
.process-grid h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.18;
}

.service-card p {
  margin: 8px 18px 0;
}

.dark-section {
  color: #fff;
  background:
    radial-gradient(circle at 25% 0, rgba(15, 52, 79, .55), transparent 42%),
    linear-gradient(115deg, #050a0f, #11171b 48%, #071827);
}

.work-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

figure {
  margin: 0;
}

.work-strip figure,
.gallery-grid figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b1117;
  transition: transform .28s ease, box-shadow .28s ease;
}

.work-strip figure:hover,
.gallery-grid figure:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .3);
}

.work-strip figcaption,
.gallery-grid figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  font-weight: 900;
  text-align: center;
}

.split-cta,
.banner-cta,
.drawing-cta,
.wide-contact {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 44px clamp(24px, 8vw, 112px);
  color: #fff;
  isolation: isolate;
}

.split-cta > div,
.banner-cta > *,
.drawing-cta > *,
.wide-contact > * {
  position: relative;
  z-index: 1;
}

.split-cta h2,
.banner-cta h2,
.drawing-cta h2,
.wide-contact h2 {
  max-width: 540px;
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.1;
}

.split-cta p,
.banner-cta p,
.drawing-cta p,
.wide-contact p {
  max-width: 460px;
  margin: 0 0 18px;
  font-size: 22px;
}

.split-cta small {
  display: block;
  margin-top: 14px;
  color: #dfe9f3;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.feature-row article {
  padding: 16px 18px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.feature-row article:first-child {
  border-left: 0;
}

.feature-row strong,
.feature-row span {
  display: block;
}

.feature-row strong {
  color: #8f0000;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.6fr .8fr 1.1fr 1.2fr;
  gap: 38px;
  padding: 40px clamp(24px, 6vw, 78px) 0;
  color: #fff;
  background: linear-gradient(90deg, #9b0000, #6c0000);
}

.site-footer h3 {
  margin: 0 0 10px;
}

.site-footer a:not(.brand):not(.btn) {
  display: block;
  color: #f2f4f7;
  margin: 4px 0;
}

.site-footer p {
  color: #f1f4f8;
}

.copyright {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

.mini-footer,
.contact-band {
  padding: 16px 24px;
  color: #fff;
  background: linear-gradient(90deg, #9b0000, #c00000);
  text-align: center;
}

.category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-card {
  position: relative;
  min-height: 260px;
}

.category-card.wide {
  grid-column: span 1;
}

.category-card::after {
  position: absolute;
  right: 26px;
  bottom: 28px;
  color: var(--red);
  font-size: 28px;
  content: "→";
}

.category-card strong,
.category-card span {
  display: block;
  padding-left: 82px;
}

.category-card strong {
  margin-top: 24px;
}

.category-card span {
  color: #202a34;
}

.section-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}

.product-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.product-card {
  padding-bottom: 18px;
  color: var(--ink);
  text-align: center;
}

.product-card img {
  height: 170px;
}

.product-card h3 {
  margin: 14px 10px 6px;
  font-size: 18px;
}

.product-card p {
  min-height: 58px;
  margin: 0 10px 10px;
}

.banner-cta,
.drawing-cta {
  width: min(1180px, 100%);
  margin: 28px auto 0;
  border-radius: var(--radius);
}

.process-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px;
}

.process-grid article {
  position: relative;
  min-height: 235px;
  padding: 48px 22px 22px;
  text-align: center;
}

.process-grid article span {
  position: absolute;
  left: 50%;
  top: -18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font-weight: 900;
  transform: translateX(-50%);
}

.process-grid article::before {
  display: block;
  margin: 0 auto 18px;
  color: #46515c;
  font-size: 56px;
  line-height: 1;
  content: "▣";
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.gallery-grid img {
  height: 170px;
}

.drawing-cta {
  min-height: 285px;
}

.drawing-cta ul {
  margin: 0 0 22px;
  padding-left: 20px;
}

.contact-cards article {
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 260px;
  padding: 32px 20px 24px;
  text-align: center;
}

.big {
  width: 74px;
  height: 74px;
  margin-bottom: 18px;
  font-size: 34px;
}

.big.line {
  font-size: 16px;
}

.phone {
  background: #b80000;
}

.mail {
  background: #5b6268;
}

.contact-cards small {
  color: var(--muted);
}

.contact-cards h3 {
  margin: 6px 0 20px;
  font-size: 24px;
  line-height: 1.28;
}

.map-section {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 520px;
}

.map-section aside {
  padding: 38px 44px;
  color: #fff;
  background: linear-gradient(145deg, #05111e, #082b49);
}

.map-section h2::after {
  width: 60px;
  margin-top: 12px;
}

.info-block {
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
}

.info-block:last-child {
  border-bottom: 0;
}

.info-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.info-block p {
  margin: 0;
}

.map-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(30deg, transparent 47%, #9ebbd6 48%, #9ebbd6 52%, transparent 53%),
    linear-gradient(-18deg, transparent 46%, #719abd 47%, #719abd 53%, transparent 54%),
    linear-gradient(90deg, rgba(30, 84, 129, .12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(30, 84, 129, .12) 1px, transparent 1px),
    #edf4fb;
  background-size: auto, auto, 72px 72px, 72px 72px, auto;
}

.road {
  position: absolute;
  color: #325779;
  font-weight: 900;
}

.main-road {
  left: 38%;
  bottom: 37%;
  transform: rotate(-18deg);
}

.cross-road {
  left: 45%;
  top: 20%;
  transform: rotate(30deg);
}

.pin {
  position: absolute;
  left: 45%;
  top: 43%;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  background: var(--red);
  transform: rotate(-45deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  animation: pinDrop .7s ease-out both, pinBeat 2.4s ease-in-out .9s infinite;
}

.pin::after {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.map-label {
  position: absolute;
  left: 52%;
  top: 37%;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.map-visual .btn {
  position: absolute;
  right: 32px;
  bottom: 32px;
}

.wide-contact {
  min-height: 270px;
}

.contact-band {
  display: flex;
  justify-content: center;
  gap: 48px;
  background: #f7f8fa;
  color: var(--ink);
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
    padding: 0 20px;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 74px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
    background: #061523;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 14px 4px;
  }

  .main-nav a::after {
    left: 0;
    right: auto;
    width: 70px;
  }

  .service-grid,
  .category-grid,
  .contact-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid,
  .work-strip,
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .process-grid,
  .feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer,
  .map-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 68px;
    gap: 10px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small,
  .socials {
    display: none;
  }

  .main-nav {
    top: 68px;
  }

  .hero,
  .inner-hero {
    min-height: 390px;
  }

  .hero-content {
    width: min(100% - 36px, 1180px);
  }

  .hero h1 {
    font-size: 46px;
  }

  .lead {
    font-size: 20px;
  }

  .section {
    padding: 30px 18px;
  }

  .service-grid,
  .category-grid,
  .product-grid,
  .process-grid,
  .work-strip,
  .gallery-grid,
  .contact-cards,
  .feature-row {
    grid-template-columns: 1fr;
  }

  .feature-row article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .feature-row article:first-child {
    border-top: 0;
  }

  .section-title-line,
  .contact-band {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .map-section aside {
    padding: 30px 24px;
  }

  .map-visual {
    min-height: 420px;
  }

  .map-label {
    left: 22%;
    right: 20px;
    top: 34%;
  }

  .wide-contact,
  .split-cta,
  .banner-cta,
  .drawing-cta {
    padding: 34px 22px;
  }
}

.reveal-item {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .58s ease, transform .58s ease;
  transition-delay: calc(var(--reveal-index, 0) * 70ms);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.service-card.reveal-item.is-visible:hover,
.category-card.reveal-item.is-visible:hover,
.product-card.reveal-item.is-visible:hover,
.process-grid article.reveal-item.is-visible:hover,
.contact-cards article.reveal-item.is-visible:hover {
  transform: translateY(-7px);
}

.work-strip figure.reveal-item.is-visible:hover,
.gallery-grid figure.reveal-item.is-visible:hover {
  transform: translateY(-5px);
}

.section-heading,
.section-title-line {
  animation: titleIn .62s ease-out both;
  animation-timeline: view();
  animation-range: entry 0% cover 34%;
}

@keyframes heroTextIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.04) translate3d(-10px, -6px, 0);
  }
  to {
    transform: scale(1.08) translate3d(12px, 8px, 0);
  }
}

@keyframes markPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(196, 0, 0, .28);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(196, 0, 0, 0);
  }
}

@keyframes pinDrop {
  from {
    opacity: 0;
    transform: translateY(-22px) rotate(-45deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-45deg);
  }
}

@keyframes pinBeat {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(0, 0, 0, .28), 0 0 0 0 rgba(196, 0, 0, .34);
  }
  50% {
    box-shadow: 0 8px 20px rgba(0, 0, 0, .28), 0 0 0 12px rgba(196, 0, 0, 0);
  }
}

@keyframes titleIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .reveal-item {
    opacity: 1;
    transform: none;
  }
}
