/* =========================================================
   Tema qiran
   Arah: tipografi saja. Satu huruf (Sentient), satu warna dasar,
   satu tinta, satu aksen hijau giok untuk tombol utama.
   ========================================================= */

/* ---------- Token ---------- */

:root {
    /* Mode terang: kertas tulang, tinta hijau-hitam */
    --bg: #e3e2da;
    --surface: #d6d5cc;
    --ink: #161c1a;
    --muted: #4d5550;
    --accent: #9fc7b8;
    --accent-ink: #161c1a;
    --mark: #9fc7b8;

    /* Bagian yang dibalik (footer): selalu kebalikan dari halaman */
    --inv-bg: #161c1a;
    --inv-ink: #e3e2da;
    --inv-muted: #a3a9a1;

    --font: var(--gh-font-body, "Sentient"), Georgia, "Times New Roman", serif;
    --font-display: var(--gh-font-heading, "Sentient"), Georgia, serif;

    /* Lima ukuran huruf, tidak lebih */
    --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
    --step-body: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
    --step-lead: clamp(1.5rem, 1.2rem + 1.1vw, 2.25rem);
    --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
    --step-display: clamp(3.5rem, 6.6vw, 6.5rem);

    --margin: clamp(20px, 3.4vw, 48px);
    --axis: 42vw;
    --measure: 680px;
    --section: clamp(96px, 14vw, 200px);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

:root[data-mode="dark"] {
    --bg: #161c1a;
    --surface: #1f2725;
    --ink: #e3e2da;
    --muted: #a3a9a1;
    --inv-bg: #e3e2da;
    --inv-ink: #161c1a;
    --inv-muted: #4d5550;
    --mark: #2f5d50;
}
@media (prefers-color-scheme: dark) {
    :root[data-mode="auto"] {
        --bg: #161c1a;
        --surface: #1f2725;
        --ink: #e3e2da;
        --muted: #a3a9a1;
        --inv-bg: #e3e2da;
        --inv-ink: #161c1a;
        --inv-muted: #4d5550;
        --mark: #2f5d50;
    }
}

/* ---------- Dasar ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--step-body);
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip-link {
    position: absolute; left: var(--margin); top: -100px; z-index: 50;
    padding: 10px 16px; background: var(--ink); color: var(--bg); text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Halaman berada di atas footer; footer terungkap saat halaman habis di-scroll */
.page { position: relative; z-index: 2; background: var(--bg); }
.main { min-height: 60vh; }

/* ---------- Tombol dan tautan ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink);
    font: 500 var(--step-body)/1 var(--font); text-decoration: none; cursor: pointer;
    transition: transform .2s var(--ease-out), background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-ink { background: var(--accent-ink); color: var(--accent); }

.textbtn, .textlink {
    padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
    font: inherit; text-decoration: underline; text-decoration-thickness: 1px;
    text-underline-offset: .25em; text-decoration-color: transparent;
    transition: text-decoration-color .2s;
}
.textbtn:hover, .textlink:hover, .textbtn:focus-visible { text-decoration-color: currentColor; }
.textlink { text-decoration-color: var(--muted); }

/* ---------- Baris atas ---------- */

.topbar {
    position: relative; z-index: 5;
    display: grid; grid-template-columns: calc(var(--axis) - var(--margin)) 1fr auto;
    align-items: baseline; padding: 40px var(--margin) 0;
    font-size: var(--step-body);
}
.wordmark { font-weight: 500; font-size: var(--step-lead); line-height: 1; letter-spacing: -.02em; text-decoration: none; }
.wordmark img { height: 32px; width: auto; }
.topnav .nav { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.topnav .nav a {
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em;
    text-decoration-color: transparent; transition: text-decoration-color .2s;
}
.topnav .nav a:hover { text-decoration-color: currentColor; }
.topactions { display: flex; gap: 24px; }
.menu-btn { display: none; }

@media (max-width: 760px) {
    .topbar { grid-template-columns: 1fr auto; padding-top: 24px; }
    .topactions { gap: 18px; }
    .menu-btn { display: inline; }
    .topnav { display: none; grid-column: 1 / -1; padding-top: 20px; }
    .topnav.is-open { display: block; }
    .topnav .nav { flex-direction: column; gap: 0; }
    .topnav .nav a { display: block; padding: 10px 0; font-size: var(--step-lead); color: var(--ink); }
}

/* ---------- Beranda: pernyataan pembuka ---------- */

.hero {
    position: relative;
    min-height: min(88svh, 860px);
    display: grid; grid-template-columns: calc(var(--axis) - var(--margin)) 1fr;
    grid-template-rows: 1fr auto auto;
    padding: 0 var(--margin) 72px;
}
.hero-title {
    grid-column: 2; grid-row: 2; align-self: end;
    margin: 0; max-width: 11em;
    font: 400 var(--step-display)/.95 var(--font-display); letter-spacing: -.04em;
}
.hero-foot { display: contents; }
.hero-text {
    grid-column: 1; grid-row: 2; align-self: end;
    max-width: 32ch; margin: 0 32px 6px 0; color: var(--muted);
    font-size: var(--step-body); line-height: 1.5;
}
.hero-btn { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 40px; }

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr; grid-template-rows: 1fr auto auto auto;
        min-height: 82svh; padding-bottom: 28px;
    }
    .hero-title { grid-column: 1; grid-row: 2; font-size: 12.5vw; }
    .hero-text { grid-column: 1; grid-row: 3; margin: 24px 0 0; }
    .hero-btn { grid-column: 1; grid-row: 4; margin-top: 28px; }
}

/* ---------- Beranda: tulisan terbaru (blok warna giok) ---------- */

.latest {
    background: var(--accent); color: var(--accent-ink);
    padding: var(--section) var(--margin);
}
.latest-inner { max-width: 1100px; }
.latest-title {
    margin: 0 0 32px; max-width: 18em;
    font: 400 var(--step-head)/1 var(--font-display); letter-spacing: -.03em;
}
@media (max-width: 600px) { .latest-title { font-size: var(--step-lead); line-height: 1.1; } }
.latest-title a { text-decoration: none; }
.latest-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.latest-text { margin: 0 0 48px; max-width: 30em; font-size: var(--step-lead); line-height: 1.25; letter-spacing: -.01em; }
.latest-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.latest-meta { margin: 0; font-size: var(--step-body); }

/* Gambar besar sebagai jeda dari tulisan */
.relief { margin: 0; overflow: hidden; background: var(--surface); }
.relief-img { width: 100%; height: min(80svh, 56.25vw); object-fit: cover; transform-origin: center; }
.relief figcaption, .article-figure figcaption {
    padding: 14px var(--margin) 0; color: var(--muted); font-size: var(--step-small);
}

/* ---------- Daftar tulisan ---------- */

.archive { padding: var(--section) var(--margin); }
.archive-top { padding-top: clamp(64px, 10vw, 140px); }
.archive-more { padding-top: var(--section); }
.archive-col { max-width: 640px; margin-left: calc(22vw - var(--margin)); }
@media (max-width: 900px) { .archive-col { margin-left: 0; } }

/* Daftar + pratinjau di layar lebar: judul di kiri, gambar dan ringkasan di kanan */
.peeks { display: none; }
@media (min-width: 1100px) {
    .has-peek {
        display: grid; align-items: start;
        grid-template-columns: calc(22vw - var(--margin)) minmax(0, 600px) minmax(0, 1fr);
    }
    .has-peek .archive-col { grid-column: 2; margin-left: 0; }
    .has-peek .peeks {
        display: block; grid-column: 3; position: sticky; top: 48px;
        margin-top: calc(var(--step-head) + 32px); padding-left: clamp(40px, 5vw, 80px);
    }
}
.peek { display: none; }
.peek.is-on { display: block; animation: peek-in .45s var(--ease-out); }
.peek-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); margin-bottom: 24px; }
.peek-text { margin: 0 0 12px; max-width: 34ch; font-size: var(--step-body); line-height: 1.45; }
.peek-meta { margin: 0; color: var(--muted); font-size: var(--step-small); }
@keyframes peek-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.row.is-active .row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

.archive-title {
    margin: 0 0 32px;
    font: 400 var(--step-head)/1 var(--font-display); letter-spacing: -.03em;
}
.archive-top .archive-title { font-size: var(--step-head); line-height: .95; letter-spacing: -.04em; margin-bottom: 40px; }
.lead-soft { margin: -12px 0 40px; max-width: 34em; color: var(--muted); }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 24px; }

.filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.chip {
    min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
    background: var(--surface); color: var(--ink); font: inherit; font-size: var(--step-body); cursor: pointer;
    transition: background-color .2s, color .2s, transform .15s;
}
.chip:hover { transform: translateY(-1px); }
.chip.is-on { background: var(--ink); color: var(--bg); }

.rows { margin: 0; padding: 0; list-style: none; }
.rows-group {
    margin: 40px 0 6px; color: var(--muted); font-size: var(--step-body);
}
.rows-group:first-child { margin-top: 0; }
.row-link {
    display: grid; grid-template-columns: 16px 1fr auto; gap: 0 12px; align-items: baseline;
    padding: 9px 0; text-decoration: none;
}
.row-dot {
    width: 16px; height: 16px; border-radius: 50%; overflow: hidden;
    background: var(--accent); align-self: center; transform: translateY(1px);
}
.row-dot img { width: 16px; height: 16px; object-fit: cover; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { line-height: 1.3; transition: color .2s; }
.row-sub { color: var(--muted); font-size: var(--step-small); margin-top: 2px; }
.row-date { color: var(--muted); font-size: var(--step-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link:hover .row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.rows-empty { color: var(--muted); }

@media (max-width: 600px) {
    .row-link { grid-template-columns: 16px 1fr; padding: 11px 0; }
    .row-date { grid-column: 2; margin-top: 2px; }
}

.pager {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    margin-top: 56px; font-size: var(--step-body);
}
.pager-info { color: var(--muted); font-size: var(--step-small); }

/* ---------- Beranda: tentang (dua kolom, kata yang ditandai) ---------- */

.about { background: var(--surface); padding: var(--section) var(--margin); }
.about-title { margin: 0 0 40px; font: 400 var(--step-head)/1 var(--font-display); letter-spacing: -.03em; }
.about-body {
    columns: 2; column-gap: 48px; max-width: 1240px;
    color: var(--ink); font-size: clamp(1.25rem, 1.05rem + 0.5vw, 1.5rem); line-height: 1.35;
}
.about-body p { margin: 0 0 .6em; }
.about-body strong { color: var(--ink); font-weight: 500; }
.about-body mark, .gh-content mark {
    background: var(--mark); color: var(--ink); padding: 0 .1em;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.about-body a { color: var(--ink); }
@media (max-width: 760px) {
    .about-body { columns: 1; }
}

/* ---------- Artikel ---------- */

.article-head {
    display: grid; grid-template-columns: calc(var(--axis) - var(--margin)) 1fr;
    padding: clamp(64px, 12vw, 160px) var(--margin) 56px;
}
.article-title {
    grid-column: 2; margin: 0; max-width: 14em;
    font: 400 var(--step-head)/1 var(--font-display); letter-spacing: -.03em; overflow-wrap: break-word;
}
.article-meta {
    grid-column: 1; grid-row: 1; align-self: end;
    display: flex; flex-direction: column; gap: 2px; padding-right: 32px;
    color: var(--muted); font-size: var(--step-small);
}
.article-author { color: var(--ink); font-size: var(--step-body); text-decoration: none; }
.article-author:hover, .article-tag:hover { text-decoration: underline; }
.article-tag { color: var(--muted); text-decoration: none; }
.article-lede {
    grid-column: 2; margin: 32px 0 0; max-width: 34em;
    color: var(--muted); font-size: clamp(1.25rem, 1rem + .6vw, 1.5rem); line-height: 1.4;
}
@media (max-width: 900px) {
    .article-head { grid-template-columns: 1fr; }
    .article-title, .article-lede { grid-column: 1; }
    .article-meta { grid-column: 1; grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; margin-top: 24px; }
}

.article-figure { margin: 0 0 clamp(48px, 7vw, 96px); }
.article-figure img { width: 100%; max-height: 85svh; object-fit: cover; }

/* Isi dari editor Ghost. Kolom baca mulai di sumbu yang sama dengan judul. */
.gh-content {
    display: grid;
    grid-template-columns:
        [full-start] var(--margin)
        [wide-start] calc(var(--axis) - var(--margin) * 2)
        var(--margin)
        [main-start] minmax(0, var(--measure)) [main-end]
        minmax(0, 1fr)
        [wide-end] var(--margin) [full-end];
    font-size: var(--step-body);
    line-height: 1.6;
}
@media (max-width: 1200px) {
    .gh-content {
        grid-template-columns:
            [full-start] var(--margin)
            [wide-start] minmax(0, 1fr)
            [main-start] minmax(0, var(--measure)) [main-end]
            minmax(0, 1fr)
            [wide-end] var(--margin) [full-end];
    }
}
.gh-content > * { grid-column: main; margin: 0 0 1.25em; }
.gh-content > .kg-width-wide { grid-column: wide; }
.gh-content > .kg-width-full { grid-column: full; }
.gh-content > .kg-width-full img { width: 100%; }
.gh-content > :last-child { margin-bottom: 0; }

.gh-content h2, .gh-content h3, .gh-content h4 {
    margin: 1.8em 0 .5em; font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -.02em;
}
.gh-content h2 { font-size: var(--step-lead); }
.gh-content h3, .gh-content h4 { font-size: var(--step-body); font-weight: 700; letter-spacing: 0; }
.gh-content a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.gh-content a:hover { text-decoration-color: currentColor; }
.gh-content strong { font-weight: 700; }
.gh-content ul, .gh-content ol { padding-left: 1.2em; }
.gh-content li + li { margin-top: .35em; }
.gh-content blockquote:not([class]) {
    margin-left: 0; margin-right: 0; padding: 0 0 0 1em;
    font-size: var(--step-lead); line-height: 1.3; letter-spacing: -.01em;
    border-left: 3px solid var(--accent);
}
.gh-content blockquote.kg-blockquote-alt {
    padding: 0; font-size: var(--step-lead); line-height: 1.3; font-style: italic; text-align: left;
}
.gh-content hr {
    width: 100%; height: auto; border: 0; margin: 2em 0; text-align: center; color: var(--muted);
}
.gh-content hr::after { content: "* * *"; letter-spacing: .5em; }
.gh-content code { padding: .1em .35em; background: var(--surface); border-radius: 4px; font-size: .85em; }
.gh-content pre { overflow-x: auto; padding: 18px 20px; background: var(--surface); border-radius: 6px; font-size: 15px; line-height: 1.6; }
.gh-content pre code { padding: 0; background: none; font-size: inherit; }
.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content figcaption { margin-top: 10px; color: var(--muted); font-size: var(--step-small); }
.gh-content table { width: 100%; border-collapse: collapse; font-size: var(--step-small); }
.gh-content th, .gh-content td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--surface); }
.kg-callout-card { border-radius: 6px; }
.kg-bookmark-card a { color: inherit; }

.article-end, .article-comments {
    padding: 0 var(--margin); margin: 64px auto 0;
    max-width: calc(var(--measure) + var(--margin) * 2);
}
@media (min-width: 1201px) {
    .article-end, .article-comments { margin-left: calc(var(--axis) - var(--margin)); }
}
.article-tags { margin: 0; color: var(--muted); }

/* ---------- Footer: dibalik, nama besar di bawah ---------- */

.footer {
    display: grid; grid-template-rows: auto auto;
    padding: 40px var(--margin) 20px;
    background: var(--inv-bg); color: var(--inv-ink);
}
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.footer-col { color: var(--inv-muted); font-size: var(--step-body); line-height: 1.45; }
.footer-col p { margin: 0; }
.footer-col .footer-head { color: var(--inv-ink); margin-bottom: 4px; }
.footer-col ul, .footer-col .nav { margin: 0; padding: 0; list-style: none; }
.footer-col a { color: inherit; text-decoration: none; }
.footer-col a:hover { color: var(--inv-ink); text-decoration: underline; }
.footer-mark { margin-top: clamp(96px, 12vw, 180px); overflow: hidden; }
.bigmark {
    display: inline-block; margin: 0; padding-bottom: .06em; white-space: nowrap;
    font: 300 38vw/1.08 var(--font-display); letter-spacing: -.05em;
}
.legal { margin: 16px 0 0; color: var(--inv-muted); font-size: var(--step-small); }

@media (max-width: 760px) {
    .footer-cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
}

/* ---------- Halaman error ---------- */

.error {
    min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
    gap: 28px; padding: var(--margin) var(--margin) 72px;
}
.error-title { margin: 0; font: 400 var(--step-display)/.95 var(--font-display); letter-spacing: -.04em; max-width: 10em; }

/* ---------- Gerak ---------- */

/* Judul naik dari balik garisnya sendiri (hanya kalau JavaScript aktif) */
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line-inner { display: block; }
.js .js-lines .line-inner { transform: translateY(105%); }
.js .js-lines.is-in .line-inner { transform: none; transition: transform .9s var(--ease-out); }
.js .js-lines.is-in .line:nth-child(2) .line-inner { transition-delay: .11s; }
.js .js-lines.is-in .line:nth-child(3) .line-inner { transition-delay: .22s; }
.js .hero-text, .js .hero-btn { opacity: 0; transform: translateY(16px); }
.js .is-ready .hero-text, .js .is-ready .hero-btn { opacity: 1; transform: none; transition: opacity .7s .5s, transform .7s .5s var(--ease-out); }

/* Bagian lain muncul berurutan saat masuk layar */
.js-ready .reveal { opacity: 0; transform: translateY(24px); }
.js-ready .reveal.is-in { opacity: 1; transform: none; transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--d, 0s); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
    .js .js-lines .line-inner, .js-ready .reveal, .js .hero-text, .js .hero-btn { transform: none !important; opacity: 1 !important; }
}

/* Pengaman: kalau main.js gagal dimuat, judul tetap tampil setelah 3 detik */
.js-fallback .js-lines .line-inner, .js-fallback .hero-text, .js-fallback .hero-btn { transform: none; opacity: 1; }
