/* ============================================================
   prescient.dev — Arwes-inspired sci-fi UI
   ============================================================ */

:root {
  /* Core palette — cyan/teal HUD on deep space */
  --bg-0: #02060a;
  --bg-1: #050d14;
  --bg-2: #081722;

  --cyan: #7afdff;
  --cyan-hot: #00e6ff;
  --cyan-dim: #2b8a96;
  --cyan-glow: rgba(0, 230, 255, 0.55);
  --cyan-soft: rgba(122, 253, 255, 0.12);

  --accent: #ff9d4d;     /* warning/orange highlight */
  --accent-soft: rgba(255, 157, 77, 0.15);

  --ok: #6dff9d;
  --text: #cfeef3;
  --text-dim: #6e8a93;
  --text-faint: #3a525a;

  --frame-line: rgba(0, 230, 255, 0.45);
  --frame-bg: rgba(0, 230, 255, 0.04);

  /* Typography */
  --font-display: "Orbitron", "Rajdhani", system-ui, sans-serif;
  --font-body: "Rajdhani", system-ui, sans-serif;
  --font-mono: "Share Tech Mono", "JetBrains Mono", monospace;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 230, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 157, 77, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
}

a { color: var(--cyan); text-decoration: none; }

::selection { background: var(--cyan-hot); color: var(--bg-0); }

/* ============================================================
   Atmospheric overlays
   ============================================================ */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(0, 230, 255, 0.025) 3px,
    rgba(0, 230, 255, 0.025) 4px
  );
  mix-blend-mode: screen;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 230, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 230, 255, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, transparent 80%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  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' 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>");
}

/* Above-overlay content */
.nav, main, .footer { position: relative; z-index: 10; }

/* ============================================================
   Frame component — Arwes cut-corner aesthetic
   ============================================================ */

.frame {
  position: relative;
  background: var(--frame-bg);
  /* Cut-corner clip path */
  clip-path: polygon(
    14px 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    14px 100%,
    0 calc(100% - 14px),
    0 14px
  );
}

.frame::before {
  /* Outline using a second clip-path layer underneath */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--frame-line);
  clip-path: polygon(
    14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px),
    calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px,
    14px 0,
    14px 1px,
    1px 14px,
    1px calc(100% - 14px),
    14px calc(100% - 1px),
    calc(100% - 14px) calc(100% - 1px),
    calc(100% - 1px) calc(100% - 14px),
    calc(100% - 1px) 14px,
    calc(100% - 14px) 1px,
    14px 1px
  );
  pointer-events: none;
}

.frame::after {
  /* Corner accent ticks */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    /* top-left tick */
    linear-gradient(90deg, var(--cyan-hot) 0 8px, transparent 8px) 0 4px / 100% 1px no-repeat,
    /* bottom-right tick */
    linear-gradient(90deg, transparent calc(100% - 8px), var(--cyan-hot) calc(100% - 8px)) 0 calc(100% - 4px) / 100% 1px no-repeat;
  filter: drop-shadow(0 0 4px var(--cyan-glow));
}

/* ============================================================
   Navigation
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(2, 6, 10, 0.55);
  border-bottom: 1px solid rgba(0, 230, 255, 0.12);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-size: 16px;
}

.brand-mark {
  display: inline-flex;
  filter: drop-shadow(0 0 6px var(--cyan-glow));
  animation: pulse-glow 4s ease-in-out infinite;
}

.brand-dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 13px;
}

.nav-links a {
  color: var(--text-dim);
  transition: color 0.2s var(--ease), text-shadow 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  transition: filter 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-cta:hover {
  color: var(--cyan-hot);
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 120px 32px 100px;
  min-height: 88vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  animation: hero-in 1s var(--ease) both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 6px 12px;
  border: 1px solid rgba(0, 230, 255, 0.3);
  background: rgba(0, 230, 255, 0.05);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag-pulse .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(42px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: uppercase;
}

.hero-title .line { display: block; }
.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: word-in 0.8s var(--ease) forwards;
  margin-right: 0.25em;
  text-shadow: 0 0 24px rgba(0, 230, 255, 0.15);
}

.hero-title .word:nth-child(1) { animation-delay: 0.1s; }
.hero-title .word:nth-child(2) { animation-delay: 0.18s; }
.hero-title .word:nth-child(3) { animation-delay: 0.26s; }
.hero-title .word:nth-child(4) { animation-delay: 0.34s; }
.hero-title .word:nth-child(5) { animation-delay: 0.42s; }

.hero-title .word-accent {
  color: var(--cyan);
  text-shadow: 0 0 32px var(--cyan-glow);
}

@keyframes word-in {
  to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
}

.stat-item {
  padding: 16px 18px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan-glow);
  font-variant-numeric: tabular-nums;
}

.stat-value span {
  color: var(--accent);
  font-size: 0.7em;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--cyan);
  transition: all 0.25s var(--ease);
  position: relative;
}

.btn-primary {
  background: rgba(0, 230, 255, 0.08);
}

.btn-primary:hover {
  background: rgba(0, 230, 255, 0.18);
  color: var(--cyan-hot);
  filter: drop-shadow(0 0 12px var(--cyan-glow));
}

.btn-ghost {
  color: var(--text-dim);
  padding: 14px 0;
  border-bottom: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* HUD decorative elements */
.hud {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-tl { top: 100px; right: 32px; text-align: right; }
.hud-br { bottom: 40px; right: 32px; text-align: right; }

.hud-row {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

.hud-row span:first-child { color: var(--text-faint); }
.hud-row span:last-child { color: var(--text-dim); }
.hud-row .ok { color: var(--ok); }

@media (max-width: 800px) {
  .hud { display: none; }
}

/* ============================================================
   Sections
   ============================================================ */

.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 100px 32px;
}

.section-head {
  margin-bottom: 60px;
  max-width: 720px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  display: block;
  margin-bottom: 16px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

.section-head p {
  font-size: 19px;
  color: var(--text-dim);
  margin: 0;
}

/* ============================================================
   Services
   ============================================================ */

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

.service {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s var(--ease);
}

.service:hover {
  transform: translateY(-4px);
}

.service-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  opacity: 0.6;
}

.service h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
}

.service p {
  color: var(--text-dim);
  margin: 0;
  font-size: 16px;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.service-list li {
  padding-left: 18px;
  position: relative;
  color: var(--text-dim);
}

.service-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--cyan);
}

.service-featured {
  background: rgba(0, 230, 255, 0.07);
}

.service-featured h3 {
  color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan-glow);
}

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

/* ============================================================
   Process
   ============================================================ */

.process {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid rgba(0, 230, 255, 0.2);
  padding-left: 40px;
  position: relative;
}

.process-step {
  position: relative;
  padding: 28px 0;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  border-bottom: 1px solid rgba(0, 230, 255, 0.08);
}

.process-step:last-child { border-bottom: none; }

.step-marker {
  position: relative;
}

.step-marker::before {
  content: "";
  position: absolute;
  left: -52px;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--bg-0);
  border: 1px solid var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.step-marker span {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan-glow);
}

.step-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.step-body p {
  color: var(--text-dim);
  margin: 0;
  max-width: 640px;
}

@media (max-width: 700px) {
  .process { padding-left: 24px; }
  .process-step { grid-template-columns: 1fr; gap: 12px; }
  .step-marker::before { left: -36px; }
}

/* ============================================================
   Contact
   ============================================================ */

.section-contact { padding-bottom: 140px; }

.contact-form {
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 880px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-full { grid-column: 1 / -1; }

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  display: flex;
  gap: 8px;
  align-items: center;
}

.field label .opt {
  color: var(--text-faint);
  font-size: 10px;
}

.field input,
.field textarea {
  background: rgba(0, 230, 255, 0.04);
  border: 1px solid rgba(0, 230, 255, 0.25);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: all 0.2s var(--ease);
  border-radius: 0;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--cyan);
  background: rgba(0, 230, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 230, 255, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.form-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}

#submit-btn {
  position: relative;
}

#submit-btn[disabled] {
  opacity: 0.5;
  cursor: wait;
}

.form-status {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 20px;
  letter-spacing: 0.05em;
}

.form-status.success { color: var(--ok); }
.form-status.error   { color: var(--accent); }

@media (max-width: 700px) {
  .contact-form { grid-template-columns: 1fr; padding: 28px 24px; }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid rgba(0, 230, 255, 0.12);
  padding: 32px 0;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--cyan);
}

.footer-tag { color: var(--text-faint); }

.footer-meta {
  color: var(--text-faint);
  display: flex;
  gap: 12px;
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 6px var(--cyan-glow)); }
  50%      { filter: drop-shadow(0 0 14px var(--cyan-glow)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Responsive — tablet and mobile
   ============================================================ */

/* Tablet & smaller laptops */
@media (max-width: 960px) {
  .nav-inner { padding: 12px 20px; gap: 16px; }
  .nav-links { gap: 18px; }

  .hero { padding: 80px 20px 80px; min-height: auto; }
  .section { padding: 80px 20px; }
  .footer-inner { padding: 0 20px; }
}

/* Mobile */
@media (max-width: 680px) {
  /* Belt-and-suspenders against any overflow */
  html, body { overflow-x: clip; max-width: 100vw; }

  /* Nav — hide the inline links, keep brand + CTA */
  .nav-inner {
    padding: 10px 16px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .nav-links { display: none; }
  .brand { font-size: 14px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .nav-cta {
    padding: 7px 12px;
    font-size: 11px;
    letter-spacing: 0.08em;
    margin-left: auto;
  }
  .nav-cta svg { display: none; }

  /* Hero */
  .hero {
    padding: 56px 16px 64px;
    min-height: auto;
    align-items: flex-start;
  }
  .hero-grid { gap: 24px; width: 100%; }

  .hero-meta { gap: 8px; }
  .tag {
    font-size: 10px;
    padding: 5px 9px;
    letter-spacing: 0.1em;
  }

  .hero-title {
    /* Smaller floor so long words ("Software") never overrun */
    font-size: clamp(34px, 11vw, 56px);
    line-height: 1;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .hero-sub {
    font-size: 16px;
    line-height: 1.5;
  }

  /* Stats — stack to a single column so long labels like
     "agent_hours_deployed" don't squeeze the numbers */
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stat-item {
    padding: 12px 14px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .stat-label { margin-bottom: 0; font-size: 10px; }
  .stat-value { font-size: 26px; }

  /* CTAs — full width, stacked */
  .hero-cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn {
    padding: 13px 18px;
    font-size: 12px;
    letter-spacing: 0.12em;
    justify-content: center;
  }
  .btn-ghost { padding: 10px 0; align-self: center; }

  /* Sections */
  .section { padding: 64px 16px; }
  .section-head { margin-bottom: 36px; }
  .section-head h2 { font-size: clamp(28px, 8vw, 40px); }
  .section-head p { font-size: 16px; }

  /* Services */
  .service { padding: 24px 20px; }
  .service h3 { font-size: 19px; }

  /* Process */
  .step-marker span { font-size: 28px; }
  .step-body h3 { font-size: 19px; }

  /* Contact */
  .section-contact { padding-bottom: 96px; }
  .contact-form { padding: 24px 18px; gap: 16px; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .form-footer .btn { width: 100%; }
  .form-note { text-align: center; }

  /* Footer */
  .footer { padding: 24px 0; margin-top: 40px; }
  .footer-inner {
    padding: 0 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
  }
  .footer-brand { flex-wrap: wrap; gap: 8px; }

  /* Cut-corner frames — smaller chamfer reads better at small widths */
  .frame {
    clip-path: polygon(
      10px 0,
      calc(100% - 10px) 0,
      100% 10px,
      100% calc(100% - 10px),
      calc(100% - 10px) 100%,
      10px 100%,
      0 calc(100% - 10px),
      0 10px
    );
  }
  .frame::before {
    clip-path: polygon(
      10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px),
      calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px,
      10px 0,
      10px 1px,
      1px 10px,
      1px calc(100% - 10px),
      10px calc(100% - 1px),
      calc(100% - 10px) calc(100% - 1px),
      calc(100% - 1px) calc(100% - 10px),
      calc(100% - 1px) 10px,
      calc(100% - 10px) 1px,
      10px 1px
    );
  }
}

/* Very small phones — iPhone SE and below */
@media (max-width: 380px) {
  .hero-title { font-size: clamp(30px, 12vw, 44px); }
  .brand-text { font-size: 13px; }
  .nav-cta span { letter-spacing: 0.06em; }
}
