/* NTES Status - public page styles.
   Author: Nick Whittome, NTES, and the Claude agent he has become a slave to.

   Brand: Charcoal ink on Chalk, Amber for small accents only. The status
   colours (green, yellow, orange, red, blue) are the one exception to the
   brand palette: on a status page colour IS the information, and these are
   the colours people already read on every other provider's status page. */

@font-face { font-family: "Aspekta"; font-weight: 400; font-display: swap;
  src: url("fonts/Aspekta-400.otf") format("opentype"); }
@font-face { font-family: "Aspekta"; font-weight: 500; font-display: swap;
  src: url("fonts/Aspekta-500.otf") format("opentype"); }
@font-face { font-family: "Aspekta"; font-weight: 600; font-display: swap;
  src: url("fonts/Aspekta-600.otf") format("opentype"); }

:root {
  --ink: #3C3935; --muted: #6f6c68; --bg: #ffffff; --panel: #ffffff;
  --soft: #f6f6f4; --line: #e4e2de; --amber: #F9BF3E;
  --ok: #2e9e5b; --degraded: #d9a400; --partial: #e67e22; --major: #B3261E;
  --maint: #2f80c9; --nodata: #dcdad6; --degraded-ink: #8a6500;
  --ok-tint: #e9f6ee; --degraded-tint: #fdf5dc; --partial-tint: #fdefe2;
  --major-tint: #FBE9E7; --maint-tint: #e7f0fa;
  --on-status: #ffffff; --shadow: 0 1px 2px rgba(60,57,53,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e9e7e3; --muted: #a29e98; --bg: #1c1b1a; --panel: #242321;
    --soft: #2a2927; --line: #3a3936;
    --ok: #3fbf72; --degraded: #e8b923; --partial: #f0913a; --major: #ef6b62;
    --maint: #5aa2e6; --nodata: #4a4844; --degraded-ink: #e8b923;
    --ok-tint: #1d3326; --degraded-tint: #3a3118; --partial-tint: #3b2a1b;
    --major-tint: #3d2220; --maint-tint: #1c2c3d;
    --on-status: #141312; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --ink: #e9e7e3; --muted: #a29e98; --bg: #1c1b1a; --panel: #242321;
  --soft: #2a2927; --line: #3a3936;
  --ok: #3fbf72; --degraded: #e8b923; --partial: #f0913a; --major: #ef6b62;
  --maint: #5aa2e6; --nodata: #4a4844; --degraded-ink: #e8b923;
  --ok-tint: #1d3326; --degraded-tint: #3a3118; --partial-tint: #3b2a1b;
  --major-tint: #3d2220; --maint-tint: #1c2c3d;
  --on-status: #141312; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 "Aspekta", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: inherit; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--amber); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* Header */
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; gap: 16px; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 128px; height: auto; display: block; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}
.brand .name { font-weight: 600; font-size: 15px; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 12px; }
nav.top { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; }
nav.top a { text-decoration: none; color: var(--muted); white-space: nowrap; }
nav.top a:hover, nav.top a.on { color: var(--ink); }
nav.top a.on { box-shadow: inset 0 -2px 0 var(--amber); }
nav.top a.btn, nav.top a.btn:hover { color: #3C3935; }
.btn { display: inline-block; background: var(--amber); color: #3C3935; border: 0;
  border-radius: 8px; padding: 8px 14px; font: 600 14px/1 inherit; font-family: inherit;
  text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(.96); }

#theme { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0;
  padding: 0; cursor: pointer; color: var(--muted); font: inherit; font-size: 13px; }
#theme .track { position: relative; width: 38px; height: 21px; border-radius: 999px;
  background: var(--nodata); transition: background .16s; }
#theme .knob { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: left .16s; }
#theme[aria-pressed="true"] .track { background: var(--amber); }
#theme[aria-pressed="true"] .knob { left: 19px; background: #3C3935; }

main { padding: 28px 0 40px; }
h2 { font-size: 19px; font-weight: 600; margin: 40px 0 14px; }
h2::after { content: ""; display: block; width: 44px; height: 3px; background: var(--amber);
  margin-top: 8px; border-radius: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Overall status banner */
.banner { display: flex; align-items: center; gap: 14px; border-radius: 12px;
  padding: 18px 22px; color: var(--on-status); background: var(--ok); }
.banner svg { flex: none; width: 26px; height: 26px; }
.banner .title { font-size: 19px; font-weight: 600; }
.banner .sub { font-size: 13px; opacity: .9; }
.banner > div { min-width: 0; }
.banner .notes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.banner .notes a { display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  background: var(--panel); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 4px 12px 4px 10px; border-radius: 999px; box-shadow: 0 1px 2px rgba(0,0,0,.12);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner .notes a::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); }
.banner .notes a.n-incident::before { background: var(--partial); }
.banner .notes a.n-maintenance::before, .banner .notes a.n-planned::before { background: var(--maint); }
.banner .notes a.n-advisory::before { background: #b3a6dc; }
.banner .notes a:hover { text-decoration: underline; }
.banner.minor { background: var(--degraded); color: #2b2416; }
.banner.major { background: var(--partial); }
.banner.critical { background: var(--major); }
.banner.maintenance { background: var(--maint); }

/* Incident and maintenance cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); }
.event { margin: 0 0 16px; border-left: 5px solid var(--partial); overflow: hidden; }
.event .head { padding: 14px 20px; background: var(--partial-tint); }
.event .head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.event .head h3 a { text-decoration: none; }
.event .head h3 a:hover { text-decoration: underline; }
.event .head .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.event.none { border-left-color: var(--muted); } .event.none .head { background: var(--soft); }
.event.minor { border-left-color: var(--degraded); } .event.minor .head { background: var(--degraded-tint); }
.event.major { border-left-color: var(--partial); } .event.major .head { background: var(--partial-tint); }
.event.critical { border-left-color: var(--major); } .event.critical .head { background: var(--major-tint); }
.event.maintenance { border-left-color: var(--maint); } .event.maintenance .head { background: var(--maint-tint); }
.updates { list-style: none; margin: 0; padding: 4px 20px 8px; }
.updates li { padding: 16px 0; border-top: 1px solid var(--line); }
.updates li:first-child { border-top: 0; }
.updates .uh { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.updates .when { font-size: 12.5px; color: var(--muted); }
.updates .text { overflow-wrap: anywhere; }
.updates li:not(:first-child) .text { color: var(--muted); }

/* Stage pills: one colour per stage, so the split between updates is obvious */
.updates .label, .timeline .label { display: inline-block; font-size: 12.5px; font-weight: 600;
  line-height: 1.4; padding: 3px 11px; border-radius: 999px; background: var(--soft); color: var(--ink);
  white-space: nowrap; }
.st-investigating .label, .st-identified .label { background: var(--partial-tint); color: var(--partial); }
.st-monitoring .label, .st-scheduled .label, .st-in_progress .label, .st-verifying .label {
  background: var(--maint-tint); color: var(--maint); }
.st-resolved .label, .st-completed .label { background: var(--ok-tint); color: var(--ok); }
.st-aware .label { background: rgba(179, 166, 220, .2); color: #6e63a0; }
.st-covered .label { background: #e5f3ef; color: #2e7d6b; }
.st-provider .label { background: #fdf3dc; color: #9a6400; }
:root[data-theme="dark"] .st-provider .label { background: #3a2f17; color: #f0c674; }
:root[data-theme="dark"] .st-aware .label { color: #cdc4ea; }
:root[data-theme="dark"] .st-covered .label { background: #1d3330; color: #7fd1bd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .st-aware .label { color: #cdc4ea; }
  :root:not([data-theme="light"]) .st-covered .label { background: #1d3330; color: #7fd1bd; }
  :root:not([data-theme="light"]) .st-provider .label { background: #3a2f17; color: #f0c674; }
}

/* Components and uptime bars */
.components .row { padding: 16px 20px; border-top: 1px solid var(--line); }
.components .row:first-child { border-top: 0; }
.components .line1 { display: flex; align-items: baseline; gap: 10px; }
.components .cname { font-weight: 600; }
.components .desc { font-size: 13px; color: var(--muted); }
.components .cstatus { margin-left: auto; font-size: 14px; font-weight: 500; white-space: nowrap; }
.cstatus.operational { color: var(--ok); }
.cstatus.degraded_performance { color: var(--degraded-ink); }
.cstatus.partial_outage { color: var(--partial); }
.cstatus.major_outage { color: var(--major); }
.cstatus.under_maintenance { color: var(--maint); }
.bars { display: flex; gap: 2px; height: 34px; margin: 12px 0 6px; }
.bars .d { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--ok); cursor: default; }
.bars .d.degraded { background: var(--degraded); }
.bars .d.partial { background: var(--partial); }
.bars .d.major { background: var(--major); }
.bars .d.maintenance { background: var(--maint); }
.bars .d.none { background: var(--nodata); }
.bars .d:hover, .bars .d:focus { opacity: .7; outline: none; }
.legend { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.legend .rule { flex: 1; height: 1px; background: var(--line); }
.legend .s60, .legend .s30 { display: none; }
@media (max-width: 760px) {
  .bars .d:nth-child(-n+30) { display: none; }
  .legend .s90 { display: none; } .legend .s60 { display: inline; }
}
@media (max-width: 480px) {
  .bars .d:nth-child(-n+60) { display: none; }
  .legend .s60 { display: none; } .legend .s30 { display: inline; }
}
.rule-note { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; }

#tip { position: absolute; z-index: 10; max-width: 280px; background: var(--panel);
  color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.14); pointer-events: none; display: none; }
#tip .t-date { font-weight: 600; margin-bottom: 2px; }
#tip .t-ev { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

/* Past incidents and history */
.day { padding: 11px 0; border-top: 1px solid var(--line); }
.day:first-of-type { border-top: 0; }
.day h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.day.quiet { padding: 8px 0; font-size: 13.5px; color: var(--muted); }

/* Stage tracker */
.stages { list-style: none; margin: 12px 0 2px; padding: 0; display: flex; flex-wrap: wrap;
  align-items: center; gap: 6px 0; }
.stages li { display: flex; align-items: center; }
.stages li + li::before { content: ""; width: 22px; height: 2px; margin: 0 4px; border-radius: 2px;
  background: var(--line); }
.stages li.done + li::before { background: var(--muted); }
.stages .label { display: inline-block; font-size: 12.5px; line-height: 1.4; padding: 3px 11px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: transparent;
  white-space: nowrap; }
.stages li.done .label { color: var(--ink); }
.stages li.done .label::before { content: "\2713\00a0"; color: var(--ok); font-weight: 700; }
.stages li.todo .label { border-style: dashed; }
.stages li.now .label { font-weight: 700; border-color: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.ev { margin: 6px 0 12px; }
.ev a.t { font-weight: 600; text-decoration: none; }
.ev a.t:hover { text-decoration: underline; }
.ev.minor a.t { color: var(--degraded-ink); } .ev.major a.t { color: var(--partial); }
.ev.critical a.t { color: var(--major); } .ev.maintenance a.t { color: var(--maint); }
.ev .last { font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.ev .when { font-size: 12.5px; color: var(--muted); }
.month { margin-bottom: 8px; }
.month .card { padding: 4px 20px; }
.month .empty { padding: 14px 0; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; font-size: 14px; }
.pager a { text-decoration: none; }
.pager .disabled { color: var(--muted); opacity: .5; }

/* Incident page */
.incident-head h1 { font-size: 24px; line-height: 1.25; margin: 6px 0 4px; font-weight: 600; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px;
  padding: 2px 10px; background: var(--soft); color: var(--muted); }
.chip.minor { background: var(--degraded-tint); color: var(--degraded-ink); }
.chip.major { background: var(--partial-tint); color: var(--partial); }
.chip.critical { background: var(--major-tint); color: var(--major); }
.chip.maintenance { background: var(--maint-tint); color: var(--maint); }
.timeline { list-style: none; margin: 18px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 18px; padding: 16px 0;
  border-top: 1px solid var(--line); }
.timeline li:not(:first-child) .text { color: var(--muted); }
.timeline .text { overflow-wrap: anywhere; }
.timeline .when { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }
.affects { margin-top: 18px; font-size: 14px; color: var(--muted); }
.back { display: inline-block; margin-bottom: 8px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }

/* Uptime page */
.uptime-comp { margin-bottom: 28px; }
.uptime-comp h3 { font-size: 16px; margin: 0 0 12px; }
.cal-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .cal-row { grid-template-columns: 1fr; } }
.cal { padding: 14px; }
.cal .mhead { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.cal .mhead b { font-weight: 600; }
.cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .grid span { aspect-ratio: 1; border-radius: 3px; background: var(--ok); }
.cal .grid span.pad { background: transparent; }
.cal .grid span.wd { background: transparent; aspect-ratio: auto; font-size: 11px; color: var(--muted); text-align: center; }
.cal .grid span.future { background: var(--soft); }
.cal .grid span.degraded { background: var(--degraded); }
.cal .grid span.partial { background: var(--partial); }
.cal .grid span.major { background: var(--major); }
.cal .grid span.maintenance { background: var(--maint); }
.cal .grid span.none { background: var(--nodata); }

/* Footer */
footer.site { border-top: 1px solid var(--line); padding: 22px 0 32px; font-size: 13px; color: var(--muted); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
footer.site a { color: var(--muted); }
footer.site .right { margin-left: auto; }
@media (max-width: 560px) { footer.site .right { margin-left: 0; }
  nav.top { margin-left: 0; width: 100%; gap: 10px 14px; font-size: 13.5px; padding-bottom: 12px; flex-wrap: wrap; }
  /* Phones: the Subscribe button gets its own full-width row under the links
     rather than pushing past the edge of the screen. */
  nav.top .btn { order: 10; flex: 1 0 100%; text-align: center; padding-top: 10px; padding-bottom: 10px; }
  #theme .lbl { display: none; } }

/* Subscribe pages */
.sub-card { padding: 24px 28px; max-width: 620px; margin: 8px auto 0; }
.sub-card h1 { font-size: 22px; margin: 0 0 10px; }
.sub-form label { display: block; font-weight: 600; margin: 14px 0 6px; }
.sub-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-row input { flex: 1 1 240px; min-width: 0; font: inherit; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: inherit; }
.sub-error { color: var(--major); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sub-card + .sub-card { margin-top: 16px; }
.sub-card h2 { font-size: 18px; margin: 0 0 8px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: inherit; }
.push-ios { background: var(--soft); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
[hidden] { display: none !important; }

/* Advisories: security and third-party, never an outage of ours */
.event.advisory { border-left-color: #b3a6dc; }
.event.advisory .head { background: rgba(179, 166, 220, .12); }
.ev.advisory a.t { color: #8577b8; }
.chip.advisory { background: rgba(179, 166, 220, .2); color: #6e63a0; }
:root[data-theme="dark"] .chip.advisory { color: #cdc4ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.advisory { color: #cdc4ea; } }

/* iPhone add-to-home-screen steps */
.push-ios ol { margin: 8px 0 0; padding-left: 20px; }
.push-ios li { margin: 6px 0; }
.ios-ico { width: 20px; height: 20px; vertical-align: -5px; margin: 0 2px; fill: none; stroke: #0a84ff;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
