/* rainbird.app — operations console
   Layout rests on two things: a 12-column grid and ONE spacing scale.
   Nothing sets an ad-hoc margin; every gap is a --s* token.

   The accent, main text colour and fonts come from brand.css (linked before
   this file), shared with the invoices and the logo. deploy.sh copies it from
   ~/clients/rainbird_apps/brand. The other greys here are the site's own. */

:root {
  /* light console — one dark element (the log) carries the weight */
  --bg:       #F4F6F5;
  --bg-2:     #EAEEEC;
  --panel:    #FFFFFF;
  --line:     #DEE4E3;
  --line-2:   #C6D0CF;
  --fg:       var(--brand-ink);
  --fg-2:     #4E616C;
  --fg-3:     #7A8C96;
  --accent:   var(--brand-accent);
  --ok:       #2F7D5B;
  --fail:     #BC4632;
  --warn:     #9C6F1A;

  /* the log panel stays dark on purpose */
  --log-bg:   #0E1820;
  --log-bar:  #142129;
  --log-line: #22323E;
  --log-fg:   #DCE6ED;
  --log-dim:  #7A929F;
  --log-ok:   #56B98B;
  --log-fail: #E86F58;
  --log-warn: #DCA947;

  --sans: var(--brand-sans);
  --mono: var(--brand-mono);

  --s1: 0.5rem;  --s2: 0.75rem; --s3: 1rem;   --s4: 1.5rem;
  --s5: 2rem;    --s6: 3rem;    --s7: 4rem;   --s8: 6rem;

  --gutter: clamp(1.25rem, 3.5vw, 3rem);
  --max: 82rem;
  --band: clamp(3.5rem, 6vw, 6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- grid shell ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s5) var(--s6);
}

.band { padding-block: var(--band); border-top: 1px solid var(--line); }

/* ---------- status bar ---------- */

.statusbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.statusbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  height: 3.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.brand { color: var(--fg); text-decoration: none; font-weight: 500; letter-spacing: 0.01em; }
.brand span { color: var(--accent); }

.status-mid { display: flex; align-items: center; gap: var(--s2); color: var(--fg-2); }

.dot {
  position: relative;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(47,125,91,.14);
  flex: none;
}

/* Live indicator: a slow radar ping, status bar only. The dots on the
   failure-mode cards are static markers and deliberately do not pulse. */
.status-mid .dot::after,
.status-mid .dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--ok);
  animation: ping 2.8s cubic-bezier(.18,.6,.32,1) infinite;
}

.status-mid .dot::before { animation-delay: 1.4s; }

@keyframes ping {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(3.4); opacity: 0; }
  100% { transform: scale(3.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .status-mid .dot::after,
  .status-mid .dot::before { animation: none; opacity: 0; }
}

.dot-fail { background: var(--fail); box-shadow: 0 0 0 3px rgba(224,96,75,.16); }

.statusbar a.act {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line-2);
  padding: 0.35rem 0.9rem;
  border-radius: 2px;
}

.statusbar a.act:hover { background: var(--panel); border-color: var(--accent); }

@media (max-width: 34rem) { .status-mid { display: none; } }

/* ---------- hero ---------- */

.hero { padding-block: clamp(3rem, 7vw, 6.5rem) var(--s7); border-top: 0; }

.hero h1 {
  grid-column: 1 / 8;
  margin: 0;
  font-size: clamp(2.35rem, 1.1rem + 4.4vw, 4.9rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.026em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero h1 em { font-style: normal; color: var(--accent); }

.hero-aside { grid-column: 9 / 13; align-self: end; }

.hero-aside p { margin: 0 0 var(--s3); color: var(--fg-2); font-size: 1.0625rem; }

.hero-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-3);
  line-height: 1.9;
  border-top: 1px solid var(--line);
  padding: var(--s3) 0 0;
  margin: var(--s4) 0 0;
  list-style: none;
}

/* Same treatment as the Knack submit button, so there is one button style. */
.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.6rem 1.3rem;
  border-radius: 2px;
}
.cta:hover { filter: brightness(1.12); }

@media (max-width: 62rem) {
  .hero h1 { grid-column: 1 / -1; }
  .hero-aside { grid-column: 1 / -1; }
}

/* ---------- log panel ---------- */

.logwrap { padding-bottom: var(--s8); }

.log {
  background: var(--log-bg);
  border: 1px solid var(--log-bg);
  border-radius: 3px;
  overflow: hidden;
}

.log-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--log-line);
  background: var(--log-bar);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--log-dim);
}

.log-body {
  margin: 0;
  padding: var(--s4) var(--s5) var(--s5);
  font-family: var(--mono);
  font-size: clamp(0.72rem, 0.55rem + 0.5vw, 0.9rem);
  line-height: 2.1;
  color: var(--log-fg);
  overflow-x: auto;
  white-space: pre;
}

.log-line { display: block; }
.log-line[data-state="pending"] { opacity: 0; }
.log-t    { color: var(--log-dim); }
.log-job  { color: var(--log-fg); }
.log-ok   { color: var(--log-ok); }
.log-bad  { color: var(--log-fail); }
.log-note { color: var(--log-warn); }

@keyframes logIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.log-line.is-in { animation: logIn .2s ease-out both; }

.cursor {
  display: inline-block; width: .5em; height: 1em;
  background: var(--fg-3); vertical-align: -.15em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .log-line[data-state="pending"] { opacity: 1; }
  .log-line.is-in { animation: none; }
  .cursor { animation: none; opacity: .5; }
}

/* ---------- section scaffolding ---------- */

.sec-label {
  grid-column: 1 / 3;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-3);
  margin: 0;
  padding-top: 0.45rem;
  line-height: 1.6;
}

.sec-body { grid-column: 4 / 11; }

.sec-wide { grid-column: 4 / 13; }

@media (max-width: 62rem) {
  .sec-label { grid-column: 1 / -1; }
  .sec-body, .sec-wide { grid-column: 1 / -1; }
}

h2 {
  margin: 0 0 var(--s4);
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.15rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h3 { margin: 0 0 var(--s2); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.005em; }

p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }

.sec-body p, .sec-wide p { color: var(--fg-2); max-width: 46rem; }
.sec-body p.lead { color: var(--fg); font-size: 1.1875rem; line-height: 1.5; }

a { color: var(--accent); text-underline-offset: .2em; }

/* ---------- flows (what I build) ----------
   Outcome on the left, the plain-English chain of tools on the right. */

.flows {
  grid-column: 4 / 13;
  margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line);
}

.flows li {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--s2) var(--s5);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}

.flows h3 { margin: 0; font-size: 1rem; }
.flows p { margin: 0; color: var(--fg-2); font-size: 0.9375rem; }

@media (max-width: 48rem) {
  .flows { grid-column: 1 / -1; }
  .flows li { grid-template-columns: 1fr; }
}

/* ---------- failure cards ---------- */

.cards {
  grid-column: 4 / 13;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: var(--s4);
}

.card-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }

.card-head .dot { background: var(--fail); box-shadow: 0 0 0 3px rgba(224,96,75,.14); }

.card p { margin: 0; color: var(--fg-2); font-size: 0.9375rem; }

.card h3 { margin: 0; font-size: 1rem; }

@media (max-width: 48rem) { .cards { grid-template-columns: 1fr; grid-column: 1 / -1; } }

/* ---------- phases ---------- */

.phases {
  grid-column: 4 / 13;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s6);
}

.phase { border-top: 2px solid var(--accent); padding-top: var(--s3); }
.phase-run { border-top-color: var(--ok); }
.phase h3 { font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3); font-weight: 400; margin-bottom: var(--s2); }
.phase .big { font-size: 1.25rem; font-weight: 600; margin-bottom: var(--s2); letter-spacing: -0.01em; }
.phase p { color: var(--fg-2); font-size: 0.9375rem; }

@media (max-width: 48rem) { .phases { grid-template-columns: 1fr; grid-column: 1 / -1; gap: var(--s5); } }

/* ---------- spec table ---------- */

.spec {
  grid-column: 4 / 13;
  border-top: 1px solid var(--line);
  margin-top: var(--s5);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.spec-row { display: grid; grid-template-columns: 10rem 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.spec-row dt { color: var(--fg-3); margin: 0; }
.spec-row dd { color: var(--fg-2); margin: 0; }

@media (max-width: 40rem) {
  .spec { grid-column: 1 / -1; }
  .spec-row { grid-template-columns: 1fr; gap: var(--s1); }
}

/* ---------- fit ---------- */

.fit { grid-column: 4 / 13; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.fit h3 { font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; color: var(--fg-3); margin-bottom: var(--s3); }
.fit ul { margin: 0; padding: 0; list-style: none; }
.fit li { color: var(--fg-2); font-size: 0.9375rem; padding: var(--s2) 0 var(--s2) var(--s4); border-bottom: 1px solid var(--line); position: relative; }
.fit li:first-child { border-top: 1px solid var(--line); }
.fit li::before { content: "+"; position: absolute; left: 0; color: var(--ok); font-family: var(--mono); }
.fit .no li::before { content: "\2212"; color: var(--fg-3); }

@media (max-width: 48rem) { .fit { grid-template-columns: 1fr; grid-column: 1 / -1; gap: var(--s5); } }

/* ---------- faq ----------
   Native <details>, so answers stay in the HTML for crawlers and work
   without JavaScript. The +/− marker mirrors the fit list. */

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }

.faq summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding: var(--s3) var(--s5) var(--s3) 0;
  font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 0; top: var(--s3);
  font-family: var(--mono); color: var(--fg-3);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: var(--s3); }

/* ---------- booking ---------- */

.book { background: var(--bg-2); }
.book .sec-body { grid-column: 4 / 11; }

/* availability notice — reuses the status-dot language from the header,
   amber rather than green. Not pulsed: the ping is scoped to .status-mid. */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin: var(--s4) 0 0;
  padding: var(--s3) var(--s4);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--warn);
  border-radius: 2px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 46rem;
}

.notice .dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(156,111,26,.14);
  margin-top: 0.52rem;
}

.cal-frame {
  grid-column: 1 / -1;
  margin-top: var(--s5);
  background: none;
  border: 0;
  padding: 0;
}

/* Cal sizes its own widget; any min-height here just adds empty space.
   The booker centres itself inside the cross-origin iframe, so it cannot be
   pulled onto the grid from out here — full width, centred, left as-is. */
.cal-mount { min-height: 0; }

/* ---------- support page ----------
   The form is the whole page, so it spans the full grid instead of the
   offset content column the homepage uses for prose. Capped so the two
   form columns stay a readable width on big screens. */

.support .sec-label,
.support .sec-wide { grid-column: 1 / -1; }
.support .sec-wide { max-width: 64rem; }

/* ---------- logo page ----------
   Download links for the wordmark files, which deploy.sh copies in from the
   brand folder. Full width like the support page; the dark tile uses the log
   panel's colour so the white version is shown on the site's own dark. */

.logo-page .sec-label,
.logo-page .sec-wide { grid-column: 1 / -1; }
.logo-page .sec-wide { max-width: 64rem; }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
  margin: var(--s5) 0;
}

.logo-tile { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.logo-view { display: grid; place-items: center; aspect-ratio: 16 / 7; padding: var(--s5); }
.logo-view img { width: 100%; height: auto; }
.logo-view-dark { background: var(--log-bg); }

.logo-tile figcaption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4);
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.8125rem; color: var(--fg-3);
}
.logo-dl { display: flex; gap: var(--s3); }
.logo-dl a { text-decoration: none; font-weight: 500; }
.logo-dl a:hover { text-decoration: underline; }

@media (max-width: 48rem) { .logo-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); background: var(--bg-2); }
.foot .wrap {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
  justify-content: space-between; align-items: center;
  height: auto; min-height: 3.5rem; padding-block: var(--s3);
  font-family: var(--mono); font-size: 0.75rem; color: var(--fg-3);
}
.foot a { color: var(--fg-2); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---------- focus ---------- */

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
