/* ============================================================
   SWIFTBYTE — DESIGN SYSTEM
   Ideate. Architect. Accelerate.
   ============================================================ */

:root {
  /* Color */
  --void:        #0A0A0A;
  --panel:       #131313;
  --panel-2:     #1A1A1A;
  --line:        #2A2A2A;
  --line-soft:   #1F1F1F;
  --red:         #E8000D;
  --red-glow:    #FF2A1F;
  --red-deep:    #6E0006;
  --white:       #F4F4F2;
  --gray:        #8A8A8A;
  --gray-dim:    #545454;

  /* Type */
  --font-display: "Anton", "Arial Narrow Bold", sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Scale */
  --container: 1280px;
  --gutter: clamp(24px, 5vw, 80px);

  /* Motion */
  --ease-blade: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snap: cubic-bezier(0.7, 0, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--void);
}

body {
  background: var(--void);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--red); color: var(--white); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--red-deep); }

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

/* ============ LAYOUT PRIMITIVES ============ */
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  position: relative;
  padding: clamp(70px, 12vw, 160px) 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--red);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.98;
}

h1 { font-size: clamp(46px, 7.5vw, 104px); }
h2 { font-size: clamp(34px, 5vw, 64px); }
h3 { font-size: clamp(22px, 2.6vw, 32px); }
h4 { font-size: 18px; letter-spacing: 0.04em; }

p { color: var(--gray); max-width: 60ch; }
p.lead { color: var(--white); font-size: clamp(17px, 1.6vw, 21px); max-width: 46ch; }

.accent { color: var(--red); }

.rule {
  height: 1px;
  width: 100%;
  background: var(--line);
}

.rule--glow {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

/* ============ BUTTONS ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 30px;
  border: 1px solid var(--line);
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.4s var(--ease-blade), color 0.4s var(--ease-blade);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: translateX(-101%) skewX(-12deg);
  transform-origin: left;
  transition: transform 0.5s var(--ease-snap);
  z-index: -1;
}
.btn:hover { border-color: var(--red); }
.btn:hover::before { transform: translateX(0) skewX(-12deg); }
.btn .arrow { transition: transform 0.4s var(--ease-blade); }
.btn:hover .arrow { transform: translateX(4px); }

.btn--solid {
  background: var(--red);
  border-color: var(--red);
}
.btn--solid::before { background: var(--white); }
.btn--solid:hover { color: var(--void); border-color: var(--white); }

/* ============ GRID HELPERS ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ============ REVEAL ON SCROLL ============ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-blade), transform 0.9s var(--ease-blade);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-blade {
  position: relative;
  overflow: hidden;
}
.reveal-blade .blade-cover {
  position: absolute;
  inset: 0;
  background: var(--red);
  transform-origin: left;
  z-index: 2;
}
.reveal-blade.is-visible .blade-cover {
  animation: bladeSweep 0.9s var(--ease-snap) forwards;
}
@keyframes bladeSweep {
  0% { transform: scaleX(0); }
  45% { transform: scaleX(1); }
  100% { transform: scaleX(0); transform-origin: right; }
}

[data-stagger] > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-blade), transform 0.7s var(--ease-blade);
}
[data-stagger].is-visible > * { opacity: 1; transform: translateY(0); }
[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0s; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 0.08s; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 0.16s; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 0.24s; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 0.32s; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 0.4s; }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
