/* Blueprint style: grid paper, navy ink, 2px borders with hard offset shadows. */

:root {
  --ink: #0B1F44;
  --ink-2: #24365C;
  --ink-3: #3B4A66;
  --paper: #E9EEF8;
  --grid: #D6DEEE;
  --surface: #FFFFFF;
  --surface-2: #F1F4FA;
  --line-soft: #8A9AB8;
  --on-ink: #FFFFFF;
  --on-ink-muted: #C5D0E6;
  --hover: #1E3A8A;

  --accent: #FF6B2C;
  --cat-json: #FFD43B;
  --cat-geo: #8CE99A;
  --cat-time: #FCC2D7;
  --cat-security: #A5D8FF;
  --cat-image: #D0BFFF;
  --cat-pdf: #FFD8A8;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --border: 2px solid var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}

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

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--surface);
  border: var(--border);
  border-radius: 10px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }

/* Wide screens (laptops at 1400px+): give the extra width to the tools, whose side-by-side panes
   need it most. Long text keeps its own reading width (.prose, .tool-article > *). */
@media (min-width: 1400px) {
  .container { max-width: 1440px; padding-inline: 32px; }
}

/* Full HD (1920px) and up: the page uses most of the screen instead of a 1440px strip with
   wide empty margins. Reading widths below stay as they are. */
@media (min-width: 1800px) {
  .container { max-width: 1760px; padding-inline: 40px; }
  .page-head { max-width: 960px; }
}

/* ---------- Header ---------- */

.site-header { padding-top: 20px; }

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  background: var(--surface);
  border: var(--border);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
}

.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }

/* The mark is the favicon itself (public/favicon.svg), so there is one drawing of it. */
.logo-mark { display: block; flex-shrink: 0; width: 36px; height: 36px; }

.logo-name { font: 700 19px var(--font-display); }

.cat-nav { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: var(--border);
  border-radius: 999px;
}
.pill-json { background: var(--cat-json); }
.pill-geo { background: var(--cat-geo); }
.pill-time { background: var(--cat-time); }
.pill-security { background: var(--cat-security); }
.pill-image { background: var(--cat-image); }
.pill-pdf { background: var(--cat-pdf); }
.pill:hover { color: var(--ink); box-shadow: var(--shadow-sm); }
.pill[aria-current="page"] { box-shadow: var(--shadow-sm); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Shared pieces ---------- */

.eyebrow {
  align-self: flex-start;
  padding: 6px 10px;
  font: 500 13px var(--font-mono);
  background: var(--surface);
  border: var(--border);
  border-radius: 8px;
}

.display {
  margin: 0;
  max-width: 980px;
  font-family: var(--font-display);
  font-size: clamp(42px, 7.5vw, 76px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  /* Own stacking context, so the .hl highlight can sit behind every line of the heading. */
  position: relative;
  z-index: 0;
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

/* An inline background is as tall as the font (about 1.3em), taller than a tight line-height,
   so it reaches into the line above. Painting it behind the text keeps that line readable. */
.hl {
  position: relative;
  z-index: -1;
  padding: 0 0.15em;
  background: var(--accent);
  border-radius: 10px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lead { margin: 0; max-width: 680px; font-size: 19px; line-height: 1.55; color: var(--ink-2); }

.section { padding-bottom: 48px; }

.section-title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.card-lg { padding: 28px; border-radius: 20px; box-shadow: var(--shadow-lg); }

.chip {
  align-self: flex-start;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--surface);
  border: var(--border);
  border-radius: 6px;
}
.chip-json { background: var(--cat-json); }
.chip-geo { background: var(--cat-geo); }
.chip-time { background: var(--cat-time); }
.chip-security { background: var(--cat-security); }
.chip-image { background: var(--cat-image); }
.chip-pdf { background: var(--cat-pdf); }

/* Form controls and buttons, shared by every tool. */
.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: var(--border);
  border-radius: 12px;
}
.input::placeholder { color: #5B6B86; }
.input-lg { height: 56px; padding: 0 18px; box-shadow: 4px 4px 0 var(--ink); }
.input-mono { font-family: var(--font-mono); font-size: 22px; background: var(--surface-2); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 700; }
.field-hint { font-size: 13px; color: var(--ink-3); }
.field-error { font-size: 13px; font-weight: 600; color: #B42318; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.btn-accent { background: var(--accent); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- Home ---------- */

.hero { display: flex; flex-direction: column; gap: 24px; padding-block: 72px 48px; }

.search { width: 100%; max-width: 640px; }

/* auto-fit, not auto-fill: three categories stretch across a wide screen instead of
   leaving empty columns on the right. Same for the three .band-item blocks. */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.tile {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 150px;
  padding: 24px;
  color: var(--ink);
  text-decoration: none;
  border: var(--border);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
}
.tile-json { background: var(--cat-json); }
.tile-geo { background: var(--cat-geo); }
.tile-time { background: var(--cat-time); }
.tile-security { background: var(--cat-security); }
.tile-image { background: var(--cat-image); }
.tile-pdf { background: var(--cat-pdf); }
.tile:hover { color: var(--ink); box-shadow: var(--shadow-lg); }

.tile-text { display: flex; flex-direction: column; gap: 4px; }
.tile-name { font: 700 30px var(--font-display); }
.tile-count { font-size: 15px; font-weight: 500; }
.tile-glyph { font: 700 52px/1 var(--font-mono); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card-list { display: flex; flex-direction: column; gap: 16px; }

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
a.tool-card:hover { color: var(--ink); box-shadow: var(--shadow-lg); }
.tool-card.is-soon { box-shadow: none; border-style: dashed; }

.tool-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tool-card-name { font: 700 22px var(--font-display); }
.tool-card-summary { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.tool-card-preview {
  padding: 10px 12px;
  font: 13px var(--font-mono);
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border: 1.5px dashed var(--line-soft);
  border-radius: 8px;
}

.soon-badge { font: 500 12px var(--font-mono); color: var(--ink-3); }

.search-empty {
  margin: 16px 0 0;
  padding: 20px;
  background: var(--surface);
  border: 2px dashed var(--line-soft);
  border-radius: 14px;
}

.band { background: var(--ink); color: var(--on-ink); }
.band-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  padding-block: 56px;
}
.band-item { display: flex; flex-direction: column; gap: 10px; }
.band-item h3 { margin: 0; font: 700 22px var(--font-display); }
.band-item p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--on-ink-muted); }
.band-num { font: 700 44px/1 var(--font-display); color: var(--accent); }

/* ---------- Ads ---------- */

/* The ad units' own sizes are set in templates/partials/ads-head.php. */

.ad-row { display: flex; justify-content: center; }

.ad-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }

.ad-label { font: 11px var(--font-mono); letter-spacing: 0.04em; color: var(--ink-3); }

/* Local development only: shows where an ad will go. */
.ad-placeholder {
  font: 12px var(--font-mono);
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed #5B6B86;
  border-radius: 10px;
}
.ad-placeholder span { display: flex; align-items: center; justify-content: center; height: 100%; padding: 0 12px; text-align: center; }

/* The sidebar unit is hidden on phones. Its wrapper stops drawing a box (and the label goes),
   but the <ins> itself stays in the page: AdSense skips a hidden unit, whereas a unit
   inside a hidden wrapper has no width and makes adsbygoogle throw an error. */
@media (max-width: 639px) {
  .ad-slot-sidebar { display: contents; }
  .ad-slot-sidebar .ad-label { display: none; }
}

/* ---------- Support ---------- */

.support {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  background: var(--surface);
  border: 2px dashed var(--line-soft);
  border-radius: 16px;
}
.support-title { margin: 0; font: 700 22px var(--font-display); letter-spacing: -0.01em; }
.support-text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.support-links { display: flex; flex-wrap: wrap; gap: 12px; }
.support-link { min-height: 44px; font-size: 15px; text-decoration: none; }
.support-link:hover { color: var(--ink); box-shadow: var(--shadow); }
.support-note { font: 500 12px var(--font-body); color: var(--ink-3); }
.support-request { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-3); }

/* ---------- Inner pages ---------- */

.page { display: flex; flex-direction: column; gap: 28px; padding-block: 28px 72px; }

.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-3); }
.breadcrumb li + li::before { content: "→"; margin-right: 8px; }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb [aria-current] { font-weight: 600; color: var(--ink); }

.page-head { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }

.privacy-note { margin: 0; font: 500 13px var(--font-mono); color: var(--ink-3); }

.tool-ui { display: flex; flex-direction: column; gap: 24px; }

.with-aside { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
.tool-article { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
/* The article column grows with the screen; its blocks stay at a comfortable reading width. */
.tool-article > * { max-width: 860px; }
.aside { flex: 1 1 300px; max-width: 100%; display: flex; flex-direction: column; gap: 24px; }

.prose { max-width: 780px; font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.prose h2 { margin: 1.6em 0 0.5em; font: 700 30px/1.15 var(--font-display); letter-spacing: -0.02em; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose strong { color: var(--ink); }
.prose code { padding: 1px 6px; font: 0.9em var(--font-mono); background: var(--surface-2); border: 1px solid #D6DEEE; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th { padding: 12px 16px; text-align: left; background: var(--ink); color: var(--on-ink); }
.prose td { padding: 12px 16px; border-bottom: 2px solid #E3E9F4; }

.legal { max-width: 820px; }
.legal .title { margin-bottom: 8px; }
.legal-updated { font: 13px var(--font-mono); color: var(--ink-3); }

.faq { display: flex; flex-direction: column; gap: 12px; }
.faq h2 { margin: 0 0 4px; font: 700 30px var(--font-display); letter-spacing: -0.02em; }
.faq details { padding: 16px 20px; background: var(--surface); border: var(--border); border-radius: 14px; }
.faq summary { font: 700 18px var(--font-display); cursor: pointer; }
.faq details p { margin: 10px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }

.related { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.related-title { padding-bottom: 4px; font: 700 20px var(--font-display); }
.related-link {
  padding: 10px 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: var(--border);
  border-radius: 10px;
}

/* ---------- Tool building blocks (shared by every tool) ---------- */

.segmented {
  display: flex;
  flex-wrap: wrap;
  align-self: flex-start;
  overflow: hidden;
  border: var(--border);
  border-radius: 12px;
}
.segmented-btn {
  min-height: 46px;
  padding: 0 20px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-right: var(--border);
  cursor: pointer;
}
.segmented-btn:last-child { border-right: 0; }
.segmented-btn[aria-pressed="true"] { font-weight: 700; background: var(--accent); }

.field-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.field .input[aria-invalid="true"] { border-color: #B42318; box-shadow: 0 0 0 2px #FECDCA; }

.result {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 2px dashed var(--line-soft);
}
.result-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.result-label { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.result-value-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.result-value {
  font: 700 clamp(44px, 8vw, 72px)/1 var(--font-mono);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.result-badge {
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 700;
  background: var(--cat-time);
  border: var(--border);
  border-radius: 6px;
}
.result-detail { margin: 0; font-size: 15px; color: var(--ink-2); }
.result.is-empty .result-value { color: var(--line-soft); }

.noscript {
  margin: 0;
  padding: 16px;
  font-weight: 600;
  background: var(--cat-json);
  border: var(--border);
  border-radius: 12px;
}

/* ---------- Footer ---------- */

.site-footer { margin-top: 0; background: var(--ink); color: var(--on-ink); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px 40px;
  padding-block: 40px 24px;
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; max-width: 340px; font-size: 14px; color: var(--on-ink-muted); }
.footer-name { font: 700 18px var(--font-display); color: var(--on-ink); }

.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: 14px; }
.footer-nav a { padding: 8px 0; color: var(--on-ink-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--on-ink); text-decoration: underline; }
.footer-nav .footer-donate { padding: 6px 12px; font-weight: 600; color: var(--ink); background: var(--accent); border-radius: 8px; }
.footer-nav .footer-donate:hover { color: var(--ink); }

.footer-copy { padding-block: 16px 32px; font-size: 13px; color: var(--on-ink-muted); border-top: 1px solid var(--ink-2); }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .container { padding-inline: 16px; }
  /* A wide table in an article scrolls sideways on its own, instead of making the whole page scroll. */
  .prose table { display: block; overflow-x: auto; }
  .hero { padding-block: 40px 32px; }
  .card-lg { padding: 20px; box-shadow: var(--shadow); }
  .card-grid, .tile-grid { grid-template-columns: 1fr; }
  .tile { min-height: 120px; }
  .tile-glyph { font-size: 40px; }
  .lead { font-size: 17px; }
}

@media (prefers-reduced-motion: no-preference) {
  .pill, .tile, a.tool-card, .btn { transition: box-shadow 120ms ease, transform 120ms ease; }
}

/* A tool that needs every pixel (the JSON editor): its card grows past the page container,
   up to 1880px, centred, with a 16px gap to the window on each side.
   100vw includes the scrollbar; the gap is wider than half a scrollbar, so the card never
   causes sideways scrolling. */
.tool-ui-wide {
  --wide: min(1880px, calc(100vw - 32px));
  width: var(--wide);
  margin-inline: calc((100% - var(--wide)) / 2);
  padding: 16px;
}
@media (max-width: 640px) {
  .tool-ui-wide { --wide: calc(100vw - 16px); padding: 10px; border-radius: 14px; }
}

/* ---------- Guides (/panduan) ---------- */

.guide-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 24px;
  padding: 18px 20px;
  background: var(--cat-image);
}
.guide-cta p { margin: 0; font-weight: 600; }
.guide-more, .guide-links { margin: 32px 0; }
.guide-more h2, .guide-links h2 { font: 700 22px var(--font-display); margin: 0 0 10px; }
.guide-more ul, .guide-links ul { margin: 0; padding-left: 20px; line-height: 1.8; }
.guide-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; max-width: 820px; }
.guide-list li { padding: 20px 22px; }
.guide-list p { margin: 6px 0 0; color: var(--ink-2); }
.guide-list-title { font: 700 20px var(--font-display); color: var(--ink); }
