/* ================================================================
   24 KRAT Aja — situs informasi
   Corak Melayu Kepri — palet & tipografi mengikuti brand.dart aplikasi
   ================================================================ */

:root {
  --hijau-songket: #123F2D;
  --forest:        #1B6B4A;
  --kuning-melayu: #B9860A;
  --emas-tua:      #A67C1C;
  --gold-soft:     #F2E3B3;
  --gading:        #F5F0E2;
  --gading-raised: #EFE8D4;
  --tinta:         #1B241E;
  --merah:         #A6321E;

  --bg:        var(--gading);
  --surface:   #FFFFFF;
  --text:      var(--tinta);
  --text-dim:  #5A5F55;
  --text-mute: #85897E;
  --hair:      rgba(166, 124, 28, 0.28);
  --hair-soft: rgba(166, 124, 28, 0.16);
  --link:      var(--forest);
  --ketupat:   rgba(18, 63, 45, 0.045);
  --shadow:    0 1px 2px rgba(27,36,30,.04), 0 12px 34px -12px rgba(18,63,45,.14);

  --measure: 68ch;
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --manuscript: "Amiri", "Iowan Old Style", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1D17; --surface: #182B22;
    --text: #ECE6D6; --text-dim: #B4B7A9; --text-mute: #8A8D80;
    --hair: rgba(242,227,179,.20); --hair-soft: rgba(242,227,179,.12);
    --link: #7FD4A8; --ketupat: rgba(242,227,179,.05);
    --gading-raised: #1C2E25;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 16px 40px -14px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --bg: #0F1D17; --surface: #182B22;
  --text: #ECE6D6; --text-dim: #B4B7A9; --text-mute: #8A8D80;
  --hair: rgba(242,227,179,.20); --hair-soft: rgba(242,227,179,.12);
  --link: #7FD4A8; --ketupat: rgba(242,227,179,.05);
  --gading-raised: #1C2E25;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 16px 40px -14px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(45deg,  transparent 0 26px, var(--ketupat) 26px 27px),
    repeating-linear-gradient(-45deg, transparent 0 26px, var(--ketupat) 26px 27px);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.14; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-color: var(--hair); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--kuning-melayu); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 940px; margin-inline: auto; padding-inline: 24px; }
.measure { max-width: var(--measure); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--kuning-melayu); }

/* ---- pucuk rebung edge ---- */
.pucuk { display: block; width: 100%; height: 16px; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--hair-soft);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar__row { display: flex; align-items: center; gap: 12px; height: 58px; }
.topbar__home {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 16px; font-weight: 600;
  color: var(--text); text-decoration: none;
}
.topbar__home svg { width: 16px; height: 16px; color: var(--emas-tua); }
.topbar__spacer { margin-left: auto; }
.theme-toggle {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--hair); border-radius: 8px;
  background: transparent; color: var(--text-dim); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--kuning-melayu); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ---- hero (landing) ---- */
.hero {
  position: relative; overflow: clip; isolation: isolate;
  background: linear-gradient(155deg, var(--hijau-songket), #0c2a1e 62%, #081f16);
  color: #F6F1E4;
}
.hero__weave {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    repeating-linear-gradient(45deg,  transparent 0 30px, rgba(255,255,255,.035) 30px 31px),
    repeating-linear-gradient(-45deg, transparent 0 30px, rgba(255,255,255,.035) 30px 31px);
}
.hero__inner {
  /* padding-block only — .wrap keeps its 24px padding-inline */
  padding-block: calc(clamp(48px, 9vw, 84px) + env(safe-area-inset-top, 0px)) clamp(38px, 6vw, 60px);
}
.hero .eyebrow { color: var(--gold-soft); opacity: .85; }
.wordmark {
  font-family: var(--serif); font-optical-sizing: auto;
  font-size: clamp(2.8rem, 10vw, 5rem); font-weight: 400;
  letter-spacing: -0.02em; margin: 16px 0 0; color: #fff;
}
.wordmark em { font-style: italic; color: var(--gold-soft); }
.hero__lede { font-size: clamp(1.02rem, 2.3vw, 1.25rem); color: rgba(246,241,228,.86); max-width: 46ch; margin: 18px 0 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1px solid rgba(242,227,179,.34); border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--gold-soft);
}
.chip svg { width: 14px; height: 14px; }
.gurindam {
  margin: 36px 0 0; padding-top: 24px;
  border-top: 1px solid rgba(242,227,179,.22);
  font-family: var(--manuscript); font-style: italic;
  font-size: clamp(1.02rem, 2.4vw, 1.32rem); line-height: 1.7;
  color: rgba(246,241,228,.9); max-width: 44ch;
}
.gurindam__src {
  display: block; margin-top: 12px;
  font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: rgba(242,227,179,.55);
}
.pucuk--hero { color: var(--bg); margin-top: -1px; }

/* ---- page header (sub-pages) ---- */
.page-head {
  background: linear-gradient(155deg, var(--hijau-songket), #0d2c20);
  color: #F6F1E4; position: relative; overflow: clip;
}
.page-head__weave {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,  transparent 0 28px, rgba(255,255,255,.035) 28px 29px),
    repeating-linear-gradient(-45deg, transparent 0 28px, rgba(255,255,255,.035) 28px 29px);
}
.page-head__inner {
  position: relative;
  /* padding-block only — .wrap keeps its 24px padding-inline */
  padding-block: clamp(46px, 9vw, 72px) clamp(32px, 5vw, 44px);
}
.page-head .eyebrow { color: var(--gold-soft); opacity: .82; }
.page-head h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 12px 0 0; color: #fff; }
.page-head p.sub { margin: 12px 0 0; color: rgba(246,241,228,.8); max-width: 52ch; font-size: 1.02rem; }
.pucuk--page { color: var(--bg); }

/* ---- content ---- */
main { padding: clamp(40px, 7vw, 68px) 0 clamp(56px, 9vw, 92px); }
.prose { max-width: var(--measure); }
.prose > p:first-child { font-size: 1.08rem; color: var(--text-dim); }
.prose h2 {
  font-size: 1.4rem; margin: 40px 0 12px;
  display: flex; align-items: center; gap: 11px;
}
.prose h2 .rosette { flex: none; width: 22px; height: 22px; color: var(--emas-tua); }
.prose h2:first-of-type { margin-top: 8px; }
.prose h3 { font-size: 1.12rem; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-dim); font-size: 15.5px; line-height: 1.74; }
.prose ol, .prose ul { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose ol.alpha { list-style: lower-alpha; }
.prose li { margin-bottom: .55em; }
.prose .note {
  margin-top: 24px; padding: 16px 18px;
  border-left: 3px solid var(--emas-tua);
  background: var(--gading-raised); border-radius: 0 10px 10px 0;
  font-size: 14.5px; color: var(--text-dim);
}
.prose blockquote {
  margin: 16px 0; padding-left: 16px;
  border-left: 3px solid var(--emas-tua);
  font-family: var(--manuscript); font-style: italic;
  font-size: 1.15rem; line-height: 1.7; color: var(--text);
}
.prose blockquote span {
  display: block; margin-top: 8px;
  font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute);
}

/* ---- index: navigation cards ---- */
.nav-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 640px) { .nav-cards { grid-template-columns: 1fr; } }
.nav-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.nav-card:hover { transform: translateY(-2px); border-color: var(--kuning-melayu); }
.nav-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, var(--emas-tua)); }
.nav-card .num { font-family: var(--serif); font-size: 13px; color: var(--kuning-melayu); font-weight: 600; letter-spacing: .1em; }
.nav-card h3 { font-size: 1.16rem; margin: 6px 0 6px; }
.nav-card p { font-size: 14px; color: var(--text-dim); margin: 0; }
.nav-card .go { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--link); display: inline-flex; align-items: center; gap: 5px; }

/* ---- feature groups (Tentang) ---- */
.groups { display: grid; gap: 16px; margin-top: 8px; }
.group {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 16px;
  padding: 20px 20px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.group::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--g, var(--emas-tua)); }
.group h3 { font-size: 1.08rem; margin: 0 0 4px; display: flex; align-items: center; gap: 9px; }
.group h3 .dot { width: 9px; height: 9px; border-radius: 2px; background: var(--g, var(--emas-tua)); flex: none; }
.group .meta { margin: 0 0 12px; font-size: 13px; color: var(--text-mute); }
.group ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px 18px; }
.group li { font-size: 14.5px; color: var(--text-dim); padding-left: 15px; position: relative; margin: 0; }
.group li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--g, var(--emas-tua)); opacity: .55; }
@media (max-width: 520px) { .group ul { grid-template-columns: 1fr; } }

/* ---- philosophy ---- */
.philo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 720px) { .philo-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.card h3 { font-size: 1.12rem; margin: 0 0 10px; }
.card p { font-size: 14.5px; color: var(--text-dim); margin: 0 0 .8em; }
.card p:last-child { margin-bottom: 0; }
.card--wide { grid-column: 1 / -1; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.swatch { flex: 1 1 118px; border-radius: 10px; overflow: hidden; border: 1px solid var(--hair-soft); }
.swatch__chip { height: 44px; }
.swatch__label { padding: 8px 10px; font-size: 11.5px; background: var(--gading-raised); }
.swatch__label b { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; }
.swatch__label span { color: var(--text-mute); font-variant-numeric: tabular-nums; }
.motifs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 14px; }
.motif { display: grid; grid-template-columns: 38px 1fr; gap: 13px; align-items: start; }
.motif svg { width: 32px; height: 32px; color: var(--emas-tua); }
.motif b { font-family: var(--serif); font-weight: 600; font-size: 1rem; color: var(--text); }
.motif span { display: block; font-size: 14px; color: var(--text-dim); margin-top: 2px; }
.type-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 12px; }
.type-spec { flex: 1 1 140px; }
.type-spec .big { font-size: 2rem; line-height: 1; color: var(--text); }
.type-spec .f-serif { font-family: var(--serif); }
.type-spec .f-sans { font-family: var(--sans); font-weight: 600; }
.type-spec .f-ms { font-family: var(--manuscript); font-style: italic; }
.type-spec small { display: block; margin-top: 8px; font-size: 12px; color: var(--text-mute); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }

/* ---- help ---- */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 640px) { .help-grid { grid-template-columns: 1fr; } }
.help-card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 5px;
}
.help-card .ico { width: 32px; height: 32px; color: var(--forest); }
.help-card b { font-family: var(--serif); font-size: 1.05rem; color: var(--text); margin-top: 4px; }
.help-card .val { font-size: 1.12rem; font-weight: 600; color: var(--text); word-break: break-word; text-decoration: none; }
.help-card a.val:hover { color: var(--link); }
.help-card small { color: var(--text-mute); font-size: 13px; }

/* ---- footer ---- */
.site-foot { background: linear-gradient(160deg, var(--hijau-songket), #0b241a); color: rgba(246,241,228,.82); }
.site-foot .pucuk { color: var(--bg); }
.site-foot .wrap { padding-top: 42px; padding-bottom: 42px; }
.site-foot .f-word { font-family: var(--serif); font-size: 1.4rem; color: #fff; }
.site-foot .f-motto { font-style: italic; color: var(--gold-soft); margin: 4px 0 16px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 18px; }
.site-foot nav a { font-size: 13.5px; color: rgba(246,241,228,.8); text-decoration: none; }
.site-foot nav a:hover { color: #fff; }
.hr-song { height: 6px; width: 100%; background: repeating-linear-gradient(90deg, var(--emas-tua) 0 10px, transparent 10px 20px); opacity: .5; }
.site-foot .f-meta { margin-top: 18px; font-size: 12.5px; color: rgba(246,241,228,.55); line-height: 1.8; }
.site-foot .f-meta a { color: var(--gold-soft); }
