/* ==========================================================
   Mataram Foundation — Sistem Desain Publik (Front-end)
   ========================================================== */

:root {
    --f-head: 'Fraunces', Georgia, serif;
    --f-body: 'Inter', system-ui, sans-serif;

    /* LIGHT (default) */
    --bg: #f6f3ec;
    --bg-elev: #fbf9f4;
    --ink: #1a2b20;
    --soft: #5c6b60;
    --green: #1f3d2f;
    --green-deep: #16302a;
    --cream: #e8e0c4;
    --sand: #b5843c;
    --line: #e2dccb;
    --nav-ink: #1f3d2f;
    --mega-bg: #fbf9f4;
    --logo-green: block;
    --logo-cream: none;
    --shadow: 0 10px 40px rgba(20,30,20,.10);
}

[data-theme="dark"] {
    --bg: #10201a;
    --bg-elev: #152a22;
    --ink: #ece7d6;
    --soft: #9aab9e;
    --green: #e8e0c4;
    --green-deep: #0c1813;
    --cream: #e8e0c4;
    --sand: #cfa055;
    --line: #263a30;
    --nav-ink: #ece7d6;
    --mega-bg: #152a22;
    --logo-green: none;
    --logo-cream: block;
    --shadow: 0 10px 40px rgba(0,0,0,.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--f-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    transition: background .5s ease, color .5s ease;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sand); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- HEADER ---------- */
header.site {
    position: sticky; top: 0; z-index: 200;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transition: background .5s, border-color .5s;
}
.bar {
    max-width: 1300px; margin: 0 auto;
    padding: 1rem 2rem;
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.logo { display: flex; align-items: center; height: 50px; flex-shrink: 0; }
.logo img { height: 100%; width: auto; }
.logo .green-logo { display: var(--logo-green); }
.logo .cream-logo { display: var(--logo-cream); }

.nav-main { display: flex; align-items: center; gap: .3rem; }
.nav-main > .item { position: relative; }
.nav-main > .item > a {
    display: flex; align-items: center; gap: .35rem;
    padding: .6rem .9rem; font-size: .92rem; font-weight: 500;
    color: var(--nav-ink); border-radius: 8px; opacity: .85;
    transition: background .25s, color .25s;
}
.nav-main > .item > a:hover { opacity: 1; background: color-mix(in srgb, var(--sand) 12%, transparent); }
.nav-main > .item.has-mega > a::after {
    content: ""; width: 6px; height: 6px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px); opacity: .6; transition: transform .3s;
}
.nav-main > .item.has-mega:hover > a::after { transform: rotate(225deg) translateY(0); }

/* mega menu */
.mega {
    position: absolute; top: calc(100% + .6rem); left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--mega-bg); border: 1px solid var(--line);
    border-radius: 16px; box-shadow: var(--shadow);
    padding: 1.4rem; width: 520px;
    opacity: 0; visibility: hidden; transition: opacity .3s, transform .3s;
    display: grid; grid-template-columns: 1fr 1fr; gap: .4rem;
}
.item.has-mega:hover .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega::before { content: ""; position: absolute; top: -.6rem; left: 0; right: 0; height: .6rem; }
.mega a { display: block; padding: .75rem .9rem; border-radius: 10px; transition: background .25s; }
.mega a:hover { background: color-mix(in srgb, var(--sand) 14%, transparent); }
.mega a .t { font-family: var(--f-head); font-size: 1rem; color: var(--ink); margin-bottom: .15rem; display: block; }
.mega a .d { font-size: .8rem; color: var(--soft); line-height: 1.4; }
.mega .mega-head {
    grid-column: 1/-1; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--sand); padding: .2rem .9rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem;
}

/* right cluster */
.actions { display: flex; align-items: center; gap: .6rem; }
.lang { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 100px; overflow: hidden; }
.lang a {
    padding: .35rem .7rem; color: var(--soft); font-size: .82rem; font-weight: 500;
    font-family: inherit; transition: .25s;
}
.lang a.on { background: var(--green); color: var(--bg-elev); }
[data-theme="dark"] .lang a.on { color: var(--green-deep); }

.theme-btn {
    width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 100px;
    background: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: .3s; color: var(--nav-ink);
}
.theme-btn:hover { background: color-mix(in srgb, var(--sand) 14%, transparent); border-color: var(--sand); }
.theme-btn svg { width: 20px; height: 20px; overflow: visible; }
.theme-btn .disc { transition: transform .6s cubic-bezier(.5,0,.2,1); }
[data-theme="dark"] .theme-btn .disc { transform: translateX(5px); }
.theme-btn .shade { transition: transform .6s cubic-bezier(.5,0,.2,1); transform: translateX(9px); }
[data-theme="dark"] .theme-btn .shade { transform: translateX(2px); }

.burger {
    display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 100px;
    background: none; cursor: pointer; color: var(--nav-ink); align-items: center; justify-content: center;
}
.burger svg { width: 20px; height: 20px; }

/* ---------- MAIN ---------- */
main { max-width: 1300px; margin: 0 auto; padding: 3rem 2rem; min-height: 60vh; }

/* ---------- FOOTER ---------- */
footer.site {
    background: var(--green-deep); color: var(--cream);
    padding: 5rem 2rem 2rem; margin-top: 6rem; transition: background .5s;
}
[data-theme="dark"] footer.site { background: #0a1410; }
.foot {
    max-width: 1300px; margin: 0 auto;
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 3rem;
}
.foot .brand-col .fmark { height: 40px; margin-bottom: 1.3rem; }
.foot .brand-col .fmark img { height: 100%; }
.foot .brand-col p { color: color-mix(in srgb, var(--cream) 75%, transparent); max-width: 32ch; font-size: .92rem; line-height: 1.7; }
.foot .addr { margin-top: 1.3rem; font-size: .88rem; color: color-mix(in srgb, var(--cream) 70%, transparent); line-height: 1.7; font-style: normal; }
.foot .col h4 {
    font-size: .74rem; letter-spacing: .18em; text-transform: uppercase;
    color: color-mix(in srgb, var(--cream) 55%, transparent); margin-bottom: 1.2rem; font-weight: 600;
}
.foot .col a {
    display: block; color: color-mix(in srgb, var(--cream) 85%, transparent);
    margin-bottom: .7rem; font-size: .95rem; transition: .25s; width: fit-content;
}
.foot .col a:hover { color: var(--cream); transform: translateX(4px); }
.social { display: flex; gap: .7rem; margin-top: .4rem; }
.social a {
    width: 40px; height: 40px; border: 1px solid color-mix(in srgb, var(--cream) 25%, transparent);
    border-radius: 100px; display: flex; align-items: center; justify-content: center; transition: .3s;
}
.social a:hover { background: var(--sand); border-color: var(--sand); transform: translateY(-3px); }
.social a:hover svg { color: var(--green-deep); }
.social svg { width: 18px; height: 18px; color: var(--cream); transition: color .3s; }
.foot-bottom {
    max-width: 1300px; margin: 3.5rem auto 0; padding-top: 1.8rem;
    border-top: 1px solid color-mix(in srgb, var(--cream) 15%, transparent);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
    font-size: .82rem; color: color-mix(in srgb, var(--cream) 60%, transparent);
}
.foot-bottom .made em { font-style: italic; font-family: var(--f-head); }

/* ---------- MOBILE PANEL ---------- */
.mobile-panel {
    position: fixed; inset: 0; z-index: 300; background: var(--bg);
    transform: translateX(100%); transition: transform .4s cubic-bezier(.5,0,.2,1);
    padding: 2rem; display: flex; flex-direction: column; overflow-y: auto;
}
.mobile-panel.open { transform: translateX(0); }
.mobile-panel .mp-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.mobile-panel .mp-top .logo { height: 34px; }
.mobile-panel .mp-close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 100px; background: none; color: var(--nav-ink); cursor: pointer; font-size: 1.3rem; }
.mobile-panel nav a { display: block; font-family: var(--f-head); font-size: 1.5rem; color: var(--ink); padding: .7rem 0; border-bottom: 1px solid var(--line); }
.mobile-panel nav .sub a { font-family: var(--f-body); font-size: 1rem; color: var(--soft); padding: .5rem 0 .5rem 1rem; border: none; }
.mobile-panel .mp-actions { margin-top: auto; padding-top: 2rem; display: flex; align-items: center; gap: 1rem; }

@media (max-width: 960px) {
    .nav-main, .actions .lang, .actions .theme-btn { display: none; }
    .burger { display: flex; }
    .foot { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
    .foot .brand-col { grid-column: 1/-1; }
}
@media (max-width: 560px) {
    .bar { padding: .9rem 1.2rem; }
    main { padding: 2rem 1.2rem; }
    .foot { grid-template-columns: 1fr; }
    .foot-bottom { flex-direction: column; align-items: flex-start; }
}