/* ==========================================================================
   Antimagic Custom Styles
   Bootstrap 5.3 + custom design system. No Argon dependency.
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  --am-dark: #0F172A;
  --am-dark-lighter: #1E293B;
  --am-primary: #5e72e4;
  --am-cyan: #06B6D4;
  --am-emerald: #10B981;
  --am-surface: #F8FAFC;
  --am-border: #E2E8F0;
  --am-text-muted: #64748B;
  --am-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ---------- Base Typography (replaces Argon defaults) ---------- */
body {
  font-family: 'Open Sans', sans-serif;
  color: #344767;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
  color: #344767;
  font-weight: 600;
}
a { color: var(--am-primary); text-decoration: none; }
a:hover { color: #233dd2; }

/* ---------- Gradient Backgrounds (replaces Argon) ---------- */
.bg-gradient-primary { background: linear-gradient(310deg, #5e72e4 0%, #825ee4 100%) !important; }
.bg-gradient-dark { background: linear-gradient(310deg, #1a1d21 0%, #344767 100%) !important; }
.bg-gradient-success { background: linear-gradient(310deg, #2dce89 0%, #2dcecc 100%) !important; }
.bg-gradient-secondary { background: linear-gradient(310deg, #627594 0%, #8ca1cb 100%) !important; }
.bg-gradient-warning { background: linear-gradient(310deg, #fb6340 0%, #fbb140 100%) !important; }
.bg-gradient-info { background: linear-gradient(310deg, #11cdef 0%, #1171ef 100%) !important; }
.bg-gradient-danger { background: linear-gradient(310deg, #f5365c 0%, #f56036 100%) !important; }

/* ---------- Icon Shapes (replaces Argon) ---------- */
.icon-shape {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 50%;
}
.icon-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.icon-md { width: 48px; height: 48px; font-size: 1rem; }
.icon-lg { width: 64px; height: 64px; font-size: 1.25rem; }
.icon-xl { width: 80px; height: 80px; font-size: 1.5rem; }
.icon-xxl { width: 100px; height: 100px; font-size: 2rem; }

/* ---------- Utilities (replaces Argon) ---------- */
.text-white-50 { color: rgba(255, 255, 255, 0.5) !important; }
.bg-gray-100 { background-color: #f8f9fa !important; }

.btn-white {
  background-color: #fff;
  color: #344767;
  border-color: #fff;
}
.btn-white:hover {
  background-color: #e9ecef;
  color: #344767;
  border-color: #e9ecef;
}

/* ---------- Card Enhancements ---------- */
.card {
  border-radius: 0.75rem;
}
.shadow-sm {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.08) !important;
}
.shadow-lg {
  box-shadow: 0 8px 26px 0 rgba(0, 0, 0, 0.12) !important;
}

/* ---------- Button Refinements ---------- */
.btn {
  font-weight: 600;
  letter-spacing: -0.025rem;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
}
.btn-primary {
  background-color: #5e72e4;
  border-color: #5e72e4;
}
.btn-primary:hover {
  background-color: #324cdd;
  border-color: #324cdd;
  transform: translateY(-1px);
}
.btn-outline-light:hover {
  transform: translateY(-1px);
}
.btn-outline-primary {
  color: #5e72e4;
  border-color: #5e72e4;
}
.btn-outline-primary:hover {
  background-color: #5e72e4;
  border-color: #5e72e4;
}

/* ---------- Navbar fix ---------- */
.navbar .nav-link {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---------- Form Controls ---------- */
.form-control-lg {
  border-radius: 0.5rem;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
}

/* ---------- Badge refinement ---------- */
.badge {
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* ---------- Page Hero Sections (fixed navbar clearance) ---------- */
.py-7 {
  padding-top: 8rem !important;
  padding-bottom: 4rem !important;
}

/* ---------- Grain Texture Overlay ---------- */
.grain-overlay {
  position: relative;
}
.grain-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  z-index: 1;
}
.grain-overlay > * {
  position: relative;
  z-index: 2;
}

/* ---------- Work Page Hero ---------- */
.work-hero {
  background: var(--am-dark);
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
}
.work-hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}
.work-hero .lead {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.15rem;
  max-width: 540px;
}
.work-hero .metric-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.work-hero .metric-item {
  text-align: center;
}
.work-hero .metric-item .metric-number {
  font-family: var(--am-mono);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--am-cyan);
  line-height: 1;
  display: block;
}
.work-hero .metric-item .metric-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.35rem;
  display: block;
}

/* ---------- Terminal Mockup ---------- */
.terminal-mockup {
  background: var(--am-dark);
  border: 1px solid var(--am-dark-lighter);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}
.terminal-mockup .terminal-header {
  background: var(--am-dark-lighter);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.terminal-mockup .terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-mockup .terminal-dot.red { background: #f5365c; }
.terminal-mockup .terminal-dot.yellow { background: #fb6340; }
.terminal-mockup .terminal-dot.green { background: #2dce89; }
.terminal-mockup .terminal-title {
  font-family: var(--am-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.5rem;
}
.terminal-mockup .terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--am-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
}
.terminal-mockup .terminal-body .prompt {
  color: var(--am-cyan);
}
.terminal-mockup .terminal-body .comment {
  color: rgba(255, 255, 255, 0.35);
}
.terminal-mockup .terminal-body .success {
  color: var(--am-emerald);
}
.terminal-mockup .terminal-body .highlight {
  color: #fff;
  font-weight: 700;
}
.terminal-mockup .terminal-body .status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--am-emerald);
  font-weight: 700;
}

/* ---------- Work Cards (Metric-Forward) ---------- */
.work-card {
  border-radius: 0.75rem;
  border: 1px solid var(--am-border);
  border-left: 3px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  background: #fff;
}
.work-card:hover {
  border-left-color: var(--card-accent, var(--am-primary));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.work-card .work-card__metric-header {
  background: var(--am-dark);
  padding: 2rem 1.5rem;
  text-align: center;
}
.work-card .work-card__metric-number {
  font-family: var(--am-mono);
  font-weight: 700;
  font-size: 2.25rem;
  color: var(--am-cyan);
  line-height: 1;
}
.work-card .work-card__metric-sublabel {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.work-card .work-card__body {
  padding: 1.5rem;
}
.work-card .work-card__footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--am-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Status Badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--live {
  background: var(--am-emerald);
  animation: pulse 2s ease-in-out infinite;
}
.status-dot--ready {
  background: var(--am-cyan);
}
.status-dot--complete {
  background: #94A3B8;
}

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

/* ---------- Context Label ---------- */
.context-label {
  font-family: var(--am-mono);
  font-size: 0.65rem;
  color: var(--am-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Tech Badges (override) ---------- */
.tech-pill {
  font-family: var(--am-mono);
  font-size: 0.65rem;
  padding: 0.3em 0.7em;
  border-radius: 50px;
  font-weight: 600;
  background: var(--am-surface);
  color: var(--am-dark);
  border: 1px solid var(--am-border);
}

/* ---------- Proof Strip ---------- */
.proof-strip {
  background: var(--am-dark);
  padding: 3rem 0;
}
.proof-strip .proof-stat {
  text-align: center;
  padding: 0 1rem;
}
.proof-strip .proof-stat .stat-value {
  font-family: var(--am-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--am-cyan);
  display: block;
  line-height: 1.2;
}
.proof-strip .proof-stat .stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.35rem;
  display: block;
}

/* ---------- Process Timeline ---------- */
.process-timeline {
  display: flex;
  align-items: flex-start;
  position: relative;
  gap: 0;
}
.process-timeline::before {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(12.5% + 20px);
  right: calc(12.5% + 20px);
  height: 2px;
  background: var(--am-border);
  z-index: 0;
}
.process-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}
.process-step .step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  margin-bottom: 1rem;
}

/* ---------- Scroll Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .work-hero {
    padding: 7rem 0 3rem;
  }
  .work-hero h1 {
    font-size: 2.25rem;
  }
  .work-hero .metric-strip {
    gap: 1.5rem;
    margin-top: 2rem;
  }
}

@media (max-width: 767px) {
  .work-hero h1 {
    font-size: 2rem;
  }
  .work-hero .metric-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .work-card .work-card__metric-number {
    font-size: 1.75rem;
  }
  .process-timeline {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }
  .process-timeline::before {
    top: 0;
    bottom: 0;
    left: 20px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .process-step {
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
  }
  .process-step .step-dot {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .proof-strip .row {
    gap: 1.5rem;
  }
}

/* ---------- Hero Showcase (Landing Page) ---------- */
.hero-showcase {
  position: relative;
  height: 480px;
}

/* Browser Window */
.showcase-browser {
  position: relative;
  background: #0d1117;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4), 0 0 40px rgba(99,102,241,0.08);
  z-index: 2;
}
.showcase-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #161b22;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.showcase-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.showcase-url {
  margin-left: 10px;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  font-family: var(--am-mono, monospace);
  letter-spacing: 0.02em;
}
.showcase-browser__body {
  padding: 16px;
}
.showcase-browser__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.showcase-greeting {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e6edf3;
}
.showcase-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.showcase-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6rem;
  color: var(--am-emerald, #10b981);
  white-space: nowrap;
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 20px;
  padding: 3px 10px;
}
.showcase-status__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--am-emerald, #10b981);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Metrics Row */
.showcase-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.showcase-metric {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 8px 8px;
  position: relative;
  overflow: hidden;
}
.showcase-metric__val {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #e6edf3;
  font-family: var(--am-mono, monospace);
  line-height: 1.1;
}
.showcase-metric__lbl {
  display: block;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.35);
  margin-top: 3px;
}
.showcase-metric__bar {
  display: block;
  height: 2px;
  background: var(--accent, var(--am-primary));
  border-radius: 2px;
  margin-top: 6px;
  opacity: 0.6;
}

/* Agent Activity Row */
.showcase-agent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px;
}
.showcase-agent-icon {
  width: 28px; height: 28px;
  background: rgba(99,102,241,0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--am-primary);
  font-size: 0.7rem;
  flex-shrink: 0;
}
.showcase-agent-info {
  flex: 1;
  font-size: 0.7rem;
  color: #e6edf3;
}
.showcase-agent-info strong { font-weight: 600; }
.showcase-live-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--am-emerald, #10b981);
  margin: 0 3px;
  animation: pulse-dot 2s infinite;
}
.showcase-agent-msg {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  line-height: 1.4;
}
.showcase-agent-time {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Rotating Service Panels */
.showcase-panels {
  position: relative;
  min-height: 58px;
  margin-top: 10px;
  margin-bottom: 10px;
}
.showcase-panels__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.showcase-panels__row.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}
.showcase-panel {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 10px;
}
.showcase-panel__icon {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
}
.showcase-panel__info {
  flex: 1;
  min-width: 0;
}
.showcase-panel__info > strong {
  font-size: 0.65rem;
  color: #e6edf3;
  display: block;
  margin-bottom: 2px;
}
.showcase-panel__stats {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.showcase-panel__stats span {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.35);
  display: flex;
  justify-content: space-between;
}
.showcase-panel__stats strong {
  color: #e6edf3;
  font-weight: 600;
}

/* Activity Log */
.showcase-activity-log {
  margin-top: 10px;
  margin-bottom: 10px;
}
.showcase-activity-log__header {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.showcase-activity-log__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.showcase-activity-log__item:last-child {
  border-bottom: none;
}
.showcase-activity-log__msg {
  flex: 1;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.5);
}
.showcase-activity-log__time {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
}

/* Bottom Bar */
.showcase-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.showcase-compliance-tags {
  display: flex;
  gap: 6px;
}
.showcase-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
.showcase-tag__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
}
.showcase-activity {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.3);
}
.showcase-activity__dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--am-emerald, #10b981);
  margin-right: 3px;
}
.showcase-activity em {
  font-style: normal;
  color: rgba(255,255,255,0.2);
}

/* ---------- Mobile Showcase ---------- */
.showcase-metric-mobile {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.showcase-metric-mobile__val {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #e6edf3;
  font-family: var(--am-mono, monospace);
  line-height: 1.2;
}
.showcase-metric-mobile__lbl {
  display: block;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

/* ---------- Improved contrast for small white text on dark ---------- */
.proof-strip .stat-label,
.showcase-metric__lbl,
.showcase-panel__stats span,
.showcase-tag,
.showcase-activity-log__msg,
.showcase-activity-log__header,
.showcase-agent-msg,
.showcase-sub {
  color: rgba(255,255,255,0.6) !important;
}

/* ---------- Showcase min font floor ---------- */
.showcase-metric__lbl,
.showcase-panel__stats span,
.showcase-tag,
.showcase-activity-log__msg,
.showcase-activity-log__time,
.showcase-activity-log__header,
.showcase-agent-msg,
.showcase-agent-time {
  font-size: max(0.7rem, var(--_font-size, 0.7rem));
}

@media (max-width: 575px) {
  .work-hero {
    padding: 6rem 0 2rem;
  }
  .work-hero h1 {
    font-size: 1.75rem;
  }
  .terminal-mockup .terminal-body {
    font-size: 0.7rem;
    padding: 1rem;
    overflow-x: auto;
  }
}
