/* Shared shell: nav + ticker — mirrors web/src app.css + TickerStrip.svelte
   so marketing and leaderboard.deployforward.dev stay visually consistent. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --gray-50: #f5f5f4;
  --gray-100: #edeeec;
  --ink: #0a0c12;
  --gray-700: #2b3242;
  --gray-600: #49505f;
  --gray-500: #727a89;
  --gray-400: #9aa1ad;
  --gray-300: #ccd0d8;
  --gray-200: #e6e8ec;
  --accent: #1d4ed8;
  --accent-2: #2563eb;
  --accent-soft: rgba(29, 78, 216, 0.07);
  --teal: #0d9488;
  --line: rgba(10, 12, 18, 0.1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Work Sans", system-ui, sans-serif;
}

/* Canonical lede — home, solutions, and board (.lede / .df-lede) 1:1 */
.df-lede {
  font-family: "Work Sans", var(--sans), system-ui, sans-serif;
  font-size: clamp(0.98rem, 1.4vw, 1.18rem);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: normal;
  color: var(--gray-600);
  max-width: 640px;
  margin: 0;
}

/* --- nav (web .df-nav) ---
   Brand left / actions right / primary links ABSOLUTE center of the bar
   (grid 1fr|auto|1fr still drifts when side widths differ). */
.df-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 clamp(1.25rem, 4vw, 3.5rem);
  background: rgba(251, 251, 250, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  border-bottom: 1px solid var(--gray-200);
}

.df-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.df-brand:hover { text-decoration: none; color: var(--ink); }

/* Logo lockup — mirrors web/src/lib/Logo.svelte */
.df-brand .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: inherit;
  line-height: 1;
}
.df-brand .mark {
  width: var(--mark-size, 22px);
  height: var(--mark-size, 22px);
  flex: none;
  display: block;
}
.df-brand .lockup {
  display: inline-flex;
  flex-direction: column;
  gap: 0.18em;
}
.df-brand .wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: inherit;
  white-space: nowrap;
}

/* legacy class kept for any residual markup */
.df-logo {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: none;
}
.df-logo svg { width: 100%; height: 100%; display: block; }

.df-brand {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  min-width: 0;
}

/* Period-tab style box — true horizontal center of the nav bar */
.df-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: inline-flex;
  align-items: stretch;
  width: max-content;
  max-width: min(100% - 2rem, 100%);
  border: 1px solid var(--ink);
  background: var(--surface);
  gap: 0;
}

/* Right actions: same seg box as .df-center — Sign in | Deploy With Us */
.df-right {
  position: relative;
  z-index: 1;
  margin-left: auto;
  display: inline-flex;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.df-center .nav-account { display: none; }

.df-center a {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gray-500);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.1;
  padding: 0.48rem 0.85rem;
  border-right: 1px solid var(--line);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.df-center a:last-child,
.df-center a.nav-account { border-right: 0; }
/* Organization is last visible on desktop (nav-account hidden) */
.df-center a:nth-last-child(2) { border-right: 0; }

.df-center a:hover {
  background: var(--gray-50);
  color: var(--ink);
  text-decoration: none;
}
.df-center a.active,
.df-center a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

/* Sign in (and any non-CTA right link) — open cell, lights on hover */
.df-right > a:not(.btn-nav) {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gray-500);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.1;
  padding: 0.48rem 0.85rem;
  border-right: 1px solid var(--line);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.df-right > a:not(.btn-nav):hover {
  background: var(--gray-50);
  color: var(--ink);
  text-decoration: none;
}

/* Deploy With Us — filled cell inside the same box */
.btn-nav {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.48rem 0.95rem;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.1;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.btn-nav:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* --- ticker (web TickerStrip.svelte) --- */
.ticker {
  position: relative;
  z-index: 900; /* under sticky nav (1000), above page content / mosaic bleed */
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: df-ticker 55s linear infinite;
}
.ticker:hover .ticker-track {
  animation-play-state: paused;
}
.ticker-set {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.ti {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 0.5rem 1.15rem;
  white-space: nowrap;
}
.tn {
  color: var(--accent);
  font-weight: 700;
}
.tlink {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  transition: color 0.14s var(--ease);
}
.tlink:hover { color: var(--accent); }
.td {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--accent);
}
@keyframes df-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-33.333%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* mobile — brand + CTA row, boxed links full-width second row */
@media (max-width: 880px) {
  .df-nav {
    flex-wrap: wrap;
    height: auto;
    row-gap: 0.55rem;
    padding: 0.6rem clamp(1rem, 4vw, 1.5rem);
  }
  .df-brand { order: 1; }
  .df-right { order: 2; flex-wrap: wrap; justify-content: flex-end; margin-left: 0; }
  .df-right a:not(.btn-nav) { display: none; }
  .df-center {
    order: 3;
    position: relative;
    left: auto;
    transform: none;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .df-center a { flex: 1 0 auto; text-align: center; }
  .df-center a:nth-last-child(2) { border-right: 1px solid var(--line); }
  .df-center .nav-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-right: 0;
    color: var(--ink);
  }
}
@media (max-width: 480px) {
  .df-nav { padding: 0.55rem 1rem; }
  .df-brand { font-size: 0.82rem; }
  .df-brand .mark { width: 20px; height: 20px; }
  .df-brand .wordmark { font-size: 0.82rem; }
  .df-logo { width: 20px; height: 20px; }
  .btn-nav { padding: 0.45rem 0.75rem; font-size: 0.64rem; }
  .df-center a { font-size: 0.56rem; padding: 0.44rem 0.55rem; }
}
