/* HIRAKU.WORKS — 文字・罫線・余白だけで構成する。装飾アイコンは使わない。 */

:root {
  --fg: #141414;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --bg: #ffffff;
  --soft: #f6f6f5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #ececec;
    --muted: #9a9a9a;
    --line: #2b2b2b;
    --bg: #111111;
    --soft: #191919;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  font-feature-settings: "palt";
  letter-spacing: 0.02em;
}

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }

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

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.brand { font-weight: 700; letter-spacing: 0.1em; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0 48px; color: var(--muted); font-size: 13px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }

/* ---- typography ---- */

.hero { padding: 112px 0 88px; }
h1 { font-size: 36px; line-height: 1.45; font-weight: 700; margin: 0 0 24px; letter-spacing: 0.03em; }
.lead { color: var(--muted); margin: 0; max-width: 36em; }

section { border-top: 1px solid var(--line); padding: 64px 0; }
.label { display: block; font-size: 12px; letter-spacing: 0.18em; color: var(--muted); margin: 0 0 6px; }
h2 { font-size: 24px; line-height: 1.5; margin: 0 0 32px; font-weight: 700; }
h3 { font-size: 17px; margin: 40px 0 8px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- lists ---- */

.items { margin: 0; }
.items > div { display: grid; grid-template-columns: 11em 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.items > div:first-child { border-top: 1px solid var(--line); }
.items > div:last-child, .steps > li:last-child, .links li:last-child { border-bottom: 0; }
.items dt { font-weight: 700; }
.items dd { margin: 0; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 3em 1fr; padding: 18px 0; border-bottom: 1px solid var(--line); }
.steps > li:first-child { border-top: 1px solid var(--line); }
.steps > li::before { content: counter(step, decimal-leading-zero); color: var(--muted); font-variant-numeric: tabular-nums; }
.steps strong { display: block; }
.steps span { color: var(--muted); }

ul.plain { margin: 0 0 16px; padding-left: 1.2em; }
ul.plain li { margin: 4px 0; }

/* ---- tables ---- */

.table-scroll { overflow-x: auto; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 14px 12px; border-bottom: 1px solid var(--line); }
thead th { font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--fg); white-space: nowrap; }
tbody th { font-weight: 600; white-space: nowrap; color: var(--muted); font-size: 14px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.plans td, .plans th { width: 25%; }
.plans thead th:not(:first-child) { color: var(--fg); font-size: 16px; }
.price { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }

.catalog td:first-child { width: 11em; min-width: 9em; }
.catalog td:nth-child(3), .catalog td:nth-child(6) { white-space: nowrap; }

.note { background: var(--soft); padding: 16px 20px; margin: 24px 0 0; font-size: 14px; }
.note p:last-child { margin-bottom: 0; }

/* ---- portal ---- */

.whoami { color: var(--muted); font-size: 13px; white-space: nowrap; }
.links { margin: 0; padding: 0; list-style: none; }
.links li { border-bottom: 1px solid var(--line); }
.links li:first-child { border-top: 1px solid var(--line); }
.links a { display: grid; grid-template-columns: 14em 1fr; gap: 24px; padding: 20px 0; text-decoration: none; }
.links a strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.links a span { color: var(--muted); }

.toc { columns: 2; column-gap: 32px; margin: 0; padding-left: 1.4em; font-size: 15px; }
.toc li { break-inside: avoid; }

/* ---- diagrams (inline SVG / 箱・線・文字のみ) ---- */

figure.diagram { margin: 0 0 24px; }
.diagram-scroll { overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: inherit; }
.diagram figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.dg-box { fill: var(--bg); stroke: var(--fg); stroke-width: 1.2; }
.dg-inner { fill: var(--soft); stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.dg-line { stroke: var(--fg); stroke-width: 1.2; fill: none; }
.dg-arrow { fill: var(--fg); }
.dg-opt { stroke-dasharray: 5 4; }
.dg-title { fill: var(--fg); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; }
.dg-text { fill: var(--fg); font-size: 13px; }
.dg-sub { fill: var(--muted); font-size: 12px; }
.dg-num { fill: var(--fg); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

.split { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); font-size: 13px; }
.total td, .total th { font-weight: 700; color: var(--fg); border-top: 1px solid var(--fg); }

.status { font-size: 12px; white-space: nowrap; }
.status.ready { font-weight: 700; }
.status.planned { color: var(--muted); }

@media (max-width: 640px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 14px; padding-bottom: 12px; }
  .nav { gap: 4px 16px; width: 100%; flex-wrap: wrap; overflow: visible; }
  .hero { padding: 72px 0 56px; }
  h1 { font-size: 28px; }
  section { padding: 48px 0; }
  .items > div, .links a { grid-template-columns: 1fr; gap: 2px; }
  .toc { columns: 1; }
  .plans { min-width: 560px; }
  .catalog { min-width: 680px; }
  .table-scroll { margin-right: -24px; padding-right: 24px; }
}

@media print {
  .site-header .nav, .site-footer { display: none; }
  section { break-inside: avoid; }
}

.wholesale tbody th { width: 46%; white-space: normal; color: var(--fg); }
.reason { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.nw { white-space: nowrap; }
.quotes td, .quotes th { padding-left: 10px; padding-right: 10px; }
