/* ==============================================================
   THE BAD.AI OFFICE // SHARED DESIGN SYSTEM & GLOBAL STYLES (v2 Paper & Storm)
   assets/site.css
   ============================================================== */

@import url('/assets/fonts/fonts.css');

:root {
  /* Paper & Storm tokens */
  --paper: #fafbfc;
  --surface: #eef2f7;
  --card: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #3b4452;
  --ink-3: #586272;
  --line: rgba(10, 10, 10, 0.10);
  --line-strong: rgba(10, 10, 10, 0.20);
  --grid: rgba(10, 10, 10, 0.04);
  --accent: #ff5a1f;
  --accent-hover: #f04a0e;
  --accent-soft: #fff1ea;
  --accent-ink: #b93a08;
  --ok: #047857;
  --ok-soft: #e6f6ef;
  --ok-dot: #10b981;
  --warn: #92400e;
  --warn-soft: #fdf3dc;
  --warn-dot: #d97706;
  --info: #1d4ed8;
  --info-soft: #e8effd;
  --info-dot: #3b82f6;
  --danger: #be123c;
  --danger-soft: #fdebf0;
  --danger-dot: #f43f5e;
  --violet: #6d28d9;
  --violet-soft: #f1eafd;
  --teal: #0f766e;
  --teal-soft: #e3f5f3;
  --pink: #be185d;
  --pink-soft: #fdeaf3;
  --cyan2: #0e7490;
  --cyan2-soft: #e0f4f8;

  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, Menlo, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 9999px;

  --shadow-1: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-2: 0 8px 24px -8px rgba(10, 10, 10, 0.12);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Legacy alias mappings */
  --bg-base: var(--paper);
  --bg-surface: var(--surface);
  --card-bg: var(--card);
  --card-bg-hover: var(--card);
  --card-border: var(--line);
  --card-border-focus: var(--line-strong);
  --card-border-hover: var(--line-strong);
  --divider-color: var(--line);
  --text-main: var(--ink);
  --text-muted: var(--ink-2);
  --text-dim: var(--ink-3);
  --accent-cyan: var(--accent-ink);
  --accent-orange: var(--accent);
  --accent-blue: var(--info);
  --accent-emerald: var(--ok);
  --accent-amber: var(--warn);
  --accent-gold: var(--warn);
  --accent-purple: var(--violet);
  --accent-rose: var(--danger);
  --cyan-glow: none;
  --orange-glow: none;
  --shadow-glow: none;
  --badge-bg: var(--surface);
  --badge-border: var(--line);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);
  --radius-pill: var(--r-pill);
  --shadow-card: var(--shadow-1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

img, video, canvas {
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 80% -10%, #dde7f1 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #e7eef5 0%, transparent 55%),
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 45%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 45%, transparent 100%);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.i {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.i-16 { width: 16px; height: 16px; }
.i-14 { width: 14px; height: 14px; }

.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  width: 100%;
  min-width: 0;
}
@media (min-width: 768px) {
  .app-container {
    padding: 28px 32px 90px;
  }
}

@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); }
  100% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

@keyframes viewFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
@media (min-width: 768px) {
  header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
    margin-bottom: 24px;
  }
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-pill {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-pill::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--paper);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
@media (min-width: 768px) {
  .brand-title {
    font-size: 18px;
  }
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-right-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.header-right-link:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Header Telemetry Chips */
.header-telemetry {
  display: flex;
  gap: 8px;
  align-items: center;
}
.telemetry-chip {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.telemetry-chip strong {
  color: var(--ink);
  font-weight: 700;
}
.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--ok-dot);
  box-shadow: 0 0 0 3px var(--ok-soft);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2.5s infinite;
}

/* Navigation */
.company-nav-tabs {
  display: none;
}
@media (min-width: 768px) {
  .company-nav-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    position: sticky;
    top: 12px;
    z-index: 100;
    margin-bottom: 8px;
  }
}
.nav-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s;
}
.nav-tab-link:hover {
  background: var(--surface);
  color: var(--ink);
}
.nav-tab-link.active {
  background: var(--ink);
  color: #fff;
}
.badge-pill-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.nav-tab-link.active .badge-pill-count {
  background: var(--accent);
  color: var(--ink);
}

.mobile-bottom-nav {
  display: none;
}
@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    z-index: 999;
  }
  .mobile-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    color: var(--ink-3);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
  }
  .mobile-nav-icon {
    width: 24px;
    height: 24px;
    display: block;
  }
  .mobile-nav-icon .i {
    width: 24px;
    height: 24px;
  }
  .mobile-nav-item:hover, .mobile-nav-item.active {
    color: var(--ink);
  }
  .mobile-nav-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 24px;
    height: 3px;
    margin-left: -12px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
  }
  .mobile-nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 22px);
    background: var(--accent);
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    text-align: center;
    padding: 0 5px;
    border-radius: 9px;
    display: none;
  }
  .mobile-nav-badge.visible {
    display: inline-block;
  }
}

/* Section Header */
section {
  padding: 56px 0;
}
@media (min-width: 768px) {
  section {
    padding: 80px 0;
  }
}
.section-header-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  min-width: 0;
  max-width: 100%;
}
.section-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  max-width: 100%;
  flex-wrap: wrap;
}
.badge-tag::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}
.section-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}
@media (min-width: 768px) {
  .section-title {
    font-size: 32px;
  }
}
.meta-desc {
  font-size: 15px;
  color: var(--ink-2);
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Hero */
.hero-section {
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 0 56px;
}
@media (min-width: 768px) {
  .hero-section {
    padding: 88px 0 80px;
  }
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  margin-bottom: 24px;
  max-width: 100%;
}
.hero-eyebrow .i {
  color: var(--accent);
}
.hero-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: 12px;
  overflow-wrap: break-word;
  word-break: break-word;
}
@media (min-width: 768px) {
  .hero-title {
    font-size: 68px;
  }
}
.hero-tagline {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  margin-bottom: 20px;
  overflow-wrap: break-word;
}
@media (min-width: 768px) {
  .hero-tagline {
    font-size: 24px;
  }
}
.hero-subline {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 720px;
  margin: 0 auto 32px;
  overflow-wrap: break-word;
}
@media (min-width: 768px) {
  .hero-subline {
    font-size: 19px;
  }
}
.hero-cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
@media (min-width: 480px) {
  .hero-cta-group {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
}
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  font: 700 14px var(--font-sans);
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--paper);
}

/* Pipeline Rail */
.pipeline-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 768px) {
  .pipeline-rail {
    flex-direction: row;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow-1);
  }
}
.pipeline-step {
  flex: 1;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: background 0.2s;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}
@media (min-width: 768px) {
  .pipeline-step {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 20px;
  }
  .pipeline-step + .pipeline-step {
    border-left: 1px solid var(--line);
  }
  .pipeline-step:hover {
    background: var(--paper);
  }
}
.step-index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-ink);
  margin-bottom: 6px;
}
.step-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.step-owner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.step-owner::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.step-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}
.pipeline-arrow {
  display: none;
}

/* Avatars */
.opc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--avatar-border, #3b82f6);
  flex-shrink: 0;
  overflow: hidden;
  margin: 4px;
}
@media (min-width: 768px) {
  .team-card .opc-avatar {
    width: 56px;
    height: 56px;
  }
}
.avatar-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.avatar-founder { --avatar-border: #10b981; }
.avatar-executive { --avatar-border: #d97706; }
.avatar-eng { --avatar-border: #3b82f6; }
.avatar-design { --avatar-border: #8b5cf6; }
.avatar-qa { --avatar-border: #f43f5e; }
.avatar-growth { --avatar-border: #14b8a6; }
.avatar-finance { --avatar-border: #0891b2; }
.avatar-customer { --avatar-border: #ec4899; }

/* Team Section */
.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.team-leader-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  grid-column: 1 / -1;
}
@media (min-width: 600px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-leader-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .team-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.team-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}
@media (min-width: 768px) {
  .team-card {
    padding: 24px;
  }
}
.team-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong);
}
.team-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
}
.team-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}
.team-card-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: break-word;
}
.team-card-role {
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: break-word;
  word-break: break-word;
}
.team-card-department {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  margin-bottom: 10px;
  max-width: 100%;
  overflow-wrap: break-word;
}
.dep-founder { background: var(--ok-soft); color: var(--ok); }
.dep-executive { background: var(--warn-soft); color: var(--warn); }
.dep-engineering { background: var(--info-soft); color: var(--info); }
.dep-design { background: var(--violet-soft); color: var(--violet); }
.dep-quality { background: var(--danger-soft); color: var(--danger); }
.dep-growth { background: var(--teal-soft); color: var(--teal); }
.dep-finance { background: var(--cyan2-soft); color: var(--cyan2); }
.dep-customer { background: var(--pink-soft); color: var(--pink); }
.team-card-one-liner {
  font-size: 14px;
  color: var(--ink-2);
  font-style: italic;
  line-height: 1.55;
}

/* Dundies */
.dundies-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 600px) {
  .dundies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .dundies-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.dundie-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}
.dundie-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong);
}
.dundie-trophy {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.dundie-trophy .i {
  width: 24px;
  height: 24px;
}
.dundie-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
}
.dundie-subhead {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  margin-bottom: 10px;
}
.dundie-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* Footer & CTA */
.footer-cta {
  text-align: center;
  padding: 72px 0 40px;
}
.footer-cta-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-ink);
  margin-bottom: 12px;
}
.footer-cta-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 14px;
}
@media (min-width: 768px) {
  .footer-cta-title {
    font-size: 44px;
  }
}
.footer-cta-subline {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 560px;
  margin: 0 auto 24px;
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  text-align: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
footer a {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
footer a:hover {
  color: var(--accent-ink);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
