/*
 * Public site chrome + base rules.
 * Fonts, colors, type scale, logo sizes: edit brand/theme.css only.
 */
@import url('brand/theme.css');

/* Public-site overrides: one ground (white), one accent (TrialX blue).
   Mono is reserved for small metadata; teal is retired to a neutral meta gray. */
:root {
  --instrument-teal: #6a7280;
  --chart-paper: #f5f5f7;
}

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

html { font-size: 16px; }
body {
  /* Atmosphere: soft TrialX-blue washes at the top edges, white ground below.
     Scrolls with content so reading surfaces stay plain white. */
  background-color: #fff;
  background-image:
    radial-gradient(1100px 540px at 88% -12%, rgba(0, 0, 254, 0.075), transparent 62%),
    radial-gradient(820px 440px at -8% 4%, rgba(0, 0, 254, 0.05), transparent 58%);
  background-repeat: no-repeat;
  color: var(--log-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
*:focus-visible {
  outline: 2px solid var(--annotation-red);
  outline-offset: 2px;
}

/* ── Nav (TrialX white bar) ── */
.nav {
  position: sticky; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #eee;
  display: flex; align-items: center;
  padding: 0; gap: var(--sp-6);
  max-width: none;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
/* Rides the shared page measure so the logo sits on the same left edge as
   page content and the hero headline. */
.nav-inner-cap {
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: var(--fw-header);
  font-size: var(--text-title-sm);
  letter-spacing: -0.01em; color: var(--log-ink);
  display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0;
  line-height: 1.2;
}
.nav-logo:hover { color: var(--annotation-red); }
.nav-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-title-sm);
  font-weight: var(--fw-header);
  color: var(--log-ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.nav-poweredby {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--fw-body);
  color: var(--ink-3);
  letter-spacing: 0.02em;
  line-height: 1;
  padding-left: var(--sp-2);
  border-left: 1px solid var(--rule-soft);
  white-space: nowrap;
}
.nav-logo:hover .nav-poweredby { color: var(--ink-3); }
.nav-logo:has(> img) { gap: var(--sp-2); align-items: center; }
.nav-logo .brand-logo {
  height: var(--brand-logo-height-nav);
}
.nav-links { display: flex; gap: var(--sp-1); flex: 1; list-style: none; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--text-nav); font-weight: var(--fw-body);
  line-height: var(--lh-nav);
  color: var(--ink-2);
  padding: 0 var(--sp-3);
  border-radius: var(--r-control);
  transition: color var(--t-fast) var(--ease);
}
.nav-link { border-bottom: 2px solid transparent; border-radius: 0; }
.nav-link:hover { color: var(--accent); }
.nav-link.active {
  color: #010101;
  font-weight: var(--fw-header);
  border-bottom-color: var(--accent);
}
.nav-right { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.nav-search {
  background: var(--chart-paper); border: 1px solid var(--rule-soft);
  border-radius: var(--r-control); padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-body-sm); color: var(--log-ink);
  font-family: var(--font-body); width: 200px; outline: none;
  transition: border-color var(--t-fast) var(--ease);
  min-height: 40px;
}
.nav-search::placeholder { color: var(--rule-gray); }
.nav-search:focus { border-color: var(--annotation-red); }

.btn-primary {
  background: var(--annotation-red); color: var(--text-on-accent);
  font-family: var(--font-body); font-weight: var(--fw-button);
  font-size: var(--text-nav); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-control); border: none; cursor: pointer;
  transition: background var(--t-fast) var(--ease);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  text-decoration: none; line-height: var(--lh-nav); min-height: 44px;
}
.btn-primary:hover { background: var(--accent-hover); color: var(--text-on-accent); }

.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 500;
  color: var(--instrument-teal); background: none;
  border: none; padding: 0;
  letter-spacing: 0.02em; white-space: nowrap;
}
.tag.success, .tag.warning, .tag.info, .tag.dim { color: var(--instrument-teal); }

.page { min-height: 100vh; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 var(--sp-6); }

.status-pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 500;
  padding: 0; border-radius: 0; white-space: nowrap;
  background: transparent;
}
.status-pill.active  { color: var(--accent); }
.status-pill.review  { color: var(--annotation-red); }
.status-pill.done    { color: var(--ink-3); }
.status-dot { width: 6px; height: 6px; border-radius: var(--r-circle); background: currentColor; }
.status-pill.active .status-dot {
  animation: pip-breathe 1.2s ease-in-out infinite alternate;
}
@keyframes pip-breathe { from { opacity: 1; } to { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .status-pill.active .status-dot { animation: none; }
}

.site-footer {
  background: #010101;
  color: rgba(255, 255, 255, 0.7);
  border-top: none;
  padding: var(--sp-10) 0;
}
.footer-inner { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.footer-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.66);
  margin: 0 0 var(--sp-6);
}
.footer-note .fn-tag {
  color: #fff;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: var(--sp-2);
}
.footer-grid { display: none; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: var(--text-caption); font-family: var(--font-body); letter-spacing: 0;
}
.footer-bottom a { color: #fff; }
.footer-bottom a:hover { color: var(--annotation-red); }
.footer-poweredby {
  font-size: 11px;
  color: color-mix(in srgb, var(--surface-1) 55%, transparent);
  letter-spacing: 0.02em;
}

.avatar {
  width: 24px; height: 24px; border-radius: var(--r-circle);
  background: var(--chart-paper); border: 1px solid var(--rule-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--instrument-teal); flex-shrink: 0;
}

/* Small screens: nav must never force horizontal overflow */
@media (max-width: 800px) {
  .nav { padding: 0; gap: var(--sp-3); }
  .nav-inner-cap { gap: var(--sp-3); }
  /* Attribution stays in the footer on small screens. */
  .nav-poweredby { display: none; }
  .nav-right { flex: 1 1 auto; min-width: 0; }
  .nav-search { width: 100%; min-width: 0; }
}
