/* Ascriptica Status - layout and palette from the Figma mockup (alpha-blues-25828509.figma.site). */

:root {
    color: #1f2937;
    background: #f5f7fa;
    font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: #f5f7fa; }
body { min-height: 100vh; margin: 0; background: #f5f7fa; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 2px solid #0085ca; outline-offset: 3px; border-radius: 4px; }
.inline-link { color: #0085ca; font-weight: 600; overflow-wrap: anywhere; }

/* Status levels: each sets the colors its pill, icon, bar and badge use. */
.level-operational      { --lv-fg: #247445; --lv-bg: #eff9f2; --lv-border: #cce8d6; --lv-solid: #31a85e; --lv-bar: #00b8e6; }
.level-maintenance      { --lv-fg: #00609a; --lv-bg: #e8f4fb; --lv-border: #b9dcf0; --lv-solid: #0085ca; --lv-bar: #0085ca; }
.level-partial_degraded { --lv-fg: #7a5600; --lv-bg: #fff8e6; --lv-border: #f1dba0; --lv-solid: #e0a800; --lv-bar: #f0b429; }
.level-degraded         { --lv-fg: #8a4b00; --lv-bg: #fff2e0; --lv-border: #f5cf9f; --lv-solid: #e68a00; --lv-bar: #e68a00; }
.level-partial_outage   { --lv-fg: #a3410c; --lv-bg: #fff0e8; --lv-border: #f7c9ae; --lv-solid: #ea6a1f; --lv-bar: #ea6a1f; }
.level-major_outage     { --lv-fg: #a61b1b; --lv-bg: #fdecec; --lv-border: #f3baba; --lv-solid: #d92d2d; --lv-bar: #d92d2d; }
.level-no_data          { --lv-fg: #6b7280; --lv-bg: #f3f4f6; --lv-border: #e5e7eb; --lv-solid: #9ca3af; --lv-bar: #d9e2ea; }

.app-shell {
    background: radial-gradient(circle at 50% -16%, #4ec3e024, #0000 38rem), #f5f7fa;
    min-height: 100vh;
}

/* Header */
.site-header {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: #fffffff0;
    border-top: 4px solid #0085ca;
    border-bottom: 1px solid #d9e2ea;
}
.header-inner, main, footer { width: min(100% - 40px, 1040px); margin-inline: auto; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 86px; }
.brand { display: flex; align-items: center; gap: 16px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ascriptica-logo { display: block; width: 42px; height: 42px; object-fit: contain; }
.ascriptica-wordmark { color: #003d7a; letter-spacing: -.045em; font-size: 24px; font-weight: 500; }
.brand-divider { background: #ced9e2; width: 1px; height: 28px; }
.brand-section { color: #003d7a; font-weight: 600; }
.support-link { display: flex; align-items: center; gap: 7px; color: #1b3d5f; font-size: 13px; font-weight: 600; transition: color .15s; }
.support-link:hover { color: #0085ca; }
.support-link svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6px; width: 17px; }

/* Intro */
main { padding: 76px 0 80px; }
.intro { max-width: 680px; }
.eyebrow { color: #0085ca; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; font-size: 11px; font-weight: 700; }
.intro h1 { color: #1b3d5f; letter-spacing: -.04em; margin: 0; font-size: clamp(34px, 5vw, 56px); font-weight: 700; line-height: 1.08; }
.intro-copy { color: #6b7280; max-width: 580px; margin: 22px 0 0; font-size: 16px; line-height: 1.65; }

/* Overall status */
.overall-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    margin-top: 48px;
    padding: 28px 30px;
    overflow: hidden;
    background: linear-gradient(120deg, #edf9fc, #f7fcfd);
    border: 1px solid #b9dfea;
    border-radius: 16px;
    box-shadow: 0 8px 30px #003d7a0f;
}
.overall-card:not(.level-operational):not(.level-no_data) {
    background: linear-gradient(120deg, var(--lv-bg), #fff);
    border-color: var(--lv-border);
}
.overall-card:after {
    content: "";
    position: absolute;
    right: -55px;
    width: 260px;
    height: 260px;
    border: 42px solid #4ec3e01a;
    border-radius: 50%;
}
.overall-icon, .history-check {
    display: grid;
    flex: none;
    place-items: center;
    width: 42px;
    height: 42px;
    background: var(--lv-solid, #20a35a);
    border-radius: 50%;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--lv-solid, #20a35a) 10%, transparent);
}
.overall-icon svg, .history-check svg { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2px; width: 22px; }
.overall-copy, .overall-meta { position: relative; z-index: 1; min-width: 0; }
.overall-copy p, .overall-meta p { color: #547184; margin: 0 0 5px; font-size: 12px; font-weight: 600; }
.overall-copy h2 { color: #1b3d5f; letter-spacing: -.02em; margin: 0; font-size: 21px; font-weight: 700; }
.overall-copy .overall-description { margin: 6px 0 0; color: #547184; font-weight: 500; line-height: 1.5; }
.overall-meta { text-align: right; min-width: 100px; }
.overall-meta span { display: block; color: #1b3d5f; font-size: 13px; font-weight: 700; }
.overall-meta small { display: block; margin-top: 3px; color: #6b7280; font-size: 11px; }
.stale-note {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    margin: 0;
    padding: 10px 14px;
    color: #7a5600;
    background: #fff8e6;
    border: 1px solid #f1dba0;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Section headings */
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 62px 0 20px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.section-heading h2 { color: #1b3d5f; letter-spacing: -.03em; margin: 0; font-size: 29px; font-weight: 700; }
.refresh-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: #1b3d5f;
    background: #fff;
    border: 1px solid #cbd9e4;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 1px 2px #142d1e08;
    transition: border-color .15s, color .15s, transform .15s;
}
.refresh-button:hover { color: #0085ca; border-color: #4ec3e0; transform: translateY(-1px); }
.refresh-button[aria-busy="true"] { cursor: wait; }
.refresh-button svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6px; width: 15px; }
.refresh-button[aria-busy="true"] svg { animation: .7s linear infinite spin; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Services */
.services-card { background: #ffffffc7; border: 1px solid #d9e2ea; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 28px #003d7a0a; }
.service-row {
    display: grid;
    /* Fixed last column so the bars line up whatever the status label. */
    grid-template-columns: minmax(240px, 1.25fr) minmax(200px, 1fr) 216px;
    align-items: center;
    gap: 32px;
    padding: 25px 27px;
    border-bottom: 1px solid #e4eaf0;
}
.service-row:last-child { border-bottom: 0; }
.service-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.service-icon { display: grid; flex: none; place-items: center; width: 43px; height: 43px; color: #0085ca; background: #edf9fc; border: 1px solid #cce7ef; border-radius: 11px; }
.service-icon svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7px; width: 22px; }
.service-icon img { object-fit: contain; mix-blend-mode: multiply; width: 27px; height: 27px; }
.service-identity h3, .history-card h3 { color: #1b3d5f; letter-spacing: -.01em; margin: 0 0 5px; font-size: 14px; font-weight: 750; }
.service-identity p, .history-card p { color: #6b7280; margin: 0; font-size: 12px; }
.region-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.region-list li { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; color: var(--lv-fg); background: var(--lv-bg); border: 1px solid var(--lv-border); border-radius: 999px; font-size: 10px; font-weight: 700; cursor: default; }
.region-list .status-dot { width: 6px; height: 6px; box-shadow: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.uptime { min-width: 0; }
.uptime-bars, .hour-bars { display: flex; gap: 3px; }
.day-bar, .hour-bar {
    flex: 1 1 0;
    min-width: 3px;
    height: 26px;
    padding: 0;
    background: var(--lv-bar);
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}
.day-bar:hover, .hour-bar:hover { opacity: .75; transform: scaleY(1.08); }
.day-bar:focus-visible, .hour-bar:focus-visible { outline: 2px solid #1b3d5f; outline-offset: 2px; }
.day-bar[aria-expanded="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1b3d5f; }
.hour-bar { height: 34px; border-radius: 3px; }
.hour-bar.is-future { background: transparent; border: 1px dashed #cbd9e4; cursor: default; }
.hour-bar.is-future:hover { opacity: 1; transform: none; }
.uptime-caption, .hours-caption { display: flex; justify-content: space-between; margin: 6px 0 0; color: #829087; font-size: 10px; font-weight: 600; }

/* A day by hour, under its service. */
.hours-panel { grid-column: 1 / -1; margin-top: -8px; padding: 16px 18px 14px; background: #f8fafc; border: 1px solid #e4eaf0; border-radius: 12px; }
.hours-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.hours-head h4 { margin: 0; color: #1b3d5f; font-size: 13px; font-weight: 750; }
.hours-sub { color: #6b7280; font-size: 11px; font-weight: 600; }
.hours-close { display: grid; place-items: center; width: 26px; height: 26px; margin-left: auto; padding: 0; color: #547184; background: #fff; border: 1px solid #d9e2ea; border-radius: 7px; cursor: pointer; align-self: center; }
.hours-close:hover { color: #0085ca; border-color: #4ec3e0; }
.hours-close svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8px; width: 14px; }

/* Popup for a bar. */
.bar-tip {
    position: absolute;
    z-index: 50;
    width: max-content;
    max-width: min(320px, calc(100vw - 16px));
    padding: 13px 15px;
    color: #1f2937;
    background: #fff;
    border: 1px solid #d9e2ea;
    border-radius: 12px;
    box-shadow: 0 12px 32px #003d7a24;
    font-size: 12px;
}
.bar-tip[hidden] { display: none; }
.bar-tip:after {
    content: "";
    position: absolute;
    left: calc(var(--arrow-x, 50%) - 6px);
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid #d9e2ea;
    border-bottom: 1px solid #d9e2ea;
    transform: rotate(45deg);
}
.bar-tip.is-below:after { top: -7px; bottom: auto; transform: rotate(225deg); }
.tip-title { margin: 0 0 8px; color: #1b3d5f; font-size: 12px; font-weight: 750; }
.tip-status { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--lv-fg); font-weight: 700; }
.tip-none { margin: 8px 0 0; color: #6b7280; }
.tip-incidents { display: grid; gap: 8px; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid #e4eaf0; list-style: none; }
.tip-incidents li { padding-left: 10px; border-left: 3px solid var(--lv-solid); }
.tip-incident-title { display: block; color: #1b3d5f; font-weight: 700; line-height: 1.4; }
.tip-incident-title:hover { color: #0085ca; text-decoration: underline; }
.tip-meta { display: block; margin-top: 2px; color: #6b7280; font-size: 11px; }
.status-pill {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    min-width: 102px;
    padding: 7px 10px;
    color: var(--lv-fg);
    background: var(--lv-bg);
    border: 1px solid var(--lv-border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    text-align: center;
    justify-self: end;
}
.status-dot { flex: none; width: 7px; height: 7px; background: var(--lv-solid); border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--lv-solid) 12%, transparent); }

/* Incident history */
.history-heading { margin-top: 58px; }
.date-range { color: #829087; font-size: 12px; font-weight: 600; }
.history-card { display: flex; align-items: center; gap: 18px; padding: 25px 28px; background: #ffffffa6; border: 1px solid #d9e2ea; border-radius: 14px; }
.history-check { width: 34px; height: 34px; box-shadow: none; background: #e4f4e9; }
.history-check svg { stroke: #28804a; width: 18px; }

.incident-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.incident-card { padding: 22px 26px; background: #fff; border: 1px solid #d9e2ea; border-radius: 14px; box-shadow: 0 8px 28px #003d7a0a; }
.incident-card.is-active { border-color: #f7c9ae; box-shadow: 0 0 0 3px #ea6a1f14, 0 8px 28px #003d7a0a; }
.incident-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; }
.incident-head > div { min-width: 0; }
.incident-head h3 { margin: 0 0 6px; color: #1b3d5f; font-size: 16px; font-weight: 750; letter-spacing: -.01em; line-height: 1.35; overflow-wrap: anywhere; }
.incident-date { margin: 0; color: #6b7280; font-size: 12px; }
.state-badge { flex: none; padding: 6px 11px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 750; }
.state-resolved { color: #247445; background: #eff9f2; border-color: #cce8d6; }
.state-investigating { color: #a3410c; background: #fff0e8; border-color: #f7c9ae; }
.state-monitoring { color: #00609a; background: #e8f4fb; border-color: #b9dcf0; }
.incident-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 18px 0 0; }
.incident-facts .wide { grid-column: 1 / -1; }
.incident-facts dt { margin: 0 0 4px; color: #547184; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.incident-facts dd { margin: 0; color: #1f2937; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.severity { display: inline-block; padding: 3px 9px; color: var(--lv-fg); background: var(--lv-bg); border: 1px solid var(--lv-border); border-radius: 999px; font-size: 12px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 4px 10px; color: #1b3d5f; background: #edf9fc; border: 1px solid #cce7ef; border-radius: 999px; font-size: 12px; font-weight: 600; }
.timeline { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e4eaf0; }
.timeline summary { color: #0085ca; font-size: 12px; font-weight: 700; cursor: pointer; }
.timeline ol { margin: 14px 0 0 5px; padding: 0 0 0 18px; border-left: 2px solid #e4eaf0; list-style: none; }
.timeline li { position: relative; padding: 0 0 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:before { content: ""; position: absolute; left: -25px; top: 3px; width: 12px; height: 12px; background: #cbd9e4; border: 2px solid #fff; border-radius: 50%; }
.timeline .update-investigating:before { background: #ea6a1f; }
.timeline .update-monitoring:before { background: #0085ca; }
.timeline .update-resolved:before { background: #31a85e; }
.update-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.update-head strong { color: #1b3d5f; font-size: 13px; }
.update-head time { color: #6b7280; font-size: 12px; }
.timeline p { margin: 4px 0 0; color: #374151; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }

/* Footer */
footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 86px; color: #6b7280; border-top: 1px solid #d9e2ea; font-size: 11px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer a { transition: color .15s; overflow-wrap: anywhere; }
footer a:hover { color: #0085ca; }

@media (width <= 760px) {
    .header-inner, main, footer { width: min(100% - 32px, 1040px); }
    main { padding-top: 52px; }
    .intro h1 { font-size: 40px; }
    .overall-card { grid-template-columns: auto 1fr; padding: 24px; }
    /* The mockup hides "Last checked" here; it stays, under the status. */
    .overall-meta { grid-column: 2; text-align: left; }
    .overall-meta span, .overall-meta small { display: inline; }
    .overall-meta small:before { content: " · "; }
    .service-row { grid-template-columns: minmax(0, 1fr) auto; gap: 18px; }
    .status-pill { justify-self: end; }
    /* The bars get a line of their own under the name and status. */
    .uptime { grid-column: 1 / -1; order: 1; }
    .hours-panel { order: 2; margin-top: 0; padding: 14px; }
    .hour-bars { gap: 2px; }
    .day-bar { height: 30px; }
}

@media (width <= 520px) {
    .support-link { font-size: 0; }
    .support-link svg { width: 20px; }
    .brand-divider, .brand-section { display: none; }
    .ascriptica-wordmark { font-size: 21px; }
    main { padding: 45px 0 60px; }
    .intro h1 { font-size: 34px; }
    .intro-copy { font-size: 14px; }
    .overall-card { align-items: start; gap: 16px; margin-top: 36px; padding: 21px 19px; }
    .overall-icon { width: 36px; height: 36px; }
    .overall-copy h2 { font-size: 17px; }
    .section-heading { margin-top: 48px; }
    .section-heading h2 { font-size: 25px; }
    .refresh-button { padding: 9px; font-size: 0; }
    .service-row { grid-template-columns: minmax(0, 1fr); padding: 21px 19px; }
    .status-pill { width: fit-content; margin-left: 58px; justify-self: start; }
    .uptime-bars { gap: 2px; }
    .date-range { display: none; }
    .history-card { align-items: flex-start; padding: 21px; }
    .incident-card { padding: 19px; }
    .incident-head { flex-direction: column; }
    .incident-facts { grid-template-columns: minmax(0, 1fr); }
    footer { flex-direction: column; justify-content: center; gap: 12px; min-height: 110px; text-align: center; }
    footer nav { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, :before, :after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
