/* ═══════════════════════════════════════════════════════
   MDT — MAUD'DIB TEK
   Arrakis Design System · Sand & Spice
   ═══════════════════════════════════════════════════════ */

:root {
  /* Sand palette — primary */
  --sand-00: #0A0806;
  --sand-01: #141009;
  --sand-02: #1E180F;
  --sand-03: #2E2318;
  --sand-04: #6B5033;
  --sand-05: #A8824F;
  --sand-06: #C9A96E;
  --sand-07: #DEC898;
  --sand-08: #F0E4CC;
  --sand-09: #FAF5EE;

  /* Spice purple — accent only */
  --spice-deep:  #3D1260;
  --spice:       #6527A0;
  --spice-mid:   #8B44C7;
  --spice-glow:  #A855F7;
  --spice-pale:  #D8B4FE;

  /* Semantic */
  --bg:           var(--sand-00);
  --surface:      var(--sand-01);
  --border:       rgba(201, 169, 110, 0.1);
  --border-hover: rgba(201, 169, 110, 0.25);
  --text-hi:      var(--sand-08);
  --text-mid:     var(--sand-06);
  --text-lo:      var(--sand-04);
  --text-dim:     var(--sand-03);
  --accent:       var(--spice);
  --accent-glow:  var(--spice-glow);

  /* Typography */
  --serif:  'Cormorant Garamond', 'Georgia', serif;
  --sans:   'Inter', system-ui, sans-serif;
  --mono:   'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --gutter: clamp(1.5rem, 5vw, 3rem);
  --section-v: clamp(5rem, 10vw, 9rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
ul[role="list"] { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Body ── */
body {
  background-color: var(--bg);
  color: var(--text-hi);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 9000;
}

/* ── Canvas ── */
#sand-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout helpers ── */
.section-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--section-v) var(--gutter);
}

/* ══════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.5rem var(--gutter);
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  background: rgba(10, 8, 6, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


.nav-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--sand-06); }

/* ══════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════ */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  /* Faint spice aurora at bottom */
  background:
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(101, 39, 160, 0.12) 0%, transparent 70%),
    linear-gradient(180deg, transparent 60%, rgba(10, 8, 6, 0.6) 100%);
}

.hero-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding-top: 6rem;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--spice-mid);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fade-up 0.7s ease 0.2s forwards;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.25rem, 9vw, 7.5rem);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.01em;
  color: var(--text-hi);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fade-up 0.7s ease 0.4s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--sand-06);
  text-shadow: 0 0 60px rgba(201, 169, 110, 0.25);
}

.hero-sub {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  color: var(--text-lo);
  max-width: 400px;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fade-up 0.7s ease 0.6s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sand-06);
  border: 1px solid rgba(201, 169, 110, 0.35);
  padding: 0.9rem 1.8rem;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, gap 0.2s;
  opacity: 0;
  animation: fade-up 0.7s ease 0.8s forwards;
}

.btn-primary:hover {
  background: rgba(201, 169, 110, 0.07);
  border-color: rgba(201, 169, 110, 0.6);
  box-shadow: 0 0 24px rgba(201, 169, 110, 0.08);
  gap: 0.9rem;
}

/* Hero coordinates */
.hero-coords {
  position: absolute;
  bottom: 3rem;
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  opacity: 0;
  animation: fade-in 1s ease 1.4s forwards;
}

.coord-label {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--spice-mid);
}

.coord-val {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

/* Scroll hint */
.hero-scroll {
  position: absolute;
  bottom: 3rem;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  animation: fade-in 1s ease 1.6s forwards;
}

.hero-scroll span {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-bar {
  width: 48px;
  height: 1px;
  background: var(--border);
  overflow: hidden;
}

.scroll-fill {
  width: 100%;
  height: 100%;
  background: var(--sand-05);
  transform: translateX(-100%);
  animation: scan 2.5s ease-in-out infinite 2s;
}

/* ══════════════════════════════════════════════════════
   SERVICES
   ══════════════════════════════════════════════════════ */
#services {
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.section-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--spice-mid);
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 300;
  color: var(--text-hi);
  margin-bottom: 4rem;
  line-height: 1.1;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
}

.service-card {
  padding: clamp(2rem, 4vw, 2.75rem);
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
}

.service-card:last-child { border-right: none; }

/* Spice bar on hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--spice-glow), transparent);
  transform: scaleX(0);
  transition: transform 0.45s ease;
}

.service-card:hover::before { transform: scaleX(1); }
.service-card:hover { background: rgba(101, 39, 160, 0.04); }

.card-num {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--spice-mid);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-hi);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.service-card p {
  font-size: 0.87rem;
  color: var(--text-lo);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list li {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  transition: color 0.2s, border-color 0.2s;
}

.service-card:hover .tag-list li {
  color: var(--spice-pale);
  border-color: rgba(168, 85, 247, 0.25);
}

/* ══════════════════════════════════════════════════════
   APPROACH
   ══════════════════════════════════════════════════════ */
#approach {
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(101, 39, 160, 0.07) 0%, transparent 65%);
}

.approach-quote {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 5.5rem;
}

.quote-glyph {
  position: absolute;
  left: 0;
  top: -0.75rem;
  font-family: var(--serif);
  font-size: 3.5rem;
  line-height: 1;
  color: var(--spice-mid);
  opacity: 0.5;
}

blockquote {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-style: italic;
  font-weight: 300;
  color: var(--text-hi);
  line-height: 1.55;
  max-width: 680px;
}

.approach-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.5rem;
}

.pillar {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  transition: border-color 0.3s;
}

.pillar:hover { border-color: rgba(168, 85, 247, 0.3); }

.pillar-mark {
  display: block;
  font-size: 1rem;
  color: var(--spice-mid);
  margin-bottom: 1.1rem;
}

.pillar h3 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sand-06);
  margin-bottom: 0.75rem;
}

.pillar p {
  font-size: 0.87rem;
  color: var(--text-lo);
  line-height: 1.75;
}

/* ══════════════════════════════════════════════════════
   STACK
   ══════════════════════════════════════════════════════ */
#stack {
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.stack-grid {
  display: flex;
  flex-direction: column;
}

.stack-row {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.stack-row:first-child { border-top: 1px solid var(--border); }

.stack-row:hover {
  background: rgba(201, 169, 110, 0.02);
}

.stack-cat {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--spice-mid);
  white-space: nowrap;
}

.stack-items {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-lo);
  letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════════
   CONTACT
   ══════════════════════════════════════════════════════ */
#contact {
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(101, 39, 160, 0.1) 0%, transparent 65%);
}

#contact .section-inner {
  text-align: center;
}

#contact .section-eyebrow { display: block; }
#contact .section-title { margin-left: auto; margin-right: auto; }

.contact-sub {
  font-size: 0.95rem;
  color: var(--text-lo);
  margin-top: -2.5rem;
  margin-bottom: 4rem;
}

.contact-block {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--border);
  max-width: 780px;
  margin: 0 auto 3rem;
}

.contact-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 2rem;
}

.contact-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.contact-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--spice-mid);
}

.contact-val {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--sand-06);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

a.contact-val:hover { color: var(--sand-08); }

.contact-plain { color: var(--text-lo); cursor: default; }

.contact-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-dim);
  cursor: default;
}

.soon-tag {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--spice-mid);
  border: 1px solid rgba(139, 68, 199, 0.35);
  padding: 0.1rem 0.4rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}

.contact-link {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s;
}

.contact-link:hover { color: var(--sand-06); }

/* ══════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════ */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--sand-06);
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.footer-tag {
  font-family: var(--serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-dim);
}

/* ══════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scan {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings */
.service-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.service-card.reveal:nth-child(3) { transition-delay: 0.2s; }
.pillar.reveal:nth-child(2) { transition-delay: 0.1s; }
.pillar.reveal:nth-child(3) { transition-delay: 0.2s; }
.stack-row.reveal:nth-child(2)  { transition-delay: 0.05s; }
.stack-row.reveal:nth-child(3)  { transition-delay: 0.10s; }
.stack-row.reveal:nth-child(4)  { transition-delay: 0.15s; }
.stack-row.reveal:nth-child(5)  { transition-delay: 0.20s; }
.stack-row.reveal:nth-child(6)  { transition-delay: 0.25s; }
.stack-row.reveal:nth-child(7)  { transition-delay: 0.30s; }
.stack-row.reveal:nth-child(8)  { transition-delay: 0.35s; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-logo-img { height: 28px; }
  .nav-links { gap: 1.5rem; }

  .hero-coords { display: none; }

  .services-grid { grid-template-columns: 1fr; }
  .service-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .service-card:last-child { border-bottom: none; }

  .approach-pillars { grid-template-columns: 1fr; gap: 2rem; }

  .stack-row { grid-template-columns: 7rem 1fr; gap: 1rem; }

  .contact-block {
    flex-direction: column;
    text-align: left;
  }
  .contact-divider { width: 100%; height: 1px; }
  .contact-soon { justify-content: flex-start; }

  .footer-inner { flex-direction: column; text-align: center; gap: 0.5rem; }
  .footer-tag { display: none; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }

  .approach-quote { padding-left: 1.75rem; }

  blockquote { font-size: 1.1rem; }

  .stack-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .stack-cat { color: var(--spice-mid); }
}

/* ── Focus styles ── */
:focus-visible {
  outline: 2px solid var(--spice-glow);
  outline-offset: 3px;
  border-radius: 2px;
}
