/* ==========================================================================
   Portal Pertanian Terintegrasi — VERSI 1 (default)
   Sederhana, cerah, profesional. Mengacu INA Digital Design System (IDDS).

   Aturan warna 60 / 30 / 10
   - 60% WARM      : latar & permukaan netral hangat (ivory, stone) + teks ink
   - 30% IDENTITY  : hijau Kementan yang tenang — navigasi, judul aksen, tombol utama, ikon, footer
   - 10% HIGHLIGHT : biru IDDS — status, tautan, chip, fokus, aliran data (dipakai hemat)
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* 60% — warm neutral */
  --warm-0: #ffffff;
  --warm-50: #fbfaf7;
  --warm-100: #f5f2ec;
  --warm-200: #ebe6dd;
  --warm-300: #ddd6ca;
  --ink-900: #1c1b18;
  --ink-700: #45423c;
  --ink-500: #6e6961;

  /* 30% — identity (hijau Kementan, tenang & profesional) */
  --id-900: #0f3d26;
  --id-800: #154c31;
  --id-700: #1a5e3a;
  --id-600: #217047;
  --id-100: #e4efe8;
  --id-50: #f1f7f3;

  /* 10% — highlight (biru IDDS) */
  --hl-700: #0049b8;
  --hl-500: #0968f6;
  --hl-100: #ecf3fe;

  /* Sentimen IDDS */
  --positive-600: #288034;
  --positive-100: #edfded;
  --negative-600: #d50b0b;
  --negative-100: #fdeded;

  /* Token semantik */
  --bg: var(--warm-50);
  --bg-alt: var(--warm-100);
  --surface: var(--warm-0);
  --border: var(--warm-200);
  --border-strong: var(--warm-300);
  --text: var(--ink-900);
  --text-2: var(--ink-700);
  --text-3: var(--ink-500);

  /* Radius & shadow IDDS */
  --r-md: .375rem;
  --r-lg: .5rem;
  --r-xl: .75rem;
  --r-2xl: 1rem;
  --r-3xl: 1.5rem;
  --r-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(28, 27, 24, .05);
  --shadow-md: 0 4px 6px -1px rgba(28, 27, 24, .07), 0 2px 4px -2px rgba(28, 27, 24, .05);
  --shadow-lg: 0 10px 15px -3px rgba(28, 27, 24, .08), 0 4px 6px -4px rgba(28, 27, 24, .05);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --container: 1160px;
  --gutter: 16px;
  color-scheme: light;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  font-family: var(--font); font-size: 16px; line-height: 24px;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--hl-100); color: var(--hl-700); }
:focus-visible { outline: 3px solid var(--hl-500); outline-offset: 2px; border-radius: var(--r-md); }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 16px; border-radius: var(--r-lg); background: var(--id-700); color: #fff; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 16px; }

/* ---------- Tipografi (skala IDDS) ---------- */
.display { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 750; }
.h2 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.22; letter-spacing: -0.01em; font-weight: 700; }
.h6 { font-size: 18px; line-height: 26px; font-weight: 650; }
.lead { font-size: clamp(16px, 1.5vw, 18px); line-height: 1.6; color: var(--text-2); max-width: 60ch; }
.eyebrow { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--id-700); margin-bottom: 12px; }
.text-id { color: var(--id-700); }

.icon { width: 24px; height: 24px; flex: none; }
.icon--sm { width: 16px; height: 16px; stroke-width: 1.25; }

/* ---------- Button (IDDS 40/44/52) ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding-inline: 20px; border-radius: var(--r-xl); border: 1px solid transparent;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.btn .icon { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn--sm { --h: 40px; padding-inline: 16px; font-size: 14px; }
.btn--lg { --h: 52px; padding-inline: 24px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--id-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--id-800); }
.btn--outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--outline:hover { border-color: var(--id-600); color: var(--id-700); }
.btn:disabled { opacity: .6; cursor: progress; }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.icon-btn .icon { width: 20px; height: 20px; }

/* ---------- Masthead ---------- */
.masthead { background: var(--warm-100); border-bottom: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--text-2); }
.masthead summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-block: 6px; cursor: pointer; list-style: none; }
.masthead summary::-webkit-details-marker { display: none; }
.masthead summary > span:first-of-type { flex: 1 1 200px; }
@media (min-width: 768px) { .masthead summary > span:first-of-type { flex: 0 1 auto; } }
.masthead__more { display: inline-flex; align-items: center; gap: 2px; color: var(--hl-700); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.masthead details[open] .masthead__more .icon { transform: rotate(180deg); }
.masthead__panel { display: grid; gap: 8px; padding: 8px 0 12px; }
.masthead__panel p { display: flex; gap: 8px; align-items: center; }
.masthead__panel .icon { width: 20px; height: 20px; color: var(--id-700); }
@media (min-width: 768px) { .masthead__panel { grid-template-columns: 1fr 1fr; } }

/* ---------- Navbar ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(251, 250, 247, .88); backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
.nav.is-scrolled { border-color: var(--border); box-shadow: var(--shadow-sm); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { width: 40px; height: 40px; }
.brand__text { display: grid; line-height: 1.15; }
.brand__text strong { font-size: 16px; font-weight: 700; color: var(--id-800); }
.brand__text small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.nav__menu { display: none; gap: 4px; }
.nav__menu a { padding: 8px 14px; border-radius: var(--r-lg); font-size: 15px; font-weight: 550; text-decoration: none; color: var(--text-2); transition: color .2s, background-color .2s; }
.nav__menu a:hover, .nav__menu a.is-active { color: var(--id-700); background: var(--id-50); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.nav__cta { display: none; }
@media (min-width: 960px) {
  .nav__menu { display: flex; }
  .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
}
@media (max-width: 959.98px) {
  .nav__menu { position: absolute; inset: 72px 0 auto 0; flex-direction: column; padding: 8px var(--gutter) 20px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { padding: 14px 12px; font-size: 16px; }
}

/* ---------- Hero ---------- */
.hero { padding-block: 56px 72px; background: linear-gradient(180deg, var(--warm-50) 0%, var(--warm-100) 100%); border-bottom: 1px solid var(--border); }
.hero__grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) { .hero { padding-block: 88px 96px; } .hero__grid { grid-template-columns: 1.05fr .95fr; gap: 64px; } }
.hero .display { margin-bottom: 20px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__points { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; font-size: 14px; color: var(--text-2); }
.hero__points li { display: inline-flex; align-items: center; gap: 6px; }
.hero__points .icon { color: var(--id-600); stroke-width: 2; }
.hero__art { width: 100%; max-width: 520px; margin-inline: auto; }

.integ-ill { width: 100%; height: auto; filter: drop-shadow(0 20px 40px rgba(28, 27, 24, .08)); }
.integ-ill .ill-bg { fill: var(--warm-0); stroke: var(--border); }
.integ-ill .ill-dot { fill: var(--warm-300); }
.integ-ill .ill-links path { stroke: var(--border-strong); }
.integ-ill .ill-packets path { stroke: var(--hl-500); stroke-dasharray: 6 200; stroke-dashoffset: 0; }
.integ-ill .ill-card { fill: var(--warm-0); stroke: var(--border-strong); stroke-width: 1.5; }
.integ-ill .ill-bar { fill: var(--warm-100); }
.integ-ill .ill-bar-dot { fill: var(--warm-300); }
.integ-ill .ill-id { fill: var(--id-700); }
.integ-ill .ill-id-soft { fill: var(--id-100); }
.integ-ill .ill-hl { fill: var(--hl-500); }
.integ-ill .ill-hl-soft { fill: var(--hl-100); }
.integ-ill .ill-line { fill: var(--warm-200); }
.integ-ill .ill-line-strong { fill: var(--warm-300); }
.integ-ill .ill-label { font: 600 12px var(--font); }
.integ-ill .ill-label--id { fill: var(--id-700); }
.integ-ill .ill-label--hl { fill: var(--hl-700); }
.integ-ill .ill-tile rect { fill: var(--warm-0); stroke: var(--border-strong); stroke-width: 1.5; }
.integ-ill .ill-tile use { color: var(--id-700); }

/* ---------- Ringkasan ---------- */
.stats { padding-block: 40px; background: var(--surface); border-bottom: 1px solid var(--border); }
.stats__grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats__grid { grid-template-columns: repeat(4, 1fr); } }
.stat { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 8px 0; }
.stat__icon { grid-row: span 2; width: 44px; height: 44px; padding: 10px; border-radius: var(--r-xl); background: var(--id-50); color: var(--id-700); }
.stat__value { font-size: 28px; line-height: 32px; font-weight: 750; letter-spacing: -0.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__label { font-size: 14px; line-height: 20px; color: var(--text-3); }
.stats__note { margin-top: 12px; font-size: 12px; color: var(--text-3); }

/* ---------- Section umum ---------- */
.section { padding-block: 88px; }
.section--warm { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head .lead { margin-top: 12px; }

/* ---------- Katalog sistem ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter { padding: 8px 16px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; font-weight: 550; color: var(--text-2); cursor: pointer; transition: all .2s; }
.filter:hover { border-color: var(--id-600); color: var(--id-700); }
.filter.is-active { background: var(--id-700); border-color: var(--id-700); color: #fff; }
.systems { display: grid; gap: 16px; }
@media (min-width: 640px) { .systems { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .systems { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.system { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: var(--r-2xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s; }
.system:hover { border-color: var(--id-100); box-shadow: var(--shadow-lg); }
.system p { color: var(--text-2); font-size: 15px; line-height: 23px; }
.system__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.system__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-xl); background: var(--id-50); color: var(--id-700); }
.system__icon .icon { width: 22px; height: 22px; }
.system__cat { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12px !important; font-weight: 600; letter-spacing: .02em; color: var(--text-3) !important; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-full); background: var(--hl-100); color: var(--hl-700); font-size: 12px; line-height: 20px; font-weight: 600; }
.status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hl-500); }
.systems__empty { padding: 24px; text-align: center; color: var(--text-3); }

/* ---------- Arsitektur integrasi ---------- */
.integ { display: grid; gap: 40px; }
@media (min-width: 1024px) { .integ { grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; } .integ__copy { position: sticky; top: 120px; } }
.integ__copy .lead { margin-top: 12px; }
.layers { display: grid; gap: 12px; position: relative; }
.layer { display: grid; grid-template-columns: auto auto 1fr; gap: 16px; align-items: start; padding: 20px 24px; border-radius: var(--r-2xl); background: var(--surface); border: 1px solid var(--border); }
.layer p { color: var(--text-2); margin-top: 4px; font-size: 15px; line-height: 23px; }
.layer__no { font-size: 14px; font-weight: 700; color: var(--text-3); padding-top: 12px; font-variant-numeric: tabular-nums; }
.layer__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-xl); background: var(--id-700); color: #fff; }

/* ---------- Dukungan ---------- */
.support { display: grid; gap: 16px; }
@media (min-width: 640px) { .support { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .support { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.support__item { padding: 24px; border-radius: var(--r-2xl); border: 1px solid var(--border); background: var(--surface); }
.support__item p { color: var(--text-2); margin-top: 6px; font-size: 15px; line-height: 23px; }
.support__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: var(--r-xl); background: var(--id-50); color: var(--id-700); }

.process { margin-top: 64px; padding: 32px; border-radius: var(--r-3xl); background: var(--surface); border: 1px solid var(--border); }
.process__title { font-size: 20px; line-height: 28px; font-weight: 700; margin-bottom: 28px; }
.process__body { position: relative; }
.process__track { display: none; position: absolute; left: 20px; right: calc(25% - 20px); top: 19px; height: 2px; background: var(--border); }
.process__track span { display: block; height: 100%; background: var(--id-600); transform-origin: left; transform: scaleX(1); }
.process__steps { display: grid; gap: 24px; position: relative; }
@media (min-width: 900px) { .process__track { display: block; } .process__steps { grid-template-columns: repeat(4, 1fr); } }
.step__dot { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 50%; background: var(--id-700); color: #fff; font-weight: 700; box-shadow: 0 0 0 6px var(--surface); position: relative; }
.step__title { font-size: 16px; line-height: 24px; font-weight: 650; }
.step p { color: var(--text-2); margin-top: 4px; font-size: 14px; line-height: 21px; }

/* ---------- Kontak ---------- */
.contact { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; gap: 64px; } }
.contact__copy .lead { margin-top: 12px; }
.contact__list { display: grid; gap: 12px; margin-top: 28px; color: var(--text-2); }
.contact__list li { display: flex; gap: 10px; align-items: flex-start; }
.contact__list .icon { color: var(--id-700); width: 20px; height: 20px; margin-top: 2px; }
.form { display: grid; gap: 18px; padding: 28px; border-radius: var(--r-3xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select { height: 48px; padding: 0 14px; border-radius: var(--r-xl); border: 1px solid var(--border-strong); background: var(--warm-50); transition: border-color .2s, box-shadow .2s; }
.field input::placeholder { color: var(--text-3); }
.field input:focus, .field select:focus { outline: none; border-color: var(--hl-500); box-shadow: 0 0 0 4px var(--hl-100); background: var(--surface); }
.field input[aria-invalid="true"] { border-color: var(--negative-600); }
.field__error { font-size: 12px; line-height: 16px; color: var(--negative-600); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form__note { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.alert { padding: 12px 16px; border-radius: var(--r-xl); font-size: 14px; border: 1px solid; }
.alert--success, .alert--info { background: var(--positive-100); border-color: #a6f0a5; color: var(--positive-600); }
.alert--error { background: var(--negative-100); border-color: #ffa0a0; color: var(--negative-600); }

/* ---------- Footer (identity) ---------- */
.footer { background: var(--id-900); color: #d6e4dc; padding-top: 56px; }
.footer__grid { display: grid; gap: 32px; padding-bottom: 40px; }
@media (min-width: 900px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.brand--light .brand__text strong { color: #fff; }
.brand--light .brand__text small { color: #a9c3b4; }
.footer__desc { margin-top: 16px; max-width: 44ch; font-size: 14px; line-height: 22px; color: #a9c3b4; }
.footer__col { display: grid; gap: 10px; align-content: start; font-size: 14px; }
.footer__col a { color: #d6e4dc; text-decoration: none; }
.footer__col a:hover { color: #fff; text-decoration: underline; }
.footer__title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: #a9c3b4; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.notfound__inner { display: grid; justify-items: center; gap: 12px; }
.notfound__code { font-size: 72px; line-height: 1; font-weight: 800; color: var(--id-700); letter-spacing: -0.03em; }
.notfound .lead { margin-bottom: 16px; }

/* ---------- Status awal animasi (lihat theme-init.js) ---------- */
.js-anim [data-hero], .js-anim [data-hero-art], .js-anim [data-reveal], .js-anim [data-layer], .js-anim [data-step], .js-anim .system { opacity: 0; }

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