/* Ritwik One status page: one stylesheet, no scripts, no third-party requests.
   Mobile first (16 px gutters at 375 px), light and dark from the reader's setting. Brand colours and fonts as on
   the Ritwik Finance Tech Blog. State is never colour alone: every state has an icon and a word. */

@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Manrope; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Every text colour below is at least 4.5:1 on the backgrounds it is used on, in both themes; bar colours are at
   least 3:1 on the card (the faint "no data" bar is deliberately quiet). */
:root {
  color-scheme: light dark;
  --page: #f4f5f9;
  --card: #ffffff;
  --ink: #16182a;
  --text: #2a2c3a;
  --muted: #5d6070;
  --line: #e1e3ec;
  --brand: #3e4775;
  --brand-soft: #eef0f7;
  --gold: #c9a449;
  --focus: #3e4775;
  --ok: #17734b;
  --ok-soft: #e8f5ee;
  --warn: #80600f;
  --warn-soft: #fbf4e1;
  --bad: #b8322c;
  --bad-soft: #fdecea;
  --unk: #555a6e;
  --unk-soft: #eef0f5;
  --bar-ok: #2e8b62;
  --bar-warn: #b5891f;
  --bar-bad: #c2413b;
  --bar-none: #c9ccd8;
  --tip-bg: #16182a;
  --tip-ink: #ffffff;
  --font-ui: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: Manrope, Inter, "Segoe UI", system-ui, sans-serif;
  --col: 48rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0f111a;
    --card: #181b28;
    --ink: #f3f4f8;
    --text: #dde0ea;
    --muted: #a7abbd;
    --line: #2c3045;
    --brand: #b9c1e8;
    --brand-soft: #222740;
    --gold: #d8b55a;
    --focus: #d8b55a;
    --ok: #5cd19b;
    --ok-soft: #12291f;
    --warn: #e7c46a;
    --warn-soft: #2b2412;
    --bad: #ff8f86;
    --bad-soft: #36191a;
    --unk: #b2b7c9;
    --unk-soft: #232637;
    --bar-ok: #3fae7c;
    --bar-warn: #d4ab45;
    --bar-bad: #e5605a;
    --bar-none: #3a3e52;
    --tip-bg: #f3f4f8;
    --tip-ink: #16182a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font-family: var(--font-ui); font-size: 1rem; line-height: 1.55; overflow-wrap: break-word; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.25; margin: 0; text-wrap: balance; }
strong { color: var(--ink); font-weight: 700; }
p { margin: 0; }

.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--card); color: var(--brand); padding: 0.5rem 0.75rem; border-radius: 6px; z-index: 10; }
.skip:focus { top: 0.75rem; }
.muted { color: var(--muted); }
.sep { color: var(--muted); padding: 0 0.15rem; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Header and footer */
.site-header { background: var(--card); border-top: 3px solid var(--gold); border-bottom: 1px solid var(--line); }
.bar-wrap { max-width: var(--col); margin: 0 auto; padding: 0.65rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand img { display: block; height: 2.4rem; width: auto; }
.brand span { font-family: var(--font-head); font-weight: 800; font-size: 0.95rem; border-left: 1px solid var(--line); padding-left: 0.7rem; }
.app-link { flex: none; font-size: 0.875rem; font-weight: 600; text-decoration: none; border: 1px solid var(--brand); border-radius: 999px; padding: 0.35rem 0.85rem; }
.app-link:hover { background: var(--brand-soft); }

.site-footer { margin-top: 1rem; background: var(--card); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.footer-grid { display: grid; gap: 0.75rem; padding: 1.5rem 1rem 2.25rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; }

/* Page */
.wrap { max-width: var(--col); margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
h1 { font-size: 1.05rem; font-weight: 800; color: var(--muted); letter-spacing: 0.01em; margin-bottom: 0.75rem; }
.intro { color: var(--muted); font-size: 0.9rem; margin-top: 0.35rem; }

.overall { display: flex; gap: 0.85rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid var(--line); border-left-width: 6px; background: var(--card); }
.overall > .icon { width: 2rem; height: 2rem; margin-top: 0.1rem; }
.overall h2 { font-size: 1.3rem; font-weight: 800; }
.overall p { margin-top: 0.3rem; font-size: 0.925rem; }
.overall-working { border-color: var(--ok); background: var(--ok-soft); }
.overall-working > .icon { color: var(--ok); }
.overall-partial { border-color: var(--warn); background: var(--warn-soft); }
.overall-partial > .icon { color: var(--warn); }
.overall-down { border-color: var(--bad); background: var(--bad-soft); }
.overall-down > .icon { color: var(--bad); }
.overall-unknown { border-color: var(--unk); background: var(--unk-soft); }
.overall-unknown > .icon { color: var(--unk); }

.section { margin-top: 2.25rem; }
.section > h2 { font-size: 1.2rem; font-weight: 800; }

/* Incidents and maintenance */
.notice { margin-top: 0.85rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-left-width: 6px; border-radius: 12px; }
.notice-major { border-left-color: var(--bad); }
.notice-minor { border-left-color: var(--warn); }
.notice-maintenance { border-left-color: var(--brand); }
.notice h3 { font-size: 1.05rem; font-weight: 800; }
.notice-meta { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.notice-affects { margin-top: 0.3rem; font-size: 0.875rem; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 0.1rem 0.6rem; border: 1px solid currentColor; }
.pill-major { color: var(--bad); background: var(--bad-soft); }
.pill-minor { color: var(--warn); background: var(--warn-soft); }
.pill-maintenance { color: var(--brand); background: var(--brand-soft); }
.updates { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.updates > li { margin-top: 0.7rem; padding-left: 0.85rem; border-left: 2px solid var(--line); }
.updates p + p { margin-top: 0.4rem; }
.update-head { font-size: 0.85rem; color: var(--muted); }

/* Components */
.group { margin-top: 1.4rem; }
.group > h3 { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.components { list-style: none; padding: 0; margin: 0.6rem 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.component { padding: 0.9rem 1rem; }
.component + .component { border-top: 1px solid var(--line); }
.component-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 0.75rem; }
.component-name { font-weight: 600; color: var(--ink); }
.state { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 700; }
.state-working { color: var(--ok); }
.state-partial { color: var(--warn); }
.state-down { color: var(--bad); }
.state-unknown { color: var(--unk); }
.state-quiet { color: var(--muted); font-weight: 600; }
.since { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }

/* 90-day bars: the last 30 days on phones, all 90 from 40rem. Hovering a bar shows its label (the same text a
   screen reader reads). The line under the bars says the same in words, for keyboards, touch and colour blindness.
   Tooltips wrap at 13rem and never leave the screen: on phones (bars 61 to 90) the first third opens to the right,
   the middle third is centred and the last third opens to the left; from 40rem the left half opens to the right. */
.bars { list-style: none; padding: 0; margin: 0.7rem 0 0.3rem; display: flex; align-items: flex-end; gap: 2px; height: 2rem; }
.bar { position: relative; flex: 1 1 0; min-width: 0; height: 100%; border-radius: 2px; background: var(--bar-none); }
.bar-working { background: var(--bar-ok); }
.bar-partial { background: var(--bar-warn); }
.bar-down { background: var(--bar-bad); }
.bar-nodata { height: 55%; }
.bar:hover > .vh { width: max-content; max-width: min(13rem, calc(100vw - 2rem)); height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; bottom: calc(100% + 6px); left: 0; padding: 0.25rem 0.5rem; border-radius: 6px; background: var(--tip-bg); color: var(--tip-ink); font-size: 0.75rem; line-height: 1.35; z-index: 5; }
.bar:nth-child(n+71):hover > .vh { left: 50%; transform: translateX(-50%); }
.bar:nth-child(n+81):hover > .vh { left: auto; right: 0; transform: none; }
.bar:nth-child(-n+60) { display: none; }
.bars-scale { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.75rem; color: var(--muted); }
.bars-summary { margin-top: 0.15rem; font-size: 0.8rem; color: var(--muted); }
.d90 { display: none; }

/* Past incidents */
.past { list-style: none; padding: 0; margin: 0.75rem 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.past-item + .past-item { border-top: 1px solid var(--line); }
.past summary { cursor: pointer; padding: 0.8rem 1rem; }
.past-title { font-weight: 600; color: var(--ink); }
.past-meta { display: block; font-size: 0.8rem; color: var(--muted); padding-left: 1.1rem; }
.past-body { padding: 0 1rem 1rem; }

@media (min-width: 40rem) {
  .wrap { padding: 2.25rem 1.5rem 3rem; }
  .bar-wrap { padding: 0.75rem 1.5rem; }
  .footer-grid { padding: 1.75rem 1.5rem 2.5rem; }
  .overall { padding: 1.25rem 1.4rem; }
  .overall h2 { font-size: 1.5rem; }
  .component { padding: 1rem 1.25rem; }
  .bar:nth-child(-n+60) { display: block; }
  .bar:nth-child(n+46):hover > .vh { left: auto; right: 0; transform: none; }
  .d90 { display: inline; }
  .d30 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .skip, .app-link { display: none; }
  body { background: #ffffff; }
}
