/* ============================================================
   MCNEISH SOLUTION LLC — BASE DESIGN SYSTEM
   The Architecture of Resurrection
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Outfit:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* ─── CSS CUSTOM PROPERTIES ────────────────────────────── */
:root {
  /* Color Palette — Derived from Client Project Photos */
  --void:          #0A0B0D;
  --steel:         #1C2027;
  --charcoal:      #252C35;
  --charcoal-mid:  #2E3744;
  --copper:        #B87333;
  --copper-lit:    #E8943A;
  --copper-deep:   #8A5520;
  --copper-glow:   rgba(184, 115, 51, 0.15);
  --copper-glow-strong: rgba(184, 115, 51, 0.35);
  --ivory:         #F0EAE0;
  --ivory-dim:     #C8BBA8;
  --ash:           #8B8F96;
  --ash-light:     #A8ACB3;
  --lapis:         #1A2B4A;
  --lapis-glow:    #2A4A7A;
  --bone:          #C8BBA8;
  --ember:         #FF5733;
  --ember-dim:     rgba(255, 87, 51, 0.7);
  --success:       #4CAF6A;

  /* Transparency layers */
  --overlay-10:    rgba(10, 11, 13, 0.10);
  --overlay-30:    rgba(10, 11, 13, 0.30);
  --overlay-60:    rgba(10, 11, 13, 0.60);
  --overlay-85:    rgba(10, 11, 13, 0.85);
  --copper-10:     rgba(184, 115, 51, 0.10);
  --copper-20:     rgba(184, 115, 51, 0.20);

  /* Typography */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-head:     'Outfit', system-ui, sans-serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Courier New', monospace;

  /* Spacing Scale */
  --space-2:   0.125rem;
  --space-4:   0.25rem;
  --space-8:   0.5rem;
  --space-12:  0.75rem;
  --space-16:  1rem;
  --space-20:  1.25rem;
  --space-24:  1.5rem;
  --space-32:  2rem;
  --space-40:  2.5rem;
  --space-48:  3rem;
  --space-64:  4rem;
  --space-80:  5rem;
  --space-96:  6rem;
  --space-128: 8rem;
  --space-160: 10rem;

  /* Layout */
  --nav-width:     68px;
  --max-content:   1440px;
  --section-pad:   clamp(4rem, 8vw, 8rem);

  /* Borders */
  --border-copper: 1px solid rgba(184, 115, 51, 0.3);
  --border-steel:  1px solid rgba(255, 255, 255, 0.06);
  --border-ash:    1px solid rgba(139, 143, 150, 0.2);

  /* Shadows */
  --shadow-copper:  0 0 40px rgba(184, 115, 51, 0.15), 0 0 80px rgba(184, 115, 51, 0.05);
  --shadow-deep:    0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-card:    0 8px 32px rgba(0, 0, 0, 0.4);

  /* Animation Timings */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-expo:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-inout:     cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-precise:   cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration-fast:  150ms;
  --duration-mid:   350ms;
  --duration-slow:  650ms;
  --duration-xslow: 1200ms;

  /* Z-Index Scale */
  --z-base:     1;
  --z-above:    10;
  --z-nav:      100;
  --z-overlay:  500;
  --z-modal:    800;
  --z-cursor:   9999;
  --z-preloader: 10000;
}

/* ─── VENETIAN PLASTER LIGHT MODE TOKENS ────────────────── */
html.light-mode, body.light-mode {
  --void:                 #F5EFEB; /* Venetian Plaster */
  --steel:                #EAE2D8; /* structural stone */
  --charcoal:             #DCD3C7; /* plaster card base */
  --charcoal-mid:         #D2C8BC; /* mortar edge */
  --copper:               #9E5C20; /* darkened copper for WCAG AA contrast */
  --copper-lit:           #C37D35; /* illuminated copper */
  --copper-deep:          #754415; /* deep dark copper */
  --copper-glow:          rgba(158, 92, 32, 0.08);
  --copper-glow-strong:   rgba(158, 92, 32, 0.18);
  --ivory:                #2C251D; /* dark timber ink */
  --ivory-dim:            #4A3F33;
  --ash:                  #756C60; /* secondary text */
  --ash-light:            #8C8274; /* secondary light text */
  --lapis:                #E1E8F5; /* diluted blueprint */
  --lapis-glow:           #C8D7EF;
  --bone:                 #EFEAE2;
  --ember:                #C83215;
  --ember-dim:            rgba(200, 50, 21, 0.7);
  --overlay-10:           rgba(245, 239, 235, 0.1);
  --overlay-30:           rgba(245, 239, 235, 0.3);
  --overlay-60:           rgba(245, 239, 235, 0.6);
  --overlay-85:           rgba(245, 239, 235, 0.85);
  --copper-10:            rgba(158, 92, 32, 0.08);
  --copper-20:            rgba(158, 92, 32, 0.15);
  --border-copper:        1px solid rgba(158, 92, 32, 0.3);
  --border-steel:         1px solid rgba(44, 37, 29, 0.06);
  --border-ash:           1px solid rgba(117, 108, 96, 0.2);
  --shadow-copper:        0 0 40px rgba(158, 92, 32, 0.1), 0 0 80px rgba(158, 92, 32, 0.03);
  --shadow-deep:          0 24px 64px rgba(44, 37, 29, 0.12);
  --shadow-card:          0 8px 32px rgba(44, 37, 29, 0.08);
}

/* ─── GLOBAL TRANSITIONS FOR SMOOTH THEME SHIFT ─────────── */
body, html, .site-nav, .top-bar, .mobile-nav, .project-panel, .testimonial-block, .site-footer, .phase-card, .btn-bracket, .link-underline, .stat-block__number {
  transition: background-color var(--duration-slow) var(--ease-precise),
              color var(--duration-slow) var(--ease-precise),
              border-color var(--duration-slow) var(--ease-precise),
              fill var(--duration-slow) var(--ease-precise),
              stroke var(--duration-slow) var(--ease-precise),
              box-shadow var(--duration-slow) var(--ease-precise);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--void);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* Custom cursor takes over */
}

/* Restore cursor on touch devices */
@media (hover: none) {
  body { cursor: auto; }
}

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

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

button {
  background: none;
  border: none;
  cursor: none;
  font-family: inherit;
}

ul, ol { list-style: none; }

svg { display: block; }

/* ─── TYPOGRAPHY SYSTEM ──────────────────────────────────── */

/* Display — Cormorant Garamond */
.t-display-xl {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 9rem);
  font-weight: 700;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ivory);
}

.t-display-lg {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 6rem);
  font-weight: 700;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.t-display-md {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 4rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.0;
}

/* Headlines — Outfit */
.t-h1 {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.t-h2 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.t-h3 {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Body — DM Sans */
.t-body-lg {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.65;
}

.t-body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

.t-body-sm {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ash-light);
}

/* Mono — JetBrains */
.t-mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.t-mono-lg {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 5vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Label style */
.t-label {
  font-family: var(--font-head);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--copper);
}

/* Copper accent text */
.t-copper { color: var(--copper); }
.t-copper-lit { color: var(--copper-lit); }
.t-ash { color: var(--ash); }
.t-ivory { color: var(--ivory); }

/* ─── UTILITY CLASSES ────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-40);
}

/* Offset for left-rail nav */
.page-content {
  margin-left: var(--nav-width);
  min-height: 100vh;
}

/* Section padding */
.section {
  padding: var(--section-pad) 0;
  position: relative;
}

/* Overflow management */
.overflow-hidden { overflow: hidden; }
.overflow-clip   { overflow: clip; }

/* GPU acceleration hint */
.gpu { transform: translateZ(0); will-change: transform; }

/* Grain overlay — site-wide subtle noise */
.grain::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-repeat: repeat;
  background-size: 128px 128px;
  z-index: var(--z-overlay);
  opacity: 0.4;
  mix-blend-mode: overlay;
}

/* 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;
  }
}

/* ─── FOCUS STYLES ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ─── SELECTION ──────────────────────────────────────────── */
::selection {
  background-color: var(--copper);
  color: var(--void);
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb {
  background: var(--copper-deep);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: var(--copper); }

/* ─── LIGHT MODE GRAIN ADJUSTMENT ────────────────────────── */
html.light-mode.grain::after {
  opacity: 0.15;
  mix-blend-mode: soft-light;
}

