/* ========================================
   BNS Consulting — Light + grid identity
   Inspired by kern.technology grid technique
   ======================================== */

/* JetBrains Mono — locally hosted (GDPR compliant) */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces — stone-tinted neutrals */
  --bg-page: #ffffff;
  --bg-alt: #fafaf9;       /* stone-50 — slightly off-white sections */
  --bg-card: #ffffff;

  /* Text */
  --text-primary: #1c1917;  /* stone-900 */
  --text-secondary: #44403c;/* stone-700 */
  --text-tertiary: #57534e; /* stone-600 */
  --text-muted: #78716c;    /* stone-500 */

  /* Lines / borders */
  --grid-color: #e7e5e4;        /* stone-200 — matches kern */
  --border-soft: #e7e5e4;       /* stone-200 */
  --border-strong: #d6d3d1;     /* stone-300 */

  /* Accent (gold preserved from previous identity) */
  --accent: #d4af37;
  --accent-strong: #b8941f;
  --accent-dim: rgba(212, 175, 55, 0.5);
  --accent-bg: rgba(212, 175, 55, 0.10);

  /* Typography */
  --font-sans: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', monospace;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', monospace;

  /* Layout */
  --space: 1rem;
  --max-width: 1100px;
  --measure: 65ch;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-page);
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--space) * 2);
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--accent);
  color: #1c1917;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: calc(var(--space) * 2.5);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space);
  letter-spacing: -0.005em;
}

p {
  color: var(--text-tertiary);
  line-height: 1.7;
}

.accent {
  color: var(--accent);
}

em {
  color: var(--text-primary);
  font-style: italic;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
}

.prose p + p {
  margin-top: calc(var(--space) * 1.25);
}

/* ========================================
   Kern-style dashed grid backdrop
   ======================================== */
.grid-bg {
  position: relative;
  overflow: hidden;
}

.grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 0 0;
  -webkit-mask-image:
    repeating-linear-gradient(to right, #000 0px, #000 3px, transparent 3px, transparent 8px),
    repeating-linear-gradient(to bottom, #000 0px, #000 3px, transparent 3px, transparent 8px),
    radial-gradient(ellipse 80% 80% at var(--grid-focus, 50% 0%), #000 55%, transparent 100%);
  mask-image:
    repeating-linear-gradient(to right, #000 0px, #000 3px, transparent 3px, transparent 8px),
    repeating-linear-gradient(to bottom, #000 0px, #000 3px, transparent 3px, transparent 8px),
    radial-gradient(ellipse 80% 80% at var(--grid-focus, 50% 0%), #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  pointer-events: none;
  z-index: 0;
}

/* Apply grid behind hero + alternating sections, vary focal point */
.hero               { --grid-focus: 80% 30%; }
section.shift       { --grid-focus: 100% 50%; }
section.method      { --grid-focus: 0% 50%; }
section.case-studies{ --grid-focus: 50% 100%; }

.hero,
section.shift,
section.method,
section.case-studies {
  position: relative;
  overflow: hidden;
  background: var(--bg-page);
}

.hero::before,
section.shift::before,
section.method::before,
section.case-studies::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 0 0;
  -webkit-mask-image:
    repeating-linear-gradient(to right, #000 0px, #000 3px, transparent 3px, transparent 8px),
    repeating-linear-gradient(to bottom, #000 0px, #000 3px, transparent 3px, transparent 8px),
    radial-gradient(ellipse 80% 80% at var(--grid-focus), #000 55%, transparent 100%);
  mask-image:
    repeating-linear-gradient(to right, #000 0px, #000 3px, transparent 3px, transparent 8px),
    repeating-linear-gradient(to bottom, #000 0px, #000 3px, transparent 3px, transparent 8px),
    radial-gradient(ellipse 80% 80% at var(--grid-focus), #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 100;
  padding: calc(var(--space) * 1.1) 0;
}

.nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space);
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-brand:hover {
  color: var(--accent-strong);
}

.nav-links {
  display: flex;
  gap: calc(var(--space) * 2);
}

.nav-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links .active {
  color: var(--accent-strong);
}

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: calc(var(--space) * 0.35);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lang-toggle .lang-current {
  color: var(--accent-strong);
  font-weight: 600;
}

.lang-toggle .lang-sep {
  color: var(--border-strong);
}

.lang-toggle .lang-link {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

.lang-toggle .lang-link:hover {
  color: var(--text-primary);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  min-height: 78vh;
  display: flex;
  align-items: center;
  padding: calc(var(--space) * 9) 0 calc(var(--space) * 5);
  margin-top: 60px;
}

.hero-title {
  font-size: clamp(2.3rem, 5.5vw, 4rem);
  font-weight: 700;
  margin-bottom: calc(var(--space) * 1.5);
  letter-spacing: -0.028em;
  line-height: 1.05;
  max-width: 18ch;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: calc(var(--space) * 2);
  max-width: 38ch;
  line-height: 1.4;
}

.hero-lede {
  font-size: 1.0rem;
  color: var(--text-tertiary);
  margin-bottom: calc(var(--space) * 3);
  max-width: 60ch;
  line-height: 1.7;
}

/* ========================================
   Section frame
   ======================================== */
section {
  padding: calc(var(--space) * 6) 0;
  position: relative;
}

section.offer,
section.background,
section.contact {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.section-title {
  text-align: left;
  margin-bottom: calc(var(--space) * 1.25);
  position: relative;
  padding-left: calc(var(--space) * 1.5);
  color: var(--text-primary);
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent);
  border-radius: 1px;
}

.section-intro {
  color: var(--text-tertiary);
  font-size: 1rem;
  margin-bottom: calc(var(--space) * 3);
  max-width: var(--measure);
}

/* ========================================
   Offer cards
   ======================================== */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: calc(var(--space) * 2);
}

.offer-grid:has(> .offer-card:only-child) {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.offer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: calc(var(--space) * 2.25);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.offer-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(28, 25, 23, 0.12);
}

.offer-card h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-bottom: calc(var(--space) * 0.75);
}

.offer-for {
  color: var(--text-tertiary);
  font-size: 0.95rem;
  margin-bottom: calc(var(--space) * 1.5);
  padding-bottom: calc(var(--space) * 1.5);
  border-bottom: 1px solid var(--border-soft);
}

.offer-spec {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr;
  gap: calc(var(--space) * 0.5) calc(var(--space) * 1.25);
  align-items: baseline;
}

.offer-spec dt {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding-top: 0.15em;
}

.offer-spec dd {
  color: var(--text-tertiary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ========================================
   Method (4 steps)
   ======================================== */
.method-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--space) * 2);
}

@media (max-width: 968px) {
  .method-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 568px) {
  .method-grid {
    grid-template-columns: 1fr;
  }
}

.method-step {
  position: relative;
  padding-left: calc(var(--space) * 2.5);
}

.method-number {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-strong);
  font-weight: 700;
}

.method-step h3 {
  font-size: 1.15rem;
  margin-bottom: calc(var(--space) * 0.5);
}

.method-step p {
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ========================================
   Background
   ======================================== */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space) * 0.75);
  margin-top: calc(var(--space) * 2.5);
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

.trust-badge {
  display: inline-block;
  padding: calc(var(--space) * 0.5) calc(var(--space) * 1);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.trust-badge:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent-strong);
}

/* ========================================
   Case studies
   ======================================== */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: calc(var(--space) * 1.5);
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: calc(var(--space) * 2);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.case-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 12px 24px -12px rgba(28, 25, 23, 0.10);
}

.case-card h3 {
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-bottom: calc(var(--space) * 1.25);
  padding-bottom: calc(var(--space) * 0.75);
  border-bottom: 1px solid var(--border-soft);
  text-wrap: balance;
  hyphens: auto;
}

.case-card dl {
  display: grid;
  gap: calc(var(--space) * 0.75);
}

.case-card dt {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: calc(var(--space) * 0.2);
}

.case-card dd {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.case-card dd.placeholder {
  color: var(--accent-strong);
  font-style: italic;
}

/* ========================================
   Contact
   ======================================== */
.contact-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.contact-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: calc(var(--space) * 1.25);
  color: var(--text-tertiary);
}

.contact-intro:last-of-type {
  margin-bottom: calc(var(--space) * 3);
}

.contact-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: calc(var(--space) * 1.5);
  margin-bottom: calc(var(--space) * 3);
  text-align: left;
}

.contact-method {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: calc(var(--space) * 1.25);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: block;
}

a.contact-method:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 8px 16px -8px rgba(28, 25, 23, 0.08);
}

.contact-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: calc(var(--space) * 0.35);
}

.contact-value {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.cta-button {
  background: var(--text-primary);
  color: #ffffff;
  border: 1px solid var(--text-primary);
  border-radius: 6px;
  padding: calc(var(--space) * 0.85) calc(var(--space) * 2.25);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.cta-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(28, 25, 23, 0.25);
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: calc(var(--space) * 3) 0 calc(var(--space) * 2);
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
}

.footer-certifications {
  display: flex;
  justify-content: center;
  gap: calc(var(--space) * 1.5);
  margin-bottom: calc(var(--space) * 2);
  padding-bottom: calc(var(--space) * 2);
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.footer-cert {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: color 0.2s;
}

.footer-cert-link {
  text-decoration: none;
}

.footer-cert-link:hover {
  color: var(--accent-strong);
}

.footer-linkedin {
  color: var(--accent-strong);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-linkedin:hover {
  color: var(--text-primary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: calc(var(--space) * 2);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ========================================
   Legal pages (Impressum/Datenschutz)
   ======================================== */
.legal-page {
  padding-top: calc(var(--space) * 8);
  padding-bottom: calc(var(--space) * 6);
  background: var(--bg-page);
  min-height: 100vh;
}

.legal-page .container {
  max-width: 800px;
}

.legal-page h1 {
  font-size: 2.25rem;
  color: var(--text-primary);
  margin-bottom: calc(var(--space) * 2);
  font-weight: 700;
  padding-bottom: calc(var(--space) * 1);
  border-bottom: 1px solid var(--border-soft);
}

.legal-page h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-top: calc(var(--space) * 4);
  margin-bottom: calc(var(--space) * 1.5);
  padding-left: 0;
}

.legal-page h2::before {
  display: none;
}

.legal-page h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-top: calc(var(--space) * 2.5);
  margin-bottom: calc(var(--space) * 0.85);
  font-weight: 600;
}

.legal-page h4 {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: calc(var(--space) * 2);
  margin-bottom: calc(var(--space) * 0.75);
  font-weight: 500;
}

.legal-page p {
  color: var(--text-tertiary);
  line-height: 1.8;
  margin-bottom: calc(var(--space) * 1.25);
  font-size: 0.95rem;
}

.legal-page ul {
  margin-left: calc(var(--space) * 1.5);
  margin-bottom: calc(var(--space) * 1.25);
  color: var(--text-tertiary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.legal-page a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.2s;
}

.legal-page a:hover {
  border-bottom-color: var(--accent);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav .container {
    justify-content: space-between;
  }

  section {
    padding: calc(var(--space) * 4) 0;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .offer-spec {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .offer-spec dt {
    margin-top: var(--space);
  }
}
