/* =========================================================
   BENGKEL JAVASCRIPT — design tokens
   ========================================================= */
:root {
  --ink: #17221D;
  --ink-soft: #2A362F;
  --paper: #FAF6EC;
  --paper-dim: #F0E9D8;
  --paper-deep: #E7DFC9;
  --line: rgba(23, 34, 29, 0.16);
  --line-soft: rgba(23, 34, 29, 0.09);
  --accent: #C2872F;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --radius: 14px;
  --station-max: 720px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-deep);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* =========================================================
   HEADER / SIGNBOARD
   ========================================================= */
.signboard {
  background: var(--ink);
  color: var(--paper);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(194, 135, 47, 0.16), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(53, 96, 122, 0.18), transparent 60%);
  padding: 4.5rem 1.5rem 3.5rem;
  border-bottom: 6px solid var(--ink);
  position: relative;
}

.signboard__inner {
  max-width: 760px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #E9C98A;
  margin-bottom: 2.5rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(233, 201, 138, 0.35);
  border-radius: 100px;
}
.brand__slash { opacity: 0.6; }
.brand__word { color: var(--paper); opacity: 0.85; }

.signboard__eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: #C7BFA3;
  margin: 0 0 0.75rem;
}

.signboard__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  margin: 0 0 1.4rem;
  letter-spacing: -0.01em;
}

.signboard__lede {
  max-width: 46ch;
  color: #DAD4C0;
  font-size: 1.05rem;
  margin: 0 0 2.6rem;
}

.signboard__progress-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #C7BFA3;
  margin-bottom: 0.6rem;
}

/* =========================================================
   PROGRESS BARS
   ========================================================= */
.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  overflow: hidden;
  max-width: 320px;
}
.progress-track--wide { max-width: 420px; }

.station .progress-track {
  background: var(--paper-deep);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent, #C2872F);
  border-radius: 100px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.signboard .progress-fill { background: #E9C98A; }

/* =========================================================
   STATION NAV (sticky)
   ========================================================= */
.stations-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.stations-nav::-webkit-scrollbar { display: none; }

.stations-nav__list {
  list-style: none;
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem 1rem;
  max-width: 760px;
  margin-inline: auto;
  width: max-content;
  min-width: 100%;
}

.station-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 0.5rem;
  border-radius: 100px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.station-chip__icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  opacity: 0.55;
  flex-shrink: 0;
}
.station-chip__icon svg { width: 100%; height: 100%; }

.station-chip b { font-weight: 700; opacity: 0.6; margin-right: 0.15em; }

.station-chip:hover {
  background: var(--paper-dim);
}

.station-chip.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--ink);
}
.station-chip.is-active .station-chip__icon {
  color: var(--accent);
  opacity: 1;
}

/* =========================================================
   STATION SECTIONS
   ========================================================= */
main { display: block; }

.station {
  padding: 4.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.station:nth-of-type(even) { background: var(--paper-dim); }

.station__inner {
  max-width: var(--station-max);
  margin: 0 auto;
}

.station__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.station__eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.station__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 2.4rem;
  letter-spacing: -0.01em;
}
.station__title-en {
  font-style: italic;
  font-weight: 500;
  color: var(--ink-soft);
  opacity: 0.55;
  font-size: 0.6em;
}

.station__block { margin-bottom: 2.4rem; }
.station__block p { margin: 0 0 1rem; }
.station__block p:last-child { margin-bottom: 0; }

.block-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0.65;
  margin: 0 0 0.9rem;
  font-weight: 600;
}

.concept-list {
  margin: 0;
  padding-left: 1.2rem;
}
.concept-list li { margin-bottom: 0.55rem; }
.concept-list li:last-child { margin-bottom: 0; }

.note-text { font-size: 0.92rem; color: var(--ink-soft); }

/* Code blocks */
.code-block {
  position: relative;
  background: var(--ink);
  color: #EFE8D6;
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  border-top: 3px solid var(--accent);
}
.code-block code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 1em;
}
.code-block::before {
  content: "";
  display: block;
  height: 0.9rem;
}
.copy-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: #C7BFA3;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); color: var(--paper); }
.copy-btn.is-copied { color: #8FBF8A; border-color: #8FBF8A; }

/* Analogy note — sticky-note styling */
.analogy-note {
  margin: 0 0 2.4rem;
  background: color-mix(in srgb, var(--accent) 10%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: 4px 12px 12px 4px;
  padding: 1.3rem 1.5rem;
  position: relative;
}
.analogy-note__label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.analogy-note p:last-child { margin: 0; }

/* =========================================================
   LATIHAN / CHECKLIST
   ========================================================= */
.latihan { margin-bottom: 0 !important; }

.latihan__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.latihan__count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  opacity: 0.7;
}

.checklist {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.checklist__item label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.station:nth-of-type(even) .checklist__item label { background: var(--paper-dim); }

.checklist__item label:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

.checklist__item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.checklist__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  border: 1.5px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 5px;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.checklist__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border-right: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(40deg);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.checklist__item input:checked ~ .checklist__box {
  background: var(--accent);
  border-color: var(--accent);
}
.checklist__item input:checked ~ .checklist__box::after { opacity: 1; }
.checklist__item input:checked ~ span:last-child {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  opacity: 0.75;
}
.checklist__item input:focus-visible ~ .checklist__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checklist__item span:last-child {
  font-size: 0.95rem;
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 3.5rem 1.5rem 3rem;
}
.site-footer__inner {
  max-width: var(--station-max);
  margin: 0 auto;
}
.site-footer__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}
.site-footer__lede {
  color: #C7BFA3;
  max-width: 46ch;
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.teacher-note {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: #C7BFA3;
}
.teacher-note summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #E9C98A;
}
.teacher-note[open] summary { margin-bottom: 0.8rem; }
.teacher-note ul { margin: 0; padding-left: 1.1rem; }
.teacher-note li { margin-bottom: 0.6rem; }
.teacher-note li:last-child { margin-bottom: 0; }
.teacher-note code { background: rgba(255, 255, 255, 0.1); color: #EFE8D6; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
  .signboard { padding: 3.2rem 1.25rem 2.6rem; }
  .station { padding: 3.2rem 1.25rem; }
  .checklist__item label { padding: 0.75rem 0.85rem; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
