/* RawatApp site styles, one section per component, in page order.
   System fonts for body copy, self-hosted Fira Code for terminals. */

@font-face {
  font-family: "Fira Code";
  src: url("files/FiraCode-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

* { box-sizing: border-box; }

:root {
  --serif: "Charter", "Cambria", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Fira Code", "Commit Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
}

:root,
:root[data-theme="light"] {
  --bg: #faf9f6; --card: #ffffff; --ink: #1f2937; --muted: #5b6472;
  --line: #e6e3dc; --head: #14231a; --green: #14532d; --green-strong: #0d3a1f;
  --ghost-hover: rgba(20, 83, 45, 0.06);
  --shadow: 0 1px 3px rgba(20, 35, 26, 0.05);
  --grid-minor: #252f3d08; --grid-major: #252f3d12;
  --term-bg: #ffffff; --term-text: #252f3d; --term-dim: #5b6472;
  --term-ok: #317653; --term-err: #b72538; --term-warn: #b45309; --term-accent: #6d53a9;
  --caption: #252f3de6;
}

:root[data-theme="dark"] {
  --bg: #0f151b; --card: #161e26; --ink: #e7ecf1; --muted: #9aa7b4;
  --line: #27323d; --head: #f2f6f9; --green: #7cc79a; --green-strong: #a3dcb6;
  --ghost-hover: rgba(124, 199, 154, 0.08);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --grid-minor: #bdc8db03; --grid-major: #bdc8db07;
  --term-bg: #10161d; --term-text: #dfe7ee; --term-dim: #8494a3;
  --term-ok: #63b589; --term-err: #eb7a7c; --term-warn: #e2a336; --term-accent: #a595d6;
  --caption: #ffffffe0;
}

/* Base */
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg); /* fine graph-paper grid, after pi.dev */
  background-image:
    linear-gradient(var(--grid-minor) 0 1px, transparent 1px 4px),
    linear-gradient(to right, var(--grid-minor) 0 1px, transparent 1px 4px),
    linear-gradient(var(--grid-major) 0 1px, transparent 1px 20px),
    linear-gradient(to right, var(--grid-major) 0 1px, transparent 1px 20px);
  background-size: 4px 4px, 4px 4px, 20px 20px, 20px 20px;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3 { font-family: var(--serif); color: var(--head); line-height: 1.2; }
h1 { font-size: 2.3rem; margin: 3.5rem 0 1rem; letter-spacing: -0.015em; }
h2 { font-size: 1.55rem; margin: 3.5rem 0 0.9rem; }
h3 { margin: 0 0 0.4rem; font-size: 1.2rem; }
main section p { max-width: 70ch; } /* reading measure on wide prose */

a { color: var(--green); }

ul { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
li strong { color: var(--head); }

/* Header */
header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  header {
    background: color-mix(in srgb, var(--card) 86%, transparent);
    backdrop-filter: blur(8px);
  }
}
nav.wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.5rem;
}
.brand {
  display: inline-flex; align-items: center;
  text-decoration: none;
}
.brand img { display: block; height: 30px; width: auto; }
.brand .wm-dark { display: none; }
:root[data-theme="dark"] .brand .wm-light { display: none; }
:root[data-theme="dark"] .brand .wm-dark { display: block; }
.nav-links a {
  margin-left: 1.25rem; text-decoration: none;
  color: var(--muted); font-size: 0.95rem;
}
.nav-links a:hover { color: var(--green); }
.nav-links .langs { margin-left: 1.25rem; font-size: 0.95rem; color: var(--muted); }
.nav-links .langs a { margin-left: 0; }
.nav-links .langs b { color: var(--green); font-weight: 700; }
.nav-links #theme-toggle {
  margin-left: 1.25rem; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.95rem; color: var(--muted);
}
.nav-links #theme-toggle:hover { color: var(--green); }
/* The label comes from CSS, so it matches the theme on the very first paint, before JS runs. */
#theme-toggle::before { content: "◎ Terang"; }
:root[lang="en"] #theme-toggle::before { content: "◎ Light"; }
:root[data-theme="dark"] #theme-toggle::before { content: "◉ Gelap"; }
:root[lang="en"][data-theme="dark"] #theme-toggle::before { content: "◉ Dark"; }
.nav-toggle { display: none; } /* shown by the small-screen rule at the end of this file */

/* Hero */
.hero {
  margin-top: 0; padding: 2.2rem 0 2.4rem;
  border-bottom: 1px solid var(--line);
}
.hero h1 { margin-top: 1.2rem; }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
body.home .hero { padding: 3rem 0 3.2rem; }

/* Buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 0.8rem; }
a.wa, a.ghost {
  display: inline-block; padding: 0.85rem 1.5rem; border-radius: 8px;
  text-decoration: none; font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}
a.wa { background: var(--green); color: #fff; }
a.wa:hover { background: var(--green-strong); transform: translateY(-1px); }
:root[data-theme="dark"] a.wa { color: #0f151b; }
a.ghost { border: 1.5px solid var(--green); color: var(--green); }
a.ghost:hover { background: var(--ghost-hover); transform: translateY(-1px); }
a.wa:active, a.ghost:active { transform: translateY(0); }
a.wa:focus-visible, a.ghost:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card > :last-child { margin-top: auto; } /* equal-height cards, trailing link pinned to the bottom */
.price {
  font-weight: 700; color: var(--green);
  margin: 0.15rem 0 0.6rem;
}
section > .card + .card { margin-top: 1.1rem; } /* stacked full-width cards (upgrade pages) */

/* FAQ */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer; font-weight: 600; padding: 0.95rem 0;
  font-family: var(--sans);
}
summary::marker { color: var(--green); }
details p { margin-top: 0; color: var(--muted); }

/* EOL checker */
.eol {
  margin: 2.2rem 0 1rem; padding: 1.4rem 1.5rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
.eol-pick { font-weight: 600; margin: 0 0 0.75rem; font-size: 0.95rem; }
.eol-versions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.eol-versions button {
  font-family: var(--mono); font-size: 0.8rem;
  padding: 0.34rem 0.75rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
}
.eol-versions button:hover { border-color: var(--green); color: var(--green); }
.eol-versions button:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.eol-versions button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
:root[data-theme="dark"] .eol-versions button[aria-pressed="true"] { color: #0f151b; }
.eol-result { margin: 1.1rem 0 0; }
.eol-result strong { display: block; margin: 0.35rem 0 0.45rem; }
.eol-result .eol-note { display: block; color: var(--muted); }
.eol-dead strong { color: var(--term-err); }
.eol-soon strong { color: var(--term-warn); }
.eol-ok strong { color: var(--green); }

/* Terminal demos: one step per row, terminal left, description right */
.demos { display: grid; gap: 1.5rem; margin-top: 1.6rem; }
.demo {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); margin: 0;
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .demo { background: color-mix(in srgb, var(--card) 88%, transparent); }
}
.term {
  font-family: var(--mono); font-size: 0.75rem; line-height: 1.5;
  background: var(--term-bg); color: var(--term-text);
  padding: 1.1rem 1.2rem;
}
/* pre-wrap on the lines only: on .term it would also render the HTML indentation between them */
.term [data-line] { white-space: pre-wrap; overflow-wrap: break-word; }
.term .dim { color: var(--term-dim); }
.term .err { color: var(--term-err); }
.term .ok { color: var(--term-ok); }
.caption {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem;
  border-left: 1px solid var(--line); padding: 1rem 1.1rem;
  font-family: var(--sans); font-size: 0.95rem; line-height: 1.55; color: var(--caption);
}
.caption p { margin: 0; }
.caption .step { display: flex; align-items: center; gap: 0.5em; }
.caption b { font-weight: 600; }
.caption .replay { margin-top: auto; }
@media (max-width: 760px) {
  .demo { grid-template-columns: 1fr; }
  .caption { border-left: 0; border-top: 1px solid var(--line); }
}
.live-dot {
  width: 0.46em; height: 0.46em; border-radius: 50%; flex: none;
  background: var(--term-accent);
  animation: term-blink 1.25s steps(1, end) infinite;
}
.demo.done .live-dot { animation: none; }
.cursor {
  display: inline-block; width: 0.55em; height: 1em;
  background: var(--term-accent); vertical-align: text-bottom;
  animation: term-blink 1.25s steps(1, end) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
.replay {
  margin-left: auto; flex: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.8rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem;
  background: var(--bg); color: var(--ink);
}
.replay:hover { border-color: var(--green); color: var(--green); }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem; padding: 2rem 0 3rem;
  color: var(--muted); font-size: 0.95rem;
}
footer a { color: var(--green); }

@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  nav { flex-wrap: wrap; }
  /* A checkbox opens the menu, so it needs no JS and closes again on each htmx swap.
     The dots are drawn with gradients, so they look the same in every font. The box is a 44px tap target. */
  .nav-toggle {
    display: block; flex: none; appearance: none; -webkit-appearance: none;
    width: 44px; height: 44px; margin: -7px -14px -7px 0; padding: 0; border: 0; border-radius: 8px;
    cursor: pointer; color: var(--muted);
    background-image: radial-gradient(circle, currentColor 2.5px, transparent 2.6px), radial-gradient(circle, currentColor 2.5px, transparent 2.6px), radial-gradient(circle, currentColor 2.5px, transparent 2.6px);
    background-size: 6px 6px; background-position: 9px 19px, 19px 19px, 29px 19px; background-repeat: no-repeat;
  }
  .nav-toggle:hover, .nav-toggle:checked, .nav-toggle:focus-visible { color: var(--green); }
  .nav-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
  .nav-links { display: none; width: 100%; flex-direction: column; }
  .nav-links > a, .nav-links > .langs, .nav-links > #theme-toggle { margin: 0; padding: 0.6rem 0; text-align: left; } /* one 44px row per item */
  .nav-toggle:checked ~ .nav-links { display: flex; }
}
/* Windows high contrast drops gradient backgrounds, so there the native checkbox shows instead. */
@media (forced-colors: active) { .nav-toggle { appearance: auto; } }

@media (prefers-reduced-motion: reduce) {
  .cursor, .live-dot { animation: none; }
}
