/* === Yori's Corner — Styles === */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400&display=swap');

:root {
  --bg: #0b0b10;
  --bg-elevated: #13131b;
  --fg: #e8e4dc;
  --fg-muted: #7a7680;
  --accent: #e8a44a;
  --accent-glow: rgba(232, 164, 74, 0.25);
  --warm: #f5c76a;
  --warm-glow: rgba(245, 199, 106, 0.2);
  --card: rgba(18, 18, 28, 0.88);
  --border: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ok: #5fd38a;
  --ok-glow: rgba(95, 211, 138, 0.25);
  --warn: #e8a44a;
  --down: #e8635f;
  --down-glow: rgba(232, 99, 95, 0.25);
}

/* — Reset & Base — */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* — Ambient Canvas — */
#ambient {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* — Header — */
.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 5rem 1rem 2rem;
}

.site-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(232, 164, 74, 0.12);
  animation: pulse-glow 5s ease-in-out infinite alternate;
}

.tagline {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--fg-muted);
  margin-top: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* — Nav — */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
  background: rgba(11, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--accent);
}

/* — Sections — */
.section {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.section h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.section-intro {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

/* — Card Grid — */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.25s, transform 0.2s;
}

.card:hover {
  border-color: rgba(232, 164, 74, 0.25);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--warm);
}

.card p {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-glow);
  padding: 0.15em 0.5em;
  border-radius: 999px;
  margin-top: 0.5rem;
}

/* — Notes List — */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note {
  background: var(--card);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--fg);
  animation: fade-in 0.4s ease;
}

.note .timestamp {
  font-size: 0.72rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  margin-top: 0.35rem;
}

/* — Presence — */
.presence-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.heartbeat {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); opacity: 1; }
  15% { transform: scale(1.3); opacity: 0.8; }
  30% { transform: scale(1); opacity: 1; }
  45% { transform: scale(1.15); opacity: 0.9; }
  60% { transform: scale(1); }
}

/* — Add Note — */
.add-note {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.add-note input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-note input:focus {
  border-color: var(--accent);
}

/* — Button — */
.btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1.2rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn:hover { background: var(--warm); }
.btn:active { transform: scale(0.97); }

/* — Footer — */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1rem 2rem;
  color: var(--fg-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* — Echo — */
.echo {
  margin-top: 1rem;
  color: var(--fg-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* — Animation — */
@keyframes pulse-glow {
  from { text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(232, 164, 74, 0.12); }
  to { text-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(232, 164, 74, 0.2); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* — Responsive — */
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .nav-bar { gap: 1rem; }
  .add-note { flex-direction: column; }
}

/* — Reduced motion — */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ SENTINEL BOARD ============ */
.sentinel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  transition: border-color 0.4s, box-shadow 0.4s;
}
.sentinel-bar.ok { border-left-color: var(--ok); box-shadow: 0 0 24px var(--ok-glow); }
.sentinel-bar.warn { border-left-color: var(--warn); box-shadow: 0 0 24px var(--accent-glow); }
.sentinel-bar.down { border-left-color: var(--down); box-shadow: 0 0 24px var(--down-glow); }
.sentinel-bar.offline { border-left-color: var(--fg-muted); }

.sentinel-identity { display: flex; align-items: center; gap: 1rem; }
.sentinel-eye {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  animation: heartbeat 1.8s ease-in-out infinite;
}
.sentinel-eye.ok { background: var(--ok); box-shadow: 0 0 16px var(--ok-glow); }
.sentinel-eye.warn { background: var(--warn); box-shadow: 0 0 16px var(--accent-glow); }
.sentinel-eye.down { background: var(--down); box-shadow: 0 0 16px var(--down-glow); }
.sentinel-eye.offline { background: var(--fg-muted); animation: none; }

.sentinel-state { font-size: 1.15rem; font-weight: 600; color: var(--fg); }
.sentinel-sub { font-size: 0.78rem; color: var(--fg-muted); font-family: var(--font-mono); margin-top: 0.2rem; }

.sentinel-metrics { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.metric { display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.metric-num { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); color: var(--warm); }
.metric-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); }

.sentinel-note {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  min-height: 1.1em;
}

/* — Status dots — */
.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--fg-muted);
  flex: 0 0 auto;
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok-glow); }
.status-dot.degraded, .status-dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--accent-glow); }
.status-dot.down, .status-dot.missing { background: var(--down); box-shadow: 0 0 8px var(--down-glow); }

/* — Sentinel cards — */
.sentinel-card { border-left: 3px solid var(--fg-muted); }
.sentinel-card.ok { border-left-color: var(--ok); }
.sentinel-card.degraded, .sentinel-card.warn { border-left-color: var(--warn); }
.sentinel-card.down, .sentinel-card.missing { border-left-color: var(--down); }

.card-head { display: flex; align-items: center; gap: 0.55rem; }
.card-head h3 { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--warm); }
.card-status {
  margin-left: auto;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}
.card-role { color: var(--fg-muted); font-size: 0.82rem; margin: 0.3rem 0 0.8rem; }
.card-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; }
.card-rows > div { display: flex; justify-content: space-between; font-size: 0.8rem; }
.card-rows span { color: var(--fg-muted); }
.card-rows b { color: var(--fg); font-family: var(--font-mono); font-weight: 500; }

/* — Disk — */
.disk-list { display: flex; flex-direction: column; gap: 0.7rem; }
.disk-row {
  display: grid;
  grid-template-columns: 220px 1fr 52px;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}
.disk-meta { display: flex; flex-direction: column; }
.disk-mount { font-weight: 600; color: var(--warm); font-size: 0.95rem; }
.disk-dev { font-size: 0.7rem; color: var(--fg-muted); font-family: var(--font-mono); }
.disk-bar { height: 9px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.disk-fill { height: 100%; border-radius: 999px; background: var(--ok); transition: width 0.6s ease; }
.disk-fill.warn { background: var(--warn); }
.disk-fill.down { background: var(--down); }
.disk-pct { text-align: right; font-family: var(--font-mono); font-size: 0.85rem; color: var(--fg); }

@media (max-width: 600px) {
  .sentinel-bar { flex-direction: column; align-items: flex-start; }
  .disk-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .disk-pct { text-align: left; }
}

/* — Live freshness pill — */
.live-pill {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.live-pill.live { color: var(--ok); background: var(--ok-glow); border-color: var(--ok); }
.live-pill.stale { color: var(--warn); background: var(--accent-glow); border-color: var(--warn); }
.live-pill.dead { color: var(--down); background: var(--down-glow); border-color: var(--down); }

/* — Fleet pulse sparklines — */
.pulse-block {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
}
.pulse-head {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.04em;
}
.spark-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.spark { display: flex; flex-direction: column; gap: 0.4rem; }
.spark-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}
.spark canvas {
  width: 100%;
  height: 44px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (max-width: 600px) {
  .spark-row { grid-template-columns: 1fr; }
}