/*
 * 12twenty.usetrackly.app
 *
 * Mirrors the TracklyWeb (src/styles/globals.css) brand system so the
 * sibling subdomain feels like the same product surface, not a third
 * party page. Tokens, typography utilities, navbar shape, footer-v3
 * structure, and the animated hero mesh gradient are all ported one
 * to one. The mesh gradient on TracklyWeb's /changelog uses a WebGL
 * shader (@paper-design/shaders-react); we reproduce the look in
 * pure CSS so the static page stays dependency free.
 */

* { box-sizing: border-box; }

:root {
  color-scheme: dark;

  /* Typography (matches TracklyWeb's --font-body / --font-display) */
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                  system-ui, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                  system-ui, sans-serif;

  /* Surface tokens (verbatim from TracklyWeb globals.css :root) */
  --background:          #1A1B1E;
  --background-secondary:#202124;
  --background-card:     #27292D;
  --background-elevated: #2F3136;

  --text-primary:   rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary:  rgba(255, 255, 255, 0.55);

  --accent:           #a855f7;
  --accent-secondary: #7c3aed;
  --accent-hover:     #9333ea;

  --success: #34D399;
  --error:   #D3001F;
  --warning: #FFDD00;

  --border: rgba(255, 255, 255, 0.10);

  --radius: 14px;
  --radius-sm: 10px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html { scroll-behavior: smooth; }

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

code {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  padding: 1px 6px;
  border-radius: 4px;
}

strong { color: var(--text-primary); font-weight: 600; }

/* ── TracklyWeb typography utilities (verbatim port) ──────────── */
.t-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 2rem + 2.4vw, 4rem);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.t-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 1.6rem + 1.35vw, 2.45rem);
  line-height: 1.16;
  font-weight: 620;
  letter-spacing: -0.022em;
  color: var(--text-primary);
}
.t-h3 {
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1rem + 0.65vw, 1.4rem);
  line-height: 1.26;
  font-weight: 620;
  letter-spacing: -0.016em;
}
.t-lead {
  font-size: clamp(1.02rem, 0.94rem + 0.6vw, 1.2rem);
  line-height: 1.57;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
}
.t-body {
  font-size: clamp(0.97rem, 0.95rem + 0.12vw, 1.03rem);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-secondary);
}
.t-meta {
  font-size: clamp(0.78rem, 0.75rem + 0.1vw, 0.85rem);
  line-height: 1.42;
  font-weight: 560;
  letter-spacing: 0.01em;
  color: var(--text-tertiary);
}
.t-ui {
  font-size: clamp(0.93rem, 0.9rem + 0.09vw, 1rem);
  line-height: 1.45;
  font-weight: 560;
  letter-spacing: -0.003em;
}
.t-label {
  font-size: clamp(0.7rem, 0.67rem + 0.08vw, 0.79rem);
  line-height: 1.3;
  font-weight: 620;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Navbar (mirrors TracklyWeb landing/navbar.tsx) ───────────── */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease,
              box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.navbar.is-scrolled {
  background: rgba(0, 0, 0, 0.88);
  border-bottom-color: var(--border);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}
.navbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.28);
}
.navbar-wordmark {
  color: #fff;
  letter-spacing: -0.01em;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.navbar-nav a {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.navbar-nav a:hover { color: #fff; }
.navbar-cta {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.35);
  transition: filter 0.2s ease, transform 0.2s ease;
}
.navbar-cta:hover {
  filter: brightness(1.10);
  color: #fff;
  transform: translateY(-1px);
}
@media (max-width: 860px) {
  .navbar-inner { padding: 0 20px; gap: 12px; }
  .navbar-nav { display: none; }
}

/* ── Hero with animated mesh gradient (matches /changelog vibe) ── */
.hero {
  position: relative;
  padding: 160px 24px 80px;
  overflow: hidden;
  background: var(--background);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 55% at 20% 25%, #5b00ff 0%, transparent 55%),
    radial-gradient(ellipse 55% 50% at 80% 15%, #ea00ff 0%, transparent 55%),
    radial-gradient(ellipse 65% 60% at 50% 90%, #00ffa3 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 90% 75%, #ff9a00 0%, transparent 55%),
    var(--background);
  background-size: 200% 200%, 220% 220%, 240% 240%, 200% 200%, auto;
  background-position: 0% 0%, 100% 0%, 50% 100%, 100% 70%, center;
  filter: saturate(1.05) brightness(0.85);
  animation: hero-mesh 28s ease-in-out infinite alternate;
  opacity: 0.62;
}
.hero-bg::before {
  /* Dithering / grain overlay, matches the @paper-design Dithering shader. */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 280px 280px;
  mix-blend-mode: overlay;
  opacity: 0.65;
}
.hero-bg::after {
  /* Fade-to-background at the bottom, matches .changelog-shader-fade. */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.30) 45%,
    rgba(0, 0, 0, 0.70) 70%,
    var(--background) 92%,
    var(--background) 100%
  );
}
@keyframes hero-mesh {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 100% 70%, center; }
  50%  { background-position: 20% 30%, 75% 25%, 60% 85%, 80% 55%, center; }
  100% { background-position: 0% 10%, 90% 5%, 40% 90%, 100% 60%, center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg { animation: none; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 960px) {
  .hero { padding: 130px 18px 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-title {
  margin: 0 0 22px;
  color: #fff;
}
.hero-title .accent {
  background: linear-gradient(90deg, var(--accent), #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 0 36px;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-meta {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-meta-item .t-h2 {
  background: linear-gradient(90deg, var(--accent), #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.hero-screenshot img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 8px 16px rgba(0, 0, 0, 0.3);
}

/* ── Content / steps ───────────────────────────────────────────── */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 24px;
}
@media (max-width: 720px) {
  .content { padding: 64px 18px; }
}

.step {
  margin-bottom: 112px;
  scroll-margin-top: 100px;
}
.step:last-of-type { margin-bottom: 64px; }

@media (max-width: 720px) {
  .step { margin-bottom: 72px; }
}

.step-head {
  margin-bottom: 36px;
  max-width: 720px;
}
.step-num {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 999px;
  margin-bottom: 14px;
}
.step h2 { margin: 0 0 16px; }
.step-tagline { margin: 0; }

.step-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 960px) {
  .step-body { grid-template-columns: 1fr; gap: 36px; }
}

.step-explain h3 {
  margin: 32px 0 12px;
  color: var(--text-tertiary);
}
.step-explain h3:first-child { margin-top: 0; }
.step-explain p { margin: 0 0 16px; }

.bulleted, .numbered {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.bulleted li, .numbered li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
}
.bulleted li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.numbered { counter-reset: step-counter; }
.numbered li { counter-increment: step-counter; }
.numbered li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.30);
}

.badge-ok, .badge-warn, .badge-gaps,
.match-exact, .match-strong, .match-weak {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.badge-ok    { background: rgba(52, 211, 153, 0.14); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.25); }
.badge-warn  { background: rgba(211, 0, 31, 0.14); color: #ff7b7b; border: 1px solid rgba(211, 0, 31, 0.25); }
.badge-gaps  { background: rgba(255, 221, 0, 0.12); color: var(--warning); border: 1px solid rgba(255, 221, 0, 0.25); }
.match-exact { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.match-strong{ background: rgba(168, 85, 247, 0.10); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.20); }
.match-weak  { background: rgba(255, 255, 255, 0.05); color: var(--text-tertiary); border: 1px solid var(--border); }

.callout {
  margin: 22px 0 0;
  padding: 18px 20px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.callout-title {
  margin-bottom: 6px;
  color: #c084fc;
}
.callout p { margin: 0; }

.step-figure { margin: 0; }
.step-figure img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--background-card);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 50px rgba(0, 0, 0, 0.4),
    0 6px 14px rgba(0, 0, 0, 0.22);
}
.step-figure figcaption {
  margin-top: 14px;
  text-align: center;
}

/* ── FAQ ────────────────────────────────────────────────────────── */
.faq {
  max-width: 800px;
  margin: 112px auto 0;
  padding-top: 72px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 100px;
}
.faq-head {
  text-align: center;
  margin-bottom: 36px;
}
.faq-head .t-label {
  display: inline-block;
  margin-bottom: 14px;
  color: #c084fc;
}
.faq-head h2 { margin: 0; }

.faq details {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.faq details:hover { border-color: rgba(168, 85, 247, 0.30); }
.faq details[open] {
  background: var(--background-elevated);
  border-color: rgba(168, 85, 247, 0.35);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  color: var(--text-primary);
  position: relative;
  padding-right: 52px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin: 0;
  padding: 0 24px 22px;
}

/* ── CTA ────────────────────────────────────────────────────────── */
.cta {
  margin-top: 112px;
  padding: 72px 32px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(168, 85, 247, 0.20), transparent 60%),
    var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.cta-inner { max-width: 520px; margin: 0 auto; }
.cta-logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  margin: 0 auto 22px;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.35);
}
.cta h2 { margin: 0 0 12px; }
.cta p { margin: 0; }

/* ── Footer V3 (verbatim port from TracklyWeb) ─────────────────── */
.footer-v3 {
  width: 100%;
  background-color: #050505;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 64px;
}
.footer-v3-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-v3-left {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.footer-v3-wordmark {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.footer-v3-copy {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
}
.footer-v3-links {
  display: flex;
  gap: 24px;
}
.footer-v3-link {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-v3-link:hover { color: rgba(255, 255, 255, 0.7); }
@media (max-width: 640px) {
  .footer-v3-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .footer-v3-left { flex-direction: column; gap: 6px; align-items: center; }
  .footer-v3-links { flex-wrap: wrap; justify-content: center; }
}

/* ── Lightbox (matches the /changelog overlay style) ──────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  background: rgba(5, 5, 6, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-figure {
  position: relative;
  margin: 0;
  max-width: 1280px;
  max-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(0.98) translateY(8px);
  transition: transform 0.25s ease;
}
.lightbox.is-open .lightbox-figure {
  transform: scale(1) translateY(0);
}
.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 12px 24px rgba(0, 0, 0, 0.32);
  background: var(--background-card);
}
.lightbox-caption {
  display: block;
  max-width: 720px;
  text-align: center;
  color: var(--text-tertiary);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
@media (max-width: 720px) {
  .lightbox { padding: 24px 16px; }
  .lightbox-close { top: 16px; right: 16px; width: 40px; height: 40px; }
}

body.lightbox-active {
  overflow: hidden;
}

/* Zoomable images get a subtle hover lift so they read as interactive. */
img[data-zoom] {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
img[data-zoom]:hover {
  transform: translateY(-2px);
}

/* ── Focus rings + accessibility ───────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
