/* status.cifleet.dev。紹介ページ（site/styles.css）と同じ色と字。
   色: 紙と夜の紺、強い色は電気の青。状態の色（緑・黄・赤）は、状態を示すところにだけ使う。
   形: 1px の罫線、等幅の小見出し、ずらしたベタの影（全体の状態の箱だけ）。 */

:root {
  --navy: #0f1b33;
  --blue: #2f5bff;
  --ok: #00a676;
  --degraded: #e09400;
  --down: #e5484d;
  --none: #c9d0dc;

  --paper: #f1f3f7;
  --surface: #ffffff;
  --ink: #0a1428;
  --ink-2: #39445c;
  --muted: #6b7690;
  --rule: #0a1428;
  --hair: #c9d0dc;
  --shadow-c: #0a1428;

  --f-text: "Geist", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, "Noto Sans JP", monospace;
  --gut: clamp(16px, 4vw, 48px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1428;
    --surface: #0f1b33;
    --ink: #e9eefb;
    --ink-2: #b9c3d8;
    --muted: #8d98b3;
    --rule: #8d98b3;
    --hair: #24314f;
    --none: #2c3a5c;
    --shadow-c: #2f5bff;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 15px;
  line-height: 1.7;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--gut);
}

.label {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.label.small {
  margin-bottom: 4px;
}

/* ---------- 上の帯 ---------- */

.top {
  border-bottom: 1px solid var(--rule);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.brand svg {
  width: 22px;
  height: 22px;
}

.brand-sub {
  padding-left: 10px;
  border-left: 1px solid var(--hair);
  color: var(--muted);
  font-weight: 500;
}

.links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.links a {
  text-decoration: none;
  color: var(--ink-2);
}

.links a:hover {
  color: var(--blue);
}

main {
  display: grid;
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 64px;
}

/* ---------- 全体の状態 ---------- */

.overall {
  --state: var(--muted);
  position: relative;
  padding: 28px 28px 26px;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 var(--shadow-c);
}

.overall::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 8px;
  background: var(--state);
}

.overall[data-state="ok"] {
  --state: var(--ok);
}
.overall[data-state="degraded"] {
  --state: var(--degraded);
}
.overall[data-state="down"] {
  --state: var(--down);
}

.overall h1 {
  margin-top: 6px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.overall-sub {
  margin-top: 6px;
  color: var(--ink-2);
}

/* ---------- 部品ごと ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--none);
}
.dot.ok {
  background: var(--ok);
}
.dot.degraded {
  background: var(--degraded);
}
.dot.down {
  background: var(--down);
}

.components {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.component {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--hair);
}

.component-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.component-name {
  font-weight: 650;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.bars {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 2px;
  height: 30px;
  margin-top: 12px;
}

.bar {
  background: var(--none);
}
.bar.ok {
  background: var(--ok);
}
.bar.degraded {
  background: var(--degraded);
}
.bar.down {
  background: var(--down);
}

.bars-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
}

.note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- 障害 ---------- */

.incidents .label {
  margin-bottom: 12px;
}

.incident {
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 4px solid var(--degraded);
}

.incident[data-impact="down"] {
  border-left-color: var(--down);
}

.incident.resolved {
  border-left-color: var(--hair);
}

.incident h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.incident-meta {
  margin-top: 2px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

.updates {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.updates li {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 4px 12px;
  font-size: 14px;
}

.updates time,
.updates .kind {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

.updates .kind {
  display: block;
  color: var(--ink-2);
  font-weight: 500;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 連絡先 ---------- */

.contact {
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.contact .label {
  margin-bottom: 10px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px 48px;
  color: var(--ink-2);
  font-size: 14px;
}

.contact-main {
  margin-bottom: 6px;
  font-family: var(--f-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.contact-main a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- 下の帯 ---------- */

.foot {
  border-top: 1px solid var(--rule);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 18px;
  padding-bottom: 28px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  main {
    gap: 40px;
    padding-top: 24px;
  }
  .overall {
    padding: 22px 20px 20px 24px;
    box-shadow: 4px 4px 0 var(--shadow-c);
  }
  .bars {
    gap: 1px;
    height: 26px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .updates li {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .links {
    gap: 14px;
  }
}
