/* Tapin status — design docs/design/status/Tapin Status.dc.html (ST1–ST7). */

@font-face {
  font-family: Montserrat;
  src: url('/fonts/montserrat-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0E1016;
  --ink-2: #2A2C32;
  --ink-3: #3E4047;
  --muted: #55575E;
  --muted-2: #6B6D74;
  --faint: #8A8C93;
  --page: #F5F5F2;
  --surface: #fff;
  --line: #ECEAE4;
  --line-strong: #E4E2DC;
  --outline: #DAD8D2;
  --soft: #F0EFEA;
  --blue: #0052FF;
  --link: #0047DB;
  --link-hover: #0038AD;
  --ok-tint: oklch(0.94 0.05 152);
  --ok-ink: oklch(0.38 0.11 152);
  --live: oklch(0.62 0.15 152);
  --gutter: 32px;
  --radius-card: 22px;
  --card-pad: 24px 28px;
  --h1: 38px;
  --h2: 22px;
  --main-gap: 24px;
  --list-cols: 170px minmax(0, 1fr);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Montserrat, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, .bar:focus-visible { outline: 3px solid color-mix(in oklch, var(--blue) 45%, transparent); outline-offset: 2px; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.mono { font: 500 13px 'JetBrains Mono', monospace; }
.container { max-width: 960px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.noscript { padding: 40px 32px; max-width: 960px; margin: 0 auto; font-size: 15px; line-height: 1.6; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.header-row { display: flex; align-items: center; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--blue); position: relative; flex-shrink: 0; }
.brand-mark::after { content: ''; position: absolute; right: 7px; bottom: 7px; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.brand-name { font-size: 20px; font-weight: 900; letter-spacing: -0.03em; }
.brand-sub { font-size: 15px; font-weight: 600; color: var(--muted); }
.langs { display: flex; border-radius: 10px; box-shadow: inset 0 0 0 1.5px var(--outline); overflow: hidden; }
.lang { height: 36px; padding: 0 11px; display: flex; align-items: center; font-size: 13px; font-weight: 700; background: var(--surface); color: var(--ink-3); }
.lang:hover { text-decoration: none; color: var(--ink); }
.lang.is-current { background: var(--ink); color: #fff; }
.subscribe { height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* Main */
.main { padding-top: 40px; padding-bottom: 56px; display: flex; flex-direction: column; gap: var(--main-gap); }
.loading { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ST7: couldn't refresh */
.stale { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink); }
.stale-icon { flex-shrink: 0; margin-top: 1px; }
.stale-text { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.5; }
.stale-text b { font-weight: 800; }
.button-soft { height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--soft); color: var(--ink); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.button-soft.is-copied { background: var(--ok-tint); color: var(--ok-ink); }
.is-stale { opacity: 0.72; }

/* Banner */
.banner { border-radius: var(--radius-card); background: var(--t); padding: 28px 32px; display: flex; align-items: center; gap: 20px; }
.banner-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--c); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.banner-body { flex: 1; min-width: 0; }
.banner h1 { font-size: var(--h1); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; color: var(--i); }
.updated { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.updated [data-updated] { flex: 1 1 0; min-width: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex-shrink: 0; }
.live-dot.is-stale { background: var(--faint); opacity: 1; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius-card); }
.card-outlined { box-shadow: inset 0 0 0 1.5px var(--c); padding: var(--card-pad); display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: var(--h2); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.card-head .card-title { flex: 1; min-width: 220px; }
.more { font-size: 13px; font-weight: 700; white-space: nowrap; }
.section-title { font-size: 17px; font-weight: 800; }
.body-text { font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--ink-2); }

/* Levels */
.dot { border-radius: 50%; background: var(--c); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dot-xs { width: 13px; height: 13px; }
.dot-legend { width: 14px; height: 14px; }
.dot-sm { width: 15px; height: 15px; }
.dot-md { width: 16px; height: 16px; }
.dot-lg { width: 18px; height: 18px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; background: var(--t); color: var(--i); white-space: nowrap; }
.pill-sm { gap: 5px; height: 22px; padding: 0 8px 0 5px; font-size: 11px; font-weight: 800; }
.pill-md { gap: 6px; height: 26px; padding: 0 10px 0 6px; font-size: 12px; font-weight: 800; }
.pill-lg { gap: 6px; height: 28px; padding: 0 10px 0 6px; font-size: 12px; font-weight: 700; }

/* ST2: incident card */
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stage { display: flex; flex-direction: column; gap: 6px; }
.stage-bar { height: 6px; border-radius: 3px; background: var(--line); }
.stage.is-reached .stage-bar { background: var(--c); }
.stage-label { font-size: 13px; font-weight: 600; color: var(--faint); }
.stage.is-reached .stage-label { color: var(--ink); }
.stage.is-current .stage-label { font-weight: 800; }
.affected { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.affected-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.updates { display: flex; flex-direction: column; }
.update { display: grid; grid-template-columns: var(--list-cols); gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.update-when { display: flex; flex-direction: column; gap: 2px; }
.update-when b { font-size: 13px; font-weight: 800; }
.update-when span { font-size: 12px; font-weight: 600; color: var(--muted); }
.update p { font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--ink-2); }

/* ST3: maintenance card */
.card-outlined:has(.maint-head) { gap: 14px; }
.maint-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.maint-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: color-mix(in oklch, var(--blue) 9%, white); color: #0038AD; font-size: 12px; font-weight: 800; }
.toggle { display: flex; border-radius: 9px; box-shadow: inset 0 0 0 1.5px var(--outline); overflow: hidden; }
.toggle button { height: 32px; padding: 0 10px; border: 0; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--ink-3); }
.toggle button.is-on { background: var(--ink); color: #fff; }
.facts { display: grid; gap: 12px; }
.facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fact-soft { padding: 12px 14px; border-radius: 14px; background: var(--page); }
.fact-card { padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.fact-key { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fact-value { font-size: 15px; font-weight: 700; margin-top: 3px; line-height: 1.35; }

/* Components and 90-day bars */
.components { padding: 20px 28px 22px; display: flex; flex-direction: column; }
.section-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 10px; }
.section-head h2 { font-size: 17px; font-weight: 800; flex: 1; }
.section-head span { font-size: 12px; font-weight: 600; color: var(--muted); }
.component { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.component.is-affected { background: linear-gradient(90deg, var(--t), transparent 60%); }
.component-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.component-name { flex: 1; min-width: 0; }
.component-name .name { font-size: 15px; font-weight: 700; }
.component-name .sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.component-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--i); }
.bar { position: relative; display: flex; height: 30px; }
.ticks { flex: 1; border-radius: 3px; cursor: pointer; }
.tick-marker { position: absolute; top: -3px; bottom: -3px; border-radius: 3px; box-shadow: 0 0 0 2px var(--ink); pointer-events: none; }
.tip { position: absolute; bottom: 38px; z-index: 5; width: 280px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 14px 34px rgba(14, 16, 22, 0.28); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.tip-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 800; }
.tip-notices { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.72); line-height: 1.45; }
.bar-legend { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--muted-2); }
.bar-legend .strong { font-weight: 700; color: var(--ink-2); }
.components-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.overall { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 200px; }
.overall-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.overall-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.legend { display: flex; gap: 10px 14px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ink-3); }

/* Past incidents */
.past { display: flex; flex-direction: column; gap: 12px; }
.past-head { display: flex; align-items: baseline; gap: 10px; }
.past-head .card-title { flex: 1; }
.list-card { padding: 6px 28px; display: flex; flex-direction: column; }
.past-row { display: grid; grid-template-columns: var(--list-cols); gap: 4px 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.past-row:first-child { border-top: 0; }
.past-date { font-size: 13px; font-weight: 700; }
.past-items { display: flex; flex-direction: column; gap: 8px; }
.none { font-size: 13px; font-weight: 500; color: var(--muted-2); }
.item { display: flex; flex-direction: column; gap: 4px; }
.item-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-title { font-size: 14px; font-weight: 700; color: var(--ink); }
a.item-title:hover { color: var(--ink); }
.item-meta { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ST4: incident detail */
.back { font-size: 13px; font-weight: 700; align-self: flex-start; }
.detail-head { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.page-title { font-size: var(--h1); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12; }
.page-sub { font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 6px; }
.copy-box { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--outline); }
.copy-box .mono { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { padding: var(--card-pad); }
.timeline .section-title { margin-bottom: 6px; }
.postmortem { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pm-card { padding: var(--card-pad); display: flex; flex-direction: column; gap: 8px; }
.pm-card .body-text { line-height: 1.7; }

/* ST5: history */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { height: 36px; padding: 0 13px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--outline); }
.filter.is-on { background: var(--ink); color: #fff; box-shadow: none; }
.month { display: flex; flex-direction: column; gap: 10px; }
.month-title { font-size: 18px; font-weight: 800; }
.month-card { padding: 6px 20px; display: flex; flex-direction: column; }
.month-none { padding: 14px 0; }
.history-item { display: flex; flex-direction: column; gap: 5px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--ink); }
.history-item:first-child { border-top: 0; }
a.history-item:hover { color: var(--ink); text-decoration: none; }
a.history-item:hover .history-title { text-decoration: underline; }
.history-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 200px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line-strong); background: var(--surface); }
.footer-inner { padding-top: 24px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 12px; }
.footer-links { display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.footer-links b { font-weight: 800; color: var(--ink); }
.footer-note { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.5; }

/* Mobile (design frames at 390) */
@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --card-pad: 18px 16px;
    --h1: 24px;
    --h2: 19px;
    --main-gap: 18px;
    --list-cols: 1fr;
  }
  .header-row { padding-top: 12px; padding-bottom: 12px; }
  .subscribe { padding: 0 12px; }
  .subscribe-label { display: none; }
  .main { padding-top: 18px; padding-bottom: 32px; }
  .banner { padding: 18px; gap: 14px; }
  .banner-icon { width: 44px; height: 44px; }
  .stage-label { font-size: 11px; }
  .facts-3 { grid-template-columns: 1fr; }
  .facts-4 { grid-template-columns: 1fr 1fr; }
  .components { padding: 14px 16px 16px; }
  .bar { gap: 1px; }
  .tip { width: 230px; }
  .overall-value { font-size: 24px; }
  .list-card { padding: 4px 16px; }
  .postmortem { grid-template-columns: 1fr; }
  .footer-inner { padding-top: 20px; padding-bottom: 28px; }
}
