/* ================================================================
   TRAILGUIDE DIGITAL — DESIGN SYSTEM
   Derived from the Zoho Consulting landing page reference.
   Tokens first, then layout primitives, then components.
   ================================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --card: #0f0f0f;
  --card-hi: #161616;

  --border: rgba(255, 255, 255, 0.06);
  --border-hi: rgba(255, 255, 255, 0.12);

  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #52525b;

  --accent: #DC734C;
  --accent-bright: #E89070;
  --accent-warm: #F0B580;
  --accent-glow: rgba(220, 115, 76, 0.35);
  --accent-soft: rgba(220, 115, 76, 0.08);

  --grad-orange: linear-gradient(135deg, #DC734C 0%, #F0B580 100%);
  --grad-accent: linear-gradient(135deg, #DC734C 0%, #B85A3A 50%, #94462A 100%);
  --grad-text: linear-gradient(180deg, #fafafa 0%, #a1a1aa 100%);
  --grad-surface: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%);

  --shadow-glow: 0 0 60px -10px var(--accent-glow);
  --shadow-card: 0 20px 60px -20px rgba(0, 0, 0, 0.8);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --container-max: 1280px;
  --section-pad: 120px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

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

a { color: inherit; }

::selection { background: var(--accent); color: #1a0f00; }

/* Subtle page-wide noise texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

section.content {
  padding: var(--section-pad) 0;
  position: relative;
}

.section-alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- Typography ---------- */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(220, 115, 76, 0.2);
  border-radius: 999px;
  font-size: 11px;
  color: var(--accent-bright);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.section-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.section-title {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  max-width: 820px;
}
.section-title .grad {
  background: linear-gradient(180deg, #fafafa 50%, #71717a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-title .accent {
  background: var(--grad-orange);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-sub {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 640px;
  line-height: 1.6;
  margin-bottom: 64px;
}

.section-head-center { text-align: center; margin-bottom: 64px; }
.section-head-center .section-title,
.section-head-center .section-sub {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s var(--ease);
  cursor: pointer;
  border: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--grad-orange);
  color: #1a0f00;
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px -10px var(--accent-glow);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary svg { transition: transform 0.2s var(--ease); }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border-hi);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.btn-hero {
  padding: 12px 52px;
  font-size: 15px;
  white-space: nowrap;
}

/* ---------- Nav ---------- */
.nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px 0;
  transition: all 0.3s var(--ease);
}
.nav-wrap.scrolled {
  background: rgba(5, 5, 5, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-wrap .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.logo-text { font-size: 15px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  margin-right: 16px;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.nav-cta svg { width: 14px; height: 14px; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 140px 0 80px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  animation: floatOrb 20s ease-in-out infinite;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -200px; right: -200px;
  opacity: 0.25;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6C3422 0%, transparent 70%);
  bottom: -100px; left: -150px;
  opacity: 0.4;
  animation-delay: -7s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent-warm) 0%, transparent 70%);
  top: 40%; left: 50%;
  opacity: 0.1;
  animation-delay: -14s;
}
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
  animation: fadeUp 0.8s var(--ease) 0.1s both;
}
.hero-badge-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-bright);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  animation: fadeUp 0.8s var(--ease) 0.2s both;
}
.hero h1 .grad-text {
  background: linear-gradient(180deg, #ffffff 30%, #52525b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 .accent-text {
  background: var(--grad-orange);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 19px;
  line-height: 1.55;
  margin-bottom: 40px;
  max-width: 640px;
  animation: fadeUp 0.8s var(--ease) 0.35s both;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  animation: fadeUp 0.8s var(--ease) 0.5s both;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.8s var(--ease) 0.65s both;
  max-width: 640px;
}
.hero-stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad-orange);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.hero-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

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

/* ---------- Cards (bento) ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.bento-card {
  position: relative;
  background: var(--grad-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  overflow: hidden;
  transition: all 0.4s var(--ease);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.bento-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
}
.bento-icon-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
}
.bento-icon-bg {
  position: absolute;
  inset: 0;
  background: var(--grad-orange);
  border-radius: 14px;
  opacity: 0.15;
  filter: blur(8px);
}
.bento-icon {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(220, 115, 76, 0.15) 0%, rgba(220, 115, 76, 0.05) 100%);
  border: 1px solid rgba(220, 115, 76, 0.3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bento-icon svg { width: 26px; height: 26px; color: var(--accent-bright); }
.bento-card h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.bento-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .bento-grid { grid-template-columns: 1fr; }
}

/* ---------- Marquee (product logos, etc.) ---------- */
.marquee-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
  position: relative;
}
.marquee-section::before,
.marquee-section::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.marquee-section::before { left: 0; background: linear-gradient(90deg, var(--bg-soft), transparent); }
.marquee-section::after  { right: 0; background: linear-gradient(270deg, var(--bg-soft), transparent); }
.marquee-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.marquee {
  display: flex;
  gap: 48px;
  animation: scrollMarquee 40s linear infinite;
  width: max-content;
}
.marquee-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
@keyframes scrollMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- CTA form section ---------- */
.cta-form-section {
  padding: var(--section-pad) 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cta-form-section::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
}

.cta-form-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px;
  background: linear-gradient(135deg, rgba(220, 115, 76, 0.04) 0%, rgba(15, 15, 15, 0.6) 100%);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), 0 0 80px -20px var(--accent-glow);
  position: relative;
  z-index: 1;
}

.cta-form-heading {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.cta-form-sub {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 28px;
}
.cta-form-note {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 14px;
  text-align: center;
}

.zf-form-mount iframe {
  width: 100%;
  border: 0;
  background: transparent;
}
.zf-form-placeholder {
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.zf-form-placeholder-text { font-size: 13px; }

@media (max-width: 640px) {
  .cta-form-wrap { padding: 28px; }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 0 64px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.footer-meta {
  color: var(--text-dim);
  font-size: 13px;
}
@media (max-width: 640px) {
  .footer-inner { justify-content: center; text-align: center; }
}

/* ---------- Scroll reveal (wired up in main.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Accessibility: visible focus ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  z-index: 200;
}
.skip-link:focus { left: 8px; }
