/* ============================================================
   FASTPARTS — Industrial editorial system
   ============================================================ */

:root {
  /* Canonical brand tokens */
  --night:    #151514;   /* primary background */
  --carbon:   #1c1c1b;   /* elevated surface */
  --iron:     #2a2c2e;   /* deeper surface */
  --steel:    #3c4042;   /* borders / dividers */
  --midnight: #003f52;   /* brand teal accent */
  --paper:    #f8f9fa;   /* light paper */
  --warm:     #f5f2ea;   /* warm cream — used in rulers/chips */
  --concrete: #d8dadd;   /* light divider */
  --ash:      #8a8d91;   /* muted text */
  --ember:    #FF5400;   /* brand orange */
  --ember-hi: #FF5B14;   /* tweaked glow ember */

  /* Legacy aliases (kept because referenced in existing rules) */
  --ink: var(--night);

  /* Alpha helpers — name = base + percent */
  --warm-03:     rgba(245, 242, 234, 0.03);
  --warm-15:     rgba(245, 242, 234, 0.15);
  --warm-18:     rgba(245, 242, 234, 0.18);
  --warm-20:     rgba(245, 242, 234, 0.20);
  --warm-40:     rgba(245, 242, 234, 0.40);
  --paper-04:    rgba(248, 249, 250, 0.04);
  --paper-025:   rgba(248, 249, 250, 0.025);
  --midnight-18: rgba(  0,  63,  82, 0.18);
  --midnight-35: rgba(  0,  63,  82, 0.35);
  --ember-05:    rgba(255,  84,   0, 0.05);
  --ember-glow:  rgba(255,  91,  20, 0.35);
}

* { -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
  font-feature-settings: "ss01";
  background-image:
    radial-gradient(circle at 20% 0%, var(--ember-05), transparent 45%),
    radial-gradient(circle at 80% 100%, var(--midnight-18), transparent 55%);
}

/* Selection already in tailwind */

/* ---------- Grain overlay ---------- */
.grain-overlay {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Ruler / measurement bar ---------- */
.ruler {
  height: 8px;
  background-image:
    repeating-linear-gradient(to right,
      var(--warm-18) 0,
      var(--warm-18) 1px,
      transparent 1px,
      transparent 10px),
    repeating-linear-gradient(to right,
      var(--warm-40) 0,
      var(--warm-40) 1px,
      transparent 1px,
      transparent 50px);
  border-bottom: 1px solid var(--steel);
}
.ruler-top { border-top: 1px solid var(--steel); border-bottom: 0; }

/* ---------- Blueprint grid ---------- */
.bp-grid {
  background-image:
    linear-gradient(to right, var(--paper-04) 1px, transparent 1px),
    linear-gradient(to bottom, var(--paper-04) 1px, transparent 1px);
  background-size: 80px 80px;
}
.bp-grid-fine {
  background-image:
    linear-gradient(to right, var(--paper-025) 1px, transparent 1px),
    linear-gradient(to bottom, var(--paper-025) 1px, transparent 1px);
  background-size: 20px 20px;
}
.bp-grid-teal {
  background-image:
    linear-gradient(to right, var(--midnight-35) 1px, transparent 1px),
    linear-gradient(to bottom, var(--midnight-35) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* ---------- Brackets ---------- */
.bracket {
  position: relative;
}
.bracket::before, .bracket::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--ember);
}
.bracket::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.bracket::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.bracket-paper::before, .bracket-paper::after { border-color: var(--paper); }

/* ---------- Marquee ---------- */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track {
  animation: marquee 40s linear infinite;
  display: flex;
  width: max-content;
}

@keyframes marquee-rev {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
.marquee-rev { animation: marquee-rev 35s linear infinite; }

/* ---------- Reveal — content is always visible; animation only enhances first paint ---------- */
.reveal, .reveal-stagger > * {
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.9s ease;
}
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0.0s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 0.40s; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 0.48s; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: 0.56s; }

/* ---------- Word switcher ---------- */
.word-switch {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
}
.word-switch span {
  display: inline-block;
  background: var(--ember);
  color: var(--ink);
  padding: 0 0.18em;
  margin-left: 0.05em;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Diagonal stripes ---------- */
.stripes {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--ember) 0,
    var(--ember) 6px,
    var(--ink) 6px,
    var(--ink) 12px
  );
}

/* ---------- Labelled tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border: 1px solid var(--warm-20);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  line-height: 1;
}

.tag-ember { border-color: var(--ember); color: var(--ember); }
.tag-dot::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 99px; background: currentColor; }

/* ---------- Big number ---------- */
.big-num {
  font-family: 'Boldonse', serif;
  font-size: clamp(4rem, 12vw, 12rem);
  line-height: 0.8;
  letter-spacing: -0.06em;
}

/* ---------- Service card hover ---------- */
.svc-card {
  position: relative;
  overflow: hidden;
  transition: background 0.4s ease;
}
.svc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ember);
  transform: translateY(101%);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 0;
}
.svc-card:hover::before { transform: translateY(0); }
.svc-card:hover .svc-card-inner { color: var(--ink); }
.svc-card:hover .svc-num { color: var(--ink); }
.svc-card-inner { position: relative; z-index: 1; transition: color 0.4s ease; }

/* ---------- Form ---------- */
.field {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--steel);
  padding: 14px 0;
  color: var(--paper);
  font-family: inherit;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.field:focus { border-color: var(--ember); }
.field::placeholder { color: var(--ash); }

/* ---------- Custom scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--steel); border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--ember); }

/* ---------- Cycling glyphs ---------- */
@keyframes spin-slow { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.spin-slow { animation: spin-slow 24s linear infinite; }

/* ---------- PMMP arrow flow ---------- */
.flow-arrow {
  height: 1px;
  background: linear-gradient(to right, var(--steel) 0, var(--ember) 50%, var(--steel) 100%);
  position: relative;
}
.flow-arrow::after {
  content: '▶';
  position: absolute; right: -2px; top: 50%; transform: translateY(-50%);
  color: var(--ember); font-size: 10px;
}

/* ---------- Section header ---------- */
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ash);
}

/* ---------- Diagonal cut ---------- */
.diagonal-divider {
  height: 60px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 60%);
}

/* ---------- Hero stencil glow ---------- */
.glow-ember { text-shadow: 0 0 60px var(--ember-glow); }

/* ---------- Print of rotating ring ---------- */
.ring-text {
  position: absolute;
  inset: 0;
}

/* ---------- Soft underline link ---------- */
.under-ember {
  background-image: linear-gradient(to right, var(--ember), var(--ember));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s ease;
  padding-bottom: 2px;
}
.under-ember:hover { background-size: 100% 1px; }

/* ---------- Material chip ---------- */
.mat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 5px 9px;
  border: 1px solid var(--warm-15);
  background: var(--warm-03);
}

/* ---------- Animated underscore caret ---------- */
.caret::after {
  content: '_';
  display: inline-block;
  margin-left: 4px;
  color: var(--ember);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Tilt label ---------- */
.tilt-label {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
}

/* ---------- Subtle background sigil ---------- */
.sigil {
  position: absolute;
  width: 320px; height: 320px;
  border: 1px solid var(--steel);
  border-radius: 999px;
  pointer-events: none;
}

/* ---------- Diagonal striped corner ---------- */
.warning-tape {
  background: repeating-linear-gradient(45deg,
    var(--ember) 0, var(--ember) 12px,
    var(--ink) 12px, var(--ink) 24px);
  height: 22px;
}

/* Responsive tightening */
@media (max-width: 768px) {
  .big-num { font-size: 18vw; }
}
