/* FW uses Google-hosted webfonts; no binaries owned. */
@import url('https://fonts.googleapis.com/css2?family=Michroma&family=Chakra+Petch:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  /* base — paper (light) */
  --bg: #f4f2ec; --bg2: #ece9dd;
  --ink: #16150f;
  --mut: #55534a; --mut2: #77756a; --faint: #9a988d;
  --rule: #d8d5c6;
  --stripe1: #eceade; --stripe2: #e8e6da;
  /* accent */
  --accent: #e33d26;
  --accent-alt-orange: #ff4f00; --accent-alt-blue: #1f4bd8; --accent-alt-green: #0f7a4d;
  --on-accent: #ffffff;
  /* semantic aliases */
  --surface-page: var(--bg); --surface-raised: var(--bg2);
  --text-body: var(--ink); --text-muted: var(--mut); --text-faint: var(--mut2);
  --border-strong: var(--ink); --border-soft: var(--rule);
}
[data-theme="dark"] {
  --bg: #14130f; --bg2: #1d1c16;
  --ink: #e9e6d9;
  --mut: #a6a396; --mut2: #8b887b; --faint: #6d6b60;
  --rule: #35342b;
  --stripe1: #191813; --stripe2: #1f1e17;
  --stripes: repeating-linear-gradient(45deg, #191813, #191813 8px, #14130f 8px, #14130f 16px); /* @kind other */
}

:root {
  /* spacing */
  --pad-cell: 24px;
  --pad-gutter-x: clamp(20px, 4vw, 56px);
  --pad-hero-y: clamp(36px, 6vw, 72px);
  --pad-btn: 13px 26px;
  --pad-btn-sm: 12px 22px;
  --page-max: 1760px;
  --rail-w: 240px;
  /* borders — borders ARE the layout */
  --border-heavy: 2px solid var(--ink);
  --border-hair: 1px solid var(--ink);
  --border-rule: 1px solid var(--rule);
  --border-notice: 1px dashed var(--ink);
  --radius: 0;
  /* texture */
  --stripes: repeating-linear-gradient(45deg, var(--stripe1), var(--stripe1) 8px, var(--bg) 8px, var(--bg) 16px);
  /* motion */
  --ease-in-view: 0.35s ease; /* @kind other */
}
@keyframes fw-slidein { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fw-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

:root {
  --font-display: 'Michroma', sans-serif;      /* headlines, wordmark; weight 400 only */
  --font-subhead: 'Chakra Petch', sans-serif;  /* card/item titles; weight 600 */
  --font-mono: 'IBM Plex Mono', monospace;     /* labels, nav, buttons, metadata */
  --font-body: 'IBM Plex Sans', sans-serif;    /* paragraphs */
  /* scale */
  --text-hero: clamp(38px, 6.5vw, 72px);
  --text-h1: clamp(30px, 4.5vw, 52px);
  --text-h2: clamp(22px, 3vw, 30px);
  --text-card-title: 19px;
  --text-body-lg: clamp(16px, 2vw, 19px);
  --text-body-md: 14px;
  --text-mono-md: 13px;
  --text-label: 12px;   /* eyebrows, section rails */
  --text-label-sm: 11px;
  --text-micro: 10px;
  /* tracking */
  --track-label: 0.2em; --track-rail: 0.15em; --track-wordmark: 0.08em;
  /* leading */
  --leading-hero: 1.08; --leading-body: 1.65; --leading-tight: 1.1;
}

/* Badge — RESTRICTED etc. */
.fw-badge { display: inline-block; background: var(--accent); color: var(--on-accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em; padding: 4px 10px; }
.fw-badge--ink { background: var(--ink); color: var(--bg); }

/* Notice box */
.fw-notice { border: var(--border-notice); padding: 18px 22px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--mut); }
.fw-notice b, .fw-notice strong { color: var(--accent); font-weight: 400; }

body {
  margin: 0;
  background: var(--bg2);
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

.ispu-page {
  min-height: 100vh;
  background: var(--bg2);
  display: flex;
  justify-content: center;
  padding: 0 0 48px;
}

.ispu-column {
  width: 100%;
  max-width: 600px;
  background: var(--bg);
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  box-sizing: border-box;
}

.masthead {
  border-bottom: 2px solid var(--ink);
  padding: 28px 20px 22px;
}

.masthead-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.masthead h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.15;
  margin: 14px 0 0;
  letter-spacing: -0.01em;
}

.masthead-copy {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--mut);
  margin-top: 10px;
  max-width: 38ch;
  text-wrap: pretty;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mut);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  color: var(--faint);
}

.status-bar[data-state="ok"] .status-dot,
.status-bar[data-state="partial"] .status-dot {
  color: var(--accent);
  animation: fw-blink 2s step-end infinite;
}

.status-time {
  white-space: nowrap;
}

.sensor-section {
  border-bottom: 2px solid var(--ink);
}

.sensor-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.sensor-name {
  margin: 0;
  min-width: 0;
  font-family: var(--font-subhead);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.sensor-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.65;
}

.dominant-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 20px 20px;
}

.dominant-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--mut2);
}

.dominant-value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(46px, 15vw, 62px);
  line-height: 1;
  margin-top: 10px;
}

.dominant-meta {
  text-align: right;
  padding-bottom: 6px;
}

.dominant-badge {
  font-size: 11px;
  padding: 6px 12px;
}

.dominant-badge-placeholder {
  display: block;
  width: 118px;
  height: 26px;
  visibility: hidden;
}

.dominant-caption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mut2);
  margin-top: 8px;
}

.pollutant-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.pollutant-row {
  display: contents;
}

.pollutant-label,
.pollutant-value,
.pollutant-badge-slot {
  min-width: 0;
}

.pollutant-value {
  font-family: var(--font-subhead);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0;
}

.pollutant-badge {
  min-width: 74px;
  text-align: center;
}

.empty-badge-slot {
  display: block;
  width: 94px;
  height: 1px;
}

.scale-block {
  padding: 20px;
  border-bottom: 1px solid var(--ink);
}

.scale-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--mut2);
  margin-bottom: 14px;
}

.scale-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mut);
}

.scale-badge {
  min-width: 118px;
  text-align: center;
}

.sensor-notice {
  margin: 20px;
}

.site-footer {
  padding: 18px 20px 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  color: var(--mut2);
}

.ispu-badge--baik {
  background: var(--accent-alt-green);
}

.ispu-badge--sedang {
  background: oklch(0.55 0.13 70);
}

.ispu-badge--tidak-sehat {
  background: var(--accent);
}

.ispu-badge--sangat-tidak-sehat {
  background: oklch(0.42 0.17 22);
}

@media (max-width: 340px) {
  .pollutant-grid {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .pollutant-label {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-bar[data-state="ok"] .status-dot,
  .status-bar[data-state="partial"] .status-dot {
    animation: none;
  }
}
