/* === CDL TOOLKIT — Global Styles === */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@300;400;500&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --amber: #F59E0B;
  --amber-dim: #F59E0B88;
  --amber-ghost: #F59E0B15;
  --amber-border: #F59E0B33;
  --bg-black: #0a0a0a;
  --bg-panel: #111111;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --border: #1f1f1f;
  --border-light: #2a2a2a;
  --text-primary: #eeeeee;
  --text-secondary: #bbbbbb;
  --text-muted: #888888;
  --text-dim: #555555;
  --text-ghost: #333333;
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'IBM Plex Sans', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

::selection { background: var(--amber); color: #000; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-black); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--amber); }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-black);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(245,158,11,0.15);
  padding-env: safe-area-inset-top safe-area-inset-right safe-area-inset-bottom safe-area-inset-left;
}

a { color: var(--amber); text-decoration: none; transition: opacity 0.3s; }
a:hover { opacity: 0.8; }

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

/* === GRAIN OVERLAY === */
.grain-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 9999; opacity: 0.3;
  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)' opacity='0.15'/%3E%3C/svg%3E");
}

/* === NAVIGATION === */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  padding: 0 40px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: all 0.4s ease;
}
.site-nav.scrolled {
  background: rgba(10,10,10,0.93);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 4px;
  color: var(--amber);
  display: flex; align-items: center; gap: 10px;
}
.nav-logo .arrow { font-size: 10px; color: var(--text-dim); }
.nav-links { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.nav-link {
  color: var(--text-muted); font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  padding: 8px 0; transition: color 0.3s; text-decoration: none;
}
.nav-link:hover, .nav-link.active { color: var(--amber); opacity: 1; }

/* Mobile nav */
.mobile-menu-btn {
  display: none; background: none; border: none;
  color: var(--amber); font-size: 24px; cursor: pointer;
}
@media (max-width: 768px) {
  .site-nav { padding: 0 20px; }
  .mobile-menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(10,10,10,0.97); backdrop-filter: blur(12px);
    flex-direction: column; padding: 20px; gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
}

/* === LAYOUT === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.container-xs { max-width: 600px; margin: 0 auto; padding: 0 24px; }

.section { padding: 80px 24px; }
.section-dark { background: var(--bg-panel); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* === TYPOGRAPHY === */
.overline {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--amber); letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 16px;
}
.heading-xl {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: 4px; color: var(--text-primary);
  line-height: 1.1;
}
.heading-lg {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 3px; color: var(--text-primary);
  line-height: 1.15;
}
.heading-md {
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: 2px;
  color: var(--text-primary);
}
.body-text {
  font-family: var(--font-body); font-size: 16px;
  color: var(--text-secondary); line-height: 1.7; font-weight: 300;
}
.caption {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-dim); letter-spacing: 1px;
}
.amber { color: var(--amber); }
.bold { font-weight: 500; }

/* === BUTTONS === */
.btn-primary {
  display: inline-block;
  background: var(--amber); color: #000; border: none;
  padding: 14px 32px;
  font-family: var(--font-display); font-size: 18px;
  letter-spacing: 3px; cursor: pointer;
  transition: all 0.3s ease; border-radius: 2px;
  text-decoration: none; text-align: center;
}
.btn-primary:hover {
  background: #fff; color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245,158,11,0.25);
  opacity: 1;
}
.btn-ghost {
  display: inline-block;
  background: transparent; color: var(--amber);
  border: 1px solid var(--amber);
  padding: 14px 32px;
  font-family: var(--font-display); font-size: 18px;
  letter-spacing: 3px; cursor: pointer;
  transition: all 0.3s ease; border-radius: 2px;
  text-decoration: none; text-align: center;
}
.btn-ghost:hover {
  background: var(--amber-ghost);
  transform: translateY(-2px);
  opacity: 1;
}
.btn-sm { padding: 10px 20px; font-size: 14px; letter-spacing: 2px; }

/* === CARDS === */
.card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-light);
  border-radius: 2px; padding: 32px 28px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: transparent; transition: background 0.3s;
}
.card:hover {
  border-color: var(--amber);
  transform: translateY(-6px);
  background: linear-gradient(145deg, var(--bg-elevated) 0%, #252218 100%);
}
.card:hover::before { background: var(--amber); }

.card-title {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: 2px; color: var(--text-primary);
  margin-bottom: 8px;
}
.card-subtitle {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 16px;
}
.card-body { font-size: 14px; color: #999; line-height: 1.6; }

/* Tag badge */
.tag {
  display: inline-block;
  background: var(--amber-ghost); border: 1px solid var(--amber-border);
  border-radius: 2px; padding: 4px 10px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--amber); text-transform: uppercase;
  letter-spacing: 2px; margin-bottom: 14px;
}

/* === LINK LISTS (inside pillar cards etc) === */
.link-list { border-top: 1px solid var(--border-light); padding-top: 16px; list-style: none; }
.link-list li { padding: 0; }
.link-list a {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: #ccc; padding: 8px 0;
  text-decoration: none; transition: all 0.2s;
  border-bottom: 1px solid transparent;
}
.link-list a::before {
  content: '◆'; color: var(--amber); font-size: 8px;
  transition: transform 0.2s;
}
.link-list a:hover { color: var(--amber); opacity: 1; }
.link-list a:hover::before { transform: translateX(4px); }

/* === ROAD DASHES === */
.road-dashes {
  display: flex; gap: 12px; justify-content: center;
  margin: 40px 0;
}
.road-dashes .dash {
  width: 40px; height: 4px; background: var(--amber);
  opacity: 0.3; border-radius: 2px;
}

/* === GRID LAYOUTS === */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

/* === PAGE HERO (for inner pages) === */
.page-hero {
  padding: 140px 24px 60px;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, #1a150a 0%, var(--bg-black) 100%);
}
.page-hero .overline { margin-bottom: 16px; }
.page-hero .heading-xl { margin-bottom: 16px; }
.page-hero .body-text { max-width: 550px; margin: 0 auto; }

/* === BREADCRUMB === */
.breadcrumb {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 1px; color: var(--text-dim);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb .sep { margin: 0 8px; }

/* === ARTICLE CONTENT === */
.article-content h2 {
  font-family: var(--font-display); font-size: 28px;
  letter-spacing: 2px; color: var(--amber);
  margin: 48px 0 16px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.article-content h3 {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: 1px; color: var(--text-primary);
  margin: 32px 0 12px;
}
.article-content p {
  font-family: var(--font-body); font-size: 16px;
  color: var(--text-secondary); line-height: 1.8;
  margin-bottom: 20px; font-weight: 300;
}
.article-content ul, .article-content ol {
  margin: 16px 0 24px 24px; color: var(--text-secondary);
}
.article-content li {
  font-size: 15px; line-height: 1.7;
  margin-bottom: 8px; padding-left: 8px;
}
.article-content li::marker { color: var(--amber); }
.article-content strong { color: var(--text-primary); font-weight: 500; }
.article-content .callout {
  background: var(--bg-panel); border-left: 3px solid var(--amber);
  padding: 20px 24px; margin: 24px 0; border-radius: 0 2px 2px 0;
}
.article-content .callout p { margin-bottom: 0; }

/* === TOOL CONTAINERS === */
.tool-wrapper {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 2px; padding: 32px; margin: 32px 0;
}
.tool-label {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--amber); letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 16px;
}
.tool-input {
  background: var(--bg-card); border: 1px solid var(--border-light);
  color: var(--text-primary); padding: 12px 16px;
  font-family: var(--font-body); font-size: 15px;
  outline: none; width: 100%; border-radius: 2px;
  transition: border-color 0.3s;
}
.tool-input:focus { border-color: var(--amber); }
.tool-input::placeholder { color: var(--text-dim); }

select.tool-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23F59E0B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.tool-result {
  background: #0d0d0a; border: 1px solid var(--amber-border);
  border-radius: 2px; padding: 24px; margin-top: 24px;
  text-align: center;
}
.tool-result .big-number {
  font-family: var(--font-display); font-size: 48px;
  color: var(--amber); letter-spacing: 2px;
}
.tool-result .result-label {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); letter-spacing: 2px;
  text-transform: uppercase; margin-top: 8px;
}

/* === NEWSLETTER === */
.email-input {
  background: var(--bg-card); border: 1px solid var(--border-light);
  color: var(--text-primary); padding: 14px 20px;
  font-family: var(--font-body); font-size: 15px;
  outline: none; flex: 1; min-width: 200px;
  border-radius: 2px; transition: border-color 0.3s;
}
.email-input:focus { border-color: var(--amber); }
.email-input::placeholder { color: var(--text-dim); }

/* === FOOTER === */
.site-footer { padding: 60px 24px 40px; max-width: 1200px; margin: 0 auto; }
.footer-top {
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 40px; margin-bottom: 40px;
}
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col-title {
  font-family: var(--font-display); font-size: 16px;
  letter-spacing: 3px; color: var(--amber); margin-bottom: 12px;
}
.footer-col a {
  display: block; font-size: 13px; color: var(--text-dim);
  padding: 4px 0; transition: color 0.2s; text-decoration: none;
}
.footer-col a:hover { color: var(--text-muted); opacity: 1; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-ghost); letter-spacing: 1px;
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flickerGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(245,158,11,0.25), 0 0 40px rgba(245,158,11,0.12); }
  50% { text-shadow: 0 0 25px rgba(245,158,11,0.4), 0 0 50px rgba(245,158,11,0.2); }
}
@keyframes dashMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(52px); }
}
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

.fade-up { animation: fadeUp 0.8s ease forwards; }
.fade-up-delay-1 { animation-delay: 0.2s; opacity: 0; }
.fade-up-delay-2 { animation-delay: 0.4s; opacity: 0; }
.fade-up-delay-3 { animation-delay: 0.6s; opacity: 0; }
.fade-up-delay-4 { animation-delay: 0.8s; opacity: 0; }

.glow { animation: flickerGlow 4s ease-in-out infinite; }

/* === RESPONSIVE — TABLET === */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-cols { gap: 40px; }
  .cred-bar { gap: 24px; }
}

/* === RESPONSIVE — MOBILE === */
@media (max-width: 600px) {
  .section { padding: 48px 16px; }
  .section-dark { padding: 32px 16px; }
  .container, .container-sm, .container-xs { padding: 0 16px; }

  /* Page hero — tighter on mobile */
  .page-hero { padding: 100px 16px 32px; }
  .page-hero .body-text { font-size: 14px; }

  /* Typography scaling */
  .heading-xl { font-size: clamp(28px, 8vw, 36px); letter-spacing: 2px; }
  .heading-lg { font-size: clamp(24px, 6vw, 32px); letter-spacing: 2px; }
  .heading-md { font-size: 20px; }
  .body-text { font-size: 15px; }
  .overline { font-size: 10px; letter-spacing: 2px; }

  /* Buttons — full width, bigger touch targets */
  .btn-primary, .btn-ghost {
    width: 100%; padding: 16px 24px;
    font-size: 16px; min-height: 52px;
  }
  .btn-sm { padding: 14px 20px; font-size: 14px; width: auto; min-height: 48px; }

  /* Cards — tighter padding */
  .card { padding: 24px 20px; }
  .pillar-icon { font-size: 28px; margin-bottom: 12px; }
  .pillar-title { font-size: 24px; letter-spacing: 2px; }
  .card-subtitle { font-size: 11px; }
  .card-title { font-size: 20px; }

  /* Link lists — bigger touch targets */
  .link-list a {
    padding: 12px 0; font-size: 15px;
    min-height: 44px;
    border-bottom: 1px solid var(--border);
  }
  .link-list li:last-child a { border-bottom: none; }

  /* Credibility bar */
  .cred-bar {
    flex-direction: column; gap: 20px;
    padding: 24px 16px;
  }
  .cred-number { font-size: 36px; }
  .cred-label { font-size: 10px; }

  /* Tool wrapper */
  .tool-wrapper { padding: 20px 16px; margin: 20px 0; }
  .tool-input { padding: 14px 12px; font-size: 16px; } /* 16px prevents iOS zoom */

  /* Article content */
  .article-content h2 { font-size: 24px; margin: 36px 0 12px; padding-top: 20px; }
  .article-content h3 { font-size: 20px; margin: 24px 0 10px; }
  .article-content p { font-size: 15px; line-height: 1.75; }
  .article-content li { font-size: 14px; line-height: 1.7; }
  .article-content .callout { padding: 16px; margin: 20px 0; }

  /* Footer */
  .site-footer { padding: 40px 16px 32px; }
  .footer-top { gap: 32px; }
  .footer-cols { gap: 28px; }
  .footer-col a { padding: 6px 0; font-size: 14px; min-height: 36px; display: flex; align-items: center; }
  .footer-bottom { flex-direction: column; text-align: center; font-size: 10px; }

  /* Newsletter — stack vertically */
  .newsletter-form { flex-direction: column; }
  .email-input { width: 100%; min-width: unset; font-size: 16px; padding: 16px; }

  /* Road dashes — fewer on mobile */
  .road-dashes .dash:nth-child(n+6) { display: none; }
  .road-dashes { gap: 8px; }

  /* Breadcrumb */
  .breadcrumb { font-size: 10px; margin-bottom: 20px; }

  /* Nav tweaks */
  .nav-logo { font-size: 18px; letter-spacing: 3px; }
  .nav-links a { font-size: 14px; padding: 12px 0; min-height: 44px; display: flex; align-items: center; }

  /* Prevent text overflow */
  * { word-break: break-word; }
}

/* === iOS / SAFARI FIXES === */
@supports (-webkit-touch-callout: none) {
  /* Prevent iOS zoom on input focus */
  input, select, textarea { font-size: 16px !important; }
  /* Fix iOS momentum scrolling */
  body { -webkit-overflow-scrolling: touch; }
}

/* === TOUCH DEVICE HOVER FIX === */
@media (hover: none) {
  .card:hover { transform: none; border-color: var(--border-light); }
  .card:hover::before { background: transparent; }
  .card:active { border-color: var(--amber); }
  .card:active::before { background: var(--amber); }
  .btn-primary:hover { transform: none; box-shadow: none; }
  .btn-ghost:hover { transform: none; }
  .btn-primary:active { background: #fff; }
  .btn-ghost:active { background: var(--amber-ghost); }
  .link-list a:hover::before { transform: none; }
  .link-list a:active { color: var(--amber); }
}
