/* Dagda Monitor marketing site.
   Brand palette (oak / torc / woad) plus the three status colours the product uses.
   The signature element is the hero "stemline": the Dagda mark is an Ogham-style
   stem with strokes, so each server is drawn as a stroke on one long line. */

@font-face { font-family: "Barlow SC"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow SC"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow SC"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow SC"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow SC"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --dagda-oak:   #1F4D3A;
  --dagda-torc:  #C08A2E;
  --dagda-woad:  #2E4A6B;
  --dagda-bg:    #F3EFE6;
  --dagda-ink:   #1A1A1A;

  --ok:   #3FB950;
  --warn: #E3B341;
  --crit: #D1495B;

  --ink-2: color-mix(in srgb, var(--dagda-ink) 72%, var(--dagda-bg));
  --line:  color-mix(in srgb, var(--dagda-ink) 16%, var(--dagda-bg));
  --alt:   color-mix(in srgb, var(--dagda-oak) 6%, var(--dagda-bg));
  --code:  color-mix(in srgb, var(--dagda-oak) 10%, var(--dagda-bg));
  --btn-ink: #F3EFE6;

  --font: "Barlow SC", "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --dagda-oak:  #3F8A68;  /* lifted for contrast on dark */
    --dagda-torc: #D9A441;
    --dagda-woad: #6F93BF;
    --dagda-bg:   #12201A;
    --dagda-ink:  #ECE7DC;
    --alt:  color-mix(in srgb, var(--dagda-oak) 9%, var(--dagda-bg));
    --code: color-mix(in srgb, #000 28%, var(--dagda-bg));
    --btn-ink: #0E1914;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--dagda-bg);
  color: var(--dagda-ink);
  font: 400 1.1875rem/1.55 var(--font);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.1; color: var(--dagda-oak); }
p { margin: 0 0 1em; }
a { color: var(--dagda-woad); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--dagda-torc); outline-offset: 3px; border-radius: 2px; }

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

.skip { position: absolute; left: -999px; top: .5rem; padding: .5rem .9rem; background: var(--dagda-oak); color: var(--btn-ink); z-index: 10; }
.skip:focus { left: .5rem; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--dagda-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 4rem; }
.lockup { display: block; color: var(--dagda-oak); line-height: 0; }
.lockup svg { height: 2.35rem; width: auto; }
.top nav { display: flex; align-items: center; gap: 1.6rem; font-weight: 500; font-size: 1.0625rem; }
.top nav a { color: var(--dagda-ink); text-decoration: none; }
.top nav a:hover { color: var(--dagda-oak); text-decoration: underline; }
.top nav .nav-cta { color: var(--dagda-oak); font-weight: 600; }
@media (max-width: 52rem) {
  .top nav a:not(.nav-cta) { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: .72rem 1.35rem .78rem;
  border-radius: 999px;
  background: var(--dagda-oak);
  color: var(--btn-ink);
  font-weight: 600; font-size: 1.0625rem; line-height: 1.2;
  text-decoration: none;
  border: 2px solid var(--dagda-oak);
}
.btn:hover { background: var(--dagda-torc); border-color: var(--dagda-torc); color: #1A1A1A; text-decoration: none; }
.btn-quiet { background: transparent; color: var(--dagda-oak); }
.btn-quiet:hover { background: transparent; color: var(--dagda-oak); border-color: var(--dagda-torc); }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 0; }
.hero h1 {
  font-size: clamp(2.75rem, 7.4vw, 5.75rem);
  letter-spacing: -.015em;
  line-height: .98;
  max-width: 13ch;
}
.lede { margin-top: 1.6rem; font-size: clamp(1.2rem, 1.9vw, 1.4rem); line-height: 1.5; max-width: 38em; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.stem { margin: clamp(2.5rem, 6vw, 4.5rem) 0 0; padding-bottom: clamp(3rem, 6vw, 5rem); }
.stem-svg { display: block; width: 100%; height: auto; overflow: visible; }
.stem-line { stroke: var(--dagda-oak); stroke-width: 12; stroke-linecap: round; }
.host line {
  stroke-width: 12; stroke-linecap: round;
}
.host.ok line   { stroke: var(--dagda-oak); }
.host.warn line { stroke: var(--warn); }
.host.crit line { stroke: var(--crit); }
.host text {
  fill: var(--ink-2); font: 500 17px var(--font); text-anchor: middle;
}
.host { cursor: pointer; outline: none; }
.host:hover text, .host:focus-visible text, .host[aria-pressed="true"] text { fill: var(--dagda-ink); font-weight: 700; }
.host:focus-visible text { text-decoration: underline; text-decoration-color: var(--dagda-torc); text-decoration-thickness: 2px; }
.host.ok:hover line, .host.ok[aria-pressed="true"] line { stroke: var(--ok); }

/* Draw-in on load: the one orchestrated moment on the page. */
@media (prefers-reduced-motion: no-preference) {
  .js .stem-line { stroke-dasharray: 1160; stroke-dashoffset: 1160; animation: draw 1.1s cubic-bezier(.6,0,.2,1) .15s forwards; }
  .js .host line { opacity: 0; animation: rise .5s ease-out forwards; animation-delay: calc(1s + var(--i, 0) * 70ms); }
  .js .host text { opacity: 0; animation: fade .6s ease-out forwards; animation-delay: calc(1.3s + var(--i, 0) * 70ms); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: scaleY(0); } to { opacity: 1; transform: scaleY(1); } }
@keyframes fade { to { opacity: 1; } }
.host line { transform-box: fill-box; transform-origin: 50% 100%; }
.host.warn line { transform-origin: 50% 0; }
.host.crit line { transform-origin: 50% 50%; }

.stem figcaption { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin-top: 1.25rem; font-size: 1rem; color: var(--ink-2); }
.key { display: inline-flex; align-items: center; gap: .55rem; }
.key i { display: inline-block; width: 4px; height: 1.05em; border-radius: 2px; }
.k-ok   { background: var(--dagda-oak); }
.k-warn { background: var(--warn); }
.k-crit { background: var(--crit); }
.readout {
  margin: 1rem 0 0; min-height: 3.2em; max-width: 44em;
  font-size: 1.0625rem; color: var(--dagda-ink);
}
.readout b { color: var(--dagda-oak); }

/* On narrow screens the stemline gets its own scroll so labels stay legible. */
@media (max-width: 40rem) {
  .stem .wrap { padding-right: 0; }
  .stem-scroll { overflow-x: auto; padding-right: var(--gutter); }
  .stem-svg { min-width: 42rem; }
  .readout, .stem figcaption { padding-right: var(--gutter); }
}

/* ---------- bands ---------- */
.band { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--line); }
.band-alt { background: var(--alt); }
.band h2 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -.01em; max-width: 20ch; }
.intro { margin-top: 1.1rem; max-width: 40em; color: var(--ink-2); font-size: 1.25rem; }
.band h3 { font-size: 1.3rem; line-height: 1.2; }

.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.split > div > p { max-width: 32em; }
.split h2 + p { margin-top: 1.1rem; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

/* What it watches: a plain grid of short entries, each hung from a small stroke. */
.watch {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 2.25rem 3rem; margin-top: 3rem;
}
.w { border-top: 3px solid var(--dagda-oak); padding-top: .9rem; }
.w p { margin: .5rem 0 0; color: var(--ink-2); }

/* Alert feed */
.feed { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.feed li {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem;
  padding: .85rem 0 .85rem 1.1rem; border-bottom: 1px solid var(--line);
  position: relative; font-size: 1.0625rem;
}
.feed li::before { content: ""; position: absolute; left: 0; top: .8rem; bottom: .8rem; width: 4px; border-radius: 2px; }
.feed li.ok::before   { background: var(--ok); }
.feed li.warn::before { background: var(--warn); }
.feed li.crit::before { background: var(--crit); }
.feed b { font-weight: 600; }
@media (max-width: 30rem) { .feed li { grid-template-columns: 1fr; gap: .1rem; } }

/* Steps (a real sequence, so numbered) */
.steps { list-style: none; counter-reset: step; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.steps li { counter-increment: step; min-width: 0; }
.steps li::before {
  content: counter(step);
  display: block; margin-bottom: .6rem;
  font-weight: 700; font-size: 2.75rem; line-height: 1; color: var(--dagda-torc);
  font-variant-numeric: lining-nums;
}
.steps p { margin: .5rem 0 0; color: var(--ink-2); }
pre {
  margin: 1rem 0 0; padding: .8rem 1rem; overflow-x: auto;
  background: var(--code); border-radius: 6px; border: 1px solid var(--line);
  font: 400 .9rem/1.5 var(--mono); color: var(--dagda-ink);
}
@media (max-width: 52rem) { .steps { grid-template-columns: 1fr; gap: 2rem; } }

/* Your data */
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.facts p { margin: .35rem 0 0; color: var(--ink-2); }

/* Access */
.access { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.access h2 + p { margin: 1.1rem 0 1.75rem; max-width: 30em; }
.reqs { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .9rem 1.75rem; }
.reqs dt { font-weight: 600; color: var(--dagda-oak); }
.reqs dd { margin: 0; color: var(--ink-2); }
@media (max-width: 52rem) { .access { grid-template-columns: 1fr; } }
@media (max-width: 30rem) { .reqs { grid-template-columns: 1fr; gap: .15rem; } .reqs dd { margin-bottom: .75rem; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: 1rem; color: var(--ink-2); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.foot-mark { width: 2.2rem; height: auto; color: var(--dagda-oak); }
.foot p { margin: 0; }
.foot .small { margin-left: auto; }
@media (max-width: 30rem) { .foot .small { margin-left: 0; } }
