/* Estimark status. The marketing site's own vocabulary: flat ink line-work on cream, one
   copper accent, uppercase 800 display headings, tracked tech labels, square edges. Light
   and dark; one-handed on a phone. Status is never colour alone: every state has a word. */
:root {
  --ink: #0C1929;
  --copper: #BA7517;
  --cream: #F8F5F0;
  --paper: #FFFFFF;
  --line: #0C1929;
  --line-faint: rgba(12, 25, 41, 0.18);
  --text: #0C1929;
  --slatey: #55606E;
  --ok: #2F6B3A;
  --warn: #B26A00;
  --bad: #B3261E;
  --maint: #2F5DA8;
  --none: #8A93A0;
  --plank: rgba(12, 25, 41, 0.10);
  --hivis: #F2C14E;
  --grid: rgba(12, 25, 41, 0.05);
  --tape-a: #0C1929;
  --tape-b: #F2C14E;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #0C1929;
    --paper: #13202F;
    --line: #F3EEE6;
    --line-faint: rgba(243, 238, 230, 0.22);
    --text: #F3EEE6;
    --slatey: #AEB7C2;
    --ok: #6CC77A;
    --warn: #E0A040;
    --bad: #F0685E;
    --maint: #7FA8E6;
    --none: #8A93A0;
    --plank: rgba(243, 238, 230, 0.12);
    --grid: rgba(243, 238, 230, 0.05);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  /* A drawing sheet: cream with a faint grid, the way the site's own scenes sit on cream. */
  background-color: var(--cream);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--copper); color: #fff; padding: .5rem 1rem; }
.skip:focus { left: 1rem; z-index: 10; }
a { color: var(--copper); font-weight: 600; text-underline-offset: 3px; }
a:focus-visible, .brick:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

.display { font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1.02; margin: 0; }
.tech { font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.6875rem; }
.eyebrow { color: var(--copper); margin: 0 0 .35rem; }
h2.display { font-size: 1.5rem; margin-bottom: .75rem; }
section { margin-top: 3rem; }
.hint, .quiet { color: var(--slatey); font-size: .9rem; margin: 0 0 1rem; }

.masthead { background: var(--ink); color: #F8F5F0; }
.masthead-row { display: flex; align-items: center; gap: 1.25rem; min-height: 3.75rem; flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
.brand { display: flex; align-items: center; gap: .625rem; text-decoration: none; }
.wordmark { font-size: 19px; letter-spacing: -0.02em; line-height: 1; font-weight: 400; }
.wordmark .esti { color: var(--copper); }
.wordmark .mark { color: #F8F5F0; font-weight: 700; }
.masthead-title { color: var(--copper); }
.masthead-links { margin-left: auto; display: flex; gap: 1.5rem; }
.masthead-links a { color: #F8F5F0; text-decoration: none; }
.masthead-links a:hover { color: var(--copper); }

/* ── the site scene and the banner ─────────────────────────────────────────── */
.hero { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 2.5rem; align-items: center; border-bottom: 3px solid var(--line); padding-bottom: 2rem; position: relative; }
/* Hazard tape across the bottom of the site while there is an outage: the stripe every
   contractor recognises, and a second signal beside the words. */
.hero[data-state="partial"]::after, .hero[data-state="major"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 12px;
  background: repeating-linear-gradient(-45deg, var(--tape-a) 0 14px, var(--tape-b) 14px 28px);
}
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } }
.scene { width: 100%; height: auto; overflow: visible; }
.ink { stroke: var(--line); }
.ink-half { stroke: var(--line); stroke-opacity: .5; }
.ink-faint { stroke: var(--line-faint); }
.ink-fill { fill: var(--line); }
.copper-fill { fill: var(--copper); }
.hivis { fill: var(--hivis); }
.hivis-stroke { stroke: var(--hivis); }
.hatch-line { stroke: var(--line); stroke-opacity: .28; stroke-width: 3; }
.load { fill: url(#hatch); stroke: var(--line); stroke-width: 2; }
.hoarding { fill: var(--paper); }
.board-face { fill: var(--paper); stroke: var(--line); }
.board-text { font-family: inherit; font-weight: 800; font-size: 19px; letter-spacing: .03em; fill: var(--line); }
.course { stroke: var(--line-faint); fill: none; }
.hero[data-state="operational"] .course { fill: var(--plank); stroke: var(--line); }
.hero[data-state="maintenance"] .course { fill: url(#hatch); stroke: var(--line); }
.hero[data-state="partial"] .board-face, .hero[data-state="major"] .board-face { fill: var(--bad); }
.hero[data-state="partial"] .board-text, .hero[data-state="major"] .board-text { fill: #fff; }
.hero[data-state="degraded"] .board-face { fill: var(--copper); }
.hero[data-state="degraded"] .board-text { fill: #fff; }
.hero[data-state="maintenance"] .board-face { fill: var(--maint); }
.hero[data-state="maintenance"] .board-text { fill: #fff; }
.hero[data-state="delayed"] .board-face, .hero[data-state="error"] .board-face, .hero[data-state="loading"] .board-face { fill: url(#hatch); }

/* The lift, twelve seconds a cycle. Three nested groups so each movement has one job:
   `.travel` runs the trolley out along the jib and back; `.hoist` lowers and raises what
   hangs from it while `.cable` stretches to match; `.swing` gives the load the lag a load on
   a hook has. The banksman marshals while the load is moving and drops his arm while it is
   landed. A block course fills as the load lands, so the building goes up while you watch. */
.travel, .hoist, .swing, .cable, .banksman .arm { transform-box: fill-box; }
.travel { animation: travel 12s ease-in-out infinite; }
@keyframes travel {
  0%, 16% { transform: translateX(0); }
  40%, 88% { transform: translateX(246px); }
  100% { transform: translateX(0); }
}
.cable { transform-origin: 50% 0%; animation: cable 12s ease-in-out infinite; }
@keyframes cable {
  0%, 40% { transform: scaleY(1); }
  60%, 70% { transform: scaleY(2.05); }
  86%, 100% { transform: scaleY(1); }
}
.hoist { animation: hoist 12s ease-in-out infinite; }
@keyframes hoist {
  0%, 40% { transform: translateY(0); }
  60%, 70% { transform: translateY(58px); }
  86%, 100% { transform: translateY(0); }
}
.swing { transform-origin: 50% -80%; animation: swing 12s ease-in-out infinite; }
@keyframes swing {
  0%, 14% { transform: rotate(0deg); }
  20% { transform: rotate(-4deg); }
  30% { transform: rotate(3deg); }
  40% { transform: rotate(-1.5deg); }
  48%, 84% { transform: rotate(0deg); }
  91% { transform: rotate(3deg); }
  96% { transform: rotate(-1.5deg); }
  100% { transform: rotate(0deg); }
}
.banksman .arm { transform-origin: 100% 100%; animation: marshal 12s ease-in-out infinite; }
@keyframes marshal {
  0%, 12% { transform: rotate(0deg); }
  16%, 20%, 24%, 28%, 32%, 36%, 40% { transform: rotate(-26deg); }
  18%, 22%, 26%, 30%, 34%, 38% { transform: rotate(-6deg); }
  44%, 56% { transform: rotate(-30deg); }
  62%, 100% { transform: rotate(0deg); }
}
/* The course the load lands on: hatched until it lands, solid once it has. */
.c3 { animation: course 12s linear infinite; }
@keyframes course {
  0%, 58% { fill: url(#hatch); }
  62%, 100% { fill: var(--plank); }
}
@media (prefers-reduced-motion: reduce) { .travel, .hoist, .swing, .cable, .banksman .arm, .c3 { animation: none !important; } }

.banner-text { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.banner-meta { margin: .75rem 0 0; color: var(--slatey); font-size: .95rem; max-width: 40ch; }
.hero[data-state="operational"] .banner-text { color: var(--ok); }
.hero[data-state="degraded"] .banner-text { color: var(--warn); }
.hero[data-state="partial"] .banner-text, .hero[data-state="major"] .banner-text { color: var(--bad); }
.hero[data-state="maintenance"] .banner-text { color: var(--maint); }

/* ── components ─────────────────────────────────────────────────────────────── */
.components { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.component { background: var(--paper); border: 2px solid var(--line); padding: 0 0 1.1rem; }
.component-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; border-bottom: 2px solid var(--line); padding: .7rem 1.15rem; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; color: var(--slatey); letter-spacing: .08em; border: 1px solid var(--line-faint); padding: .1rem .4rem; }
.component-name { font-weight: 800; margin: 0; font-size: 1.05rem; letter-spacing: -0.01em; }
.component-desc { color: var(--slatey); font-size: .85rem; margin: .1rem 0 0; flex-basis: 100%; }
.component-body { padding: .9rem 1.15rem 0; }
/* The status as a stamp on the sheet: bordered capitals, square. The dot stays for the
   colour, the word for everyone else. */
.status-word { display: inline-flex; align-items: center; gap: .45rem; margin-left: auto; white-space: nowrap; border: 2px solid currentColor; padding: .3rem .6rem; }
.dot { width: .6rem; height: .6rem; flex: none; background: var(--none); }
.s-operational .status-word { color: var(--ok); } .s-operational .dot { background: var(--ok); }
.s-degraded .status-word { color: var(--warn); } .s-degraded .dot { background: var(--warn); }
.s-down .status-word { color: var(--bad); } .s-down .dot { background: var(--bad); }
.s-maintenance .status-word { color: var(--maint); } .s-maintenance .dot { background: var(--maint); }
.s-unknown .status-word { color: var(--slatey); }
.note { font-size: .85rem; color: var(--slatey); margin: .45rem 0 0; }

/* Ninety days as a wall: three courses of thirty bricks in running bond, oldest day bottom
   left, today top right. A brick is a day; its colour is that day's availability, and the
   day and figure are on it for hover, tap and screen readers. Mortar is the ground showing
   through the gaps. */
.wall { display: grid; grid-template-columns: repeat(60, 1fr); gap: 3px; margin: .9rem 0 .5rem; }
.wall .course { display: contents; }
.brick { grid-column: span 2; height: 14px; background: var(--plank); position: relative; border-radius: 1px; }
.brick.half { grid-column: span 1; }
.brick.b-ok { background: var(--ok); }
.brick.b-warn { background: var(--warn); }
.brick.b-bad { background: var(--bad); }
.brick:hover::after, .brick:focus::after {
  content: attr(data-label); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #F8F5F0; font-size: .75rem; padding: .3rem .5rem; white-space: nowrap; z-index: 2;
}
.uptime { display: flex; gap: 1.5rem; margin: .35rem 0 0; flex-wrap: wrap; color: var(--slatey); }
.uptime span { position: relative; padding: 0 .9rem; }
.uptime span::before, .uptime span::after { content: ""; position: absolute; top: 50%; width: .6rem; height: 2px; background: var(--line); }
.uptime span::before { left: 0; } .uptime span::after { right: 0; }
.uptime span::before { box-shadow: 0 -5px 0 -1px var(--line), 0 5px 0 -1px var(--line); }
.uptime strong { color: var(--text); font-variant-numeric: tabular-nums; font-size: .95rem; letter-spacing: 0; }

/* ── chart ──────────────────────────────────────────────────────────────────── */
figure { margin: 0; background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; border: 2px solid var(--line); padding: 1rem; }
#response-chart { width: 100%; height: 12rem; display: block; }
figcaption { font-size: .85rem; color: var(--slatey); margin-top: .5rem; }
.axis { stroke: var(--line-faint); stroke-width: 1; }
.series { fill: none; stroke: var(--copper); stroke-width: 2; vector-effect: non-scaling-stroke; }
.area { fill: var(--copper); opacity: .14; }
.chart-label { font-size: 11px; fill: var(--slatey); font-family: inherit; }

/* ── incidents and maintenance ──────────────────────────────────────────────── */
.incident { background: var(--paper); border: 2px solid var(--line); border-left-width: 8px; padding: 1rem 1.15rem; margin-bottom: .9rem; }
.incident.i-resolved { border-left-color: var(--ok); }
.incident.i-live { border-left-color: var(--bad); }
.incident.i-maint { border-left-color: var(--maint); }
.incident h3 { margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.entry-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: var(--slatey); letter-spacing: .08em; margin: 0 0 .25rem; }
.incident-meta { color: var(--slatey); font-size: .85rem; margin: .25rem 0 .6rem; }
.stage { font-weight: 800; color: var(--text); }
.updates { margin: 0; padding: 0; list-style: none; }
.updates li { border-top: 1px solid var(--line-faint); padding: .55rem 0; font-size: .95rem; }
.updates time { color: var(--slatey); font-size: .75rem; display: block; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.post-incident { border-top: 2px solid var(--copper); margin-top: .75rem; padding-top: .6rem; font-size: .95rem; }
.post-incident strong::before { content: "Close-out report. "; font-weight: 800; }
.tag { display: inline-block; border: 1px solid var(--line); padding: .1rem .45rem; margin-right: .3rem; color: var(--text); }

.subscribe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.5rem 2.5rem; }
.sub-h { margin: 0 0 .25rem; font-size: 1rem; font-weight: 800; }
.alert-form label.tech { display: block; color: var(--slatey); margin-bottom: .35rem; }
.alert-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.alert-row input { flex: 1 1 14rem; border: 2px solid var(--line); background: var(--paper); color: var(--text); padding: .65rem .8rem; font: inherit; font-size: .95rem; }
.consent { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; color: var(--slatey); margin-top: .6rem; }
.consent input { margin-top: .2rem; }
.feed-box { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; background: var(--paper); border: 2px solid var(--line); padding: .9rem 1rem; }
.feed-box code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; word-break: break-all; flex: 1 1 18rem; }
.btn-copy { font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; padding: .7rem 1rem; background: var(--ink); color: #F8F5F0; border: 2px solid var(--ink); cursor: pointer; text-decoration: none; }
.btn-copy:hover { background: var(--copper); border-color: var(--copper); }
@media (prefers-color-scheme: dark) { .btn-copy { background: var(--copper); border-color: var(--copper); } .btn-copy:hover { background: #F8F5F0; color: var(--ink); border-color: #F8F5F0; } }
.foot { margin-top: 3.5rem; background: var(--ink); color: #F8F5F0; padding: 1.75rem 0 2.25rem; font-size: .9rem; }
.foot p { margin: .3rem 0; }
.foot .quiet { color: rgba(248, 245, 240, .65); }
.foot a { color: var(--copper); }
