/* TractionBoard — deep blue + tab navigation */
:root {
  --bg: #040d1f;
  --bg-deep: #020814;
  --bg-elevated: #071528;
  --surface: #0c2140;
  --border: #1a3d6e;
  --text: #eaf1fb;
  --muted: #7d9dc9;
  --accent: #6eb8ff;
  --accent-dim: #3d89d6;
  --accent-glow: rgba(110, 184, 255, 0.2);
  --btn-on-accent: #021018;
  --success: #4dd4a4;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --radius: 12px;
  --max: 68ch;
  --wide: 1100px;
  --tab-radius: 11px;
  /* Horizontal inset for all page columns (responsive + safe areas) */
  --page-gutter: clamp(1.35rem, 5.5vw + 0.75rem, 3.25rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 70% at 50% -25%, rgba(30, 90, 160, 0.35), transparent 52%),
    radial-gradient(ellipse 55% 45% at 100% 5%, rgba(110, 184, 255, 0.12), transparent 42%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 38%, #050f22 100%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tb-wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
}

/* ----- Header: corner “folder” tabs ----- */
.tb-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.35rem 0 0;
  background: linear-gradient(
    180deg,
    rgba(2, 8, 20, 0.94) 0%,
    rgba(4, 13, 31, 0.9) 100%
  );
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.tb-header-bar {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.15rem;
}

.tb-logo-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.62rem 1.15rem 0.72rem;
  margin-left: 0;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--tab-radius) var(--tab-radius) 0 0;
  box-shadow: 0 -6px 28px rgba(0, 20, 50, 0.45);
  text-decoration: none;
  flex-shrink: 0;
}

.tb-logo-tab:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.tb-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.03em;
}

.tb-logo-text span {
  color: var(--accent);
}

.tb-header-right {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

/* DOM has .tb-lang before .tb-nav-tabs; visual order: tabs left, language right */
.tb-header-right > .tb-nav-tabs {
  order: 1;
}

.tb-header-right > .tb-lang {
  order: 2;
}

.tb-lang {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  align-self: flex-end;
  margin-bottom: 0.38rem;
  margin-left: 0.45rem;
}

.tb-lang-btn {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.tb-lang-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

.tb-lang-btn--active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent-dim);
}

.tb-lang-sep {
  color: var(--border);
  font-size: 0.65rem;
  padding: 0 2px;
  user-select: none;
}

/* Right cluster: tabs */
.tb-nav-tabs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  margin-right: 0;
}

.tb-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.95rem 0.62rem;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--tab-radius) var(--tab-radius) 0 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

.tb-tab:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.tb-tab--ghost {
  background: rgba(15, 36, 64, 0.6);
}

.tb-tab--cta {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: var(--btn-on-accent) !important;
  border-color: rgba(110, 184, 255, 0.45);
  font-weight: 700;
  box-shadow:
    0 -4px 20px rgba(110, 184, 255, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.tb-tab--cta:hover {
  filter: brightness(1.07);
  color: var(--btn-on-accent) !important;
  text-decoration: none;
}

.tb-tab-label {
  white-space: nowrap;
}

/* Fixed vertical tab — right edge */
.tb-edge-tab {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 50;
  transform: translateY(-50%);
  padding: 1.1rem 0.42rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--btn-on-accent);
  background: linear-gradient(180deg, #8cc8ff 0%, var(--accent-dim) 100%);
  border: 1px solid rgba(140, 200, 255, 0.5);
  border-right: none;
  border-radius: 10px 0 0 10px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  box-shadow: -6px 6px 32px rgba(0, 0, 0, 0.45);
  transition: filter 0.15s, padding 0.15s;
}

.tb-edge-tab:hover {
  filter: brightness(1.08);
  padding-right: 0.55rem;
  text-decoration: none;
}

@media (max-width: 600px) {
  .tb-edge-tab {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    padding: 0.85rem 0.35rem;
  }

  .tb-tab {
    font-size: 0.68rem;
    padding-inline: 0.65rem;
  }
}

/* Legacy nav (fallback) */
.tb-nav a {
  color: var(--muted);
  font-size: 0.9rem;
}

.tb-nav a:hover {
  color: var(--text);
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
}

.tb-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.tb-btn-primary {
  background: linear-gradient(160deg, var(--accent), var(--accent-dim));
  color: var(--btn-on-accent);
}

.tb-btn-primary:hover {
  filter: brightness(1.06);
  color: var(--btn-on-accent);
}

.tb-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.tb-btn-secondary:hover {
  border-color: var(--muted);
  color: var(--text);
}

.tb-hero {
  /* only vertical — horizontal padding comes from .tb-wrap */
  padding-top: 4rem;
  padding-bottom: 4.5rem;
  text-align: center;
}

/* Hero: horizontal auto-scroll — 6 equal tiles wide, 12 unique photos (duplicated set for loop) */
.tb-hero-carousel {
  --tb-car-gap: 0.45rem;
  --tb-car-w: min(52ch, 95vw);
  width: 100%;
  max-width: var(--tb-car-w);
  margin: 0 auto 1.5rem;
}

.tb-hero-carousel-viewport {
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 6%,
    #000 94%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 6%,
    #000 94%,
    transparent
  );
}

.tb-hero-carousel-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: max-content;
  gap: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .tb-hero-carousel-track {
    animation: tb-hero-carousel-scroll 56s linear infinite;
  }

  .tb-hero-carousel-viewport:hover .tb-hero-carousel-track {
    animation-play-state: paused;
  }

  @keyframes tb-hero-carousel-scroll {
    to {
      transform: translateX(-50%);
    }
  }
}

.tb-hero-carousel-set {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--tb-car-gap);
  flex: 0 0 auto;
  box-sizing: border-box;
  width: max-content;
}

/* Six equal-width tiles (viewport shows ~6 faces at once; 12 scroll through) */
.tb-hero-carousel .tb-hero-photo-img {
  display: block;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: calc((var(--tb-car-w) - 5 * var(--tb-car-gap)) / 6);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(0, 12, 40, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .tb-hero-carousel-viewport {
    overflow: visible;
    mask-image: none;
  }

  .tb-hero-carousel-track {
    transform: none;
    justify-content: center;
    flex-wrap: wrap;
    width: auto;
    max-width: var(--tb-car-w);
    margin: 0 auto;
    gap: var(--tb-car-gap);
  }

  .tb-hero-carousel-set:nth-child(2) {
    display: none;
  }

  .tb-hero-carousel-set:first-child {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--tb-car-gap);
    width: var(--tb-car-w);
    max-width: 100%;
  }

  .tb-hero-carousel-set {
    flex-wrap: wrap;
    justify-content: center;
  }

  .tb-hero-carousel .tb-hero-photo-img {
    width: 100%;
    max-width: none;
  }
}

.tb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tb-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 5vw, 3.35rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  max-width: min(52ch, 95vw);
  margin-left: auto;
  margin-right: auto;
}

.tb-hero-rotate-title {
  position: relative;
}

.tb-hero-rotate-visual {
  position: relative;
  display: block;
  min-height: clamp(3.4rem, 14vw, 6.5rem);
}

.tb-hero-rotate-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .tb-hero-rotate-line--1 {
    animation: tb-hero-cut-1 12s linear infinite;
  }
  .tb-hero-rotate-line--2 {
    animation: tb-hero-cut-2 12s linear infinite;
  }
  .tb-hero-rotate-line--3 {
    animation: tb-hero-cut-3 12s linear infinite;
  }

  /* Hard “cuts” — plateaus + tiny jumps (no cross-fade) */
  @keyframes tb-hero-cut-1 {
    0%,
    33.31% {
      opacity: 1;
    }
    33.32%,
    100% {
      opacity: 0;
    }
  }

  @keyframes tb-hero-cut-2 {
    0%,
    33.31% {
      opacity: 0;
    }
    33.32%,
    66.64% {
      opacity: 1;
    }
    66.65%,
    100% {
      opacity: 0;
    }
  }

  @keyframes tb-hero-cut-3 {
    0%,
    66.64% {
      opacity: 0;
    }
    66.65%,
    99.98% {
      opacity: 1;
    }
    99.99%,
    100% {
      opacity: 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .tb-hero-rotate-visual {
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-align: center;
  }

  .tb-hero-rotate-line {
    position: static;
    opacity: 1;
  }
}

@media print {
  .tb-hero-rotate-visual {
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .tb-hero-rotate-line {
    position: static;
    opacity: 1;
  }
}

.tb-hero .tb-sub {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 42ch;
  margin: 0 auto 1.35rem;
  line-height: 1.55;
}

.tb-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.tb-tagline-bar {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2rem;
}

.tb-card-icon {
  width: 2.35rem;
  height: 2.35rem;
  margin-bottom: 0.7rem;
  color: var(--accent);
  opacity: 0.9;
}

.tb-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tb-section {
  /* only vertical — horizontal padding comes from .tb-wrap */
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  border-top: 1px solid var(--border);
}

.tb-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.tb-section-intro {
  color: var(--muted);
  max-width: var(--max);
  margin-bottom: 1.5rem;
}

.tb-problem-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.25rem;
}

.tb-problem-list li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  color: var(--text);
}

.tb-problem-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.tb-grid-2 {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .tb-grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.tb-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.tb-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .tb-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tb-steps li {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  position: relative;
  padding-left: 3.25rem;
}

.tb-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.15rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tb-steps strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.tb-outcomes {
  display: grid;
  gap: 0.65rem;
  max-width: var(--max);
}

.tb-outcomes div {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.tb-outcomes span:first-child {
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.tb-diff-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.tb-diff-list li {
  color: var(--muted);
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.tb-diff-list li::before {
  content: "×";
  position: absolute;
  left: 0;
  color: #f09898;
  font-weight: 700;
}

.tb-offer-box {
  background: linear-gradient(145deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  max-width: 560px;
}

.tb-offer-box ul {
  margin: 0.75rem 0 1.25rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.tb-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.tb-pill-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text);
}

.tb-proof {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.tb-form {
  max-width: 520px;
  margin: 2rem auto 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.tb-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.tb-form input,
.tb-form select,
.tb-form textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.tb-form textarea {
  min-height: 88px;
  resize: vertical;
}

.tb-form-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.tb-footer {
  padding: 2.5rem max(var(--page-gutter), env(safe-area-inset-left, 0px))
    2.5rem max(var(--page-gutter), env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.tb-footer a {
  color: var(--muted);
}

/* Article layout */
.tb-article {
  padding: 2.5rem 0 4rem;
  max-width: 42rem;
  margin: 0 auto;
}

.tb-article-header {
  margin-bottom: 2rem;
}

.tb-article-kicker {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.tb-article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.tb-hook {
  font-size: 1.2rem;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
}

.tb-article h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.tb-article p,
.tb-article ul {
  color: var(--muted);
}

.tb-article ul {
  padding-left: 1.2rem;
}

.tb-insight {
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text);
}

.tb-gift-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.tb-gift-box h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.tb-article-cta {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.tb-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Gift printable pages */
.tb-gift-page {
  max-width: 48rem;
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 3rem;
  padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
}

.tb-gift-page h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.tb-gift-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.tb-gift-section {
  margin-bottom: 2rem;
  page-break-inside: avoid;
}

.tb-gift-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.tb-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tb-checklist li {
  padding: 0.45rem 0;
  padding-left: 1.6rem;
  position: relative;
  color: var(--text);
}

.tb-checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.tb-callout {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.tb-bottleneck {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media print {
  .tb-header,
  .tb-footer,
  .tb-back,
  .tb-print-hide,
  .tb-edge-tab {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
  }
  .tb-gift-page {
    max-width: 100%;
    padding: 0;
  }
}
