/* =========================================================
   Phakarin 2026 Professional Experience Layer
   Navy + red industrial system, mega navigation, GSAP-ready
   editorial layouts, mineral-3D visuals and product modals.
   ========================================================= */

:root {
    --phk-navy-950: #111021;
    --phk-navy-900: #171628;
    --phk-navy-850: #1c1a30;
    --phk-navy-800: #232139;
    --phk-navy-750: #2a2842;
    --phk-red: #e03236;
    --phk-red-bright: #ff5257;
    --phk-text: #f7f7fb;
    --phk-muted: #a9a8b7;
    --phk-line: rgba(255, 255, 255, .10);
    --phk-panel: rgba(35, 33, 57, .82);
    --phk-radius-lg: 26px;
    --phk-radius-md: 16px;
    --phk-shadow: 0 32px 80px rgba(4, 4, 12, .34);
}

html { scroll-behavior: smooth; }
body { background: var(--phk-navy-850); }
body.phk-menu-open,
body.phk-modal-open { overflow: hidden; }

/* ---------- Header / navigation ---------- */
.site-header {
    padding: 18px 0 !important;
    background: linear-gradient(180deg, rgba(17,16,33,.88), rgba(17,16,33,.38)) !important;
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1 !important;
    visibility: visible !important;
    transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
    z-index: 1000;
}
.site-header.is-scrolled {
    background: rgba(17,16,33,.94) !important;
    border-bottom-color: rgba(255,255,255,.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.site-header .navbar { min-height: 58px; }
.site-header .logo-img { max-height: 70px; width: auto; }
.site-header .nav-links {
    align-items: center;
    gap: clamp(1rem, 2vw, 2.25rem);
}
.site-header .nav-item { position: static; }
.site-header .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.88);
    font-size: .91rem;
    font-weight: 600;
    letter-spacing: -.01em;
    padding: 17px 0;
    position: relative;
    transition: color .2s ease;
}
.site-header .nav-links a::after { display: none !important; }
.site-header .nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 8px;
    height: 2px;
    background: var(--phk-red);
    transition: right .25s ease;
}
.site-header .nav-item:hover > .nav-link,
.site-header .nav-item:focus-within > .nav-link,
.site-header .nav-item.active > .nav-link { color: #fff; }
.site-header .nav-item:hover > .nav-link::before,
.site-header .nav-item:focus-within > .nav-link::before,
.site-header .nav-item.active > .nav-link::before { right: 0; }
.site-header .nav-chevron {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    transition: transform .25s ease;
}
.site-header .has-mega:hover .nav-chevron,
.site-header .has-mega:focus-within .nav-chevron { transform: rotate(180deg); }
.site-header .nav-contact {
    border: 1px solid rgba(224,50,54,.55);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(224,50,54,.08);
}
.site-header .nav-contact::before { display:none; }
.site-header .nav-contact:hover { background: var(--phk-red); }

.mega-menu {
    position: absolute;
    top: calc(100% - 4px);
    left: 50%;
    width: min(1180px, calc(100vw - 48px));
    transform: translateX(-50%) translateY(12px);
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 22px;
    padding: 22px;
    background:
        radial-gradient(circle at 14% 10%, rgba(224,50,54,.12), transparent 35%),
        rgba(17,16,33,.965);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 20px;
    box-shadow: 0 35px 90px rgba(0,0,0,.48);
    backdrop-filter: blur(20px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform-origin: top center;
}
.has-mega.is-open > .mega-menu,
.has-mega:hover > .mega-menu,
.has-mega:focus-within > .mega-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.mega-intro {
    padding: 20px;
    background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.018));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 15px;
}
.mega-intro span {
    display:block;
    color: var(--phk-red-bright);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .68rem;
    font-weight: 700;
    margin-bottom: 11px;
}
.mega-intro strong {
    display:block;
    color:#fff;
    font-size: 1.12rem;
    line-height:1.4;
    margin-bottom: 10px;
}
.mega-intro p { color: var(--phk-muted); font-size:.79rem; line-height:1.65; }
.mega-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:8px; align-content:start; }
.mega-grid--solutions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.mega-grid--insight { grid-template-columns: 1fr; }
.mega-link {
    display:grid;
    grid-template-columns: 35px 1fr;
    gap:12px;
    align-items:start;
    padding: 12px 14px;
    border-radius: 12px;
    color:#fff;
    border:1px solid transparent;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.mega-link:hover {
    background: rgba(255,255,255,.055);
    border-color: rgba(224,50,54,.24);
    transform: translateX(3px);
}
.mega-index { color:var(--phk-red-bright); font-size:.69rem; font-weight:700; padding-top:3px; padding-left: 20px;}
.mega-link b { display:block; font-size:.85rem; color:#fff; margin-bottom:3px; }
.mega-link small { display:block; color:#8f8e9e; font-size:.72rem; line-height:1.45; }

.mobile-menu-btn {
    width:46px;
    height:46px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:13px;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:5px;
}
.mobile-menu-btn span { width:20px; height:2px; background:#fff; border-radius:3px; transition:.25s ease; }
.mobile-menu-btn.is-open span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
.mobile-menu-btn.is-open span:nth-child(2){ opacity:0; }
.mobile-menu-btn.is-open span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }
.mobile-menu {
    justify-content: flex-start !important;
    align-items: stretch !important;
    background: rgba(17,16,33,.985) !important;
    backdrop-filter: blur(18px);
    padding: 100px 24px 28px;
    overflow:auto;
}
.mobile-menu-inner { width:min(680px,100%); margin:0 auto; display:grid; gap:10px; }
.mobile-group,
.mobile-direct {
    border:1px solid rgba(255,255,255,.09);
    border-radius:14px;
    background:rgba(255,255,255,.025);
}
.mobile-group summary,
.mobile-direct {
    list-style:none;
    color:#fff;
    font-size:1rem;
    font-weight:650;
    padding:16px 18px;
    cursor:pointer;
}
.mobile-group summary::-webkit-details-marker{ display:none; }
.mobile-group summary { display:flex; align-items:center; justify-content:space-between; }
.mobile-group summary span { color:var(--phk-red); font-size:.7rem; }
.mobile-submenu { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:0 12px 14px; }
.mobile-submenu a { color:#c6c5ce; padding:10px 9px; font-size:.82rem; border-radius:9px; background:rgba(255,255,255,.025); }
.mobile-contact { color:#fff; background:rgba(224,50,54,.13); border-color:rgba(224,50,54,.38); }


/* Industrial Insight uses the shared legacy hero classes whose base CSS starts
   text at opacity:0 for page-specific animation scripts. This template is
   driven by the professional layer, so keep its heading/content visible even
   when JS is delayed or motion is disabled. */

/* Small invisible hover corridor above the mega panel. It removes the dead
   zone between the top-level label and the absolutely-positioned submenu,
   without intercepting the rest of the navigation row. */
@media (min-width: 1101px) {
    .site-header .mega-menu::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -30px;
        height: 30px;
        background: transparent;
    }
}

/* ---------- Hero system ---------- */
.hero {
    min-height: min(900px, 100svh);
    height: 100svh;
    background-position:center !important;
    background-size:cover !important;
    isolation:isolate;
}
.hero::before {
    background:
        linear-gradient(90deg, rgba(17,16,33,.95) 0%, rgba(17,16,33,.78) 43%, rgba(17,16,33,.42) 72%, rgba(17,16,33,.28) 100%),
        linear-gradient(0deg, rgba(17,16,33,.82) 0%, transparent 35%) !important;
}
.hero::after {
    content:"";
    position:absolute;
    inset:0;
    z-index:1;
    pointer-events:none;
    background: radial-gradient(circle at 68% 48%, transparent 0, transparent 25%, rgba(17,16,33,.15) 65%);
}
.hero .container { text-align: initial; z-index:2; }
.hero-content { max-width: 830px; }
.hero-desc { max-width:690px; font-size:clamp(.98rem,1.35vw,1.15rem); line-height:1.75; }
.scroll-indicator { z-index:3; cursor:pointer; }
.scroll-indicator .line { background:linear-gradient(var(--phk-red),rgba(255,255,255,.3)); }

.services-hero { background-image:url('../images/projects/project-engineering-plant.webp') !important; }
.products-hero { background-image:url('../images/products-hero.webp') !important; }
.partners-hero { background-image:url('../images/partners-hero.webp') !important; }
.procurement-hero { background-image:url('../images/procurement-hero.webp') !important; }
.about-hero { background-image:url('../images/about-hero.webp') !important; }
.contact-hero { background-image:url('../images/contact-hero.jpg') !important; }

/* ---------- Editorial content ---------- */
.main-content { position:relative; overflow:hidden; }
.main-content::before {
    content:"";
    position:absolute;
    width:520px;
    height:520px;
    right:-260px;
    top:12%;
    border-radius:50%;
    background:rgba(224,50,54,.055);
    filter:blur(50px);
    pointer-events:none;
}
.page-content {
    max-width:1120px;
    margin-inline:auto;
    color:#d9d8e2;
    font-size:clamp(.99rem,1.2vw,1.08rem);
    line-height:1.95;
}
.page-content > p { margin-bottom:1.55rem; }
.page-content h2,
.page-content h3 {
    color:#fff;
    letter-spacing:-.025em;
    margin-top:2.7rem;
    margin-bottom:1rem;
}
.page-content h2 { font-size:clamp(1.55rem,2.3vw,2.3rem); }
.page-content h3 { font-size:clamp(1.25rem,1.75vw,1.65rem); }
.page-content ul,
.page-content ol { padding-left:1.35rem; margin:1rem 0 1.8rem; }
.page-content li { margin:.48rem 0; }

.phk-editorial-visual {
    position:relative;
    margin:clamp(2.6rem,6vw,5.2rem) auto;
    width:min(100%, 980px);
    min-height:320px;
    display:grid;
    place-items:center;
    border-radius:var(--phk-radius-lg);
    overflow:hidden;
    background:
        linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.012)),
        radial-gradient(circle at 20% 25%, rgba(224,50,54,.11), transparent 42%),
        #171628;
    border:1px solid rgba(255,255,255,.08);
    box-shadow:var(--phk-shadow);
    transform-style:preserve-3d;
}
.phk-editorial-visual::before {
    content:"";
    position:absolute;
    inset:0;
    background-image:linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px),linear-gradient(90deg,rgba(255,255,255,.026) 1px, transparent 1px);
    background-size:44px 44px;
    mask-image:linear-gradient(to bottom,rgba(0,0,0,.7),transparent);
}
.phk-editorial-visual img {
    position:relative;
    z-index:2;
    width:min(100%, 920px);
    height:auto;
    filter:drop-shadow(0 24px 26px rgba(0,0,0,.24));
    transform:translateZ(30px);
}
.phk-editorial-visual figcaption {
    position:absolute;
    left:22px;
    bottom:18px;
    z-index:3;
    padding:7px 11px;
    border-radius:999px;
    background:rgba(17,16,33,.72);
    color:#9e9dab;
    border:1px solid rgba(255,255,255,.08);
    font-size:.69rem;
    letter-spacing:.04em;
}
.phk-visual-aura { position:absolute; inset:15% 20%; border-radius:50%; background:rgba(224,50,54,.08); filter:blur(55px); }

/* ---------- Service / industry cards ---------- */


/* ---------- Products: keep intro, convert specs to modal buttons ---------- */
.chemicals { overflow:visible; }
.chemical-detail {
    border-radius:22px !important;
    border:1px solid rgba(255,255,255,.085) !important;
    background:linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.013)) !important;
    box-shadow:0 30px 70px rgba(5,5,15,.16);
}
.chemical-header {
    align-items:center;
    gap:clamp(1.5rem,4vw,4rem);
    padding-bottom:2rem;
    border-bottom:1px solid rgba(255,255,255,.07);
}
.chemical-info { flex:1; }
.chemical-image {
    width:clamp(150px,22vw,270px) !important;
    height:clamp(150px,22vw,270px) !important;
    padding:24px;
    border-radius:22px;
    background:
        radial-gradient(circle at 50% 45%, rgba(224,50,54,.14), transparent 48%),
        rgba(255,255,255,.025);
    border:1px solid rgba(255,255,255,.08);
}
.chemical-image img { width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 16px 24px rgba(0,0,0,.28)); }
.chemical-applications { margin-top:2rem; }
.chemical-specifications {
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:2rem;
    padding-top:1.8rem;
    border-top:1px solid rgba(255,255,255,.07);
}
.phk-spec-trigger {
    appearance:none;
    border:1px solid rgba(224,50,54,.38);
    background:linear-gradient(145deg, rgba(224,50,54,.14), rgba(224,50,54,.06));
    color:#fff;
    border-radius:12px;
    padding:13px 16px;
    display:inline-flex;
    align-items:center;
    gap:10px;
    font:600 .82rem/1.2 Inter,sans-serif;
    cursor:pointer;
    transition:transform .2s ease, border-color .2s ease, background .2s ease;
}
.phk-spec-trigger::after { content:"↗"; color:var(--phk-red-bright); font-size:1rem; }
.phk-spec-trigger:hover { transform:translateY(-2px); border-color:var(--phk-red); background:rgba(224,50,54,.2); }
.phk-spec-payload[hidden] { display:none !important; }

.phk-spec-modal {
    position:fixed;
    inset:0;
    z-index:4000;
    display:grid;
    place-items:center;
    padding:clamp(14px,3vw,38px);
    visibility:hidden;
    opacity:0;
    pointer-events:none;
}
.phk-spec-modal.is-open { visibility:visible; opacity:1; pointer-events:auto; }
.phk-spec-backdrop { position:absolute; inset:0; background:rgba(7,6,18,.84); backdrop-filter:blur(14px); }
.phk-spec-dialog {
    position:relative;
    z-index:1;
    width:min(1160px,100%);
    max-height:min(86vh,900px);
    display:grid;
    grid-template-rows:auto 1fr;
    background:#1b1930;
    border:1px solid rgba(255,255,255,.12);
    border-radius:20px;
    box-shadow:0 40px 120px rgba(0,0,0,.55);
    overflow:hidden;
}
.phk-spec-modal-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:18px 20px;
    border-bottom:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.02);
}
.phk-spec-modal-title { margin:0; color:#fff; font-size:clamp(1rem,2vw,1.35rem); }
.phk-spec-close {
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.04);
    color:#fff;
    min-height:42px;
    padding:0 14px;
    border-radius:11px;
    cursor:pointer;
    font:600 .78rem/1 Inter,sans-serif;
    display:inline-flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
    transition:background .2s ease,border-color .2s ease;
}
.phk-spec-close:hover { background:rgba(224,50,54,.16); border-color:rgba(224,50,54,.5); }
.phk-spec-modal-body { overflow:auto; padding:20px; }
.phk-spec-modal-body .specifications-table {
    display:table !important;
    width:100%;
    min-width:720px;
    margin:0 0 18px;
    border-collapse:separate;
    border-spacing:0;
}
.phk-spec-modal-body .specifications-table th { position:sticky; top:0; z-index:2; background:#302e49; }
.phk-spec-modal-body .specifications-table th,
.phk-spec-modal-body .specifications-table td { padding:13px 14px; border-bottom:1px solid rgba(255,255,255,.065); }
.phk-spec-modal-body .specs-note { color:#9f9eae; font-size:.8rem; }

/* ---------- Insight / Projects pages ---------- */
.phk-hub-section { padding:clamp(72px,8vw,118px) 0; }
.phk-hub-head { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr); gap:40px; align-items:end; margin-bottom:44px; }
.phk-kicker { color:var(--phk-red-bright); text-transform:uppercase; letter-spacing:.14em; font-size:.7rem; font-weight:750; }
.phk-hub-head h2 { font-size:clamp(2rem,4vw,3.7rem); letter-spacing:-.045em; line-height:1.08; margin-top:10px; }
.phk-hub-head p { color:#a9a8b7; line-height:1.8; }
.phk-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.insight-card,
.project-card { border:1px solid var(--phk-line); border-radius:18px; min-height:100%; }
.insight-card a,
.project-card a { color:inherit; display:block; height:100%; }
.insight-card-media,
.project-card-media { aspect-ratio:16/10; overflow:hidden; background:#111021; }
.insight-card-media img,
.project-card-media img { width:100%; height:100%; object-fit:cover; transition:transform .55s cubic-bezier(.2,.75,.3,1); }
.insight-card:hover img,
.project-card:hover img { transform:scale(1.045); }
.insight-card-body,
.project-card-body { padding:20px; }
.insight-card-meta,
.project-card-meta { color:var(--phk-red-bright); font-size:.7rem; text-transform:uppercase; letter-spacing:.09em; font-weight:700; }
.insight-card h3,
.project-card h3 { color:#fff; font-size:1.1rem; line-height:1.45; margin:9px 0; }
.insight-card p,
.project-card p { color:#9998a8; font-size:.82rem; line-height:1.7; }

@media (max-width: 1100px) {
    .site-header .nav-links { display:none; }
    .site-header .mobile-menu-btn { display:flex; }
    .phk-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .hero { min-height:720px; height:92svh; }
    .hero-title { font-size:clamp(2.35rem,11vw,3.65rem); }
    .hero::before { background:linear-gradient(90deg,rgba(17,16,33,.96),rgba(17,16,33,.72)) !important; }
    .phk-editorial-visual { min-height:250px; margin:2.5rem 0; }
    .phk-editorial-visual figcaption { display:none; }
    .chemical-header { flex-direction:column-reverse; align-items:flex-start; }
    .chemical-image { width:100% !important; height:220px !important; }
    .phk-hub-head { grid-template-columns:1fr; gap:16px; }
    .phk-card-grid { grid-template-columns:1fr; }
    .mobile-submenu { grid-template-columns:1fr 1fr; }
    .phk-spec-modal-body { padding:13px; }
}
@media (max-width: 480px) {
    .site-header { padding:10px 0 !important; }
    .site-header .logo-img { max-height:35px; }
    .mobile-menu { padding-top:82px; }
    .mobile-submenu { grid-template-columns:1fr; }
}

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