/* app.amomorning.com — warm ivory base, serif display, suprematist art sections,
   unified mono status panel at the end. */

:root {
  --bg: #F7F4EE;
  --bg-card: #FBF9F4;
  --ink: #1E1C18;
  --muted: #6E6A60;
  --faint: #A09A8D;
  --hair: #E2DDD2;
  --clay: #C15F3C;

  --ok: #4A7A3D;
  --warn: #A66A1F;
  --crit: #B23A2A;
  --unknown: #A09A8D;

  --sans: "Neue Helvetica", "Helvetica Neue", Helvetica, "Inter",
    "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: var(--sans); /* legacy alias — page went full Swiss grotesque */
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(1.5rem, 8vw, 8rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* watercolor paper wash, shared from amomorning.com (hotlinked, single
   source on this box); body's --bg stays as the fallback if it fails */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg) url("https://amomorning.com/Watercolor.jpg") center / cover no-repeat;
  opacity: 0.15;
  pointer-events: none;
}

::selection { background: var(--clay); color: var(--bg); }

a { color: var(--clay); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

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

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--gutter);
  max-width: 1200px;
  margin: 0 auto;
}

.eyebrow {
  color: var(--clay);
  text-transform: uppercase;
  margin: 0 0 2.5rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
  max-width: 14ch;
}

.dot-accent { color: var(--clay); }

.lede {
  max-width: 44ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 4rem;
}

.index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
}

.index a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  color: var(--ink);
}

.index a::after { content: "↗"; color: var(--faint); font-size: 0.7rem; }
.index a:hover { background: var(--bg-card); text-decoration: none; color: var(--clay); }
.index a:hover::after { color: var(--clay); }

.status-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--clay);
  text-transform: lowercase;
}

/* --------------------------------------------------------- art sections */

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: var(--gutter);
  border-top: 1px solid var(--hair);
}

/* staggered vertical rhythm — the path turns */
.panel[data-flip="0"] .panel-inner { transform: translateY(5vh); }
.panel[data-flip="1"] .panel-inner { transform: translateY(-5vh); }

.panel-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

/* alternate composition side every other panel */
.panel[data-flip="1"] .panel-identity { order: 2; }
.panel[data-flip="1"] .panel-art { order: 1; }

.panel-identity { min-width: 0; }

.panel-kicker {
  color: var(--faint);
  text-transform: uppercase;
  margin: 0 0 1.5rem;
}

.panel-kicker .num { color: var(--clay); }

.panel h2 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

.panel .desc {
  color: var(--muted);
  max-width: 40ch;
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

.panel .visit {
  font-family: var(--mono);
  font-size: 0.82rem;
}

/* cook wordmark — same family as the page now; keeps its tighter tracking */
.panel h2.wordmark {
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* L/R stacked, overshooting the line above and below */
.wm-lr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
  margin: 0 0.04em;
}

.wm-lr i {
  font-style: normal;
  font-size: 0.78em;
  line-height: 1;
  letter-spacing: 0;
  font-weight: inherit;
  display: block;
  position: relative;
  z-index: 0;
}

/* faux-bold: ::before replicates the glyph as a stroke underneath,
   the real glyph covers it cleanly (pure outward growth, even outline) */
.wm-lr i::before {
  content: attr(data-ch);
  position: absolute;
  left: 0;
  top: 0;
  color: transparent;
  -webkit-text-stroke: 0.05em var(--ink);
  z-index: -1;
}

/* L in clay marks the stacked PLOG reading; R stays ink */
.wm-lr i:first-child { color: var(--clay); }
.wm-lr i:first-child::before { -webkit-text-stroke-color: var(--clay); }

.alias {
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: -0.25rem 0 1.1rem;
}

.panel-art { display: flex; justify-content: center; }

.panel-art svg {
  width: min(100%, 560px);
  height: auto;
  display: block;
}

/* slow life in the compositions */
.drift { animation: drift 9s ease-in-out infinite alternate; transform-origin: center; }
.drift-b { animation: drift-b 9s ease-in-out infinite alternate; transform-origin: center; }
.spin-slow { animation: spin 140s linear infinite; transform-origin: 320px 320px; }

/* syngia — signal current along the bridge */
.flow {
  stroke-dasharray: 16 26;
  animation: flow 2.8s linear infinite;
}

@keyframes flow {
  from { stroke-dashoffset: 84; }
  to   { stroke-dashoffset: 0; }
}

/* cook — steam rising from the plate */
.steam { animation: steam 5.5s ease-in-out infinite; }
.steam.s2 { animation-delay: 2.4s; }

@keyframes steam {
  0%   { transform: translateY(0); opacity: 0; }
  15%  { opacity: 0.8; }
  70%  { opacity: 0.45; }
  100% { transform: translateY(-60px); opacity: 0; }
}

/* teach-web — a climbing wave through the steps */
.climb { animation: climb 3.2s ease-in-out infinite; }

@keyframes climb {
  0%, 55%, 100% { transform: translateY(0); }
  25% { transform: translateY(-10px); }
}

.spin-tiny {
  animation: spin 60s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

@keyframes drift-b {
  from { transform: translateY(0); }
  to   { transform: translateY(10px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* -------------------------------------------------------- status panel */

.status-panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--gutter);
  border-top: 1px solid var(--hair);
  background: var(--bg-card);
}

.status-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.status-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.status-head h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.status-summary { color: var(--muted); text-transform: lowercase; }

.status-sub {
  color: var(--faint);
  margin: 0 0 2.5rem;
  max-width: 60ch;
}

.table-wrap { overflow-x: auto; }

table.status {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.78rem;
}

table.status th {
  text-align: left;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-size: 0.68rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

table.status td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
  white-space: nowrap;
}

table.status td.site-name { white-space: normal; }
table.status td.site-name a { color: var(--ink); }
table.status td.site-name a:hover { color: var(--clay); }
table.status td.site-name .kind { color: var(--faint); font-size: 0.68rem; margin-left: 0.6em; }

td.num, th.num { text-align: right; }

/* status dot */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.55em;
  vertical-align: 0.08em;
  background: var(--unknown);
}

.dot.ok   { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.crit { background: var(--crit); }
.dot.off  { background: var(--crit); animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(178, 58, 42, 0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(178, 58, 42, 0); }
}

.st-ok   { color: var(--ok); }
.st-warn { color: var(--warn); }
.st-crit { color: var(--crit); }
.st-dim  { color: var(--faint); }

/* backend chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; white-space: normal; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  border: 1px solid var(--hair);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
}

.chip .dot { margin-right: 0; width: 6px; height: 6px; }

/* uptime bars */
.bars {
  display: flex;
  gap: 2px;
  height: 14px;
  min-width: 150px;
}

.bars i {
  flex: 1;
  border-radius: 1px;
  background: color-mix(in srgb, var(--unknown) 35%, transparent);
  min-width: 2px;
}

.bars i.ok   { background: var(--ok); }
.bars i.warn { background: var(--warn); }
.bars i.crit { background: var(--crit); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
  color: var(--faint);
}

.legend span { display: inline-flex; align-items: center; }

/* ------------------------------------------------ vertical wayfinding nav */

.waynav {
  position: fixed;
  right: clamp(0.9rem, 2.2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.waynav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.1rem 0;
}

/* the tick */
.waynav i {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--faint);
  transition: width 0.25s ease, background-color 0.25s ease;
}

/* the label, revealed to the left of the tick */
.waynav span {
  position: absolute;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.waynav a:hover span,
.waynav a[aria-current] span { opacity: 1; }

.waynav a:hover i { background: var(--ink); width: 22px; }
.waynav a[aria-current] i { background: var(--clay); width: 28px; }
.waynav a[aria-current] span { color: var(--clay); }

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

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--hair);
  color: var(--faint);
  max-width: 1200px;
  margin: 0 auto;
}

/* --------------------------------------------------------------- misc */

.no-data {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  z-index: 10;
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .drift, .drift-b, .spin-slow, .spin-tiny, .flow, .steam, .climb, .dot.off { animation: none; }
}

/* ------------------------------------------------------------- narrow */

@media (max-width: 880px) {
  .waynav { display: none; }
  .panel-inner { grid-template-columns: 1fr; gap: 2rem; align-items: start; }
  .panel { align-items: flex-start; padding-top: 16vh; padding-bottom: 10vh; }
  .panel[data-flip="0"] .panel-inner, .panel[data-flip="1"] .panel-inner { transform: none; }
  .panel[data-flip="1"] .panel-identity { order: 0; }
  .panel[data-flip="1"] .panel-art { order: 0; }
  .panel-art svg { width: min(100%, 420px); }
  .hero { justify-content: flex-start; padding-top: 18vh; }
}
