/* ==========================================================
   Natural Power – navy & orange theme
   ========================================================== */
:root {
    /* Brand: navy #113786 (primary) + orange #f06e1f (accent) */
    --primary-950: #07142f;
    --primary-900: #0b2152;
    --primary-800: #0e2c6b;
    --primary-700: #113786;
    --primary-600: #1a47a8;
    --primary-500: #2a5cc7;
    --primary-400: #5b85dd;
    --primary-200: #c4d4f4;
    --primary-100: #e3ebfa;
    --primary-50:  #f3f6fd;
    --accent:      #f06e1f;
    --accent-dark: #d55a0f;
    --accent-50:   #fff3eb;
    --ink:       #0f1b33;
    --text:      #3f4b63;
    --muted:     #6b7690;
    --line:      #e1e7f2;
    --bg:        #ffffff;
    --bg-soft:   #f5f7fc;
    --radius:    18px;
    --radius-sm: 10px;
    --shadow:    0 10px 30px -12px rgba(11, 33, 82, .25);
    --shadow-lg: 0 30px 60px -20px rgba(11, 33, 82, .35);
    --container: 1200px;
    --font: 'Plus Jakarta Sans', 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-x: clip; /* clip (unlike hidden) doesn't create a scroll container, so the sticky header keeps working */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-500); }
h1, h2, h3, h4, h5 { color: var(--ink); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
.icon { flex-shrink: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--primary-950); color: #cdd8ee; }
.section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }
.section-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.section--dark .section-head p { color: #9fb0d3; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--primary-600); margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow--light { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 26px; border-radius: 999px; font-weight: 700; font-size: .95rem;
    border: 2px solid transparent; cursor: pointer; transition: all .25s ease; white-space: nowrap;
}
.btn--primary { background: var(--primary-600); color: #fff; box-shadow: 0 8px 20px -8px rgba(17, 55, 134, .6); }
.btn--primary:hover { background: var(--primary-700); color: #fff; transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(240,110,31,.65); }
.btn--accent:hover { background: var(--accent-dark); color: #fff; transform: translateY(-2px); }
.btn--light { background: #fff; color: var(--primary-800); }
.btn--light:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn--ghost-light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.btn--outline { border-color: var(--primary-600); color: var(--primary-700); }
.btn--outline:hover { background: var(--primary-600); color: #fff; }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--primary-950); color: #9fb0d3; font-size: .85rem; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.topbar__item, .topbar a { display: inline-flex; align-items: center; gap: 6px; color: #cdd8ee; }
.topbar a:hover { color: var(--accent); }
.topbar__links { display: flex; gap: 24px; flex-wrap: wrap; }

.site-header {
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid transparent; transition: box-shadow .3s, border-color .3s;
}
/* Blur lives on a pseudo-element: backdrop-filter on the header itself would make it
   the containing block for the fixed mobile menu and clip it to the header's height. */
.site-header::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -12px rgba(11, 33, 82,.25); border-color: var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 86px; }
.brand img { height: 56px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
    display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-radius: 999px;
    color: var(--ink); font-weight: 600; font-size: .94rem; white-space: nowrap;
}
.main-nav > ul > li > a:hover, .main-nav > ul > li.is-active > a { color: var(--primary-700); background: var(--primary-50); }
.main-nav > ul > li.is-active > a { box-shadow: inset 0 -2px 0 var(--primary-500); border-radius: 999px 999px 999px 999px; }
.caret { display: inline-flex; transition: transform .2s; }
.has-sub:hover .caret { transform: rotate(180deg); }
.sub {
    list-style: none; margin: 0; padding: 10px; position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px;
    background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .2s ease;
}
.sub::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.sub a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .93rem; }
.sub a .icon { color: var(--primary-500); }
.sub a:hover { background: var(--primary-50); color: var(--primary-700); }
.nav-cta { padding: 11px 20px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); padding: 8px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(88vh, 760px); display: flex; align-items: center; color: #fff; overflow: hidden; background: var(--primary-950); }
.hero__slides, .hero__slide { position: absolute; inset: 0; }
.hero__slide { background-size: cover; background-position: center; opacity: 0; transform: scale(1.08); transition: opacity 1.4s ease, transform 7s ease; }
.hero__slide.is-active { opacity: 1; transform: scale(1); }
.hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(100deg, rgba(7, 20, 47,.94) 0%, rgba(11, 33, 82,.78) 42%, rgba(11, 33, 82,.15) 100%);
}
.hero__content { position: relative; z-index: 2; max-width: 680px; padding: 80px 0; }
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero h1 span { color: var(--accent); }
.hero__lead { font-size: 1.25rem; color: #dbe4f5; margin-bottom: 34px; max-width: 560px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__badge {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); font-size: .88rem; margin-bottom: 26px; backdrop-filter: blur(6px);
}
.hero__badge b { background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: .8rem; }
.hero__dots { position: absolute; z-index: 3; bottom: 34px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.hero__dots button { width: 34px; height: 5px; border-radius: 4px; border: 0; background: rgba(255,255,255,.35); cursor: pointer; transition: all .3s; padding: 0; }
.hero__dots button.is-active { background: var(--accent); width: 56px; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
    position: relative; padding: 110px 0 90px; color: #fff; overflow: hidden;
    background: var(--primary-900) var(--bg, none) center/cover no-repeat;
}
.page-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(7, 20, 47,.95), rgba(15,81,50,.75)); }
.page-hero::after {
    content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 110, 31,.25), transparent 70%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; margin-bottom: 12px; }
.page-hero p { color: #cdd8ee; font-size: 1.15rem; max-width: 720px; margin: 0; }
.breadcrumb { display: flex; gap: 8px; font-size: .88rem; color: #9fb0d3; margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--accent); }

/* ---------- Stats ---------- */
.stats { position: relative; z-index: 5; margin-top: -70px; }
.stats__grid {
    display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.stat { padding: 34px 28px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat__num { font-size: 2.6rem; font-weight: 800; color: var(--primary-700); line-height: 1; margin-bottom: 8px; }
.stat__num small { font-size: 1.4rem; color: var(--primary-500); }
.stat__label { color: var(--muted); font-size: .92rem; font-weight: 500; }

/* ---------- Generic grid / cards ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.split--wide { grid-template-columns: 1.15fr .85fr; }
.media-stack { position: relative; }
.media-stack img { border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; object-fit: cover; }
.media-stack__badge {
    position: absolute; left: -24px; bottom: 32px; background: var(--primary-700); color: #fff; padding: 20px 24px; border-radius: 16px;
    box-shadow: var(--shadow-lg); max-width: 220px;
}
.media-stack__badge strong { display: block; font-size: 2.2rem; line-height: 1; color: var(--accent); }
.media-stack__badge span { font-size: .88rem; }

.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--primary-200); }
.card__icon {
    width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 22px;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-50)); color: var(--primary-700);
}
.card h3, .card h4 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.check-list { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list li::before {
    content: ''; flex-shrink: 0; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%;
    background: var(--primary-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23113786' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/13px no-repeat;
}
.check-list--2 { grid-template-columns: 1fr 1fr; column-gap: 28px; }
.section--dark .check-list li::before { background-color: rgba(240, 110, 31,.15); }

/* ---------- Services steps ---------- */
.steps-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 40px; }
.steps-nav button {
    text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; cursor: pointer;
    font: inherit; color: var(--ink); transition: all .25s; display: flex; flex-direction: column; gap: 8px;
}
.steps-nav button small { color: var(--primary-600); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .74rem; }
.steps-nav button span { font-weight: 700; line-height: 1.35; font-size: .97rem; }
.steps-nav button:hover { border-color: var(--primary-400); }
.steps-nav button.is-active { background: var(--primary-700); border-color: var(--primary-700); color: #fff; box-shadow: var(--shadow); }
.steps-nav button.is-active small { color: var(--accent); }
.step-panel { display: none; }
.step-panel.is-active { display: grid; animation: fadeUp .5s ease; }
.step-panel { grid-template-columns: 340px 1fr; gap: 48px; background: #fff; border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); align-items: start; }
.step-panel__img { border-radius: 14px; overflow: hidden; position: relative; }
.step-panel__img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.step-panel__num {
    position: absolute; top: 14px; left: 14px; background: var(--accent); color: #fff; font-weight: 800;
    border-radius: 999px; padding: 4px 14px; font-size: .85rem;
}
.sub-items { display: grid; gap: 22px; }
.sub-item h4 { display: flex; align-items: center; gap: 10px; }
.sub-item h4::before { content: ''; width: 8px; height: 8px; background: var(--primary-500); border-radius: 50%; }

/* services page — alternating rows */
.service-row { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: start; padding: 64px 0; border-bottom: 1px solid var(--line); }
.service-row:last-child { border-bottom: 0; }
.service-row:nth-child(even) { grid-template-columns: 1fr 300px; }
.service-row:nth-child(even) .service-row__media { order: 2; }
.service-row__media { position: sticky; top: 120px; }
.service-row__media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 1/1.35; object-fit: cover; }
.service-row__step { font-size: 4.5rem; font-weight: 800; line-height: 1; color: var(--primary-100); margin-bottom: -10px; }

/* ---------- Biogas process ---------- */
.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: proc; position: relative; }
.process .card { position: relative; padding-top: 42px; }
.process .card::before {
    counter-increment: proc; content: '0' counter(proc);
    position: absolute; top: -18px; left: 28px; background: var(--primary-700); color: #fff; font-weight: 800;
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: .95rem; box-shadow: var(--shadow);
}
.process h4 { letter-spacing: .06em; color: var(--primary-700); }
.diagram { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }

.composition { display: grid; gap: 16px; }
.bar__head { display: flex; justify-content: space-between; font-weight: 600; color: var(--ink); font-size: .95rem; margin-bottom: 6px; gap: 12px; }
.bar__head span:last-child { color: var(--primary-700); white-space: nowrap; }
.bar__track { height: 12px; background: var(--primary-50); border-radius: 999px; overflow: hidden; }
.bar__fill { height: 100%; background: linear-gradient(90deg, var(--primary-500), var(--accent)); border-radius: 999px; width: 0; transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.is-visible .bar__fill { width: var(--w); }

.tabs-nav { display: inline-flex; gap: 6px; padding: 6px; background: var(--primary-50); border-radius: 999px; margin: 0 auto 48px; flex-wrap: wrap; justify-content: center; }
.tabs-nav button {
    border: 0; background: transparent; padding: 12px 26px; border-radius: 999px; font: inherit; font-weight: 700; color: var(--primary-800); cursor: pointer; transition: all .2s;
}
.tabs-nav button.is-active { background: var(--primary-700); color: #fff; box-shadow: var(--shadow); }
.tabs-center { text-align: center; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeUp .5s ease; }

/* ---------- Technology ---------- */
.tech-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 48px; }
.tech-tabs button {
    background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 18px; cursor: pointer; font: inherit; text-align: left; transition: all .25s;
}
.tech-tabs button strong { display: block; font-size: 1.25rem; color: var(--ink); }
.tech-tabs button span { font-size: .82rem; color: var(--muted); line-height: 1.4; display: block; margin-top: 4px; }
.tech-tabs button:hover { border-color: var(--primary-400); }
.tech-tabs button.is-active { background: linear-gradient(135deg, var(--primary-700), var(--primary-900)); border-color: transparent; box-shadow: var(--shadow); }
.tech-tabs button.is-active strong { color: #fff; }
.tech-tabs button.is-active span { color: var(--primary-200); }
.tech-panel { display: none; }
.tech-panel.is-active { display: block; animation: fadeUp .5s ease; }
.tech-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.tech-side { position: sticky; top: 120px; display: grid; gap: 20px; }
.tech-side img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 1/1.4; object-fit: cover; }
.tech-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0 32px; }
.tech-stat { background: var(--primary-50); border-radius: 14px; padding: 18px; border: 1px solid var(--primary-100); }
.tech-stat strong { display: block; color: var(--primary-700); font-size: 1.2rem; line-height: 1.2; }
.tech-stat span { font-size: .85rem; color: var(--muted); }
.adv-box { background: var(--primary-950); color: #cdd8ee; border-radius: var(--radius); padding: 32px; margin-top: 12px; }
.adv-box h4 { color: #fff; display: flex; align-items: center; gap: 10px; }
.adv-box h4 .icon { color: var(--accent); }
.tag { display: inline-block; background: var(--primary-100); color: var(--primary-800); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: .8rem; margin-bottom: 10px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
.gallery a { position: relative; display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--primary-50); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.gallery a::after {
    content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(7, 20, 47,.6));
    opacity: 0; transition: opacity .3s;
}
.gallery a:hover img { transform: scale(1.08); }
.gallery a:hover::after { opacity: 1; }

/* ---------- References ---------- */
.ref-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ref-cat {
    position: relative; border-radius: var(--radius); overflow: hidden; min-height: 300px; display: flex; align-items: flex-end;
    color: #fff; padding: 26px; background: var(--primary-800) center/cover; isolation: isolate;
}
.ref-cat::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 20, 47,.1), rgba(7, 20, 47,.92)); transition: background .3s; }
.ref-cat:hover::before { background: linear-gradient(180deg, rgba(26, 71, 168,.35), rgba(7, 20, 47,.95)); }
.ref-cat h3 { color: #fff; margin-bottom: 4px; }
.ref-cat p { color: #cdd8ee; font-size: .9rem; margin: 0 0 12px; line-height: 1.5; }
.ref-cat .more { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); font-weight: 700; font-size: .9rem; }
.ref-cat:hover .more .icon { transform: translateX(4px); }
.ref-cat .more .icon { transition: transform .2s; }
.ref-cat__count { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }

.ref-switch { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 48px; }
.ref-switch a { padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .92rem; background: #fff; }
.ref-switch a:hover { border-color: var(--primary-500); color: var(--primary-700); }
.ref-switch a.is-active { background: var(--primary-700); color: #fff; border-color: var(--primary-700); }

.project { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; box-shadow: 0 2px 0 rgba(11, 33, 82,.03); }
.project__head { display: flex; align-items: center; gap: 18px; padding: 26px 32px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--primary-50), #fff); }
.project__num {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px; background: var(--primary-700); color: #fff;
    display: grid; place-items: center; font-weight: 800; font-size: 1.15rem;
}
.project__head h3 { margin: 0; font-size: 1.25rem; }
.project__head .meta { color: var(--muted); font-size: .9rem; display: flex; gap: 16px; flex-wrap: wrap; margin-top: 2px; }
.project__head .meta span { display: inline-flex; gap: 6px; align-items: center; }
.project__body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.project__body--full { grid-template-columns: 1fr; }
.info-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.info-table th, .info-table td { padding: 13px 32px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }
.info-table th { width: 38%; color: var(--muted); font-weight: 600; white-space: nowrap; }
.info-table td { color: var(--ink); font-weight: 500; }
.info-table td .pill { display: inline-block; background: var(--primary-100); color: var(--primary-800); border-radius: 999px; padding: 2px 10px; font-size: .85rem; font-weight: 700; margin: 2px 4px 2px 0; }
.project__gallery { padding: 20px; background: var(--bg-soft); border-left: 1px solid var(--line); }
.project__gallery .gallery { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.project__gallery .gallery a { border-radius: 10px; }
.project__gallery .gallery a.more-hidden { display: none; }
.project__gallery .gallery a.more-tile::before {
    content: attr(data-more); position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
    background: rgba(7, 20, 47,.65); color: #fff; font-weight: 800; font-size: 1.4rem;
}

/* ---------- About ---------- */
.vmp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.vmp .card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #cdd8ee; }
.vmp .card:hover { border-color: rgba(240, 110, 31,.4); }
.vmp .card__icon { background: rgba(240, 110, 31,.12); color: var(--accent); }
.benefits { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 28px; }
.benefit { text-align: center; padding: 24px 16px; background: #fff; border-radius: 16px; border: 1px solid var(--line); font-weight: 600; color: var(--ink); font-size: .93rem; line-height: 1.45; }
.benefit .card__icon { margin: 0 auto 14px; }
.image-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.image-trio img { border-radius: 14px; width: 100%; aspect-ratio: 1/2; object-fit: cover; box-shadow: var(--shadow); }
.image-trio img:nth-child(2) { margin-top: 40px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: stretch; }
.contact-cards { display: grid; gap: 18px; }
.contact-card { display: flex; gap: 18px; align-items: flex-start; }
.contact-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.contact-card p, .contact-card a { margin: 0; font-size: 1.02rem; }
.map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 440px; background: var(--primary-50); }
.map iframe { width: 100%; height: 100%; min-height: 440px; border: 0; display: block; }

/* ---------- News ---------- */
.empty { text-align: center; max-width: 520px; margin: 0 auto; padding: 60px 32px; border: 2px dashed var(--primary-200); border-radius: var(--radius); background: var(--primary-50); }
.empty .card__icon { margin: 0 auto 20px; width: 72px; height: 72px; background: #fff; }

/* ---------- Pre-footer & footer ---------- */
.prefooter { position: relative; padding: 80px 0; background: var(--primary-800) var(--bg) center/cover; color: #fff; overflow: hidden; }
.prefooter::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 20, 47,.95), rgba(26, 71, 168,.82)); }
.prefooter__inner { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.prefooter h2 { color: #fff; margin: 0; max-width: 640px; }
.prefooter__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.site-footer { background: var(--primary-950); color: #9fb0d3; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr .8fr 1.2fr; gap: 56px; padding-top: 72px; padding-bottom: 56px; }
.site-footer h3 { color: #fff; font-size: 1.05rem; margin: 0 0 14px; }
.footer-col p { line-height: 1.75; }
.footer-logo { height: 52px; width: auto; background: #fff; padding: 8px 14px; border-radius: 12px; margin-bottom: 24px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-links a { color: #cdd8ee; }
.footer-links a:hover { color: var(--accent); }
.footer-contact { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.footer-contact .icon { color: var(--accent); margin-top: 4px; }
.footer-contact a { color: #cdd8ee; }
.footer-contact a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 20px 0; font-size: .85rem; text-align: center; }

.to-top {
    position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary-600); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .3s;
}
.to-top .icon { transform: rotate(180deg); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--primary-700); color: #fff; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(3, 10, 26, .94); display: flex; align-items: center; justify-content: center; padding: 60px 80px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox button { position: absolute; background: rgba(255,255,255,.1); border: 0; color: #fff; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.lightbox button:hover { background: var(--primary-600); }
.lightbox__close { top: 18px; right: 18px; }
.lightbox__prev { left: 18px; top: 50%; margin-top: -26px; }
.lightbox__prev .icon { transform: rotate(90deg); }
.lightbox__next { right: 18px; top: 50%; margin-top: -26px; }
.lightbox__next .icon { transform: rotate(-90deg); }
.lightbox__count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #cdd8ee; font-size: .9rem; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1260px) {
    .nav-cta { display: none; }
    .main-nav > ul > li > a { padding: 10px 10px; }
}
@media (max-width: 1024px) {
    .nav-toggle { display: block; }
    .main-nav {
        position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); background: #fff; flex-direction: column; align-items: stretch;
        padding: 96px 20px 24px; gap: 16px; transform: translateX(100%); visibility: hidden; transition: transform .35s ease, visibility .35s; box-shadow: var(--shadow-lg); overflow-y: auto;
    }
    .main-nav.is-open { transform: none; visibility: visible; }
    .main-nav > ul { flex-direction: column; }
    .main-nav > ul > li > a { padding: 14px 16px; justify-content: space-between; }
    .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 10px; display: none; }
    .has-sub.is-open .sub { display: block; }
    .nav-cta { display: inline-flex; }
    .nav-toggle { position: relative; z-index: 110; }
    /* lock scroll on html, not body: overflow on body would break the sticky header (and hide the close button) */
    html.nav-open { overflow: hidden; }
    body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(7, 20, 47,.5); z-index: 99; }
    .site-header { z-index: 101; }
    .main-nav { z-index: 105; }

    .split, .split--wide, .contact-grid, .tech-layout { grid-template-columns: 1fr; gap: 48px; }
    .tech-side { position: static; grid-template-columns: 1fr 1fr; }
    .tech-side img { aspect-ratio: 4/3; }
    .grid-4, .ref-cats { grid-template-columns: repeat(2, 1fr); }
    .stats__grid { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: 0; }
    .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .steps-nav, .tech-tabs { grid-template-columns: repeat(2, 1fr); }
    .step-panel { grid-template-columns: 1fr; }
    .step-panel__img img { aspect-ratio: 16/9; }
    .benefits { grid-template-columns: repeat(3, 1fr); }
    .project__body { grid-template-columns: 1fr; }
    .project__gallery { border-left: 0; border-top: 1px solid var(--line); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-col--about { grid-column: 1 / -1; }
    .service-row, .service-row:nth-child(even) { grid-template-columns: 1fr; gap: 28px; }
    .service-row:nth-child(even) .service-row__media { order: 0; }
    .service-row__media { position: static; }
    .service-row__media img { aspect-ratio: 16/9; }
}
@media (max-width: 720px) {
    body { font-size: 16px; }
    .container { padding: 0 16px; }
    .section { padding: 72px 0; }
    .topbar__item { display: none; }
    .topbar__inner { justify-content: center; }
    .topbar__links { gap: 14px; justify-content: center; font-size: .78rem; }
    .site-header__inner { height: 72px; }
    .brand img { height: 42px; }
    .grid-2, .grid-3, .grid-4, .process, .vmp, .ref-cats { grid-template-columns: 1fr; }
    .check-list--2 { grid-template-columns: 1fr; }
    .benefits { grid-template-columns: 1fr 1fr; }
    .gallery--3, .project__gallery .gallery { grid-template-columns: repeat(2, 1fr); }
    .tech-stats { grid-template-columns: 1fr; }
    .tech-side { grid-template-columns: 1fr; }
    .step-panel { padding: 24px; }
    .stat { padding: 24px 12px; }
    .stat__num { font-size: 2rem; }
    .info-table th, .info-table td { display: block; width: 100%; padding: 4px 20px; border: 0; white-space: normal; }
    .info-table th { padding-top: 14px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
    .info-table tr { display: block; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
    .project__head { padding: 20px; align-items: flex-start; }
    .footer-grid { grid-template-columns: 1fr; gap: 36px; }
    .media-stack__badge { left: 12px; bottom: 12px; }
    .lightbox { padding: 60px 12px; }
    .lightbox__prev, .lightbox__next { top: auto; bottom: 14px; margin-top: 0; }
    .hero__content { padding: 60px 0 90px; }
    .page-hero { padding: 72px 0 60px; }
    .image-trio img:nth-child(2) { margin-top: 20px; }
}

/* ---------- Language switch & Thai typography ---------- */
.lang-switch { display: inline-flex; background: rgba(255,255,255,.08); border-radius: 999px; padding: 2px; gap: 2px; }
.topbar .lang-switch a { padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: .76rem; letter-spacing: .04em; color: #cdd8ee; }
.topbar .lang-switch a.is-active { background: var(--accent); color: #fff; }
.topbar .lang-switch a:not(.is-active):hover { color: #fff; background: rgba(255,255,255,.12); }

.lang-th { line-height: 1.85; }
.lang-th h1, .lang-th h2, .lang-th h3, .lang-th h4 { line-height: 1.4; letter-spacing: 0; }
.lang-th .eyebrow { letter-spacing: .06em; }
.lang-th .main-nav > ul > li > a { font-size: .97rem; }

/* ==========================================================
   Device support
   ========================================================== */

/* Long words / e-mail addresses never push the layout wider than the screen */
body { overflow-wrap: break-word; }
.split > *, .contact-grid > *, .tech-layout > *, .footer-grid > *, .step-panel > *,
.service-row > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .contact-card > div { min-width: 0; }
.contact-card a, .footer-contact a { overflow-wrap: anywhere; }

/* Notched phones (iPhone landscape etc.) */
.container {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
}
.to-top { right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); }
.main-nav.is-open { padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* Mobile menu button shows ☰ / ✕ */
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: inline; }
.nav-toggle span { display: inline-flex; }

/* Bigger hit area for the slide dots without changing their look */
.hero__dots button { height: 25px; padding: 10px 0; background-clip: content-box; }

/* Desktop dropdown opened by tap (touch screens wider than 1024px) */
.has-sub.is-open .sub { opacity: 1; visibility: visible; transform: none; }
.has-sub.is-open .caret { transform: rotate(180deg); }

/* Touch devices: larger tap targets, no hover-only effects */
@media (hover: none) {
    .topbar .lang-switch a { padding: 4px 12px; }
    .topbar__links a { padding: 4px 0; }
    .card:hover, .btn:hover { transform: none; }
    .gallery a:hover img { transform: none; }
}

/* Large screens */
@media (min-width: 1600px) {
    :root { --container: 1320px; }
    body { font-size: 17.5px; }
}

/* Tablets in portrait */
@media (min-width: 721px) and (max-width: 1024px) {
    .section { padding: 84px 0; }
    .hero { min-height: 620px; }
}

/* Phones */
@media (max-width: 720px) {
    .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    .topbar__inner { justify-content: space-between; }
    .topbar__links { flex-wrap: nowrap; gap: 12px; width: 100%; justify-content: space-between; align-items: center; }
    .tb-email { display: none; }
    .topbar__links .lang-switch { margin-left: auto; }
    .card { padding: 24px; }
    .contact-card { gap: 14px; }
    .contact-card .card__icon { width: 48px; height: 48px; margin-bottom: 0; }
    .hero__actions .btn, .prefooter__actions .btn { flex: 1 1 auto; }
    .tabs-nav { display: flex; width: 100%; }
    .tabs-nav button { flex: 1 1 0; padding: 10px 12px; }
    .steps-nav button { padding: 14px; }
    .ref-cat { min-height: 240px; }
    .adv-box { padding: 24px; }
    .empty { padding: 40px 20px; }
    .map, .map iframe { min-height: 320px; }
}

/* Small phones (iPhone SE / 320px) */
@media (max-width: 380px) {
    body { font-size: 15.5px; }
    .tb-phone { font-size: .74rem; }
    .btn { white-space: normal; text-align: center; padding: 12px 20px; }
    .brand img { height: 36px; }
    .steps-nav, .tech-tabs { grid-template-columns: 1fr; }
    .benefits { grid-template-columns: 1fr; }
    .stat__num { font-size: 1.7rem; }
    .project__num { width: 42px; height: 42px; font-size: 1rem; }
}

/* Phones in landscape: short screens */
@media (max-height: 500px) and (orientation: landscape) {
    .topbar { display: none; }
    .site-header__inner { height: 60px; }
    .brand img { height: 38px; }
    .hero { min-height: 0; }
    .hero__content { padding: 40px 0 70px; }
    .page-hero { padding: 48px 0 40px; }
    .tech-side, .service-row__media { position: static; }
    .main-nav { padding-top: 72px; }
    .lightbox { padding: 12px 70px; }
}

/* Older browsers without aspect-ratio (iOS 14 and earlier) */
@supports not (aspect-ratio: 1 / 1) {
    .gallery a { height: 0; padding-top: 75%; }
    .gallery img { position: absolute; inset: 0; top: 0; left: 0; }
    .step-panel__img img, .image-trio img, .tech-side img, .service-row__media img { height: auto; }
}

/* Print */
@media print {
    .topbar, .site-header, .prefooter, .to-top, .lightbox, .hero__dots, .hero__slides, .tabs-nav, .tech-tabs, .steps-nav, .ref-switch { display: none !important; }
    body { color: #000; font-size: 11pt; }
    .hero, .page-hero { min-height: 0; padding: 20px 0; background: none; color: #000; }
    .hero::after, .page-hero::before, .page-hero::after { display: none; }
    .hero h1, .page-hero h1, .page-hero p, .hero__lead { color: #000; }
    .tab-panel, .tech-panel, .step-panel { display: block !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .section { padding: 24px 0; }
    .section--dark, .site-footer, .adv-box { background: #fff; color: #000; }
    .section--dark h2, .section--dark h3, .site-footer h3, .adv-box h4 { color: #000; }
    .card, .project { break-inside: avoid; box-shadow: none; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}

/* ---------- Contact form ---------- */
.contact-grid { grid-template-columns: .85fr 1.15fr; align-items: start; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); scroll-margin-top: 110px; }
.form-card h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.form-intro { color: var(--muted); margin-bottom: 24px; }
.contact-form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-weight: 600; color: var(--ink); font-size: .92rem; }
.field > span b { color: var(--accent); }
.field input, .field select, .field textarea {
    width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zooming into the field */
    color: var(--ink); background: var(--bg-soft); border: 1.5px solid var(--line); border-radius: 12px;
    padding: 12px 14px; transition: border-color .2s, box-shadow .2s, background .2s; -webkit-appearance: none; appearance: none;
}
.field select {
    padding-right: 40px; cursor: pointer;
    background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23113786' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center/16px no-repeat;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary-500); background-color: #fff; box-shadow: 0 0 0 4px rgba(42, 92, 199, .15); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #d93025; background-color: #fff6f5; }
.field__error { color: #c5221f; font-size: .85rem; font-weight: 500; }
.form-alert { background: #fff3eb; border: 1px solid #fbc9a8; color: #8a3a0a; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-weight: 500; }
.form-alert span { display: block; margin-top: 4px; font-size: .92rem; }
.form-note { font-size: .85rem; color: var(--muted); margin: 0; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .7; cursor: wait; transform: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-success { text-align: center; padding: 32px 8px; }
.form-success .card__icon { margin: 0 auto 18px; width: 76px; height: 76px; background: #e6f6ec; color: #1e8e3e; border-radius: 50%; }
.contact-grid .map, .section .map { min-height: 380px; }
.section .map iframe { min-height: 380px; }

@media (max-width: 1024px) { .contact-grid { grid-template-columns: 1fr; } .contact-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
    .form-card { padding: 24px 18px; }
    .form-row { grid-template-columns: 1fr; }
    .contact-cards { grid-template-columns: 1fr; }
}
