:root {
  --bg: #050505;
  --panel: #0D0D0D;
  --accent: #FF5A00;
  --accent-glow: #FF8A00;
  --text: #E8E8E8;
  --text-dim: #8A8A8A;
  --text-faint: #555555;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-soft: rgba(255, 255, 255, 0.05);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --radius: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

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

html { scroll-behavior: smooth; }

/* Viewport-locked sections on screens tall/wide enough to fit them */
@media (min-width: 900px) and (min-height: 640px) {
  html { scroll-snap-type: y mandatory; }
  .hero, .section { scroll-snap-align: start; }
  .footer { scroll-snap-align: end; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(255, 90, 0, 0.25); color: #fff; }

/* ============ CHROME ============ */

/* Orange elements lean toward the cursor; --gx/--gy are set by JS */
.drift { display: inline-block; }
.drift-1 { transform: translate(calc(var(--gx, 0) * 4px),  calc(var(--gy, 0) * 3px)); }
.drift-2 { transform: translate(calc(var(--gx, 0) * 8px),  calc(var(--gy, 0) * 6px)); }
.drift-3 { transform: translate(calc(var(--gx, 0) * 14px), calc(var(--gy, 0) * 10px)); }

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 90, 0, 0.7), rgba(255, 138, 0, 0.35));
  transform: scaleX(0);
  transform-origin: left;
  z-index: 200;
  pointer-events: none;
}

.section-rail {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%) translate(calc(var(--gx, 0) * 3px), calc(var(--gy, 0) * 2px));
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 90;
}

.section-rail a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.4s var(--ease);
}

.section-rail a::before {
  content: "";
  width: 12px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.5);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.section-rail a.active {
  color: var(--accent-glow);
}

.section-rail a.active::before {
  transform: scaleX(1);
}

.section-rail a:hover { color: var(--text-dim); }
.section-rail a.active:hover { color: var(--accent-glow); }

@media (max-width: 900px) {
  .section-rail { display: none; }
}

/* ============ NAV ============ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 64px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.5s var(--ease), background 0.5s var(--ease);
}

.nav.scrolled {
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(10, 10, 10, 0.94));
  border-bottom-color: var(--glass-border);
  box-shadow: var(--glass-highlight);
}

.nav-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.42em;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav-links a:hover { color: var(--accent-glow); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ============ HERO ============ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 34% 24% at 50% 60%, rgba(255, 138, 0, 0.08), transparent 70%);
  pointer-events: none;
}

/* Center-anchored glow that stretches toward the cursor (driven by JS) */
.hero-glow {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 72vw;
  height: 52vh;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 90, 0, 0.13), transparent 70%);
  transform: translate(-50%, -50%);
  will-change: transform;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: -60px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, black 30%, transparent 78%);
  animation: grid-drift 60s linear infinite;
}

@keyframes grid-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(72px, 72px); }
}

.hero-scanline {
  position: absolute;
  left: 0; right: 0;
  top: -2px;
  height: 1px;
  margin-left: calc(var(--gx, 0) * 26px);
  background: linear-gradient(90deg, transparent 5%, rgba(255, 90, 0, 0.35) 50%, transparent 95%);
  animation: scan 14s var(--ease) infinite;
  pointer-events: none;
}

@keyframes scan {
  0%   { transform: translateY(0);    opacity: 0; }
  8%   { opacity: 1; }
  45%  { opacity: 1; }
  60%  { transform: translateY(100vh); opacity: 0; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* Frame corner marks + metadata */

.hero-frame { position: absolute; inset: 88px 48px 48px; pointer-events: none; }

.frame-mark {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.frame-mark.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.frame-mark.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.frame-mark.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.frame-mark.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.frame-meta {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}
.meta-tl { top: 6px; left: 26px; }
.meta-tr { top: 6px; right: 26px; color: rgba(255, 90, 0, 0.55); }
.meta-bl { bottom: 6px; left: 26px; }
.meta-br { bottom: 6px; right: 26px; }

.hero-content {
  position: relative;
  text-align: center;
  padding: 0 24px;
  max-width: 780px;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 34px;
  min-height: 1.2em; /* holds space while the boot line types in */
}

.hero-kicker .caret {
  display: inline-block;
  width: 0.6em;
  margin-left: 2px;
  color: var(--accent-glow);
  animation: caret-blink 0.8s steps(1) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(52px, 10vw, 118px);
  letter-spacing: 0.18em;
  line-height: 1;
  margin-left: 0.18em; /* optically recenter letterspaced text */
  color: var(--text);
}

.hero-title-sub {
  display: block;
  margin-top: 26px;
  font-size: clamp(22px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: 0.58em;
  color: var(--text);
}

.hero-rule {
  width: 56px;
  height: 1px;
  margin: 38px auto;
}

.rule-line {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
}

.hero-sub {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(17px, 2.2vw, 21px);
  letter-spacing: 0.02em;
  color: var(--text);
}

.hero-body {
  margin: 22px auto 0;
  max-width: 560px;
  font-size: 14.5px;
  color: var(--text-dim);
}

.hero-actions {
  margin-top: 52px;
  display: flex;
  gap: 18px;
  justify-content: center;
}

.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 34px;
  border: 1px solid;
  border-radius: 8px;
  transition: all 0.35s var(--ease);
}

.btn-primary {
  color: var(--accent-glow);
  border-color: rgba(255, 90, 0, 0.45);
  background: linear-gradient(180deg, rgba(255, 90, 0, 0.09), rgba(255, 90, 0, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 138, 0, 0.14);
}
.btn-primary:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 90, 0, 0.14), rgba(255, 90, 0, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 138, 0, 0.2), 0 0 28px rgba(255, 90, 0, 0.14);
}

.btn-ghost {
  color: var(--text-dim);
  border-color: var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-highlight);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
}

.hero-scroll {
  position: absolute;
  bottom: 76px;
  left: 50%;
}

.scroll-line {
  display: block;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.28));
  animation: scroll-pulse 2.6s var(--ease) infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.9; }
}

/* ============ SECTIONS ============ */

.section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 48px;
  border-top: 1px solid var(--hairline-soft);
  overflow: hidden;
}

.section-inner, .section-diagnostic { width: 100%; }

.section::before {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  transform: translate(calc(var(--gx, 0) * 54px), calc(var(--gy, 0) * 38px));
  will-change: transform;
}

#problem::before {
  background: radial-gradient(ellipse 45% 55% at 12% 25%, rgba(255, 90, 0, 0.07), transparent 70%);
}

#technology::before {
  background: radial-gradient(ellipse 50% 60% at 88% 20%, rgba(255, 90, 0, 0.06), transparent 70%);
}

#team::before {
  background:
    radial-gradient(ellipse 48% 60% at 85% 65%, rgba(255, 90, 0, 0.08), transparent 70%),
    radial-gradient(ellipse 35% 45% at 8% 15%, rgba(255, 138, 0, 0.04), transparent 70%);
}

#contact::before {
  background: radial-gradient(ellipse 55% 65% at 50% 85%, rgba(255, 90, 0, 0.09), transparent 72%);
}

.section-inner {
  max-width: 680px;
  margin: 0 auto;
}

.section-inner.wide { max-width: 1080px; }

.section-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(255, 90, 0, 0.7);
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: 0.01em;
  line-height: 1.18;
  max-width: 640px;
}

.section-body {
  margin-top: 26px;
  max-width: 560px;
  font-size: 15px;
  color: var(--text-dim);
}

/* Problem diagnostics */

.section-diagnostic {
  max-width: 680px;
  margin: 64px auto 0;
  display: grid;
  gap: 16px;
  padding: 32px 36px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-highlight);
}

.diag-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
}

.diag-bar {
  display: block;
  height: 1px;
  background: var(--hairline-soft);
  position: relative;
}

.diag-bar i {
  position: absolute;
  left: 0; top: -0.5px;
  height: 2px;
  width: var(--w);
  background: linear-gradient(90deg, rgba(255, 90, 0, 0.55), rgba(255, 138, 0, 0.18));
  transform-origin: left;
  transform: translateX(calc(var(--gx, 0) * 10px)) scaleX(0);
  transition: transform 1.4s var(--ease) 0.3s;
}

.revealed .diag-bar i { transform: translateX(calc(var(--gx, 0) * 10px)) scaleX(1); }

/* Technology cards */

.cards {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-highlight);
  padding: 44px 36px 52px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0);
  transition: transform 0.5s var(--ease);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--glass-highlight), 0 0 40px rgba(255, 90, 0, 0.06);
}
.card:hover::before { transform: scaleX(1); }

/* Corner brackets that register on hover */
.card::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) left 0 top 0 / 12px 1px,
    linear-gradient(var(--accent), var(--accent)) left 0 top 0 / 1px 12px,
    linear-gradient(var(--accent), var(--accent)) right 0 bottom 0 / 12px 1px,
    linear-gradient(var(--accent), var(--accent)) right 0 bottom 0 / 1px 12px;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.card:hover::after { opacity: 0.7; }

.card-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--text-faint);
  margin-bottom: 40px;
  transition: color 0.4s var(--ease);
}

.card:hover .card-index { color: rgba(255, 90, 0, 0.75); }

.card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.card p:last-child {
  font-size: 14px;
  color: var(--text-dim);
}

/* Team */

.team {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.member {
  border-top: 1px solid var(--hairline);
  padding-top: 28px;
  transition: border-color 0.4s var(--ease);
}

.member:hover { border-top-color: rgba(255, 90, 0, 0.5); }

.member-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.03em;
}

.member-role {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 8px;
}

.member-link {
  display: inline-flex;
  margin-top: 20px;
  color: var(--text-faint);
  transition: color 0.3s var(--ease);
}

.member-link:hover { color: var(--accent-glow); }

/* Contact */

.contact-btn {
  display: inline-block;
  margin-top: 44px;
}

/* ============ FOOTER ============ */

.footer {
  border-top: 1px solid var(--hairline-soft);
  padding: 88px 48px 44px;
  background: var(--panel);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.42em;
}

.footer-tag {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 320px;
}

.footer-links {
  display: flex;
  gap: 36px;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.footer-links a:hover { color: var(--accent-glow); }

.footer-base {
  max-width: 1080px;
  margin: 72px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

/* ============ REVEAL ============ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(5px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
}

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

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .cards, .team { grid-template-columns: 1fr; }
  .cards { gap: 14px; }
  .card { padding: 32px 28px 38px; }
  .team { gap: 32px; }
  .section { padding: 96px 26px; }
  .nav { padding: 0 22px; height: 58px; }
  .nav-links { gap: 26px; }
  .hero-frame { inset: 74px 18px 26px; }
  .frame-meta.meta-bl, .frame-meta.meta-br { display: none; }
  .footer { padding: 64px 26px 36px; }
  .footer-inner { flex-direction: column; }
  .footer-links { flex-wrap: wrap; gap: 20px 28px; }
  .section-diagnostic { padding: 24px 22px; margin-top: 48px; }
  .diag-row { grid-template-columns: 128px 1fr; gap: 14px; }
  .hero-actions { flex-direction: column; align-items: center; gap: 14px; margin-top: 44px; }
  .btn { width: 230px; text-align: center; }
  .hero-scroll { bottom: 40px; }
  .section-title { font-size: clamp(28px, 7.5vw, 40px); }
}

@media (max-width: 560px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 9px; letter-spacing: 0.12em; }
  .nav-wordmark { font-size: 10px; letter-spacing: 0.22em; }
  .hero-title { font-size: clamp(40px, 12vw, 52px); }
  .hero-title-sub { letter-spacing: 0.42em; font-size: clamp(16px, 5vw, 22px); }
  .hero-kicker { font-size: 9px; letter-spacing: 0.24em; }
  .hero-sub { font-size: 16px; padding: 0 8px; }
  .section-index { font-size: 10px; }
  .diag-row { grid-template-columns: 1fr; gap: 8px; }
  .diag-row span:first-child { font-size: 9px; }
  .member { padding-top: 22px; }
  .footer-base { flex-direction: column; gap: 10px; }
}

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  .hero-grid, .hero-scanline, .scroll-line { animation: none; }
  .hero-scanline { display: none; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .diag-bar i { transform: scaleX(1); transition: none; }
  .section::before { transform: none; }
  .drift-1, .drift-2, .drift-3 { transform: none; }
  .hero-scanline { margin-left: 0; }
  .diag-bar i, .revealed .diag-bar i { transform: scaleX(1); }
  .section-rail { transform: translateY(-50%); }
  .hero-kicker .caret { animation: none; display: none; }
  html { scroll-behavior: auto; scroll-snap-type: none; }
}
