/* ============================================================
   DEVsouls — Dark Terminal marketing site
   Palette: Modern Teal/Cyan on near-black (plan §2, Option C)
   ============================================================ */

/* ============================================================
   SCROLL-PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: transparent; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width .08s linear;
}

:root {
  /* Backgrounds */
  --bg-0: #06090C;          /* page base (near-black with cool tint) */
  --bg-1: #0A0E12;          /* primary surface */
  --bg-2: #0F141B;          /* raised surface (cards, navbar after scroll) */
  --bg-3: #151C25;          /* hovered/active surface */
  --line: #1E2733;          /* hairline borders */
  --line-strong: #2A3543;

  /* Text */
  --text: #E6EDF3;          /* primary text */
  --text-soft: #9AA7B4;     /* secondary text */
  --text-dim: #5C6B7A;      /* tertiary / labels */

  /* Accent — Teal/Cyan */
  --accent: #2DD4BF;        /* primary glow */
  --accent-bright: #5EEAD4; /* hover / highlights */
  --accent-dim: #0F3D38;    /* deep accent for fills */
  --accent-glow: rgba(45, 212, 191, 0.18);

  /* Status colors */
  --live: #34D399;
  --building: #FBBF24;
  --soon: #60A5FA;

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Shape */
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1140px;

  /* Easings */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; }
ul { list-style: none; }
section { scroll-margin-top: 84px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Selection ---------- */
::selection { background: var(--accent); color: var(--bg-0); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease),
              border-color .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent); color: var(--bg-0);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-bright); transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent-bright), 0 12px 32px -8px var(--accent-glow);
}

.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ============================================================
   LOGO / WORDMARK
   ============================================================ */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  color: var(--bg-0); background: var(--accent);
  padding: 6px 8px; border-radius: 7px; letter-spacing: -0.5px;
  box-shadow: 0 0 18px var(--accent-glow);
}
.logo-text { font-size: 1.22rem; letter-spacing: -0.5px; font-weight: 500; }
.logo-text b { font-weight: 800; }
.logo-soft { color: var(--text-soft); margin-left: 1px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(10, 14, 18, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  font-size: 0.95rem; color: var(--text-soft); font-weight: 500;
  transition: color .2s var(--ease); position: relative;
}
.nav-links a:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--accent);
  transition: width .25s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--text); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 120px 0 80px; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* subtle moving grid */
.grid-overlay {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 75%);
  opacity: 0.55;
  animation: gridDrift 24s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 54px 54px, 54px 54px; }
}

/* ambient glows */
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.glow-1 {
  width: 480px; height: 480px; background: var(--accent);
  top: -120px; right: -80px; opacity: 0.22;
  animation: float1 14s ease-in-out infinite;
}
.glow-2 {
  width: 380px; height: 380px; background: #2563EB;
  bottom: -140px; left: -100px; opacity: 0.15;
  animation: float2 18s ease-in-out infinite;
}
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-30px, 40px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px, -30px); } }

.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center;
}
.hero-copy { max-width: 560px; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  color: var(--accent); letter-spacing: 0.5px;
  background: var(--accent-glow); border: 1px solid var(--accent-dim);
  padding: 6px 13px; border-radius: 999px;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 8px var(--live); animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.8rem); font-weight: 800;
  line-height: 1.08; letter-spacing: -1.5px; margin: 22px 0 20px;
}
.accent { color: var(--accent); }
.lead {
  font-size: 1.12rem; color: var(--text-soft); max-width: 500px; line-height: 1.65;
}
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- Terminal window ---------- */
.terminal {
  background: linear-gradient(180deg, #0C1116 0%, #080B0F 100%);
  border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(45,212,191,0.06),
              inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: hidden; font-family: var(--font-mono);
}
.terminal.small { font-size: 0.86rem; }
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: #0A0E13; border-bottom: 1px solid var(--line);
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.red { background: #FF5F57; }
.term-dot.yellow { background: #FEBC2E; }
.term-dot.green { background: #28C840; }
.term-title {
  margin-left: 10px; font-size: 0.78rem; color: var(--text-dim);
}
.terminal-body {
  padding: 22px 22px 26px; font-size: 0.92rem; line-height: 1.9;
}
.terminal.small .terminal-body { padding: 18px; }
.term-line { color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }
.term-line.out { color: var(--text); padding-left: 4px; }
.prompt { color: var(--accent); font-weight: 700; }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* code syntax colors (about section) */
.c-comment { color: var(--text-dim); font-style: italic; }
.c-key { color: #c084fc; }
.c-var { color: var(--accent); }
.c-prop { color: #7dd3fc; }
.c-str { color: #fcd34d; }
.c-bool { color: #f472b6; }
.terminal-body code { font-family: inherit; }
.terminal-body pre { margin: 0; }

/* ============================================================
   GENERIC SECTION
   ============================================================ */
.section { padding: 100px 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker {
  display: inline-block; font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--accent); margin-bottom: 14px; letter-spacing: 0.3px;
}
.section h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 800;
  letter-spacing: -1px; line-height: 1.15;
}
.section-sub { margin-top: 14px; color: var(--text-soft); font-size: 1.08rem; }

/* ============================================================
   PRODUCTS
   ============================================================ */
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
}
.card {
  position: relative; padding: 30px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s var(--ease);
}
.card:hover {
  transform: translateY(-6px); border-color: var(--line-strong);
  box-shadow: 0 24px 50px -24px var(--accent-glow);
}
.card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: grid; place-items: center; color: var(--accent);
  background: var(--accent-glow); border: 1px solid var(--accent-dim);
}
.status { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.3px; }
.status-live { color: var(--live); }
.status-building { color: var(--building); }
.status-soon { color: var(--soon); }

.card h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.4px; }
.card p { color: var(--text-soft); font-size: 0.98rem; }
.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 20px; font-weight: 600; font-size: 0.92rem; color: var(--accent);
  transition: gap .25s var(--ease);
}
.card-link:hover { gap: 12px; }

/* ============================================================
   ABOUT
   ============================================================ */
.about { background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 50%, var(--bg-0) 100%); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-copy p { color: var(--text-soft); margin-top: 18px; font-size: 1.05rem; }
.about-stats { display: flex; gap: 40px; margin-top: 34px; }
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 2.2rem; font-weight: 800; color: var(--accent);
  font-family: var(--font-mono); line-height: 1;
}
.stat-label { font-size: 0.85rem; color: var(--text-dim); margin-top: 6px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { background: var(--bg-1); }
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 40px; align-items: start; }
.contact-channels { display: flex; flex-direction: column; gap: 14px; }
.contact-card {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.contact-card:hover { transform: translateX(4px); border-color: var(--accent-dim); }
.contact-ic {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--accent);
  background: var(--accent-glow); border: 1px solid var(--accent-dim);
}
.contact-label { display: block; font-size: 0.78rem; color: var(--text-dim); font-family: var(--font-mono); }
.contact-value { display: block; font-weight: 600; margin-top: 2px; }

.contact-form {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 0.82rem; font-family: var(--font-mono);
  color: var(--text-dim); margin-bottom: 8px; letter-spacing: 0.3px;
}
.field input, .field textarea {
  width: 100%; padding: 12px 14px; background: var(--bg-0);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  color: var(--text); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field textarea { resize: vertical; min-height: 100px; }
.form-note {
  margin-top: 14px; font-size: 0.9rem; font-family: var(--font-mono); text-align: center;
}
.form-note.ok { color: var(--live); }
.form-note.err { color: #F87171; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: var(--bg-0); padding: 50px 0 28px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.logo-footer .logo-text { font-size: 1.1rem; }
.footer-links { display: flex; gap: 28px; }
.footer-links a { color: var(--text-soft); font-size: 0.95rem; transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--accent); }
.socials { display: flex; gap: 10px; }
.social {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-soft); border: 1px solid var(--line);
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.social:hover { color: var(--accent); border-color: var(--accent-dim); transform: translateY(-3px); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 0.88rem; color: var(--text-dim);
}
.footer-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); }

/* ============================================================
   SCROLL REVEAL — word-mask + blur-fade (cinematic)
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(28px); filter: blur(8px);
  transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; filter: blur(0); }
/* Headings using word-mask already animate; skip the blur/rise to avoid doubling up. */
.reveal[data-split-words] { opacity: 1; transform: none; filter: none; }

/* Word-mask reveal for headings: each word rises from behind a clip mask.
   JS wraps each word as <span class="word"><span class="word-inner" style="--i:n">. */
[data-split-words] .word {
  display: inline-block; overflow: hidden; vertical-align: top;
  padding-bottom: 0.14em; line-height: 1.15; /* prevents clipping of descenders */
}
[data-split-words] .word-inner {
  display: inline-block;
  transform: translateY(115%);
  transition: transform .85s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
[data-split-words] .word-inner.accent { color: var(--accent); }
[data-split-words].reveal.visible .word-inner { transform: translateY(0); }

/* Hero content dissipates as the user scrolls past it. */
.hero-inner {
  transition: opacity .1s linear, transform .1s linear, filter .1s linear;
  will-change: opacity, transform, filter;
}

/* Parallax layers (transform updated by JS on scroll). */
[data-parallax] { will-change: transform; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { max-width: none; }
  .about-inner { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed; top: 70px; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-1); border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px; transform: translateY(-130%);
    transition: transform .35s var(--ease);
    box-shadow: 0 20px 40px -20px rgba(0,0,0,0.6);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:not(.nav-cta)::after { display: none; }
  .nav-cta { margin-top: 14px; text-align: center; border-bottom: none !important; }

  .nav-toggle { display: flex; }

  .product-grid { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .hero { padding: 110px 0 60px; }
  .about-stats { gap: 28px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; gap: 10px; align-items: flex-start; }
}

@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .contact-form, .card { padding: 22px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  [data-split-words] .word-inner { transform: none; }
  .hero-inner { opacity: 1 !important; transform: none !important; filter: none !important; }
  [data-parallax] { transform: none !important; }
  .caret { animation: none; }
}
