/* glasspane public status pages, "Atelier"
   Warm paper / editorial framing with a serif display face; the glasspane ink
   green drives links, the sparkline and the top accent line. Light is the
   default; [data-theme="dark"] is a warm dark, data-theme="auto" follows the
   visitor's system preference. */

@font-face{font-family:"Fraunces";font-style:normal;font-weight:500;font-display:swap;
  src:url("/static/fonts/fraunces-500.woff2") format("woff2")}
@font-face{font-family:"Fraunces";font-style:normal;font-weight:600;font-display:swap;
  src:url("/static/fonts/fraunces-600.woff2") format("woff2")}
@font-face{font-family:"Fraunces";font-style:italic;font-weight:500;font-display:swap;
  src:url("/static/fonts/fraunces-500-italic.woff2") format("woff2")}

:root {
  --accent: #1f6b4f; /* glasspane ink green */

  --paper: #f6f4ee;
  --surface: #fffdf8;
  --surface-2: #efece2;
  --text: #1a1916;
  --muted: #6b675e;
  --faint: #9a958a;
  --border: #e7e3d8;
  --border-strong: #d7d2c4;

  --ok: #1f6b4f;
  --warn: #b07d18;
  --down: #c0432f;
  --empty: #e2ddd0;

  --shadow: 0 1px 2px rgba(26, 25, 22, .04);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #5cc295;
  --paper: #16130e;
  --surface: #1e1a14;
  --surface-2: #28231a;
  --text: #ece6d9;
  --muted: #9c9486;
  --faint: #6d665a;
  --border: rgba(255, 247, 233, .085);
  --border-strong: rgba(255, 247, 233, .17);
  --ok: #5cc295;
  --warn: #d8a544;
  --down: #e07a5f;
  --empty: #2c2820;
  --shadow: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --accent: #5cc295;
    --paper: #16130e;
    --surface: #1e1a14;
    --surface-2: #28231a;
    --text: #ece6d9;
    --muted: #9c9486;
    --faint: #6d665a;
    --border: rgba(255, 247, 233, .085);
    --border-strong: rgba(255, 247, 233, .17);
    --ok: #5cc295;
    --warn: #d8a544;
    --down: #e07a5f;
    --empty: #2c2820;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  background: var(--paper); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* A quiet accent line at the very top — the page's brand color as a hairline. */
body::after {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 3px;
  background: var(--accent); opacity: .9; z-index: 50; pointer-events: none;
}

/* overflow-x: clip is a structural guard: nothing inside a status page should ever
   make it scroll sideways (long monitor names, hover tooltips near an edge, a wide
   sparkline). clip only bounds the x-axis, so tooltips can still spill upward. */
.wrap { max-width: 760px; margin: 0 auto; padding: 52px 22px 64px; position: relative; z-index: 1; overflow-x: clip; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
.muted { color: var(--muted); font-weight: 400; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

/* ---------- header ---------- */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.head-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.head h1 { margin: 0; font-family: var(--serif); font-size: 1.85rem; font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.desc { margin: 4px 0 0; color: var(--muted); }
.theme-btn {
  background: none; border: 1px solid var(--border-strong); color: var(--muted);
  border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; flex-shrink: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--text); }

/* ---------- overall banner ---------- */
.banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 24px;
  font-family: var(--serif); font-size: 1.24rem; font-weight: 500; letter-spacing: -.01em;
}
.banner-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; position: relative; }
.banner-up .banner-dot { background: var(--ok); }
.banner-down .banner-dot { background: var(--down); }
.banner-unknown .banner-dot { background: var(--muted); }
.banner-pending .banner-dot { background: var(--muted); }
.banner-up .banner-dot::after, .banner-down .banner-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; animation: ping 2.4s ease-out infinite;
}
.banner-down { border-color: color-mix(in srgb, var(--down) 38%, var(--border)); }
.banner-updated { margin-left: auto; font-family: var(--sans); font-size: .76rem; font-weight: 400; color: var(--muted); }
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- monitor cards ---------- */
.monitor {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 14px;
}
.monitor.empty { text-align: center; color: var(--muted); }
.monitor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.monitor-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.monitor-title h2 { margin: 0; font-family: var(--serif); font-size: 1.12rem; font-weight: 500; letter-spacing: -.01em; min-width: 0; overflow-wrap: anywhere; }
.uptime-headline { font-size: 1.18rem; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.uptime-label { font-size: .7rem; font-weight: 400; color: var(--muted); margin-left: 4px; }
.uptime-pending { font-size: .8rem; font-weight: 400; color: var(--muted); white-space: normal; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: .73rem; font-weight: 500;
  background: color-mix(in srgb, currentColor 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 26%, transparent);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-up { color: var(--ok); }
.pill-down { color: var(--down); }
.pill-down .dot { animation: pulse 1.6s infinite; }
.pill-unknown { color: var(--muted); }
.pill-pending { color: var(--muted); }
.pill-pending .dot { animation: pulse 1.6s infinite; }
.pill-resolved { color: var(--muted); }

/* ---------- daily uptime bar ---------- */
.daybar { display: flex; gap: 3px; height: 34px; }
.seg { flex: 1; border-radius: 3px; min-width: 4px; position: relative; cursor: default; transition: transform .12s ease; }
.seg-ok { background: var(--ok); color: var(--ok); }
.seg-warn { background: var(--warn); color: var(--warn); }
.seg-down { background: var(--down); color: var(--down); }
.seg-empty { background: var(--empty); color: var(--muted); }
/* Hover tooltips are a pointer-only affordance: you can't hover a 4px-wide bar
   on a touch screen, and the always-laid-out (opacity:0) tooltip would otherwise
   poke past a narrow viewport and make the whole page scroll sideways. Only emit
   it where a fine pointer can actually hover. */
@media (hover: hover) and (pointer: fine) {
  .seg:hover { transform: scaleY(1.16); }
  .seg::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
    background: var(--text); color: var(--surface);
    padding: 5px 9px; border-radius: 8px;
    font-size: .72rem; font-weight: 500; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 5;
  }
  .seg:hover::after { opacity: 1; }
  .seg:first-child::after { left: 0; transform: none; }
  .seg:last-child::after { left: auto; right: 0; transform: none; }
}
.daybar-legend { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 8px; }

/* ---------- stats row ---------- */
.monitor-meta {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.monitor-meta strong { color: var(--text); font-weight: 500; }
.latency { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.spark { width: 110px; height: 26px; }
.spark polyline { stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- visitor ratings (thumbs up/down) ---------- */
.votes {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px;
}
.votes-q { font-size: .78rem; color: var(--muted); margin-right: 2px; }
.vote { margin: 0; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 5px 12px; border-radius: 999px; font: inherit; font-size: .82rem;
  border: 1px solid var(--border-strong); background: var(--paper); color: var(--text);
  font-variant-numeric: tabular-nums; transition: border-color .12s, background .12s;
}
.vote-btn:hover { border-color: var(--accent); }
.vote-up:hover { border-color: var(--ok); }
.vote-down:hover { border-color: var(--down); }
.vote-n { color: var(--muted); font-weight: 500; }
.vote-challenge-form { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 8px; }

/* ---------- incidents ---------- */
.incidents { margin-top: 38px; }
.incidents h2 { font-family: var(--serif); font-size: 1.16rem; font-weight: 500; letter-spacing: -.01em; }
.incidents ul { list-style: none; margin: 16px 0 0; padding: 0; }
.incident {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; margin-bottom: 10px;
}
.incident.ongoing { border-color: color-mix(in srgb, var(--down) 42%, var(--border)); }
.incident-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.incident-line strong { min-width: 0; overflow-wrap: anywhere; }
.incident-meta { color: var(--muted); font-size: .8rem; margin-top: 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- subscribe ---------- */
.subscribe {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-top: 38px;
}
.subscribe h2 { margin: 0; font-family: var(--serif); font-size: 1.16rem; font-weight: 500; letter-spacing: -.01em; }
.subscribe-lead { margin: 6px 0 16px; color: var(--muted); }
.subscribe-error {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
  color: var(--down); font-size: .85rem;
  background: color-mix(in srgb, var(--down) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down) 30%, transparent);
}
.subscribe-monitors { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px; }
.subscribe-mon { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.subscribe-mon input { accent-color: var(--accent); width: 16px; height: 16px; }
.subscribe-row { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe-row input[type="email"] {
  flex: 1; min-width: 220px;
  padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--paper); color: var(--text);
  font: inherit;
}
.subscribe-row input[type="email"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.subscribe-btn {
  padding: 10px 20px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--surface); font: inherit; font-weight: 500;
}
.subscribe-btn:hover { filter: brightness(1.06); }
.subscribe-fine { margin: 12px 0 0; font-size: .76rem; color: var(--faint); }

/* ---------- subscribe / alert result pages ---------- */
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 32px; text-align: center; margin-top: 40px;
}
.result-card h1 { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; letter-spacing: -.02em; margin: 0 0 8px; }
.result-icon {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 600;
}
.result-icon.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.result-icon.fail { color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); }

/* ---------- footer ---------- */
.foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--muted);
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }
.foot-legal { display: flex; gap: 16px; align-items: center; }

@media (max-width: 560px) {
  .wrap { padding-top: 40px; }
  .head h1 { font-size: 1.6rem; }
  .banner { flex-wrap: wrap; }
  .banner-updated { width: 100%; margin-left: 25px; }
  .monitor-head { flex-direction: column; gap: 6px; }
  .latency { margin-left: 0; }
  /* Stack the footer and centre it instead of squeezing "Powered by" against
     three legal items: brand on its own line, the two links on one row, the
     timezone note on its own line below, all centred. */
  .foot { flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-top: 40px; }
  .foot-legal { flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
  .foot-legal .muted { flex-basis: 100%; }
}
