/* Mercuryo Statements - internal tool UI sample in the mercuryo.io design
   language. Palette tokens come from site-research/DEV-SPEC.md; Bitter
   stands in for Karloff (serif), Inter for BrutalType (sans).
   Dark theme is the default; [data-theme="light"] overrides. */

:root {
  --serif: 'Bitter', serif;
  --sans: 'Inter', sans-serif;
  --orange: #ff592c;
  --orange-hover: #fb908a;
  --green: #4afc7c;
  --yellow: #eeff2d;
  --bounce: cubic-bezier(.66, -0.45, .35, 1.39);

  /* light is the default - this is mercuryo.io's own daylight look */
  --blue: #5835ff;
  --blue-hover: #6d4aff;
  --bg: #fbfbfb;
  --card: #ffffff;
  --card-2: #f5f3ff;
  --ink: #232323;
  --muted: #6f6f78;
  --border: #e8e8e8;
  --hover: rgba(88, 53, 255, .06);
  --chip-green-bg: #d9fbe4; --chip-green-ink: #0b6b31;
  --chip-yellow-bg: #f8fbc8; --chip-yellow-ink: #6b6b00;
  --chip-blue-bg: #eae4ff; --chip-blue-ink: #4527d8;
  --blob-opacity: .10;
  --shadow: 0 20px 50px rgba(35, 35, 35, .10);
}
[data-theme="dark"] {
  --blue: #7b5cff;
  --blue-hover: #8f75ff;
  --bg: #0f0f11;
  --card: #18181c;
  --card-2: #202027;
  --ink: #f5f5f5;
  --muted: #9b9ba4;
  --border: #2b2b33;
  --hover: rgba(123, 92, 255, .10);
  --chip-green-bg: rgba(74, 252, 124, .16); --chip-green-ink: #6dffa0;
  --chip-yellow-bg: rgba(238, 255, 45, .14); --chip-yellow-ink: #e6f542;
  --chip-blue-bg: rgba(123, 92, 255, .18); --chip-blue-ink: #a893ff;
  --blob-opacity: .16;
  --shadow: 0 20px 50px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  line-height: 1.55; min-height: 100vh;
  transition: background .5s ease, color .3s ease;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: 21px; margin-bottom: 16px; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* decorative blob behind content - the one loud mercuryo.io note kept */
.bg-blob {
  position: fixed; z-index: -1; right: -180px; top: -140px;
  width: 560px; height: 560px; opacity: var(--blob-opacity);
  background: linear-gradient(160deg, var(--blue), #a18bff);
  border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
  animation: blob-morph 18s ease-in-out infinite alternate;
}
@keyframes blob-morph {
  to { border-radius: 45% 55% 44% 56% / 55% 44% 58% 42%; transform: rotate(14deg) scale(1.08); }
}

/* ---------- header ---------- */
#site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 28px;
  padding: 0 32px; height: 64px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
/* Real mercuryo brand assets (from the corporate site), used as CSS masks so
   they recolour with the theme: the four-point star + the wordmark. */
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-star {
  width: 22px; height: 23px; background: var(--orange);
  -webkit-mask: url(logo-star.svg) no-repeat center / contain;
  mask: url(logo-star.svg) no-repeat center / contain;
  transition: transform .25s var(--bounce);
}
.brand:hover .brand-star { transform: rotate(90deg) scale(1.1); }
.brand-word {
  width: 118px; height: 17px; background: var(--ink);
  -webkit-mask: url(logo-wordmark.svg) no-repeat center / contain;
  mask: url(logo-wordmark.svg) no-repeat center / contain;
}
.brand-suffix {
  font-family: var(--serif); font-size: 15px; color: var(--muted);
  border-left: 1px solid var(--border); padding-left: 9px; line-height: 1;
}

.tabs { display: flex; gap: 4px; margin-right: auto; }
.tab {
  border: 0; background: none; cursor: pointer; color: var(--muted);
  font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  padding: 8px 16px; border-radius: 12px;
  transition: color .2s, background .2s;
}
.tab:hover { color: var(--ink); background: var(--hover); }
.tab.active { color: var(--ink); background: var(--card-2); }

.header-right { display: flex; align-items: center; gap: 12px; }
.guide-link { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); transition: color .2s; }
.guide-link:hover { color: var(--blue); }
.icon-btn, .chip-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  border-radius: 12px; cursor: pointer; font-family: var(--sans); font-size: 14px;
  transition: transform .2s var(--bounce), border-color .2s, background .3s;
}
.icon-btn { width: 38px; height: 38px; }
.chip-btn { padding: 9px 14px; font-weight: 600; }
.icon-btn:hover, .chip-btn:hover { border-color: var(--blue); transform: translateY(-1px); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 8px;
  display: none; flex-direction: column;
}
.dropdown-menu.open { display: flex; }
.menu-email { font-size: 13px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-menu a, .dropdown-menu button {
  text-align: left; text-decoration: none; background: none; border: 0; cursor: pointer;
  color: var(--ink); font-family: var(--sans); font-size: 14.5px; font-weight: 500;
  padding: 9px 12px; border-radius: 10px; transition: background .15s;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--hover); }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 44px 32px 80px; }
.page-head { margin-bottom: 30px; }
.page-head h1 { margin-bottom: 8px; font-size: clamp(38px, 5vw, 64px); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  padding: 26px; margin-bottom: 20px;
  transition: background .5s ease, border-color .3s;
}
.card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.card-toolbar h2 { margin-bottom: 0; }
.toolbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.field-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.field span { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
input, select {
  font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 13px; outline: none; transition: border-color .2s, background .5s ease;
}
input:focus, select:focus { border-color: var(--blue); }
input[type="search"] { min-width: 210px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1.5px dashed var(--border); border-radius: 16px;
  padding: 26px; margin-bottom: 16px; color: var(--muted); font-size: 14.5px;
  transition: border-color .2s, background .2s; cursor: pointer;
}
.dropzone:hover { border-color: var(--blue); background: var(--hover); }
.dz-icon { font-size: 22px; color: var(--blue); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font-family: var(--sans); font-weight: 600; font-size: 14.5px;
  padding: 11px 22px; border-radius: 13px; color: var(--ink);
  background: var(--card-2); border: 1px solid var(--border);
  transition: transform .2s var(--bounce), background-color .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--blue); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-ghost { background: transparent; }
.btn-mini { padding: 6px 13px; font-size: 13px; border-radius: 10px; }
.btn-danger { background: transparent; color: var(--orange); border-color: var(--orange); }
.btn-danger:hover { background: rgba(255, 89, 44, .12); border-color: var(--orange); }
.btn-accent { color: var(--blue); border-color: var(--blue); background: transparent; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.seg-btn { border: 0; background: none; color: var(--muted); font-family: var(--sans); font-size: 13.5px; font-weight: 600; padding: 8px 14px; cursor: pointer; transition: background .2s, color .2s; }
.seg-btn.active { background: var(--card-2); color: var(--ink); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--hover); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.desc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-attn td { background: rgba(238, 255, 45, .05); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 9px; white-space: nowrap; }
.chip.green { background: var(--chip-green-bg); color: var(--chip-green-ink); }
.chip.yellow { background: var(--chip-yellow-bg); color: var(--chip-yellow-ink); }
.chip.blue { background: var(--chip-blue-bg); color: var(--chip-blue-ink); }

/* ---------- stats ---------- */
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--serif); font-size: 34px; line-height: 1.15; }
.stat-num.ok { color: var(--chip-green-ink); }
.stat-num.warn { color: var(--chip-yellow-ink); }
.stat-num.alert { color: var(--orange); }
.progress { height: 8px; border-radius: 5px; background: var(--card-2); overflow: hidden; margin-bottom: 10px; }
.progress span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width 1s ease; }
.card .btn-ghost { margin-top: 12px; }

/* ---------- reference list ---------- */
.ref-list { display: flex; flex-direction: column; }
.ref-row { display: flex; align-items: center; gap: 16px; padding: 15px 4px; border-bottom: 1px solid var(--border); }
.ref-row:last-child { border-bottom: 0; }
.ref-row > div:first-child { display: flex; flex-direction: column; flex: 1; }
.ref-row .chip { margin-left: auto; }

/* ---------- guide page ---------- */
.guide { display: grid; grid-template-columns: 210px 1fr; gap: 44px; align-items: start; }
.toc { position: sticky; top: 88px; }
.toc nav { display: flex; flex-direction: column; gap: 2px; }
.toc a {
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 7px 12px; border-radius: 10px; transition: color .15s, background .15s;
}
.toc a:hover { color: var(--ink); background: var(--hover); }
.guide-body h1 { margin-bottom: 8px; }
.guide-body section { margin-top: 40px; scroll-margin-top: 84px; }
.guide-body h2 { font-size: 24px; }
.guide-body p, .guide-body li { color: var(--ink); font-size: 15px; max-width: 68ch; }
.guide-body ul, .guide-body ol { padding-left: 22px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.guide-body table { margin: 14px 0; }
.guide-body em { font-style: normal; color: var(--blue); }
.callout {
  border-left: 3px solid var(--orange); background: var(--hover);
  border-radius: 0 14px 14px 0; padding: 12px 16px; margin-top: 12px;
}

/* ---------- footer: the mercuryo.io black block with a rounded corner ---------- */
footer { background: #000; color: #fff; margin-top: 40px; border-radius: 0 0 0 90px; overflow: hidden; }
.marquee { overflow: hidden; border-bottom: 1px solid #232323; }
.marquee-track {
  display: inline-flex; align-items: center; gap: 38px; white-space: nowrap;
  padding: 18px 0 18px 38px;
  font-family: var(--serif); font-size: 20px; color: #f5f5f5;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track i { font-style: normal; color: var(--orange); font-size: 15px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 44px 32px 34px; }
.foot-brandline { font-family: var(--serif); font-size: clamp(26px, 3.5vw, 40px); margin-bottom: 30px; }
.foot-cols { display: flex; gap: 80px; flex-wrap: wrap; margin-bottom: 36px; }
.foot-cols h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #8a8a8a; margin-bottom: 10px; }
.foot-cols a { display: block; color: #d9d9d9; text-decoration: none; margin-bottom: 8px; font-size: 14.5px; transition: color .2s; }
.foot-cols a:hover { color: #a893ff; }
.foot-note { color: #6f6f6f; font-size: 13px; }

/* ---------- auth (login/register) page ---------- */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px 90px; max-width: none; }
.auth-card { width: 400px; max-width: 100%; }
.auth-title { font-size: 34px; margin-bottom: 4px; }
.auth-card .muted.small { margin-bottom: 18px; }
.auth-card .field { margin-bottom: 14px; }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-switch { margin-top: 16px; margin-bottom: 0 !important; }
.auth-switch a { color: var(--blue); }
/* the marquee lives only here, pinned to the bottom of the login screen */
.auth-marquee { position: fixed; left: 0; right: 0; bottom: 0; background: #000; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .3s ease-out, transform .3s ease-out; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .bg-blob { animation: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  #site-header { flex-wrap: wrap; height: auto; padding: 10px 18px; row-gap: 8px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .header-right { margin-left: auto; }
  main { padding: 24px 18px 60px; }
  .grid-2 { grid-template-columns: 1fr; }
  .guide { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; }
  .toc nav { flex-direction: row; flex-wrap: wrap; }
  .card { padding: 20px; border-radius: 18px; }
  td.desc { max-width: 180px; }
  footer { padding: 18px; }
}
