/* Virtual Machine LLC — site styles
   方針は ../../DESIGN.md を参照。色は少なく、角は四角、区切りは罫線のみ。 */

:root {
  --bg: #ffffff;
  --fg: #121212;
  --muted: #555555;
  --dim: #6b6b6b;
  --rule: #e2e2e2;
  --rule-strong: #121212;
  --accent: #1c6b45;
  --status-online: #1c6b45;
  --status-maintenance: #b45309;
  --status-outage: #b91c1c;
  --status-unknown: #737373;
  --header-bg: rgba(255, 255, 255, 0.94);

  --font-sans: "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: 40px;
  --label-col: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f10;
    --fg: #e9e9e7;
    --muted: #a6a6a3;
    --dim: #8f8f8c;
    --rule: #26282a;
    --rule-strong: #e9e9e7;
    --accent: #6cc495;
    --status-online: #6cc495;
    --status-maintenance: #eab308;
    --status-outage: #f87171;
    --status-unknown: #8f8f8c;
    --header-bg: rgba(14, 15, 16, 0.94);
    color-scheme: dark;
  }
}

/* ---------- language switching ---------- */
html[data-lang="ja"] body [lang="en"],
html[data-lang="en"] body [lang="ja"] { display: none !important; }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}
html[data-lang="en"] body { line-height: 1.65; }

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.mono { font-family: var(--font-mono); font-feature-settings: "zero" 0; letter-spacing: 0; }
.dim { color: var(--dim); }
strong { font-weight: 600; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

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

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 20;
  background: var(--fg); color: var(--bg); padding: 8px 12px; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(1.2) blur(6px);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
}
.header-inner {
  display: flex; align-items: center; gap: 32px;
  height: 60px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--fg);
  font-weight: 500; font-size: 15px; letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-mark { width: 18px; height: 18px; fill: currentColor; flex: none; }
.brand-suffix { color: var(--muted); font-weight: 400; }

.nav { display: flex; gap: 28px; margin-left: auto; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--fg); }

.lang-switch { display: inline-flex; border: 1px solid var(--rule); }
.lang-switch button {
  appearance: none; border: 0; margin: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  min-width: 44px; height: 32px; padding: 0 10px;
}
.lang-switch button + button { border-left: 1px solid var(--rule); }
.lang-switch button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.lang-switch button:not([aria-pressed="true"]):hover { color: var(--fg); }

/* ---------- hero ---------- */
.hero { padding-top: 120px; padding-bottom: 96px; }

.status {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); margin-bottom: 36px;
}
.status-mark { width: 7px; height: 7px; background: var(--accent); flex: none; transition: background-color 0.15s ease; }
.status[data-state="online"] .status-mark { background: var(--status-online); }
.status[data-state="maintenance"] .status-mark { background: var(--status-maintenance); }
.status[data-state="outage"] .status-mark { background: var(--status-outage); }
.status[data-state="unknown"] .status-mark { background: var(--status-unknown); }

.hero h1 {
  font-size: clamp(30px, 3.9vw, 50px);
  line-height: 1.42;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-feature-settings: "palt" 1;
  max-width: 22em;
}
html[data-lang="en"] .hero h1 { letter-spacing: -0.015em; line-height: 1.18; max-width: 17em; }

.lead {
  margin-top: 32px;
  max-width: 38em;
  font-size: 17px;
  color: var(--muted);
}

.facts {
  margin-top: 88px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
}
.facts > div { padding: 18px 24px 0 0; }
.facts > div + div { padding-left: 24px; border-left: 1px solid var(--rule); }
.facts dt { font-size: 12px; color: var(--dim); letter-spacing: 0.02em; }
.facts dd { margin-top: 6px; font-size: 15px; line-height: 1.5; }

/* ---------- sections ---------- */
.section {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: 48px;
  padding-top: 40px;
  padding-bottom: 112px;
  position: relative;
}
.section::before {
  content: ""; position: absolute; top: 0;
  left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--rule-strong);
}
.section-title {
  font-size: 15px; font-weight: 500; letter-spacing: 0.02em;
  line-height: 1.6;
}
.section-body { max-width: 760px; }

.note { font-size: 13px; color: var(--dim); margin-bottom: 20px; line-height: 1.6; }

.sub-title {
  font-size: 15px; font-weight: 500;
  margin-top: 72px; margin-bottom: 4px;
  line-height: 1.6;
}

/* business purposes */
.purposes { border-top: 1px solid var(--rule); }
.purposes li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr);
  padding: 18px 0; border-bottom: 1px solid var(--rule);
  font-size: 17px; line-height: 1.7;
}
.purposes .num { color: var(--dim); font-size: 14px; padding-top: 3px; }

/* how the business works */
.flow { counter-reset: flow; margin-top: 16px; }
.flow li {
  counter-increment: flow;
  display: grid; grid-template-columns: 40px minmax(0, 1fr);
  padding: 18px 0; border-top: 1px solid var(--rule);
  color: var(--muted);
}
.flow li:last-child { border-bottom: 1px solid var(--rule); }
.flow li::before {
  content: counter(flow);
  font-family: var(--font-mono); font-size: 14px; color: var(--dim);
  grid-row: 1 / span 2; padding-top: 2px;
}
.flow-head { color: var(--fg); font-weight: 500; margin-bottom: 2px; }

/* spec tables */
.spec {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--rule);
  font-size: 15px;
}
.spec th, .spec td {
  text-align: left; vertical-align: top;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.7;
}
.spec th {
  width: 30%; padding-right: 24px;
  font-weight: 400; color: var(--muted);
}
.spec td .dim { font-size: 14px; }
.spec td.mono, .spec td .mono { font-size: 14px; }

/* topology */
.topology { margin-top: 40px; }
.topo-row {
  display: flex; align-items: stretch;
  border: 1px solid var(--rule);
  padding: 28px 24px;
}
.topo-node {
  border: 1px solid var(--rule-strong);
  padding: 12px 14px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  flex: none; min-width: 120px;
}
.topo-host { flex: 1 1 auto; }
.topo-label { font-size: 14px; font-weight: 500; line-height: 1.4; }
.topo-sub { font-size: 12px; color: var(--muted); }
.topo-gpus { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.topo-gpus span {
  border: 1px solid var(--rule-strong);
  font-size: 11px; text-align: center; padding: 6px 0; line-height: 1.2;
}
.topo-link {
  flex: 1 1 40px; min-width: 32px;
  position: relative;
  display: flex; align-items: flex-start; justify-content: center;
  font-size: 11px; color: var(--dim);
}
.topo-link::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--rule-strong);
}
.topo-link span { position: relative; top: calc(50% - 22px); background: var(--bg); padding: 0 4px; white-space: nowrap; }
.topology figcaption { font-size: 13px; color: var(--dim); margin-top: 12px; line-height: 1.7; }

/* operating points */
.points li {
  padding: 16px 0; border-top: 1px solid var(--rule);
  color: var(--muted);
}
.points li:last-child { border-bottom: 1px solid var(--rule); }
.points strong { color: var(--fg); font-weight: 500; }
.point-head { display: block; margin-bottom: 2px; }

/* history */
.history { border-top: 1px solid var(--rule); }
.history li {
  display: grid; grid-template-columns: 96px minmax(0, 1fr);
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.history .when { color: var(--dim); font-size: 14px; padding-top: 1px; }

/* contact */
.contact-text { color: var(--muted); }
.contact-mail {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.6vw, 30px);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 32px;
  padding-top: 28px; padding-bottom: 40px;
  font-size: 13px; color: var(--muted);
}
.footer-name { display: flex; gap: 12px; flex-wrap: wrap; color: var(--fg); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.copyright { margin-left: auto; font-family: var(--font-mono); font-size: 12px; }

/* ---------- privacy page ---------- */
.doc { padding-top: 88px; padding-bottom: 112px; }
.doc h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 500; line-height: 1.4; font-feature-settings: "palt" 1; }
.doc .meta { font-size: 13px; color: var(--dim); margin-top: 12px; }
.doc .doc-body { max-width: 720px; margin-top: 56px; border-top: 1px solid var(--rule-strong); }
.doc h2 { font-size: 16px; font-weight: 500; margin-top: 40px; margin-bottom: 8px; line-height: 1.6; }
.doc p, .doc li { color: var(--muted); }
.doc ul { margin-top: 6px; }
.doc ul li { padding-left: 1.1em; position: relative; }
.doc ul li::before { content: ""; position: absolute; left: 0; top: 0.9em; width: 5px; height: 1px; background: var(--dim); }
html[data-lang="en"] .doc ul li::before { top: 0.8em; }
.back { display: inline-block; margin-top: 56px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  :root { --gutter: 28px; --label-col: 180px; }
  .nav { display: none; }
  .lang-switch { margin-left: auto; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  body { font-size: 15px; }
  .header-inner { height: 56px; gap: 16px; }
  .hero { padding-top: 64px; padding-bottom: 64px; }
  .status { margin-bottom: 24px; font-size: 12px; align-items: flex-start; }
  .status-mark { margin-top: 7px; }
  .lead { font-size: 15.5px; margin-top: 24px; }
  .facts { margin-top: 56px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div { padding: 14px 12px 14px 0; }
  .facts > div + div { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .facts dd { font-size: 14px; }

  .section { grid-template-columns: minmax(0, 1fr); padding-top: 24px; padding-bottom: 80px; }
  .section-title { margin-bottom: 24px; }
  .sub-title { margin-top: 56px; }

  .purposes li { font-size: 15.5px; grid-template-columns: 32px minmax(0, 1fr); padding: 14px 0; }
  .flow li { grid-template-columns: 32px minmax(0, 1fr); }

  .spec { font-size: 14.5px; }
  .spec th, .spec td { display: block; width: auto; padding: 0; border: 0; }
  .spec tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .spec th { font-size: 12.5px; padding-bottom: 2px; color: var(--dim); }

  .topo-row { flex-direction: column; align-items: stretch; padding: 20px 16px; }
  .topo-node { min-width: 0; }
  .topo-link { flex: none; height: 36px; justify-content: flex-start; align-items: center; padding-left: 16px; }
  .topo-link::before { left: 16px; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 1px solid var(--rule-strong); }
  .topo-link span { top: 0; left: 10px; background: transparent; }

  .history li { grid-template-columns: 76px minmax(0, 1fr); font-size: 14.5px; }

  .footer-inner { flex-direction: column; gap: 10px; }
  .copyright { margin-left: 0; }
}
.doc .intro { margin-top: 32px; }

/* ---------- Japanese line breaking (round-2 review) ---------- */
html[data-lang="ja"] body { line-break: strict; word-break: auto-phrase; overflow-wrap: break-word; }
.hero h1, .purposes li, .sub-title, .flow-head, .point-head, .history li, .contact-text,
.topology figcaption, .doc h1, .doc h2, .note, .status, .lead {
  word-break: auto-phrase;
}
.facts .dim { white-space: nowrap; }
a.mono, .contact-mail a { white-space: nowrap; }

@media (max-width: 720px) {
  .hero h1 { font-size: 27px; line-height: 1.5; }
  html[data-lang="en"] .hero h1 { font-size: 30px; line-height: 1.2; }
  .br-wide { display: none; }
  .contact-mail { font-size: 19px; }
}
