/* status.hangar.my — Hangar brand: Graphite surfaces, Cobalt accent, Noto Sans */
@font-face { font-family: "Noto Sans"; font-weight: 400; font-display: swap; src: url(/assets/fonts/NotoSans-Regular.woff) format("woff"); }
@font-face { font-family: "Noto Sans"; font-weight: 600 800; font-display: swap; src: url(/assets/fonts/NotoSans-Bold.woff) format("woff"); }
@font-face { font-family: "Noto Sans Mono"; font-weight: 400; font-display: swap; src: url(/assets/fonts/NotoSansMono-Regular.woff) format("woff"); }

:root, [data-theme="dark"] {
  --bg: #0a0d13; --surface: #11151d; --surface-2: #161b25; --surface-3: #1d232f; --border: #242b38;
  --text: #eef1f6; --body: #c9d0dc; --muted: #98a2b4; --subtle: #6b7487;
  --primary: #2f76ff; --primary-strong: #075bff; --sky: #49c2f6;
  --operational: #22c55e; --degraded: #eab308; --partial: #f97316; --outage: #ef4444; --maintenance: #49c2f6; --none: #222936;
  --shade: rgba(10, 13, 19, .92); --shade-2: rgba(10, 13, 19, .15);
  --shadow: 0 18px 50px -28px rgba(7, 40, 110, .55);
}
[data-theme="light"] {
  --bg: #f4f7fb; --surface: #ffffff; --surface-2: #f7f9fc; --surface-3: #eef2f8; --border: #e1e7f0;
  --text: #171d27; --body: #3a4456; --muted: #5d687b; --subtle: #8a94a6;
  --primary: #075bff; --primary-strong: #0047d6; --sky: #1d9bd8;
  --operational: #16a34a; --degraded: #ca8a04; --partial: #ea580c; --outage: #dc2626; --maintenance: #0b84c6; --none: #e3e8f0;
  --shade: rgba(244, 247, 251, .93); --shade-2: rgba(244, 247, 251, .1);
  --shadow: 0 18px 50px -30px rgba(7, 60, 160, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 "Noto Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack > * + * { margin-top: 14px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand-tag { font-size: 12px; font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); padding: 2px 9px; border-radius: 999px; }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav a { color: var(--muted); font-size: 14px; padding: 7px 10px; border-radius: 8px; }
.top-nav a:hover { color: var(--text); background: var(--surface-2); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; margin-left: 6px; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); min-height: 300px; display: flex; align-items: flex-end; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 60%; image-rendering: pixelated; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--shade) 0%, var(--shade) 30%, color-mix(in srgb, var(--bg) 62%, transparent) 58%, var(--shade-2) 100%); }
[data-theme="dark"] .scene-light, [data-theme="light"] .scene-dark { display: none; }
.hero-in { position: relative; z-index: 1; padding-top: 64px; padding-bottom: 40px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--primary); margin-bottom: 14px; }
.eyebrow::before { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; background: var(--primary); margin-bottom: 14px; }
.overall { display: flex; align-items: center; gap: 18px; }
.overall h1 { margin: 0; font-size: clamp(26px, 4.4vw, 40px); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
.overall p { margin: 6px 0 0; font-size: 14px; }
.overall-icon { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--subtle)) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--subtle)) 45%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c, var(--subtle)) 10%, transparent); }
.overall-icon::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--c, var(--subtle)); box-shadow: 0 0 18px var(--c, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.82); opacity: .75; } }
.overall.operational { --c: var(--operational); } .overall.degraded { --c: var(--degraded); } .overall.partial { --c: var(--partial); }
.overall.outage { --c: var(--outage); } .overall.maintenance { --c: var(--maintenance); }

/* blocks */
main.wrap { padding-top: 26px; padding-bottom: 64px; }
.block { margin-top: 34px; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.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 { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: var(--none); }
.dot.operational { background: var(--operational); } .dot.degraded { background: var(--degraded); } .dot.partial { background: var(--partial); }
.dot.outage { background: var(--outage); } .dot.maintenance { background: var(--maintenance); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.skeleton { height: 180px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* groups and components */
.group-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.group-title .gstate { font-size: 12px; font-weight: 600; }
.comp { padding: 14px 18px 16px; }
.comp + .comp { border-top: 1px solid var(--border); }
.comp-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.comp-name { font-weight: 600; }
.comp-desc { color: var(--subtle); font-size: 12.5px; }
.comp-state { text-align: right; flex: none; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--c); }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent); }
.s-operational { --c: var(--operational); } .s-degraded { --c: var(--degraded); } .s-partial { --c: var(--partial); }
.s-outage { --c: var(--outage); } .s-maintenance { --c: var(--maintenance); } .s-unknown { --c: var(--subtle); }
.comp-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bars { display: flex; gap: 2px; height: 30px; margin-top: 12px; align-items: stretch; }
.bars i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--none); transition: transform .12s; }
.bars i:hover { transform: scaleY(1.15); }
.bars i.operational { background: var(--operational); } .bars i.degraded { background: var(--degraded); } .bars i.partial { background: var(--partial); }
.bars i.outage { background: var(--outage); } .bars i.maintenance { background: var(--maintenance); }
.bars-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--subtle); margin-top: 6px; }
.bars-foot b { color: var(--muted); font-weight: 600; }

/* incidents */
.incident { border-left: 4px solid var(--c); padding: 16px 18px; }
.incident h3 { margin: 0 0 2px; font-size: 16px; }
.incident .meta { font-size: 12.5px; color: var(--muted); }
.incident .badge { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 6px; padding: 1px 8px; margin-right: 8px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--subtle); }
.timeline .what { font-size: 14px; color: var(--body); white-space: pre-wrap; }
.timeline b { color: var(--text); }

/* latency */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 4px 11px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: color-mix(in srgb, var(--primary) 60%, transparent); background: color-mix(in srgb, var(--primary) 14%, transparent); }
.chart-card { padding: 16px 18px 12px; }
.chart-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-stats div { font-size: 12px; color: var(--muted); }
.chart-stats b { display: block; font-size: 22px; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.chart-stats b small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 170px; }
.chart .ylab { position: absolute; left: 2px; font-size: 10.5px; color: var(--subtle); transform: translateY(-115%); }
.chart .pt { fill: var(--primary); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .area { fill: url(#latfill); }
.chart text { fill: var(--subtle); font-size: 10px; font-family: "Noto Sans", sans-serif; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--subtle); margin-top: 4px; }
.empty-chart { height: 170px; display: grid; place-items: center; color: var(--subtle); font-size: 13px; }

/* history */
.history { padding: 4px 18px; }
.day { padding: 14px 0; }
.day + .day { border-top: 1px solid var(--border); }
.day-date { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.day-empty { color: var(--subtle); font-size: 13.5px; }
.day-quiet { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.day-quiet::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--operational); flex: none; }
.day-quiet b { color: var(--text); font-weight: 600; }
.day .incident { border-left-width: 3px; padding: 6px 0 6px 14px; margin-top: 8px; }
.day .incident h3 { font-size: 14.5px; }

/* tooltip */
.tip { position: fixed; z-index: 50; pointer-events: none; max-width: 260px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); }
.tip b { display: block; }

.foot { border-top: 1px solid var(--border); color: var(--subtle); font-size: 13px; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 28px; }
.foot-links { display: flex; gap: 16px; }
.foot a:hover { color: var(--text); }

@media (max-width: 640px) {
  .hide-sm { display: none; }
  .top-nav a { padding: 7px 7px; font-size: 13px; }
  .brand-name { font-size: 19px; }
  .hero { min-height: 250px; }
  .hero-in { padding-top: 48px; padding-bottom: 28px; }
  .overall-icon { width: 44px; height: 44px; border-radius: 13px; }
  /* 30 days on a phone */
  .bars i:nth-child(-n+60) { display: none; }
  .bars-foot .d90 { font-size: 0; }
  .bars-foot .d90::after { content: "30 дней назад"; font-size: 11.5px; }
  .comp-row { flex-direction: column; gap: 4px; }
  .comp-state { text-align: left; }
  main.wrap { padding-bottom: 48px; }
  .block { margin-top: 28px; }
  .history { padding: 2px 14px; }
}
@media (max-width: 440px) {
  .hide-xs { display: none; }
  .brand-tag { padding: 2px 7px; }
}
@media (prefers-reduced-motion: reduce) { .overall-icon::after, .skeleton { animation: none; } }
