/* style.css paints every dark-theme body navy (#0f172a !important); the public
   site sits on one near-black backdrop instead, so header, page and footer match. */
html[data-bs-theme] body.public-dark-shell { background-color: #05070b !important; }

/* ============================================================
   Public-site header (includes/layout/public-nav.php)
   A floating glass capsule; .is-scrolled tightens it once the page moves.
   ============================================================ */

.pn {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 14px 0 6px;
    pointer-events: none; /* only the pieces below take clicks */
    transition: padding .35s ease;
}
.pn.is-scrolled { padding-top: 8px; }
/* Once the page moves, a soft fade keeps content from showing through behind
   the logo and actions. */
.pn::before {
    content: "";
    position: absolute;
    inset: 0 0 -18px;
    background: linear-gradient(180deg, rgba(5, 7, 11, .94) 0%, rgba(5, 7, 11, .72) 55%, rgba(5, 7, 11, 0) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
    mask-image: linear-gradient(180deg, #000 55%, transparent);
    opacity: .8;
    transition: opacity .35s ease;
    pointer-events: none;
}
.pn.is-scrolled::before { opacity: 1; }

.pn-inner {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}
.pn-inner > * { pointer-events: auto; }

/* ---------- Brand ---------- */
.pn-brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: #f5f7fb;
}
.pn-brand .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0f3d34, #0b2a33);
    border: 1px solid rgba(32, 231, 168, .35);
    box-shadow: 0 0 24px rgba(32, 231, 168, .18), inset 0 0 12px rgba(79, 215, 255, .12);
    transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s ease;
}
.pn-brand:hover .brand-logo {
    transform: rotate(-8deg) scale(1.06);
    box-shadow: 0 0 34px rgba(32, 231, 168, .32), inset 0 0 12px rgba(79, 215, 255, .2);
}
.pn-brand .brand-logo-ai-a { color: #e9fffb; }
.pn-brand .brand-logo-ai-i { color: #20e7a8; }
.pn-wordmark {
    font: 700 1.08rem/1 "Chakra Petch", "Kanit", sans-serif;
    letter-spacing: .02em;
    display: inline-flex;
    gap: .35em;
}
.pn-wordmark span {
    font-weight: 500;
    color: #8b95a4;
    transition: color .3s ease;
}
.pn-brand:hover .pn-wordmark span { color: #20e7a8; }

/* ---------- Capsule ---------- */
.pn-capsule {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(12, 17, 23, .55);
    border: 1px solid rgba(148, 163, 184, .14);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, .35),
        inset 0 1px 0 rgba(255, 255, 255, .05);
    transition: padding .35s ease, background .35s ease, box-shadow .35s ease;
}
/* thin moving highlight along the capsule's top edge */
.pn-capsule::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(32, 231, 168, .55) 45%, rgba(79, 215, 255, .55) 55%, transparent 100%) -200% 0 / 200% 100% no-repeat;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: pn-edge 7s linear infinite;
    pointer-events: none;
}
@keyframes pn-edge { to { background-position: 200% 0; } }

.pn.is-scrolled .pn-capsule {
    padding: 3px;
    background: rgba(9, 13, 18, .82);
    box-shadow: 0 14px 44px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.pn-link {
    position: relative;
    z-index: 1;
    padding: .55rem 1.05rem;
    border-radius: 999px;
    font: 500 .92rem/1 "Kanit", sans-serif;
    color: #a6afbd;
    text-decoration: none;
    white-space: nowrap;
    transition: color .25s ease, padding .35s ease;
}
.pn.is-scrolled .pn-link { padding: .5rem .95rem; }
.pn-link:hover,
.pn-link:focus-visible,
.pn-link.is-active { color: #f5f7fb; }
.pn-link.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: #20e7a8;
    box-shadow: 0 0 8px #20e7a8;
}

/* the light that follows the pointer between links */
.pn-glow {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(32, 231, 168, .16), rgba(79, 215, 255, .08));
    border: 1px solid rgba(32, 231, 168, .22);
    opacity: 0;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1), width .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
    pointer-events: none;
}
.pn.is-scrolled .pn-glow { top: 3px; bottom: 3px; }
.pn-capsule.has-glow .pn-glow { opacity: 1; }

/* ---------- Actions ---------- */
.pn-lang {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgba(12, 17, 23, .55);
    border: 1px solid rgba(148, 163, 184, .14);
}
.pn-lang a {
    padding: .38rem .6rem;
    border-radius: 999px;
    font: 600 .72rem/1 "Chakra Petch", sans-serif;
    letter-spacing: .08em;
    color: #8b95a4;
    text-decoration: none;
    transition: color .2s ease, background .2s ease;
}
.pn-lang a:hover { color: #f5f7fb; }
.pn-lang a.is-active { color: #04110d; background: linear-gradient(120deg, #20e7a8, #4fd7ff); }
@media (max-width: 419.98px) { .pn .pn-lang { display: none; } }
.pn-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.pn-plain {
    padding: .55rem .8rem;
    font: 500 .9rem/1 "Kanit", sans-serif;
    color: #a6afbd;
    text-decoration: none;
    transition: color .2s ease;
}
.pn-plain:hover { color: #f5f7fb; }
.pn-cta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .62rem 1.1rem;
    border-radius: 999px;
    font: 600 .9rem/1 "Kanit", sans-serif;
    color: #04110d;
    text-decoration: none;
    background: linear-gradient(120deg, #20e7a8, #4fd7ff);
    box-shadow: 0 0 0 0 rgba(32, 231, 168, 0), 0 8px 24px rgba(32, 231, 168, .22);
    transition: transform .25s ease, box-shadow .35s ease;
}
.pn-cta:hover {
    color: #04110d;
    transform: translateY(-1px);
    box-shadow: 0 0 0 4px rgba(32, 231, 168, .14), 0 10px 30px rgba(32, 231, 168, .3);
}
.pn-cta .bi { transition: transform .25s ease; }
.pn-cta:hover .bi { transform: translate(2px, -2px); }

.pn-avatar {
    padding: 2px;
    border-radius: 50%;
    border: 1px solid rgba(32, 231, 168, .35);
    background: transparent;
    line-height: 0;
}
.pn-avatar img { border-radius: 50%; object-fit: cover; }
.pn-menu-list {
    background: rgba(10, 14, 19, .96);
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 14px;
    padding: .4rem;
    min-width: 220px;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.pn-menu-list .dropdown-item {
    border-radius: 9px;
    color: #c9d1dc;
    padding: .5rem .7rem;
}
.pn-menu-list .dropdown-item:hover { background: rgba(32, 231, 168, .1); color: #f5f7fb; }
.pn-menu-list .dropdown-divider { border-color: rgba(148, 163, 184, .14); }
.pn-menu-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .7rem .6rem;
    color: #f5f7fb;
}

.pn-burger {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(12, 17, 23, .6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.pn-burger span {
    width: 18px;
    height: 1.5px;
    border-radius: 2px;
    background: #e9fffb;
    transition: transform .3s ease, width .3s ease;
}
.pn-burger span:last-child { width: 11px; margin-left: 7px; }
.pn-burger:hover span:last-child { width: 18px; margin-left: 0; }

/* ---------- Mobile menu (offcanvas from header.php) on the dark public site ---------- */
.public-dark-shell #mobileMenu {
    background: rgba(7, 10, 14, .96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-left: 1px solid rgba(148, 163, 184, .12);
    color: #f5f7fb;
}
.public-dark-shell #mobileMenu .nav-link {
    font: 500 1.05rem/1.2 "Kanit", sans-serif;
    color: #c9d1dc;
    padding: .7rem .2rem;
}
.public-dark-shell #mobileMenu .nav-link.active,
.public-dark-shell #mobileMenu .nav-link:hover { color: #20e7a8; }

/* ============================================================
   Public-site footer (includes/layout/public-footer.php)
   ============================================================ */
.pf {
    position: relative;
    z-index: 1;
    margin-top: 0;
    color: #a6afbd;
    background:
        radial-gradient(60% 50% at 50% 100%, rgba(32, 231, 168, .09), transparent 70%),
        linear-gradient(rgba(79, 215, 255, .025) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(90deg, rgba(79, 215, 255, .025) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(180deg, rgba(5, 7, 11, 0) 0, #05070b 140px);
    overflow: hidden;
}
.pf::before { /* a glowing hairline across the top */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(32, 231, 168, .3) 30%, rgba(79, 215, 255, .3) 70%, transparent);
    opacity: .7;
}
.pf-inner {
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(3rem, 6vw, 5rem) 0 1.5rem;
}
.pf-top {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
    gap: clamp(2rem, 5vw, 5rem);
}
.pf-brand p {
    max-width: 26rem;
    margin: 1.1rem 0 1.4rem;
    line-height: 1.75;
    color: #8c96a5;
}
.pf-mail {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font: 600 clamp(1.25rem, 2.4vw, 1.75rem)/1.2 "Chakra Petch", "Kanit", sans-serif;
    color: #f5f7fb;
    text-decoration: none;
    background: linear-gradient(90deg, #20e7a8, #4fd7ff) 0 100% / 0 1px no-repeat;
    transition: background-size .45s cubic-bezier(.2, .7, .2, 1), color .3s ease;
}
.pf-mail:hover { color: #e9fffb; background-size: 100% 1px; }
.pf-mail .bi { font-size: .8em; color: #20e7a8; transition: transform .3s ease; }
.pf-mail:hover .bi { transform: translate(3px, -3px); }
.pf-phone {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .8rem;
    color: #8c96a5;
    text-decoration: none;
    font-size: .92rem;
}
.pf-phone:hover { color: #20e7a8; }

.pf-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}
.pf-cols h2 {
    margin: 0 0 1rem;
    font: 600 .72rem/1 "Chakra Petch", ui-monospace, monospace;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #20e7a8;
}
.pf-cols a {
    display: block;
    width: fit-content;
    padding: .38rem 0;
    color: #a6afbd;
    text-decoration: none;
    transition: color .2s ease, transform .25s ease;
}
.pf-cols a:hover { color: #f5f7fb; transform: translateX(4px); }

/* the wordmark: drawn in particles (a dot pattern clipped to the letters),
   brighter where the pointer is */
.pf-word {
    margin: clamp(2rem, 5vw, 4rem) 0 -.1em;
    font: 700 clamp(5rem, 21vw, 19rem)/.82 "Chakra Petch", sans-serif;
    letter-spacing: .02em;
    text-align: center;
    color: transparent;
    background:
        radial-gradient(300px circle at var(--mx, -999px) var(--my, -999px), rgba(233, 255, 251, .95), rgba(32, 231, 168, .6) 35%, transparent 70%),
        radial-gradient(circle, rgba(32, 231, 168, .55) 0 1.1px, transparent 1.6px) 0 0 / 6px 6px,
        radial-gradient(circle, rgba(79, 215, 255, .35) 0 .9px, transparent 1.4px) 3px 3px / 6px 6px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-mask-image: linear-gradient(180deg, #000 30%, rgba(0, 0, 0, .25) 100%);
    mask-image: linear-gradient(180deg, #000 30%, rgba(0, 0, 0, .25) 100%);
    filter: drop-shadow(0 0 18px rgba(32, 231, 168, .12));
    user-select: none;
    animation: pf-shimmer 9s ease-in-out infinite;
}
@keyframes pf-shimmer { 50% { filter: drop-shadow(0 0 28px rgba(32, 231, 168, .22)); } }
.pf-bottom {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, .1);
    font-size: .85rem;
    color: #8b95a4;
}
.pf-legal { display: inline-flex; gap: 1.25rem; }
.pf-legal a { color: #8b95a4; text-decoration: none; }
.pf-legal a:hover { color: #f5f7fb; }

@media (max-width: 991.98px) {
    .pf-top { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .pf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .pn-inner { grid-template-columns: 1fr auto; }
    .pn-capsule { display: none; }
    .pn-burger { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
    .pn-capsule::before { animation: none; }
    .pn-glow { transition: none; }
}
