:root {
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-deep: #7c3aed;
  --bg-dark: #0f0f1a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(167, 139, 250, 0.35);
  --color-error: #f87171;
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 720px;
  --max-width-wide: 1080px;
  --section-spacing: 100px;
  --section-spacing-mobile: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Ambient gradient glows — the live site's signature */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse at 20% 15%, rgba(139, 92, 246, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 82% 85%, rgba(59, 130, 246, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.10) 0%, transparent 65%);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 20;
}

.container.wide {
  max-width: var(--max-width-wide);
}

section {
  padding: var(--section-spacing-mobile) 0;
  position: relative;
}

@media (min-width: 768px) {
  body {
    font-size: 18px;
  }
  section {
    padding: var(--section-spacing) 0;
  }
}

/* Logo */
.site-logo {
  position: fixed;
  top: 22px;
  left: 28px;
  font-family: var(--font-stack);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  z-index: 30;
  transition: opacity 0.2s ease;
}

.site-logo span {
  color: var(--primary-light);
}

.site-logo:hover {
  opacity: 0.85;
}

/* Typography */
h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
  max-width: 640px;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.625rem;
  margin-bottom: 2rem;
}

h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  h1 {
    font-size: 2.75rem;
  }
  h2 {
    font-size: 2rem;
  }
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

/* Hero */
.hero {
  padding-top: 140px;
  padding-bottom: var(--section-spacing-mobile);
}

@media (min-width: 768px) {
  .hero {
    padding-top: 180px;
    padding-bottom: var(--section-spacing);
  }
}

.hero-sub {
  color: var(--text-secondary);
  max-width: 560px;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.cta-link {
  display: inline-block;
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
  padding: 12px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.cta-link:hover,
.cta-link:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.2);
}

/* Section ledes */
.section-lede {
  color: var(--text-secondary);
  max-width: 640px;
  margin-top: -1rem;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* Glass cards */
.cards {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 32px 28px;
  position: relative;
  z-index: 20;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.18);
}

.card h3 {
  color: var(--primary-light);
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-secondary);
}

/* Work */
.work-example {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.work-example:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.work-example h3 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.about p {
  max-width: 600px;
}

/* Pull quote */
.pullquote-section {
  padding: var(--section-spacing-mobile) 0;
}

@media (min-width: 768px) {
  .pullquote-section {
    padding: calc(var(--section-spacing) * 0.6) 0;
  }
}

.pullquote {
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

@media (min-width: 768px) {
  .pullquote {
    font-size: 1.5rem;
  }
}

/* Process steps */
.process .steps {
  display: grid;
  gap: 32px;
}

.step h3 {
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

/* Form */
.contact h2 {
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-stack);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  position: relative;
  z-index: 20;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

textarea {
  resize: vertical;
}

button[type="submit"] {
  width: 100%;
  padding: 15px 20px;
  font-family: var(--font-stack);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
  position: relative;
  z-index: 20;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.45);
}

button[type="submit"]:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-error {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  min-height: 0;
}

.form-error:empty {
  margin-bottom: 0;
}

.form-success {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  padding: 24px;
  color: var(--primary-light);
  font-weight: 600;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 20;
}

.form-success p {
  margin: 0;
  color: var(--primary-light);
}

.form-note {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

footer {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
}

footer p {
  margin: 0;
  color: var(--text-muted);
}

.footer-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--primary-light);
}

/* Pinstripe overlay — kept from the cream version, re-tuned for dark */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.08) 0 1px,
      transparent 1px 32px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.08) 0 1px,
      transparent 1px 32px
    );
  -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.85) 100%);
          mask-image: linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.85) 100%);
  -webkit-mask-size: 220% 220%;
          mask-size: 220% 220%;
  -webkit-mask-position: 0% 0%;
          mask-position: 0% 0%;
  animation: pinstripe-drift 48s ease-in-out infinite alternate;
  animation-delay: -24s;
}

@keyframes pinstripe-drift {
  from {
    -webkit-mask-position: 0% 0%;
            mask-position: 0% 0%;
  }
  to {
    -webkit-mask-position: 100% 100%;
            mask-position: 100% 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}
