/* ════════════════════════════════════════════════════════════════
 *  TITAN CONSTRUCTION GROUP — main.css
 *  Design tokens, modern reset, base typography, utilities.
 * ════════════════════════════════════════════════════════════════ */

/* ────────── FONTS ────────── */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-var.woff2') format('woff2-variations'),
       url('/assets/fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  size-adjust: 100%;
}
@font-face {
  font-family: 'Inter Tight';
  src: url('/assets/fonts/inter-tight-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/assets/fonts/cinzel-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/assets/fonts/cinzel-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ────────── TOKENS ────────── */
:root {
  /* Base palette */
  --titan-black:        #0A0A0A;
  --titan-obsidian:     #141414;
  --titan-graphite:     #1F1F1F;
  --titan-steel:        #2A2A2A;
  --titan-iron:         #3A3A3A;

  /* Gold spectrum */
  --titan-gold:         #D4AF37;
  --titan-gold-bright:  #F5C842;
  --titan-gold-dark:    #9A7B1F;
  --titan-gold-50:      rgba(212, 175, 55, .50);
  --titan-gold-25:      rgba(212, 175, 55, .25);
  --titan-gold-10:      rgba(212, 175, 55, .10);
  --titan-gold-05:      rgba(212, 175, 55, .05);

  /* Text */
  --titan-ivory:        #F4F1E8;
  --titan-bone:         #B8B0A0;
  --titan-ash:          #6B6359;
  --titan-fog:          #4A453E;

  /* States */
  --titan-success:      #4ADE80;
  --titan-warning:      #FBBF24;
  --titan-error:        #EF4444;
  --titan-info:         #60A5FA;

  /* Gradients */
  --grad-gold:          linear-gradient(135deg, #9A7B1F 0%, #D4AF37 50%, #F5C842 100%);
  --grad-gold-text:     linear-gradient(180deg, #F5C842 0%, #D4AF37 60%, #9A7B1F 100%);
  --grad-shield:        radial-gradient(ellipse at top, #1F1F1F 0%, #0A0A0A 100%);
  --grad-overlay-b:     linear-gradient(180deg, rgba(10,10,10,0) 0%, rgba(10,10,10,.95) 100%);
  --grad-overlay-t:     linear-gradient(180deg, rgba(10,10,10,.85) 0%, rgba(10,10,10,0) 50%);
  --grad-overlay-radial:radial-gradient(ellipse at center, rgba(10,10,10,.55) 0%, rgba(10,10,10,.95) 100%);

  /* Typography */
  --font-display:       'Cinzel', 'Georgia', 'Times New Roman', serif;
  --font-heading:       'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-body:          'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:          ui-monospace, 'SF Mono', Menlo, monospace;

  /* Type scale (fluid) */
  --text-xs:   0.75rem;     /* 12 */
  --text-sm:   0.875rem;    /* 14 */
  --text-base: 1rem;        /* 16 */
  --text-lg:   1.125rem;    /* 18 */
  --text-xl:   1.25rem;     /* 20 */
  --text-2xl:  clamp(1.375rem, 1.2rem + .7vw, 1.5rem);     /* 22-24 */
  --text-3xl:  clamp(1.75rem, 1.4rem + 1.5vw, 2rem);       /* 28-32 */
  --text-4xl:  clamp(2rem, 1.6rem + 2vw, 2.75rem);         /* 32-44 */
  --text-5xl:  clamp(2.5rem, 1.8rem + 3.5vw, 3.75rem);     /* 40-60 */
  --text-6xl:  clamp(3rem, 2rem + 5vw, 5rem);              /* 48-80 */
  --text-7xl:  clamp(3.5rem, 2.5rem + 6vw, 7rem);          /* 56-112 */

  /* Line heights */
  --lh-tight:   1.05;
  --lh-snug:    1.2;
  --lh-base:    1.6;
  --lh-relaxed: 1.75;

  /* Letter-spacing */
  --tracking-tight:   -0.02em;
  --tracking-base:    0;
  --tracking-wide:    0.04em;
  --tracking-widest:  0.16em;

  /* Spacing scale */
  --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;
  --space-32: 8rem;     --space-40: 10rem;

  /* Section rhythm */
  --section-y:        clamp(4rem, 8vw, 8rem);
  --section-y-lg:     clamp(5rem, 10vw, 10rem);

  /* Container */
  --container-max:    1400px;
  --container-px:     clamp(1rem, 4vw, 2.5rem);

  /* Elevation */
  --shadow-sm:   0 1px 2px rgba(0,0,0,.5);
  --shadow-md:   0 4px 12px rgba(0,0,0,.4), 0 0 0 1px var(--titan-gold-05);
  --shadow-lg:   0 20px 40px rgba(0,0,0,.6), 0 0 0 1px var(--titan-gold-10);
  --shadow-xl:   0 32px 64px rgba(0,0,0,.7), 0 0 0 1px var(--titan-gold-10);
  --shadow-gold: 0 0 40px rgba(212,175,55,.28), 0 6px 16px rgba(0,0,0,.5);

  /* Radii */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 9999px;

  /* Borders */
  --border-thin:        1px solid var(--titan-steel);
  --border-gold-thin:   1px solid var(--titan-gold-25);
  --border-gold:        1px solid var(--titan-gold);

  /* Motion */
  --ease-out-quad:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-quart:   cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-out-expo:    cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:    150ms;
  --dur-base:    300ms;
  --dur-slow:    600ms;
  --dur-slower:  900ms;

  /* Z-layers */
  --z-base:     1;
  --z-sticky:   50;
  --z-header:   100;
  --z-mobile:   200;
  --z-modal:    300;
  --z-toast:    400;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  color: var(--titan-ivory);
  background-color: var(--titan-black);
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
}

/* Subtle grain on dark surfaces */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

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

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

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

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

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--titan-gold);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

ul, ol { list-style: none; }

hr {
  border: 0;
  border-top: 1px solid var(--titan-steel);
  margin: var(--space-8) 0;
}

::selection {
  background: var(--titan-gold);
  color: var(--titan-black);
}

/* Skip link */
.tcg-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--titan-gold);
  color: var(--titan-black);
  padding: var(--space-2) var(--space-4);
  font-weight: 700;
  z-index: var(--z-toast);
}
.tcg-skip:focus {
  left: 8px;
}

/* ────────── BASE TYPOGRAPHY ────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--titan-ivory);
  text-wrap: balance;
}
h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-5xl); }
h3 { font-size: var(--text-3xl); font-family: var(--font-heading); }
h4 { font-size: var(--text-2xl); font-family: var(--font-heading); }
h5 { font-size: var(--text-xl);  font-family: var(--font-heading); }
h6 { font-size: var(--text-lg);  font-family: var(--font-heading); }

p {
  text-wrap: pretty;
  max-width: 75ch;
}

strong, b { font-weight: 600; color: var(--titan-ivory); }
em, i { font-style: italic; }

small { font-size: var(--text-sm); color: var(--titan-bone); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--titan-graphite);
  border-radius: var(--radius-xs);
}
code { padding: 0.1em 0.35em; }
pre  { padding: var(--space-4); overflow-x: auto; }

/* Display variants */
.tcg-h-display {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--titan-ivory);
  text-transform: uppercase;
}
.tcg-h-hero {
  font-family: var(--font-display);
  font-size: var(--text-7xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
.tcg-eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--titan-gold);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.tcg-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--titan-gold);
}

.tcg-lead {
  font-size: var(--text-lg);
  color: var(--titan-bone);
  line-height: var(--lh-relaxed);
  max-width: 70ch;
}

/* Gold text gradient */
.tcg-gold-text {
  background: var(--grad-gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ────────── LAYOUT ────────── */
.tcg-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
  position: relative;
  z-index: var(--z-base);
}

.tcg-section {
  padding-block: var(--section-y);
  position: relative;
}
.tcg-section--lg     { padding-block: var(--section-y-lg); }
.tcg-section--dark   { background: var(--titan-black); }
.tcg-section--ob     { background: var(--titan-obsidian); }
.tcg-section--grad   { background: var(--grad-shield); }

.tcg-main { display: block; }
[id] { scroll-margin-top: 96px; }

/* Section header alignment helpers */
.tcg-sec-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: clamp(2rem, 4vw, 4rem);
}
.tcg-sec-head--center {
  align-items: center;
  text-align: center;
}
.tcg-sec-head__title { margin: 0; }
.tcg-sec-head__sub { color: var(--titan-bone); max-width: 60ch; }
.tcg-sec-head--center .tcg-sec-head__sub { margin-inline: auto; }

/* Grid helpers */
.tcg-grid { display: grid; gap: var(--space-6); }
.tcg-grid--2 { grid-template-columns: 1fr; }
.tcg-grid--3 { grid-template-columns: 1fr; }
.tcg-grid--4 { grid-template-columns: 1fr; }
@media (min-width: 640px)  { .tcg-grid--2 { grid-template-columns: repeat(2, 1fr); }
                             .tcg-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .tcg-grid--3 { grid-template-columns: repeat(3, 1fr); }
                             .tcg-grid--4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .tcg-grid--2-7-5 { grid-template-columns: 7fr 5fr; } }

.tcg-flex      { display: flex; gap: var(--space-4); }
.tcg-flex--ctr { align-items: center; }
.tcg-flex--btw { justify-content: space-between; }

/* ────────── UTILITIES ────────── */
.tcg-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tcg-text-center { text-align: center; }
.tcg-text-gold   { color: var(--titan-gold); }
.tcg-text-bone   { color: var(--titan-bone); }
.tcg-text-ivory  { color: var(--titan-ivory); }
.tcg-uppercase   { text-transform: uppercase; letter-spacing: var(--tracking-wide); }

.tcg-mb-0 { margin-bottom: 0; }
.tcg-mb-2 { margin-bottom: var(--space-2); }
.tcg-mb-4 { margin-bottom: var(--space-4); }
.tcg-mb-6 { margin-bottom: var(--space-6); }
.tcg-mb-8 { margin-bottom: var(--space-8); }

.tcg-hide-mobile { display: none; }
.tcg-hide-desktop { display: block; }
@media (min-width: 900px) {
  .tcg-hide-mobile  { display: block; }
  .tcg-hide-desktop { display: none; }
}

/* Reveal animation hooks */
[data-tcg-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity var(--dur-slow) var(--ease-out-quart),
    transform var(--dur-slow) var(--ease-out-quart);
  will-change: opacity, transform;
}
[data-tcg-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-tcg-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-slow) var(--ease-out-quart),
    transform var(--dur-slow) var(--ease-out-quart);
}
[data-tcg-stagger].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
[data-tcg-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; }
[data-tcg-stagger].is-visible > *:nth-child(2) { transition-delay: 100ms; }
[data-tcg-stagger].is-visible > *:nth-child(3) { transition-delay: 200ms; }
[data-tcg-stagger].is-visible > *:nth-child(4) { transition-delay: 300ms; }
[data-tcg-stagger].is-visible > *:nth-child(5) { transition-delay: 400ms; }
[data-tcg-stagger].is-visible > *:nth-child(6) { transition-delay: 500ms; }

/* ────────── ICONS ────────── */
.tcg-icon {
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
  flex-shrink: 0;
}
.tcg-icon--gold { color: var(--titan-gold); }
.tcg-icon--xs   { width: 14px; height: 14px; }
.tcg-icon--sm   { width: 18px; height: 18px; }
.tcg-icon--lg   { width: 28px; height: 28px; }

/* ────────── ORNAMENTS ────────── */
.tcg-chevron-div {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-12) auto;
  gap: var(--space-2);
}
.tcg-chevron-div::before,
.tcg-chevron-div::after {
  content: '';
  height: 1px;
  flex: 1;
  max-width: 120px;
  background: linear-gradient(90deg, transparent, var(--titan-gold-50), transparent);
}
.tcg-chevron-div__mark {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border: 1.5px solid var(--titan-gold);
  border-top: 0;
  border-left: 0;
}

.tcg-roman {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  color: var(--titan-gold);
  letter-spacing: 0.05em;
  display: inline-block;
}

/* Brand-signature shield-cut corners (clip-path) */
.tcg-shield-cut {
  clip-path: polygon(
    18px 0,
    100% 0,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    0 100%,
    0 18px
  );
}
