/* ===========================================================
   TOKENS - RICH LAB PREMIUM DARK MODE
   =========================================================== */
:root {
  /* Dark Premium Palette */
  --bg: #0a0a0f;
  --bg-alt: #13131a;
  --paper: #1c1c24;
  --paper-glass: rgba(28, 28, 36, 0.6);
  --ink: #f0f0f5;
  --ink-soft: #a0a0b0;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  
  /* RichLab Accent */
  --blue: #7e57c2;
  --coral: #673ab7; /* Main deep purple */
  --coral-dark: #512da8;
  --amber: #f59e0b;
  --gradient-accent: linear-gradient(135deg, #673ab7 0%, #9c27b0 100%);
  --glow: rgba(103, 58, 183, 0.4);

  --display: 'Space Grotesk', sans-serif;
  --body: 'Work Sans', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --container: 1180px;
  --radius: 16px;
  --ease: cubic-bezier(.16,.84,.44,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(circle at 15% 50%, rgba(103, 58, 183, 0.08), transparent 25%),
                    radial-gradient(circle at 85% 30%, rgba(156, 39, 176, 0.08), transparent 25%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1.1; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.15; margin-bottom: 16px; }
h3 { font-size: 1.25rem; margin-bottom: 10px; }

.eyebrow {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}

.section-sub {
  color: var(--ink-soft);
  max-width: 580px;
  font-size: 1.1rem;
}

section { padding: 110px 0; }

::selection { background: var(--coral); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* reveal on scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===========================================================
   BUTTONS
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .3s var(--ease);
}
.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 10px 25px -8px var(--glow);
  border: none;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px -8px var(--glow);
}
.btn-outline {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
  backdrop-filter: blur(5px);
}
.btn-outline:hover {
  background: var(--line-strong);
  color: #fff;
  transform: translateY(-2px);
}
.btn-small { padding: 12px 22px; font-size: .9rem; }
.btn-full { width: 100%; }

/* Language Toggle */
.lang-toggle {
  background: var(--paper-glass);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  backdrop-filter: blur(10px);
}
.lang-toggle:hover {
  background: var(--line-strong);
  color: #fff;
}

/* ===========================================================
   HEADER
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 80px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { border-radius: 8px; }
.logo-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -.02em;
}
.logo-word-accent { color: var(--blue); }

.main-nav { display: flex; gap: 36px; }
.main-nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--gradient-accent); transition: width .3s var(--ease);
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper-glass); cursor: pointer;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); margin: 0 auto; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .site-header {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .main-nav {
    position: fixed; inset: 80px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    padding: 40px 24px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform .4s var(--ease);
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a { font-size: 1.2rem; }
  .nav-toggle { display: flex; background: var(--paper); }
  .header-actions .btn-small { display: none; }
}

/* ===========================================================
   HERO
   =========================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
}
.blueprint-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: .3;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 20%, transparent 80%);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 24px 0 40px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 50px; }

.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats dt { 
  font-family: var(--display); 
  font-weight: 700; 
  font-size: 1.8rem; 
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-stats dd { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; color: var(--ink-soft); text-transform: uppercase; }

.hero-figure { display: flex; justify-content: center; position: relative; }
.hero-figure::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  background: var(--coral);
  filter: blur(120px);
  opacity: 0.15;
  z-index: 0;
}
.blueprint-device { width: 100%; max-width: 440px; height: auto; position: relative; z-index: 1; }
.bp-line { stroke: var(--blue); }
.bp-line-soft { stroke: var(--line-strong); }
.bp-fill { fill: var(--bg-alt); }
.bp-accent { stroke: var(--blue); color: var(--blue); }
.bp-accent-fill { fill: var(--coral); }
.bp-dim { stroke: var(--line-strong); }
.bp-label {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--ink-soft);
  letter-spacing: .05em;
}

@media (max-width: 950px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-figure { order: -1; max-width: 320px; margin: 0 auto; }
}

/* ===========================================================
   MARQUEE
   =========================================================== */
.marquee-section {
  padding: 32px 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.marquee { width: 100%; overflow: hidden; }
.marquee-track {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: scroll-left 30s linear infinite;
}
.marquee-track span {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===========================================================
   SERVICES — sheet cards
   =========================================================== */
.sheet-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.sheet-card {
  position: relative;
  background: var(--paper-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all .4s var(--ease);
}
.sheet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(40, 40, 55, 0.6);
}
.sheet-card::before,
.sheet-card::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border-color: var(--blue); border-style: solid; opacity: 0;
  transition: opacity .4s var(--ease);
}
.sheet-card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.sheet-card::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }
.sheet-card:hover::before,
.sheet-card:hover::after { opacity: 1; }

.sheet-number {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--coral);
  letter-spacing: .1em;
  margin-bottom: 16px;
}
.sheet-card p:not(.sheet-number) { color: var(--ink-soft); font-size: 1rem; }

/* ===========================================================
   PROCESS — timeline
   =========================================================== */
.process { background: var(--bg-alt); }
.timeline {
  list-style: none;
  margin-top: 60px;
  max-width: 720px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 29px; top: 10px; bottom: 10px;
  width: 2px;
  background: var(--line);
}
.timeline li {
  display: flex;
  gap: 28px;
  padding-bottom: 56px;
  position: relative;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline-index {
  flex: 0 0 auto;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--blue);
  z-index: 1;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.timeline p { color: var(--ink-soft); max-width: 500px; font-size: 1.05rem; }

/* ===========================================================
   WORK
   =========================================================== */
.work-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}
.work-card {
  background: var(--paper-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .4s var(--ease);
}
.work-card:hover { 
  transform: translateY(-6px); 
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
  border-color: rgba(255,255,255,0.2);
}
.work-thumb {
  height: 200px;
  background: var(--gradient-accent);
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 16px;
}
.work-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 10px);
}
.work-thumb span {
  position: relative; z-index: 2;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .12em;
  color: #fff;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 6px;
}
.work-body { padding: 28px; }
.work-tags {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.work-body p:not(.work-tags) { color: var(--ink-soft); font-size: 1rem; margin: 10px 0 20px; }
.text-link { font-weight: 600; font-size: .95rem; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.text-link:hover { color: var(--blue); }

/* ===========================================================
   ABOUT / STATS
   =========================================================== */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.stat-grid dt {
  font-family: var(--display);
  font-size: 2.8rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-grid dd {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}
@media (max-width: 900px) {
  .about-inner { grid-template-columns: 1fr; }
}

/* ===========================================================
   TESTIMONIALS
   =========================================================== */
.testimonials { background: var(--bg-alt); }
.testimonial-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.testimonial-grid blockquote {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 32px;
  border-left: 4px solid var(--blue);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}
.testimonial-grid p { font-size: 1.05rem; color: var(--ink); margin-bottom: 20px; font-style: italic; }
.testimonial-grid footer {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink-soft);
  letter-spacing: .04em;
}

/* ===========================================================
   FINAL CTA
   =========================================================== */
.final-cta {
  background: var(--paper);
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.final-cta::before {
  content: '';
  position: absolute;
  top: -50%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(103, 58, 183, 0.15) 0%, transparent 70%);
}
.final-cta-inner { text-align: center; max-width: 700px; position: relative; z-index: 2; }
.final-cta h2 { color: var(--ink); }
.final-cta p { color: var(--ink-soft); margin-bottom: 40px; font-size: 1.15rem; }

/* ===========================================================
   CONTACT
   =========================================================== */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.contact-meta {
  list-style: none;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--mono);
  font-size: .95rem;
  color: var(--ink-soft);
}
.contact-form {
  background: var(--paper-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.4);
}
.form-row { margin-bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.form-row input,
.form-row textarea {
  font-family: var(--body);
  font-size: 1rem;
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(0,0,0,0.2);
  color: var(--ink);
  transition: all .3s var(--ease);
  resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus { border-color: var(--blue); outline: none; background: rgba(0,0,0,0.4); box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.2); }
.form-row.has-error input,
.form-row.has-error textarea { border-color: var(--coral); }
.field-error {
  font-size: .8rem;
  color: #ef4444;
  min-height: 1em;
}
.form-status {
  margin-top: 16px;
  font-size: .95rem;
  font-family: var(--mono);
  min-height: 1.2em;
  text-align: center;
}
.form-status.success { color: #10b981; }

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

/* ===========================================================
   FOOTER
   =========================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-nav a { font-size: .95rem; color: var(--ink-soft); transition: color 0.3s; }
.footer-nav a:hover { color: var(--ink); }
.footer-copy { font-size: .85rem; color: var(--ink-soft); font-family: var(--mono); }

/* ===========================================================
   BACK TO TOP
   =========================================================== */
.back-to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all .3s var(--ease);
  z-index: 40;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--blue); color: #fff; border-color: var(--blue); transform: translateY(-3px); }
