/* ============================================
   Mark1 Marketing - Base Stylesheet
   Reset, tokens, typography, shared components
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* --- Design Tokens --- */
:root {
  /* Colors */
  --bg: #0D0D0D;
  --surface: #161616;
  --surface-elevated: #1E1E1E;
  --border: #2A2A2A;
  --text-primary: #F5F5F3;
  --text-secondary: #A0A09C;
  --text-tertiary: #6B6B67;
  --gold: #C9A84C;
  --gold-hover: #D4B860;
  --gold-muted: rgba(201, 168, 76, 0.15);
  --gold-subtle: rgba(201, 168, 76, 0.08);

  /* Light section tokens */
  --light-bg: #F5F3EE;
  --light-surface: #EDEAE4;
  --light-text: #1A1A1A;
  --light-text-secondary: #4A4A46;
  --light-border: #D4D1CB;

  /* Typography */
  --font-display: 'General Sans', sans-serif;
  --font-body: 'Satoshi', sans-serif;

  /* Type Scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.775rem + 0.2vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.4rem + 2.4vw, 2.75rem);
  --text-4xl: clamp(2.25rem, 1.5rem + 3.75vw, 3.75rem);
  --text-hero: clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width: 1200px;
  --section-padding: clamp(2rem, 4vw, 3.5rem);
  --container-padding: clamp(1rem, 4vw, 2rem);

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 40px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base Typography --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg);
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
}

h1 { font-size: var(--text-hero); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.015em; }
h3 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 65ch;
}

strong { font-weight: 600; color: var(--text-primary); }

/* --- Shared Components --- */

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Section */
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

/* Light section — inverted for contrast breaks */
.section-light {
  background: var(--light-bg);
  color: var(--light-text);
  border-top: none;
  border-bottom: none;
}

.section-light h2,
.section-light h3,
.section-light h4,
.section-light strong {
  color: var(--light-text);
}

.section-light p,
.section-light li {
  color: var(--light-text-secondary);
}

.section-light .eyebrow {
  color: var(--gold);
}

.section-light .stat-number {
  color: var(--gold);
}

.section-light .stat-label {
  color: var(--light-text-secondary);
}

/* Elevated section surface — subtle lift from base dark */
.section-elevated {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Elevated card surface */
.card-elevated {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.card-elevated:hover {
  border-color: var(--gold-muted);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  border: none;
  line-height: 1;
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background-color: var(--gold);
  color: #0D0D0D;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(201, 168, 76, 0.35),
              0 0 0 1px rgba(201, 168, 76, 0.1);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  padding: 0.75rem 1.5rem;
}

.btn-ghost:hover {
  background: var(--gold-muted);
}

.btn-sm {
  padding: 0.625rem 1.5rem;
  font-size: var(--text-xs);
}

/* Dark button for light sections */
.section-light .btn-primary {
  background-color: var(--light-text);
  color: var(--light-bg);
}

.section-light .btn-primary:hover {
  background-color: #333;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.section-light .btn-secondary {
  border-color: var(--light-text);
  color: var(--light-text);
}

.section-light .btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  transition: border-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.card:hover {
  border-color: rgba(201, 168, 76, 0.3);
}

.card-elevated {
  background: var(--surface-elevated);
}

/* Section Label / Eyebrow */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

/* Section header pattern */
.section-header {
  margin-bottom: var(--space-8);
}

.section-header p {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  border: none;
}

/* Gold accent line */
.accent-line {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin-bottom: var(--space-6);
}

/* Grid utilities */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Text utilities */
.text-gold { color: var(--gold); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-center { text-align: center; }

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }
.reveal-delay-4 { transition-delay: 0.48s; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--gold);
  color: var(--bg);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-size: var(--text-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Marquee / Trust bar */
.marquee-wrap {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  gap: var(--space-8);
  align-items: center;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.marquee-track img:hover {
  opacity: 0.65;
}

@media (min-width: 640px) {
  .marquee-track img {
    height: 44px;
  }
}

/* Selection */
::selection {
  background: rgba(201, 168, 76, 0.3);
  color: var(--text-primary);
}

/* --- Noise Texture Overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  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.65' numOctaves='3' 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;
}
