/* ===== Nineplus Engineering — สีและฟอนต์ตาม Company Profile 2026 (แก้ที่นี่ที่เดียว) ===== */
:root {
  --navy: #214499;        /* สีหลัก (สีโลโก้) */
  --navy-dark: #19357A;
  --indigo: #262262;      /* น้ำเงินเข้มสุด */
  --steel: #5E78B5;       /* แถบเฉียงโทนกลาง */
  --sky: #6288CD;
  --azure: #226AB3;
  --light: #609ED0;
  --tint: #EEF1F8;        /* พื้นหลังอ่อน */
  --tint-2: #E3E8F4;
  --ink: #1D2340;         /* ตัวอักษรหลัก */
  --ink-2: #4A5170;       /* ตัวอักษรรอง */
  --line: #DCE1EE;
  --white: #FFFFFF;
  --radius: 4px;
  --max: 1200px;
  --font-head: 'Prompt', sans-serif;
  --font-body: 'Sarabun', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--white); line-height: 1.65; font-size: 16px; overflow-x: hidden; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
/* สลับภาษา: ซ่อนภาษาที่ไม่ได้เลือก */
html.lang-en .th, html:not(.lang-en) .en { display: none !important; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.3; color: var(--navy); }
p { margin: 0; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; position: relative; }

/* หัวข้อแบบ PROJECT REFERENCE ในโปรไฟล์ */
.eyebrow { font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--azure); margin-bottom: 10px; }
.section-title { font-weight: 700; font-size: clamp(28px, 4vw, 38px); }
.section-title::after { content: ''; display: block; width: 72px; height: 4px; background: var(--navy); margin-top: 18px; }
.center { text-align: center; }
.center .section-title::after { margin-left: auto; margin-right: auto; }
.lead { font-size: 17px; color: var(--ink-2); }

/* ===== แถบเฉียง (ลายจากหน้าปกโปรไฟล์) ===== */
.stripes { position: absolute; width: 420px; height: 420px; pointer-events: none; overflow: hidden; }
.stripes span { position: absolute; display: block; height: 46px; width: 700px; transform-origin: 0 0; }
.stripes.tr { top: 0; right: 0; }
.stripes.tr span { transform: rotate(45deg); }
.stripes.tr span:nth-child(1) { background: var(--navy); left: 0; top: -100px; }
.stripes.tr span:nth-child(2) { background: var(--steel); left: 80px; top: -100px; height: 30px; }
.stripes.tr span:nth-child(3) { background: var(--light); left: 140px; top: -100px; height: 20px; }
.stripes.tr span:nth-child(4) { background: var(--indigo); left: 200px; top: -100px; height: 54px; }
.stripes.bl { bottom: 0; left: 0; }
.stripes.bl span { transform: rotate(45deg); }
.stripes.bl span:nth-child(1) { background: var(--light); left: -100px; top: 20px; height: 20px; }
.stripes.bl span:nth-child(2) { background: var(--navy); left: -100px; top: 80px; }
.stripes.bl span:nth-child(3) { background: var(--steel); left: -100px; top: 150px; height: 30px; }
.stripes.bl span:nth-child(4) { background: var(--indigo); left: -100px; top: 210px; height: 54px; }
.stripes.small { width: 260px; height: 260px; opacity: .9; }

/* ===== ปุ่ม ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px; border-radius: var(--radius); font-family: var(--font-head); font-weight: 600; font-size: 16px; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--indigo); color: var(--white); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-white { background: var(--white); color: var(--navy); }

/* ===== Header / เมนู ===== */
.header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.header.scrolled { box-shadow: 0 4px 20px rgba(33, 68, 153, .1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 64px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; font-family: var(--font-head); font-weight: 500; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; padding: 10px 0; position: relative; }
.nav a.nav-link::after { content: ''; position: absolute; left: 0; bottom: 4px; width: 0; height: 2px; background: var(--navy); transition: width .2s; }
.nav a.nav-link:hover::after, .nav a.nav-link.active::after { width: 100%; }
.nav a.nav-link.active { color: var(--navy); }
.nav .btn { min-height: 44px; padding: 0 18px; font-size: 15px; color: var(--white); }
.nav { margin-left: auto; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.lang-btn { min-width: 44px; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: .5px; cursor: pointer; }
.lang-btn:hover { color: var(--navy); }
.lang-btn.active { background: var(--navy); color: var(--white); }
.lang-btn:focus-visible, .filter-btn:focus-visible, .btn:focus-visible { outline: 3px solid var(--azure); outline-offset: 2px; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--navy); align-items: center; justify-content: center; }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; background: var(--white); }
.hero-inner { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding: 88px 24px 104px; }
.hero-text { flex: 999 1 500px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero-kicker { font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--azure); }
.hero h1 { font-weight: 700; font-size: clamp(28px, 4.6vw, 50px); line-height: 1.22; }
.hero h1 em { font-style: normal; color: var(--azure); }
.hero-text > p { font-size: 18px; max-width: 580px; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-media { flex: 1 1 380px; min-width: 0; position: relative; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: 0 24px 48px rgba(38, 34, 98, .22); }
.hero-media::before { content: ''; position: absolute; inset: 18px -18px -18px 18px; border: 3px solid var(--sky); border-radius: var(--radius); z-index: -1; }
.hero-media figcaption { position: absolute; left: -16px; bottom: 24px; background: var(--navy); color: var(--white); padding: 12px 18px; font-size: 14px; line-height: 1.4; max-width: 80%; border-radius: var(--radius); }
.hero-media figcaption b { display: block; font-family: var(--font-head); font-size: 15px; }

/* ===== ตัวเลข (แถบน้ำเงินแบบท้ายหน้าโปรไฟล์) ===== */
.stats { background: var(--navy); color: var(--white); position: relative; overflow: hidden; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; padding: 44px 24px; position: relative; z-index: 1; }
.stat { border-left: 3px solid var(--light); padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: var(--font-head); font-weight: 700; font-size: 38px; line-height: 1.15; }
.stat-num small { font-size: 18px; font-weight: 500; }
.stat-label { color: #D4DCF0; font-size: 15px; }
.chevrons { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); display: flex; gap: 0; opacity: .18; pointer-events: none; }
.chevrons svg { width: 90px; height: 120px; margin-left: -34px; }

/* ===== เกี่ยวกับเรา ===== */
.about-inner { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.about-text { flex: 1 1 420px; max-width: 860px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.facts { flex: 1 1 360px; min-width: 0; background: var(--tint); border-top: 4px solid var(--navy); padding: 32px; border-radius: var(--radius); }
.facts h3 { font-size: 20px; margin-bottom: 16px; }
.facts dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 12px 20px; font-size: 15px; }
.facts dt { font-weight: 600; color: var(--navy); }
.facts dd { margin: 0; color: var(--ink-2); }
.why-grid { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.why { background: var(--white); border: 1px solid var(--line); padding: 28px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; transition: border-color .2s, transform .2s; }
.why:hover { border-color: var(--sky); transform: translateY(-3px); }
.why > span { font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--sky); }
.why h3 { font-weight: 600; font-size: 18px; }
.why p { font-size: 15px; color: var(--ink-2); }

/* ===== บริการ ===== */
.services { background: var(--tint); overflow: hidden; }
.section-head { max-width: 720px; margin-bottom: 48px; position: relative; z-index: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; position: relative; z-index: 1; }
.service { display: flex; flex-direction: column; gap: 14px; padding: 32px 28px; background: var(--white); border-radius: var(--radius); border-bottom: 4px solid transparent; transition: transform .2s, box-shadow .2s, border-color .2s; }
.service:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(33, 68, 153, .12); border-bottom-color: var(--navy); }
.service .icon { width: 54px; height: 54px; border-radius: var(--radius); background: var(--navy); color: var(--white); display: flex; align-items: center; justify-content: center; }
.service h3 { font-weight: 600; font-size: 20px; }
.service p { color: var(--ink-2); font-size: 15.5px; }
.service.dark { background: var(--indigo); }
.service.dark h3 { color: var(--white); }
.service.dark .icon { background: var(--white); color: var(--indigo); }
.service.dark p { color: #CFD3EE; }
.sectors { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; position: relative; z-index: 1; }
.sectors b { font-family: var(--font-head); color: var(--navy); margin-right: 6px; }
.sectors > span { background: var(--white); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); }

/* ===== ผลงาน ===== */
.projects-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-btn { min-height: 44px; padding: 0 18px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; font-family: var(--font-head); font-size: 14px; color: var(--ink); cursor: pointer; }
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.project { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); transition: box-shadow .2s, transform .2s; }
.project:hover { box-shadow: 0 14px 32px rgba(33, 68, 153, .14); transform: translateY(-3px); }
.project[hidden] { display: none; }
.project-open { all: unset; cursor: pointer; display: flex; flex-direction: column; height: 100%; }
.project-open:focus-visible { outline: 3px solid var(--azure); outline-offset: -3px; }
.project-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint-2); }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.project:hover .project-img img { transform: scale(1.05); }
.project-year { position: absolute; left: 0; top: 16px; background: var(--navy); color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: 13px; padding: 4px 12px; }
.project-count { position: absolute; right: 12px; bottom: 12px; background: rgba(29, 35, 64, .78); color: var(--white); font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.project-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; }
.project-client { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--azure); letter-spacing: .3px; }
.project h3 { font-weight: 600; font-size: 18px; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: 12.5px; font-weight: 600; color: var(--navy); background: var(--tint); padding: 3px 10px; border-radius: 3px; }
.more-wrap { text-align: center; margin-top: 36px; }

/* ===== รายชื่อโครงการทั้งหมด ===== */
.reference { background: var(--tint); overflow: hidden; }
.ref-table-wrap { position: relative; z-index: 1; background: var(--white); border-radius: var(--radius); overflow-x: auto; box-shadow: 0 6px 24px rgba(33, 68, 153, .06); }
.ref-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.ref-table th { background: var(--navy); color: var(--white); font-family: var(--font-head); font-weight: 600; text-align: left; padding: 14px 20px; font-size: 15px; }
.ref-table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.ref-table td:first-child { width: 90px; font-family: var(--font-head); font-weight: 600; color: var(--navy); }
.ref-table td small { display: block; color: var(--ink-2); font-size: 13.5px; }
.ref-table tr.extra { display: none; }
.ref-table.expanded tr.extra { display: table-row; }
.ref-table tbody tr:hover td { background: #F7F9FD; }
.clients { margin-top: 48px; position: relative; z-index: 1; }
.clients h3 { font-size: 18px; margin-bottom: 16px; }
.client-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.client-list > span { background: var(--white); border-left: 3px solid var(--navy); padding: 14px 16px; font-family: var(--font-head); font-weight: 500; font-size: 14.5px; color: var(--ink); border-radius: var(--radius); }

/* ===== ติดต่อ ===== */
.contact-inner { display: flex; flex-wrap: wrap; gap: 48px; }
.contact-info { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.contact-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .ci { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--navy); display: flex; align-items: center; justify-content: center; }
.contact-list b { display: block; font-family: var(--font-head); font-weight: 600; color: var(--navy); font-size: 14px; }
.map { margin-top: 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map iframe { display: block; width: 100%; height: 260px; border: 0; }
.contact-map { flex: 1.25 1 440px; min-width: 0; align-self: stretch; display: flex; }
.map-large { margin: 0; flex: 1; display: flex; }
.map-large iframe { height: 100%; min-height: 420px; }
.map-card { flex: 1; min-height: 320px; background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 40px; display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; position: relative; overflow: hidden; }
.map-card .eyebrow { color: var(--light); margin: 0; }
.map-card h3 { color: var(--white); font-size: 22px; }
.map-card .btn { align-self: flex-start; background: var(--white); color: var(--navy); }

/* ===== Footer (แถบน้ำเงินพร้อมลูกศรแบบโปรไฟล์) ===== */
.footer { background: var(--navy); color: #D4DCF0; position: relative; overflow: hidden; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding: 56px 24px 36px; position: relative; z-index: 1; }
.footer-brand { display: flex; align-items: flex-start; gap: 20px; flex: 1 1 380px; min-width: 0; }
.footer-brand img { width: 92px; height: auto; flex: none; }
.footer-brand strong { color: var(--white); font-family: var(--font-head); font-size: 17px; display: block; margin-bottom: 4px; }
.footer-brand p { font-size: 14.5px; }
.footer-brand a { color: #D4DCF0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: center; font-family: var(--font-head); font-size: 15px; }
.footer-nav a { color: var(--white); text-decoration: none; padding: 8px 0; }
.footer-nav a:hover { color: var(--light); }
.copyright { border-top: 1px solid rgba(255, 255, 255, .18); padding: 20px 24px; font-size: 13.5px; position: relative; z-index: 1; }
.footer .chevrons { opacity: .14; right: 0; }

/* ===== ดูรูปผลงานแบบเต็มจอ ===== */
.lightbox { width: min(1000px, 94vw); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius); background: var(--white); color: var(--ink); overflow: auto; }
.lightbox::backdrop { background: rgba(29, 35, 64, .82); }
.lb-stage { position: relative; background: #0F1430; }
.lb-stage img { width: 100%; max-height: 64vh; object-fit: contain; margin: 0 auto; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: var(--white); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.lb-counter { position: absolute; left: 12px; bottom: 12px; color: var(--white); background: rgba(0, 0, 0, .5); padding: 3px 10px; border-radius: 999px; font-size: 13px; }
.lb-thumbs { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; }
.lb-thumbs button { flex: none; width: 76px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 3px; overflow: hidden; cursor: pointer; background: none; opacity: .6; }
.lb-thumbs button.active { border-color: var(--navy); opacity: 1; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lb-info { padding: 18px 24px 26px; display: flex; flex-direction: column; gap: 6px; }
.lb-info h3 { font-size: 21px; }
.lb-info p { color: var(--ink-2); }

/* ===== ปุ่มกลับขึ้นบน ===== */
.to-top { position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--navy); color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(33, 68, 153, .35); opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 40; }
.to-top.show { opacity: 1; visibility: visible; }

/* ===== เอฟเฟกต์เลื่อนเข้า ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== มือถือ ===== */
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .lang-switch { margin-left: auto; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: 8px 24px 20px; display: none; box-shadow: 0 12px 24px rgba(33, 68, 153, .1); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a.nav-link::after { display: none; }
  .nav .btn { margin-top: 12px; border-bottom: 0; }
  .section { padding: 64px 0; }
  .hero-inner { padding: 56px 24px 72px; gap: 40px; }
  .hero-media::before { inset: 12px -10px -12px 12px; }
  .hero-media figcaption { left: 8px; }
  .stripes { width: 220px; height: 220px; opacity: .55; }
  .facts, .map-card { padding: 24px; }
  .map-large iframe { min-height: 300px; }
  .project-grid { grid-template-columns: 1fr; }
  .lb-nav { width: 40px; height: 40px; }
}
@media (max-width: 600px) {
  .hero .stripes.tr { display: none; }
  .ref-table { min-width: 0; }
  .ref-table th, .ref-table td { padding: 12px 14px; }
  .ref-table td:first-child { width: 58px; }
  .facts dl { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 10px; }
}
