/* Stilo English site. Deep navy ground, monospaced accents, editor chrome.
   No external resources (no tracking, and the page still renders offline).
   Fonts are subsets built by scripts/build_webfonts.py — rerun it when the copy changes.
   The Japanese face is split off by unicode-range so the Latin pages never download it. */

@font-face {
  font-family: "IBM Plex Sans JP subset";
  src: url("fonts/stilo-plex-400.v3.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-2E7F;
}
@font-face {
  font-family: "IBM Plex Sans JP subset";
  src: url("fonts/stilo-plex-600.v3.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-2E7F;
}
@font-face {
  font-family: "IBM Plex Sans JP subset";
  src: url("fonts/stilo-plex-700.v3.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-2E7F;
}
@font-face {
  font-family: "IBM Plex Sans JP subset";
  src: url("fonts/stilo-plex-400-jp.v3.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-FFFF;
}
@font-face {
  font-family: "IBM Plex Sans JP subset";
  src: url("fonts/stilo-plex-700-jp.v3.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-FFFF;
}
@font-face {
  font-family: "JetBrains Mono subset";
  src: url("fonts/stilo-mono.v3.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ground and panels */
  --bg: #0b1725;
  --panel: #0e1e2f;
  --panel-raised: #102031;
  --panel-accent: #12253a;
  --panel-bar: #13253a;
  --panel-warn: #1a2233;
  --chip-bg: #16283b;

  /* borders */
  --border-weak: #1c3046;
  --border: #1f3549;
  --border-strong: #22394f;
  --border-tab: #2a425a;
  --border-dashed: #33506d;

  /* text */
  --text-heading: #f4f8fc;
  --text: #e8eff6;
  --text-body: #a7bccf;
  --text-muted: #9bb1c6;
  --text-faint: #8ea5ba;
  --text-label: #7e96ac; /* uppercase mono labels only, never running copy */
  --text-code: #d8e6f2;

  /* accent. The brand orange sits too dark on #0B1725 for small text;
     --accent is the same hue lifted in lightness. */
  --accent: #f2a93b;
  --accent-brand: #f28c00;
  --on-accent: #0b1725;

  /* shadows */
  --shadow-frame: 0 28px 60px rgba(0, 0, 0, 0.45);
  --shadow-device: 0 20px 44px rgba(0, 0, 0, 0.55);

  /* radii */
  --radius-frame: 10px;
  --radius-card: 8px;
  --radius-button: 4px;
  --radius-device: 22px;
  --radius-icon: 7px;

  --font-body: "IBM Plex Sans JP subset", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono subset", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 64px;
}

/* ---------- reset ---------- */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.95;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  color: var(--text-heading);
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding-left: 1.3em;
}

img {
  max-width: 100%;
  height: auto;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--chip-bg);
  color: var(--text-code);
  padding: 2px 7px;
  border-radius: 3px;
}

.mono {
  font-family: var(--font-mono);
}

/* Ruby. Kept small so it does not crowd the line above. */
ruby {
  ruby-align: center;
}

rt {
  font-size: 0.5em;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  color: var(--text-faint);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

.page {
  max-width: 1280px;
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 12px 20px;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ---------- header ---------- */

.site-header {
  height: 76px;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border-weak);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
  line-height: 1;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-icon);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 13.5px;
}

.site-nav a {
  color: var(--text-body);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--text-heading);
}

.site-nav a[aria-current="page"] {
  color: var(--text-heading);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  color: var(--text);
  cursor: pointer;
}

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

.site-footer {
  border-top: 1px solid var(--border-weak);
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}

.site-footer a {
  color: var(--text-faint);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 32px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15.5px;
  font-weight: 700;
  border-radius: var(--radius-button);
  text-decoration: none;
}

.btn-primary:hover {
  background: #f7bb5f;
}

/* ---------- mono labels ---------- */

.label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-label);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--accent);
}

.section-rule {
  width: 44px;
  height: 3px;
  background: var(--accent);
  border: 0;
  margin: 0;
}

/* ---------- home ---------- */

.hero {
  padding: 64px var(--gutter) 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 56px;
}

.hero-copy {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.hero h1 {
  font-size: 46px;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.hero-lead {
  font-size: 15.5px;
  line-height: 1.95;
}

.hero-cta {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hero-terms {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-faint);
}

/* ---------- editor frame ---------- */

.editor-frame {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-frame);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-frame);
}

.tab-bar {
  height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-bar);
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 6px 14px;
  border-radius: 4px;
  color: var(--text-label);
  white-space: nowrap;
}

.tab.active {
  background: var(--panel);
  border: 1px solid var(--border-tab);
  color: var(--text);
}

.tab-bar .where {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-label);
  white-space: nowrap;
}

.panes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panes > figure {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.panes > figure:first-child {
  border-right: 1px solid var(--border-strong);
}

.panes > figure:last-child {
  background: var(--bg);
}

.panes img {
  width: 368px;
  height: auto;
  border-radius: var(--radius-device);
  box-shadow: var(--shadow-device);
}

.panes figcaption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-faint);
  text-align: center;
}

/* ---------- sections ---------- */

.section {
  padding: 0 var(--gutter) 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.measure {
  max-width: 760px;
}

.section-head h2 {
  font-size: 22px;
  line-height: 1.4;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feature {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
}

.feature p {
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-muted);
}

.pro-band {
  margin: 0 var(--gutter) 64px;
  border-top: 3px solid var(--accent);
  background: var(--panel-accent);
  padding: 40px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.pro-copy {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pro-band h2 {
  font-size: 25px;
  line-height: 1.4;
}

.pro-copy p {
  font-size: 14px;
  line-height: 1.85;
}

.pro-price {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.pro-price .price {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent);
}

.pro-price small {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- sub-page shell ---------- */

.page-head {
  padding: 56px var(--gutter) 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-bottom: 1px solid var(--border-weak);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-label);
}

.breadcrumb a {
  color: var(--text-label);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text-body);
}

.page-head h1 {
  font-size: 44px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.page-lead {
  max-width: 720px;
  font-size: 15.5px;
  line-height: 1.95;
}

.with-aside {
  padding: 48px var(--gutter) 64px;
  display: flex;
  gap: 56px;
  align-items: flex-start;
}

.with-aside > .content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* single column without a TOC (changelog); left edge lines up with the .page-head h1 */
.single {
  padding: 48px var(--gutter) 64px;
}

.single > .content {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ---------- contents / categories ---------- */

.toc {
  flex: none;
  width: 280px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 26px;
  position: sticky;
  top: 24px;
}

.toc .toc-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-label);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.toc ol {
  font-size: 13px;
  line-height: 2.15;
  padding-left: 1.6em;
  color: var(--text-label);
}

.toc a {
  color: var(--text-body);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.catnav {
  flex: none;
  width: 240px;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catnav .label {
  margin-bottom: 8px;
}

.catnav a {
  display: block;
  font-size: 14px;
  line-height: 1.6;
  padding: 9px 14px;
  border-radius: 6px;
  color: var(--text-body);
  text-decoration: none;
}

.catnav a:hover {
  color: var(--text-heading);
}

.catnav a[aria-current="true"] {
  background: var(--panel-raised);
  color: var(--text-heading);
  font-weight: 600;
}

/* ---------- chapters ---------- */

.chapter {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 24px;
}

.chapter h2 {
  font-size: 26px;
  line-height: 1.4;
}

.chapter h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 8px;
}

.chapter p,
.chapter ul,
.chapter ol {
  max-width: 760px;
}

.chapter li {
  margin-bottom: 6px;
}

.figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.figure img {
  max-height: 520px;
  width: auto;
  border-radius: 14px;
  box-shadow: var(--shadow-device);
}

.figure img.wide {
  max-height: none;
  width: 100%;
  max-width: 560px;
  border-radius: 8px;
}

.figure figcaption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}

.steps {
  display: flex;
  flex-direction: column;
  max-width: 760px;
}

.steps > div {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border-top: 1px solid var(--border);
  padding: 18px 0;
}

.steps .num {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1;
  color: var(--accent);
  margin-top: 4px;
}

.steps dl {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.steps dt {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.6;
}

.steps dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-muted);
}

/* 44x3px amber rule above each chapter heading */
.chapter h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 16px;
}

/* Unnumbered entries keep the indent but draw no circle */
.steps .num:empty {
  border-color: transparent;
}

/* Screen readers only — prefixes the highlighted heading with "Warning:" */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Aside block */
.note {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 20px 24px;
}

.note p {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-muted);
}

/* ---------- callout ---------- */

.callout {
  background: var(--panel-accent);
  border-top: 3px solid var(--accent);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.callout h2,
.callout h3 {
  font-size: 22px;
  line-height: 1.4;
}

.callout p,
.callout li {
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-muted);
}

.callout .btn-primary {
  margin-top: 6px;
}

/* ---------- support Q&A ---------- */

.faq {
  display: flex;
  flex-direction: column;
}

.faq > div {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.faq p,
.faq li {
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-muted);
  max-width: 760px;
}

/* Tint, icon and its own heading — three signals, never amber alone. */
.faq > div.warn {
  background: var(--panel-warn);
  padding: 22px;
  margin-inline: -22px;
}

.warn-icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- prose (privacy) ---------- */

.prose {
  padding: 48px var(--gutter) 64px;
}

.prose-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 42px;
}

.prose section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prose h2 {
  font-size: 23px;
  line-height: 1.4;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.updated {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.statement {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.statement p {
  font-size: 14.5px;
}

.statement .lede {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-heading);
}

.prose dl {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prose dl > div {
  border-left: 2px solid var(--border-tab);
  padding-left: 18px;
}

.prose dt {
  font-weight: 600;
  color: var(--text-heading);
}

.prose dd {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-muted);
}

.prose-foot {
  border-top: 1px solid var(--border);
  padding-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- tablet ---------- */

@media (max-width: 1119px) {
  :root {
    --gutter: 40px;
  }

  .hero-top {
    gap: 36px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .panes > figure {
    padding: 22px 16px;
  }

  .panes img {
    width: 100%;
    max-width: 300px;
  }

  .with-aside {
    flex-direction: column;
    gap: 36px;
  }

  .toc,
  .catnav {
    position: static;
    width: 100%;
  }

  .catnav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .catnav .label {
    width: 100%;
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- phone ---------- */

@media (max-width: 767px) {
  :root {
    --gutter: 20px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-header {
    position: relative;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--panel-raised);
    border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 16px;
    z-index: 5;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-weak);
  }

  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--border-weak);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
  }

  .hero {
    padding-top: 40px;
    padding-bottom: 40px;
    gap: 32px;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .hero h1 {
    font-size: 32px;
    line-height: 1.35;
  }

  .panes {
    grid-template-columns: minmax(0, 1fr);
  }

  .panes > figure:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--border-strong);
  }

  .panes img {
    max-width: 320px;
  }

  .features {
    grid-template-columns: minmax(0, 1fr);
  }

  .pro-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 32px 22px;
  }

  .pro-price {
    align-items: flex-start;
    text-align: left;
  }

  .page-head {
    padding-top: 36px;
    padding-bottom: 26px;
  }

  .page-head h1 {
    font-size: 28px;
  }

  .chapter h2 {
    font-size: 22px;
  }

  .prose h2 {
    font-size: 20px;
  }

  .statement .lede {
    font-size: 21px;
  }

  .callout {
    padding: 26px 22px;
  }

  .figure {
    padding: 18px 12px;
  }

  .faq > div.warn {
    margin-inline: -12px;
    padding: 20px 12px;
  }
}
