/*
 * GoGaijin website design system.
 *
 * Lifted from `GoGaijin Website.dc.html`, and deliberately the same system as
 * the app: cream paper, Georgia for anything a person would say, IBM Plex Mono
 * for anything the machine knows, hard edges, red spent only on the next action.
 *
 * The comp is a fixed 1440px desktop mock. A real site has to survive a phone,
 * so the layout rules below collapse the multi column grids under 900px. That
 * is an addition to the comp, not a departure from it.
 */

:root {
  --paper: #f8f4ea;
  --canvas: #e9e2cf;
  --card: #fdfbf4;
  --ink: #221d15;

  --red: #c2371f;
  --red-text: #b32e1b;
  --red-dark-bg: #e8543a;

  --teal: #17807e;
  --teal-light: #4fa3a0;
  --green: #4e7d5d;
  --rust: #a05b36;
  --amber: #e0a500;
  --strip-green: #6e9478;

  --mute: #988f7b;
  --sand: #c9bfa6;
  --rule: #e0d8c4;
  --rule-soft: #ebe4d2;
  --text-2: #6b6353;
  --text-body: #55503f;

  --on-dark: #f4efe3;
  --on-dark-2: #cfc7b4;
  --on-red: #fbf7ec;
  --dark-rule: #3a3327;
  --dark-mute: #8a8168;

  --serif: Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1440px;
  --pad: 48px;
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--red-text); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--red); color: var(--on-red); }

img { max-width: 100%; }

/* ---------- shell ---------- */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--ink);
}

/* ---------- type ---------- */

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-2);
}
.mono--wide { letter-spacing: 0.24em; }
.mono--widest { font-size: 12px; letter-spacing: 0.28em; color: var(--red-text); }
.mono--sm { font-size: 10px; letter-spacing: 0.16em; }
.mono--tight { letter-spacing: 0.1em; }

.display {
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

.prose { font-size: 19px; line-height: 1.75; }
.prose + .prose { margin-top: 24px; }

.cite {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red-text);
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 var(--pad);
  height: 72px;
  border-bottom: 1px solid var(--ink);
}
.masthead--sub { height: 64px; border-bottom-color: var(--rule); }

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand__mark { width: 14px; height: 14px; background: var(--red); flex: none; }
.brand__name { font-size: 22px; }
.masthead--sub .brand__mark { width: 12px; height: 12px; }
.masthead--sub .brand__name { font-size: 19px; }

.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-2);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 36px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
}
.nav a { color: var(--text-2); }
.nav a:hover { color: var(--ink); text-decoration: none; }

.btn {
  background: var(--red);
  color: var(--on-red);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 500;
  padding: 10px 20px;
  display: inline-block;
  border: 0;
  cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn--sm { font-size: 11px; padding: 9px 16px; }

/* ---------- generic blocks ---------- */

.band { padding: 96px var(--pad) 72px; border-bottom: 1px solid var(--ink); }
.rule-top { border-top: 1px solid var(--ink); }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; }
.split-3 { display: grid; grid-template-columns: repeat(3, 1fr); }

.tag {
  border: 1px solid var(--sand);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 10px 16px;
}

.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 5px 10px;
  white-space: nowrap;
  border: 1px solid currentColor;
  align-self: flex-start;
}

.stat__n { font-size: 40px; letter-spacing: -0.01em; }
.stat__l {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-2);
  margin-top: 6px;
}

.numeral {
  width: 32px; height: 32px;
  border: 2px solid var(--red-text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red-text);
  flex: none;
}

/* ---------- stop timeline (planner) ---------- */

.stop { display: grid; grid-template-columns: 44px 1fr; gap: 0 20px; }
.stop__rail { display: flex; justify-content: center; }
.stop__dot {
  width: 30px; height: 30px;
  border: 2px solid var(--red-text);
  border-radius: 50%;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--red-text);
  flex: none;
}
.stop__body {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding-bottom: 6px;
}
.stop__time { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--teal); }
.stop__title { font-size: 20px; letter-spacing: -0.005em; }
.stop__note { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.stop__line { width: 2px; background: var(--sand); min-height: 44px; }
.stop__seg {
  display: flex; align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 8px 0;
}

/* ---------- dark surfaces ---------- */

.dark { background: var(--ink); color: var(--on-dark); }
.dark .mono { color: var(--dark-mute); }

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px var(--pad);
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute);
}
.footer__legal { font-style: normal; line-height: 1.8; }

/* ---------- responsive ----------
   The comp is desktop only. These are the minimum rules that keep it honest on
   a phone: collapse every multi column grid, shrink the display sizes, and let
   wide tables scroll inside themselves rather than pushing the page sideways. */

@media (max-width: 1100px) {
  :root { --pad: 32px; }
}

@media (max-width: 900px) {
  :root { --pad: 20px; }

  .masthead { height: auto; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
  .nav { gap: 18px; font-size: 11px; flex-wrap: wrap; }

  .band { padding: 48px var(--pad) 40px; }

  .split-2,
  .split-3,
  .grid-collapse { grid-template-columns: 1fr !important; }

  /* Vertical rules become horizontal ones once the columns stack. */
  .split-2 > * + *,
  .split-3 > * + * { border-right: 0 !important; border-top: 1px solid var(--rule); }

  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prose { font-size: 17px; }
}

/* ---------- preview notice ----------
   Used on pages whose facts came from the design comp rather than from the
   graph. Remove the banner from a page only when every claim on it has been
   verified against the source it cites. */
.preview {
  background: var(--ink);
  color: var(--on-dark);
  padding: 12px var(--pad);
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}
.preview__tag { color: var(--red-dark-bg); white-space: nowrap; }
.preview__msg { color: var(--on-dark-2); letter-spacing: 0.08em; }
