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

/* ── Variables ── */
:root {
  --color-bg: #0a0a0a;
  --color-bg-elevated: #141414;
  --color-bg-subtle: #1a1a1a;
  --color-surface: #222222;
  --color-text: #e8e8e8;
  --color-text-muted: #888888;
  --color-text-dim: #555555;
  --color-accent: #e8a317;
  --color-accent-hover: #f5ba3b;
  --color-accent-dim: #92400e;
  --color-accent-glow: rgba(232, 163, 23, 0.15);
  --color-grid: #1a1a1a;
  --color-grid-accent: #2a2a2a;
  --color-border: #2a2a2a;
  --font-heading: "Syne", sans-serif;
  --font-body: "Outfit", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --font-logo: "Doto", monospace;
  --header-height: 4rem;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px),
    linear-gradient(var(--color-grid-accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid-accent) 1px, transparent 1px);
  background-size:
    20px 20px,
    20px 20px,
    80px 80px,
    80px 80px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip to content ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus {
  top: 0.5rem;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Typography ── */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
}
h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
}
h2::before {
  content: "// ";
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-weight: 400;
}

/* ── Section ── */
section {
  padding: 3.75rem 0;
}
.section-alt {
  background-color: var(--color-bg-subtle);
}

/* ── Scroll animations (only when JS is active) ── */
.js .fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.js .fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}
.header.scrolled {
  background-color: rgba(20, 20, 20, 0.1);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 1px 0 var(--color-border);
}
.header .container {
  display: flex;
  align-items: center;
  height: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--color-text);
}
.logo svg {
  width: 32px;
  height: 32px;
}
.logo-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}
.header .lang-switch {
  margin-left: 2rem;
}
.nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover,
.nav a:focus {
  color: var(--color-text);
}
.nav-cta {
  background: var(--color-accent);
  color: var(--color-bg) !important;
  padding: 0.5rem 1.25rem;
  font-weight: 500 !important;
  font-size: 0.875rem;
  transition: background-color 0.2s !important;
}
.nav-cta:hover,
.nav-cta:focus {
  background: var(--color-accent-hover);
  color: var(--color-bg) !important;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition:
    transform 0.3s,
    opacity 0.3s;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Language switch ── */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
}
.lang-switch-active,
.lang-switch-link {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.125rem 0.125rem;
  text-decoration: none;
  line-height: 1;
}
.lang-switch-active {
  color: var(--color-text);
}
.lang-switch-link {
  color: var(--color-text-dim) !important;
  transition: color 0.2s ease;
}
.lang-switch-link:hover,
.lang-switch-link:focus {
  color: var(--color-text) !important;
}
.lang-switch > :nth-child(2)::before {
  content: "/";
  color: var(--color-text-dim);
  font-weight: 400;
  margin: 0 0.125rem;
}

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
}
.hero-content {
  max-width: 880px;
}
.hero-company {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}
.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.hero-lead {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}
.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-accent-hover);
}
.btn-secondary {
  display: inline-block;
  color: var(--color-accent);
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  transition:
    border-color 0.2s,
    color 0.2s;
}
.btn-secondary:hover,
.btn-secondary:focus {
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
}
.hero-metrics {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}
.metric {
  display: flex;
  flex-direction: column;
}
.metric-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}
.metric-label {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  font-family: var(--font-mono);
}

/* Hero staggered animation */
.hero-content .hero-kicker,
.hero-content h1,
.hero-content .hero-lead,
.hero-content .hero-ctas,
.hero-content .hero-metrics {
  animation: fadeUp 0.6s ease both;
}
.hero-content .hero-kicker {
  animation-delay: 0.1s;
}
.hero-content h1 {
  animation-delay: 0.3s;
}
.hero-content .hero-lead {
  animation-delay: 0.5s;
}
.hero-content .hero-ctas {
  animation-delay: 0.7s;
}
.hero-content .hero-metrics {
  animation-delay: 0.9s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Services ── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.service-card {
  background: var(--color-bg-elevated);
  border-left: 3px solid var(--color-accent);
  padding: 2rem;
}
.service-number {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}
.service-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  min-height: 2.4em;
  margin-bottom: 0.75rem;
}
.service-card p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.service-card:nth-child(1) {
  transition-delay: 0s;
}
.service-card:nth-child(2) {
  transition-delay: 0.05s;
}
.service-card:nth-child(3) {
  transition-delay: 0.1s;
}
.service-card:nth-child(4) {
  transition-delay: 0.15s;
}

/* ── Process ── */
.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  position: relative;
}
.process-step {
  position: relative;
  padding-left: 2rem;
  border-left: 2px dashed var(--color-border);
  padding-bottom: 0.5rem;
}
.process-step::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
}
.process-step-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}
.process-step h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.process-step p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ── References ── */
.reference-card {
  background: var(--color-bg-elevated);
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}
.reference-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.reference-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
.reference-role {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}
.reference-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.reference-col h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}
.reference-col p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.reference-col.impact {
  border-top: 3px solid var(--color-accent);
  padding-top: 1rem;
}
.reference-col.impact h4 {
  color: var(--color-accent);
}

/* ── Tech Stack ── */
.tech-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.tech-category {
  margin-bottom: 2rem;
}
.tech-category-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 0.75rem;
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.375rem 0.875rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    color 0.2s;
}
.tech-tag:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent-glow);
  color: var(--color-text);
}

/* ── Contact ── */
.contact-section {
  text-align: center;
}
.contact-section h2 {
  display: inline-block;
}
.contact-lead {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.contact-cta {
  margin-bottom: 3rem;
}
.contact-cta .btn-primary {
  font-size: 1.125rem;
  padding: 1rem 2.5rem;
}
.contact-details {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.contact-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.contact-link:hover,
.contact-link:focus {
  color: var(--color-accent);
}
.contact-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Footer ── */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}
footer p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

/* ── Focus styles ── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Responsive: 768px+ ── */
@media (min-width: 768px) {
  .container {
    padding: 0 2.5rem;
  }
  h2 {
    font-size: 2.5rem;
  }
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }
  .process-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  .reference-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .reference-col.impact {
    border-top: none;
    padding-top: 0;
    border-left: 3px solid var(--color-accent);
    padding-left: 1rem;
    margin: -1rem;
    padding: 1rem;
  }
  .tech-tags {
    gap: 0.625rem;
  }
  .tech-grid {
    grid-template-columns: auto auto;
    column-gap: 4rem;
    justify-content: start;
  }
}

/* ── Responsive: 1024px+ ── */
@media (min-width: 1024px) {
  .container {
    padding: 0 3.75rem;
  }
  .process-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }
  .process-step {
    border-left: none;
    border-top: 2px dashed var(--color-border);
    padding-left: 0;
    padding-top: 2rem;
    padding-right: 1.5rem;
  }
  .process-step::before {
    left: 0;
    top: -7px;
  }
}

/* ── Mobile nav ── */
@media (max-width: 767px) {
  .hamburger {
    display: block;
  }
  .logo-text {
    display: none;
  }
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg-elevated);
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
    margin-left: 0;
  }
  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav a {
    font-size: 1rem;
  }
  .nav-cta {
    text-align: center;
  }
  .header .lang-switch {
    margin-left: auto;
  }
  .hamburger {
    margin-left: 0.75rem;
  }
  .hero-company {
    display: block;
  }
  .hero-metrics {
    gap: 2rem;
  }
  .hero-kicker {
    margin-top: 2rem;
  }
}

/* ── Responsive: 1440px+ ── */
@media (min-width: 1920px) {
  html {
    font-size: 17px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .js .fade-up {
    opacity: 1;
    transform: none;
  }
}
