/* ============================================================
   IstarCloud Portal v6 — Design System "editorial bank"
   Híbrido Griffin (griffin.com): serif display (Fraunces),
   mono uppercase micro-labels, paleta stone/cream cálida,
   bento glass — con tokens 4px, focus a11y, skeletons,
   motion reducido por defecto seguro.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "Cascadia Code", Consolas, ui-monospace, monospace;

  color-scheme: dark;
  --bg: #0f0e0c;
  --bg-soft: #161411;
  --surface: color-mix(in oklab, #ffffff 4%, transparent);
  --surface-solid: #1a1815;
  --surface2: color-mix(in oklab, #ffffff 7%, transparent);
  --stroke: color-mix(in oklab, #ffffff 12%, transparent);
  --stroke-soft: color-mix(in oklab, #ffffff 7%, transparent);
  --text: #ede9e1;
  --text2: #b3aca0;
  --text3: #827b70;
  --accent: oklch(0.76 0.1 175);
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
  --accent-strong: color-mix(in oklab, var(--accent) 28%, transparent);
  --success: oklch(0.75 0.15 160);
  --warn: oklch(0.78 0.12 85);
  --danger: oklch(0.68 0.18 25);
  --r: 14px;
  --r-sm: 9px;
  --r-lg: 18px;
  --ease: cubic-bezier(.22, .8, .26, .99);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .28);
  --shadow-md: 0 8px 24px -12px rgb(0 0 0 / .5);
  --shadow-lg: 0 24px 60px -18px rgb(0 0 0 / .55);
  --topbar-h: 58px;
  --content-w: 1080px;
}

html.light {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-soft: #efece5;
  --surface: color-mix(in oklab, #ffffff 78%, transparent);
  --surface-solid: #fffefb;
  --surface2: color-mix(in oklab, #211d16 5%, transparent);
  --stroke: color-mix(in oklab, #211d16 14%, transparent);
  --stroke-soft: color-mix(in oklab, #211d16 8%, transparent);
  --text: #211d16;
  --text2: #575147;
  --text3: #857e72;
  --accent: oklch(0.5 0.09 185);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-strong: color-mix(in oklab, var(--accent) 20%, transparent);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--stroke) transparent;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  line-height: 1.5;
}

::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); }

/* ---------- Ambient: aurora + grid + grain ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: clip; pointer-events: none; contain: strict; }
.aurora { position: absolute; inset: -20%; filter: blur(90px) saturate(1.15); opacity: .55; }
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.b1 { width: 44vw; height: 44vw; left: 6%; top: -12%; background: radial-gradient(circle at 30% 30%, color-mix(in oklab, var(--accent) 30%, transparent), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 38vw; height: 38vw; right: -6%; top: 8%; background: radial-gradient(circle at 60% 40%, color-mix(in oklab, oklch(.6 .08 75) 22%, transparent), transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.b3 { width: 46vw; height: 46vw; left: 28%; bottom: -18%; background: radial-gradient(circle at 50% 50%, color-mix(in oklab, oklch(.66 .09 195) 20%, transparent), transparent 62%); animation: drift3 38s ease-in-out infinite alternate; }
html.light .aurora { opacity: .20; }
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-7vw, 9vh) scale(.92); } }
@keyframes drift3 { to { transform: translate(6vw, -7vh) scale(1.08); } }

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--stroke-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--stroke-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 25%, transparent 78%);
  opacity: .5;
}
.grain {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ---------- Skip link + focus ---------- */
.skip-link {
  position: fixed; top: -48px; left: 16px; z-index: 100; padding: 10px 16px;
  background: var(--accent); color: #06222c; border-radius: 10px; font-weight: 650;
  text-decoration: none; transition: top 160ms var(--ease); font-size: 13px;
}
.skip-link:focus-visible { top: 12px; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible {
  outline-offset: 2px;
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--accent);
  transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .progress { animation: progress-grow linear both; animation-timeline: scroll(); }
  @keyframes progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--topbar-h);
  padding: 0 clamp(16px, 4vw, 32px);
  padding-top: env(safe-area-inset-top, 0);
  background: color-mix(in oklab, var(--bg) 68%, transparent);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--stroke-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.tile {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px;
  background: linear-gradient(135deg, #2a5f70, var(--accent));
  box-shadow: 0 2px 10px color-mix(in oklab, var(--accent) 28%, transparent);
  flex-shrink: 0;
}
.tile img { width: 18px; height: 18px; display: block; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: .01em; white-space: nowrap; }

.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 550; color: var(--text2);
  text-decoration: none; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--stroke-soft); background: var(--surface);
  transition: border-color 200ms var(--ease), color 200ms var(--ease), background 200ms var(--ease);
  white-space: nowrap; max-width: 220px;
}
.pill:hover { border-color: var(--stroke); color: var(--text); }
.pill:active { transform: scale(.98); }
.pill .dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--text3); transition: background 240ms; flex-shrink: 0; }
.pill.ok .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; opacity: .4;
  animation: dot-ring 2.4s ease-out infinite;
}
@keyframes dot-ring {
  0% { transform: scale(1); opacity: .45; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}
.pill.ok .dot { background: var(--success); box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 22%, transparent); }
.pill.warn .dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in oklab, var(--warn) 22%, transparent); }
.pill.down .dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 25%, transparent); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  color: var(--text2); background: var(--surface); border: 1px solid var(--stroke-soft);
  border-radius: 9px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500;
  transition: color 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease), transform 120ms var(--ease);
  white-space: nowrap;
}
.ghost-btn:hover { color: var(--text); border-color: var(--stroke); background: var(--surface2); }
.ghost-btn:active { transform: scale(.97); }
.ghost-btn kbd {
  font-family: var(--mono); font-size: 10px; color: var(--text3);
  border: 1px solid var(--stroke-soft); border-radius: 4px; padding: 1px 5px;
  background: color-mix(in oklab, var(--bg) 40%, transparent);
}
.ghost-btn.icon-only { width: 32px; padding: 0; justify-content: center; }
.hide-sm { display: inline; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .pill { padding: 6px 10px; font-size: 11px; }
  .pill #global-pill-text { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
  .ghost-btn kbd { display: none; }
  .ghost-btn { height: 30px; padding: 0 9px; }
}
@media (max-width: 380px) {
  .brand-name { display: none; }
}
html:not(.light) .ico-sun { display: none; }
html.light .ico-moon { display: none; }

.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 16px;
  border-radius: 999px; text-decoration: none;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--text); color: var(--bg);
  border: 1px solid transparent;
  transition: opacity 160ms var(--ease), transform 120ms var(--ease), box-shadow 200ms var(--ease);
  white-space: nowrap;
}
.auth-btn:hover { opacity: .88; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.auth-btn:active { transform: scale(.97); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--content-w); margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 32px) 64px; }
section { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.sec-head { margin: clamp(44px, 7vw, 72px) 0 18px; }
.kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.sec-head h2 {
  font-family: var(--serif); font-weight: 420;
  font-size: clamp(26px, 4vw, 38px); letter-spacing: -.015em; line-height: 1.12;
}
.sec-head h2 em, .hero-title em { font-style: italic; font-weight: 340; }
.sec-sub { color: var(--text3); font-size: 13px; margin-top: 6px; line-height: 1.6; max-width: 60ch; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(20px, 4vw, 44px);
  align-items: center; padding-top: clamp(20px, 5vw, 56px);
}
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-title {
  font-family: var(--serif); font-weight: 430;
  font-size: clamp(38px, 6.4vw, 68px); line-height: 1.02; letter-spacing: -.02em;
  margin: 12px 0 16px;
  background: linear-gradient(180deg, var(--text) 55%, color-mix(in oklab, var(--text) 55%, transparent));
  -webkit-background-clip: text; background-clip: text;
}
.hero-title em { font-weight: 320; }
.hero-sub { color: var(--text2); font-size: clamp(14px, 1.55vw, 16px); line-height: 1.7; max-width: 54ch; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.accent { color: var(--accent); }
.hero-cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px;
  border-radius: 999px; font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; text-decoration: none;
  color: var(--text); border: 1px solid var(--stroke); background: transparent;
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease), box-shadow 240ms var(--ease), opacity 160ms var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: color-mix(in oklab, var(--accent) 45%, transparent); background: var(--surface2); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline-offset: 3px; }
.btn.primary {
  background: var(--text); color: var(--bg); border-color: transparent;
  box-shadow: 0 4px 18px color-mix(in oklab, var(--text) 18%, transparent);
}
.btn.primary:hover { box-shadow: 0 8px 26px color-mix(in oklab, var(--text) 26%, transparent); }
.btn.ghost { border-color: var(--stroke-soft); color: var(--text2); }
.btn.ghost:hover { color: var(--text); border-color: var(--stroke); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, auto); gap: clamp(14px, 3vw, 28px);
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--stroke-soft);
  width: fit-content; max-width: 100%;
}
.hero-stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); }
.hero-stats dd { font-family: var(--serif); font-size: clamp(20px, 2.5vw, 26px); font-weight: 460; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; min-height: 1.2em; }
@media (max-width: 640px) { .hero-stats { grid-template-columns: repeat(2, auto); gap: 16px 24px; } }
@media (max-width: 360px) { .hero-cta .btn { flex: 1 1 auto; } }

.hero-visual { position: relative; }
.hero-hint { margin-top: 10px; font-size: 11px; color: var(--text3); text-align: center; }

/* ---------- Console ---------- */
.console {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--stroke-soft);
  box-shadow: var(--shadow-lg);
}
html.light .console { box-shadow: 0 24px 60px -24px rgb(20 40 60 / .22); }
.console-bar {
  display: flex; align-items: center; gap: 6px; padding: 11px 14px;
  border-bottom: 1px solid var(--stroke-soft);
  background: color-mix(in oklab, var(--surface-solid) 50%, transparent);
}
.c-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.c-dot.r { background: oklch(.62 .19 25); }
.c-dot.y { background: oklch(.8 .14 85); }
.c-dot.g { background: oklch(.72 .16 155); }
.console-title {
  margin-left: 8px; font-family: var(--mono); font-size: 11px; color: var(--text3);
  letter-spacing: .02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.console-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--success); font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  background: color-mix(in oklab, var(--success) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--success) 18%, transparent);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.console-body { padding: 14px 16px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 2; }
.cl { display: flex; align-items: center; gap: 10px; margin: 0; white-space: nowrap; overflow: hidden; }
.cl .prompt { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.cl.dim { color: var(--text3); font-size: 11.5px; }
.cl .c-dot.st { width: 7px; height: 7px; background: var(--text3); }
.cl .c-dot.st.ok { background: var(--success); box-shadow: 0 0 6px color-mix(in oklab, var(--success) 55%, transparent); }
.cl .c-dot.st.down { background: var(--danger); box-shadow: 0 0 6px color-mix(in oklab, var(--danger) 55%, transparent); }
.cl .c-dot.st.warn { background: var(--warn); }
.cl .cname { color: var(--text); min-width: 5ch; flex-shrink: 0; }
.cl .cval { margin-left: auto; color: var(--text3); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; max-width: 14ch; text-align: right; }
.cl .cval.ok { color: var(--success); }
.cl .cval.down { color: var(--danger); }
.cursor {
  display: inline-block; width: 8px; height: 15px; margin-left: 2px;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.theme-reveal {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: var(--bg);
}
.glow-border::before {
  content: ""; position: absolute; inset: -1px; border-radius: calc(var(--r-lg) + 1px); z-index: 0;
  padding: 1px; background: conic-gradient(from var(--edge-angle, 0deg),
    transparent 0%, color-mix(in oklab, var(--accent) 60%, transparent) 10%,
    transparent 26%, transparent 62%, color-mix(in oklab, var(--accent) 30%, transparent) 76%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: edge-spin 7s linear infinite;
}
@keyframes edge-spin { to { --edge-angle: 360deg; } }
@property --edge-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* ---------- Bento cards ---------- */
.bento {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 12px;
}
.card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 18px; border-radius: var(--r);
  background: color-mix(in oklab, var(--surface-solid) 62%, transparent);
  border: 1px solid var(--stroke-soft);
  color: var(--text); text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), box-shadow 320ms var(--ease), background 220ms var(--ease);
  overflow: hidden;
  will-change: transform;
}
html.light .card { background: color-mix(in oklab, #ffffff 84%, transparent); box-shadow: 0 1px 3px rgb(16 30 50 / .07); }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx) var(--my),
    color-mix(in oklab, var(--accent) 9%, transparent), transparent 70%);
  opacity: 0; transition: opacity 320ms var(--ease);
}
.card:hover::after { opacity: 1; }
a.card:hover, .card:hover { transform: translateY(-2px); border-color: var(--stroke); box-shadow: var(--shadow-md); }
a.card:active { transform: translateY(0) scale(.985); }
a.card:focus-visible { outline-offset: 3px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ico {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: var(--surface2); border: 1px solid var(--stroke-soft); color: var(--accent);
  flex-shrink: 0;
}
.ico svg { width: 20px; height: 20px; }
.card .name { font-family: var(--serif); font-weight: 480; font-size: 16.5px; letter-spacing: -.005em; line-height: 1.2; }
.card .desc { color: var(--text3); font-size: 12.5px; line-height: 1.55; }
.card .meta {
  margin-top: auto; padding-top: 8px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.card .meta code { font-family: var(--mono); font-size: 11px; color: var(--accent); opacity: .85; }
.card.slim { padding: 16px; gap: 8px; }
.status {
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--stroke); color: var(--text3);
  white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.4;
}
.status.ok { color: var(--success); border-color: color-mix(in oklab, var(--success) 38%, transparent); background: color-mix(in oklab, var(--success) 8%, transparent); }
.status.warn { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 38%, transparent); background: color-mix(in oklab, var(--warn) 8%, transparent); }
.status.down { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, transparent); background: color-mix(in oklab, var(--danger) 10%, transparent); }
.tag {
  font-family: var(--mono); font-size: 10px; font-weight: 500; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--stroke); color: var(--text3); white-space: nowrap; letter-spacing: .02em;
}
.tag.ext { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 35%, transparent); }
.spark { opacity: .9; display: block; }

/* ---------- Status board ---------- */
.card-surface {
  border-radius: var(--r); background: color-mix(in oklab, var(--surface-solid) 62%, transparent);
  border: 1px solid var(--stroke-soft);
  padding: 6px 18px;
}
html.light .card-surface { background: color-mix(in oklab, #ffffff 84%, transparent); }
.status-row { padding: 14px 0; border-bottom: 1px solid var(--stroke-soft); }
.status-row:last-of-type { border-bottom: none; }
.status-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.status-row-head .name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.lat { font-family: var(--mono); font-size: 11.5px; color: var(--text3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lat.ok { color: var(--success); }
.lat.down { color: var(--danger); }
.uptime-bars { display: flex; gap: 3px; height: 26px; align-items: stretch; }
.uptime-bars span {
  flex: 1; min-width: 3px; border-radius: 3px;
  background: var(--stroke-soft);
  transition: transform 140ms var(--ease), filter 140ms var(--ease), opacity 140ms var(--ease);
}
.uptime-bars span:hover { transform: scaleY(1.25); filter: brightness(1.35); }
.uptime-bars span.up { background: var(--success); opacity: .85; }
.uptime-bars span.down { background: var(--danger); }
.uptime-bars span.degraded { background: var(--warn); }
.uptime-bars span.none { background: var(--stroke-soft); opacity: .6; }
.status-legend { display: flex; align-items: center; gap: 6px 14px; padding: 12px 0 10px; font-size: 11px; color: var(--text3); flex-wrap: wrap; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.lg.up { background: var(--success); opacity: .85; }
.lg.down { background: var(--danger); }
.lg.degraded { background: var(--warn); }
.lg.none { background: var(--stroke-soft); }

/* ---------- Minecraft ---------- */
.mc-live {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--stroke-soft); flex-wrap: wrap;
}
.mc-players { display: flex; align-items: baseline; gap: 8px; }
.mc-count { font-size: 26px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.mc-label { font-size: 11px; color: var(--text3); }
.mc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-meta code { font-family: var(--mono); font-size: 11px; color: var(--accent); opacity: .85; }
.copy-ip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--stroke-soft);
  color: var(--text2); font: inherit; cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease);
}
.copy-ip:hover { border-color: var(--stroke); background: var(--surface); color: var(--text); }
.copy-ip:active { transform: scale(.97); }
.copy-ip.copied { border-color: color-mix(in oklab, var(--success) 40%, transparent); color: var(--success); }

/* ---------- Infra diagram ---------- */
.infra { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.infra-flow {
  display: grid; grid-template-columns: 1fr auto 1.3fr auto 1.3fr; align-items: stretch; gap: 10px;
}
@media (max-width: 760px) {
  .infra-flow { grid-template-columns: 1fr; gap: 6px; }
  .edge { transform: rotate(90deg); height: 22px; width: 100%; }
  .edge::before { width: 2px; height: 100%; background: linear-gradient(180deg, transparent, var(--stroke), transparent); }
}
.node {
  padding: 14px; border-radius: 12px; text-align: center; font-size: 13px; font-weight: 600;
  background: var(--surface2); border: 1px solid var(--stroke-soft);
  display: grid; place-content: center; gap: 2px; min-height: 64px;
}
.node small { font-size: 10.5px; font-weight: 500; color: var(--text3); letter-spacing: .02em; }
.node.cf { border-color: color-mix(in oklab, var(--warn) 30%, transparent); }
.node.vps { border-color: color-mix(in oklab, var(--accent) 35%, transparent); }
.edge { display: grid; place-items: center; width: 46px; position: relative; }
.edge::before {
  content: ""; width: 100%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--stroke), transparent);
}
.pulse {
  position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 70%, transparent);
  animation: edge-pulse 2.2s ease-in-out infinite;
}
@keyframes edge-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.infra-branches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.branch {
  font-family: var(--mono); font-size: 11px; color: var(--text2);
  padding: 6px 11px; border-radius: 8px;
  background: var(--surface2); border: 1px dashed var(--stroke-soft);
}
.infra-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--stroke-soft); color: var(--text2); background: var(--surface);
}
.chip.ok { color: var(--success); border-color: color-mix(in oklab, var(--success) 32%, transparent); background: color-mix(in oklab, var(--success) 8%, transparent); }
.infra-links { margin-top: 12px; }

/* ---------- CTA card (admin) ---------- */
.cta-card { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.cta-card .btn { flex-shrink: 0; }
@media (max-width: 480px) { .cta-card { flex-direction: column; align-items: stretch; } }

/* ---------- Footer ---------- */
footer { margin-top: clamp(48px, 8vw, 84px); padding-top: 20px; border-top: 1px solid var(--stroke-soft); text-align: center; }
footer p { color: var(--text3); font-size: 12px; line-height: 1.7; }
footer strong { color: var(--text2); }
footer a { color: var(--text2); text-decoration: underline; text-decoration-color: var(--stroke); text-underline-offset: 3px; }
footer a:hover { color: var(--accent); }
.foot-meta { margin-top: 6px; font-size: 11px; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; bottom: 20px; right: 16px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  font-size: 13px; line-height: 1.5; color: var(--text);
  animation: toast-in 320ms var(--ease-out) both;
}
.toast.out { animation: toast-out 220ms var(--ease) both; }
.toast.ok { border-color: color-mix(in oklab, var(--success) 30%, transparent); }
.toast.err { border-color: color-mix(in oklab, var(--danger) 30%, transparent); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--accent); }
.toast.ok .toast-dot { background: var(--success); }
.toast.err .toast-dot { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 90; display: grid; place-items: start center; padding-top: 14vh; padding-inline: 16px; }
.palette[hidden] { display: none !important; }
.palette-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.palette-box {
  position: relative; width: min(560px, 100%);
  background: var(--surface-solid); border: 1px solid var(--stroke);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px -12px rgb(0 0 0 / .6);
  max-height: min(72vh, 560px); display: flex; flex-direction: column;
}
.palette-search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 52px; flex-shrink: 0;
  border-bottom: 1px solid var(--stroke-soft);
  color: var(--text3);
}
.palette-search input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none;
  background: transparent; color: var(--text); font: inherit; font-size: 15px;
}
.palette-search input::placeholder { color: var(--text3); }
.palette-esc {
  font-family: var(--mono); font-size: 10px; color: var(--text3);
  border: 1px solid var(--stroke-soft); border-radius: 4px; padding: 2px 6px;
  background: var(--surface);
}
#palette-list { list-style: none; overflow-y: auto; padding: 6px; flex: 1; min-height: 0; scrollbar-width: thin; }
#palette-list li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  font-size: 13.5px; color: var(--text2); cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
#palette-list li .pi { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--surface2); color: var(--accent); flex-shrink: 0; font-size: 12px; }
#palette-list li .pi svg { width: 14px; height: 14px; }
#palette-list li small { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; max-width: 14ch; text-align: right; }
#palette-list li.active, #palette-list li:hover { background: var(--accent-soft); color: var(--text); }
#palette-list .empty { padding: 22px; text-align: center; color: var(--text3); cursor: default; font-size: 13px; }
#palette-list .empty:hover { background: none; }
.palette-foot {
  display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--stroke-soft);
  font-size: 11px; color: var(--text3); flex-wrap: wrap; flex-shrink: 0;
}
.palette-foot kbd { font-family: var(--mono); border: 1px solid var(--stroke-soft); border-radius: 4px; padding: 1px 5px; background: var(--surface); font-size: 10px; }

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html:not(.js) .reveal { opacity: 0; transform: translateY(16px); animation: reveal-fallback .7s var(--ease) forwards; animation-delay: .15s; }
  @keyframes reveal-fallback { to { opacity: 1; transform: none; } }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sec-head, .bento > *, .status-board, .infra {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes rise-in {
      from { opacity: 0; transform: translateY(20px); }
      to { opacity: 1; transform: none; }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Admin (compat) ---------- */
#admin[hidden] { display: none !important; }

/* ---------- Skeletons ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--stroke-soft) 25%, var(--stroke) 37%, var(--stroke-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px; color: transparent !important;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- View transition ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Print ---------- */
@media print {
  .ambient, .progress, .topbar, .palette, .toast-stack { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .card, .console, .card-surface { box-shadow: none; break-inside: avoid; }
}

/* ---------- High contrast ---------- */
@media (prefers-contrast: more) {
  :root { --stroke: color-mix(in oklab, #ffffff 22%, transparent); --stroke-soft: color-mix(in oklab, #ffffff 14%, transparent); }
  .card, .console, .card-surface { border-width: 1.5px; }
}
