/* Koudelka Engineering & Consulting — portfolio
   Clean corporate: navy + steel on off-white, technical mono accents. */

:root {
  --navy: #1e3a5f;
  --navy-700: #16304f;
  --navy-900: #0f2540;
  --steel: #7c8790;
  --steel-300: #aab2b9;
  --bg: #f5f5f2;
  --surface: #ffffff;
  --ink: #1a2432;
  --muted: #5c6773;
  --line: #e4e3dd;
  --accent: #2e6da4;
  --maxw: 1120px;
  --radius: 6px;
  --shadow: 0 10px 30px -14px rgba(15, 37, 64, 0.28);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Archivo", "Inter", sans-serif;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--navy-900);
  font-weight: 700;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

section { padding: 5.5rem 0; }
section:nth-child(even) { background: var(--surface); }

/* Eyebrow / section labels — technical spec-sheet feel */
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin: 0.9rem 0 0; }
.section-intro { color: var(--muted); max-width: 46rem; margin-top: 1rem; font-size: 1.05rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 245, 242, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { height: 38px; width: 38px; object-fit: contain; }
.brand-text { font-family: "Archivo", sans-serif; font-weight: 700; color: var(--navy-900); font-size: 1.05rem; letter-spacing: 0.01em; }
.brand-text span { color: var(--steel); font-weight: 600; }
.nav-ctrl { display: flex; align-items: center; gap: 1rem; }
.brand-banner { display: none; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang-toggle button {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.35rem 0.7rem; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--navy-900); }

.header-socials { display: flex; align-items: center; gap: 0.45rem; }
.header-socials a {
  display: grid; place-items: center;
  width: 1.7rem; height: 1.7rem; border-radius: 999px;
  background: var(--navy); color: #fff; transition: background 0.15s;
}
.header-socials a:hover { background: var(--navy-700); text-decoration: none; }
/* optically balance the two marks (the LinkedIn "in" reads heavier) */
.header-socials svg { width: 0.92rem; height: 0.92rem; }
.header-socials a[aria-label="LinkedIn"] svg { width: 0.8rem; height: 0.8rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.95rem;
  padding: 0.7rem 1.3rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-ghost { background: transparent; color: var(--navy-900); border-color: var(--steel-300); }
.btn-ghost:hover { border-color: var(--navy); }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 5rem; }
.hero .container { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; align-items: center; }
.hero-name { font-family: "IBM Plex Mono", monospace; color: var(--accent); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.82rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-top: 1rem; }
.hero-tagline {
  font-family: "Archivo", sans-serif; font-style: italic; font-weight: 600;
  color: var(--navy); font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-top: 1.5rem; padding-left: 1rem; border-left: 3px solid var(--accent);
}
.hero-sub { color: var(--muted); font-size: 1.08rem; margin-top: 1.5rem; max-width: 34rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

.hero-banner {
  grid-column: 1 / -1; order: -2;
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-figure { position: relative; }
.hero-figure img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-figure .caption {
  position: absolute; left: 1rem; bottom: 1rem;
  background: rgba(15, 37, 64, 0.9); color: #fff;
  font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; letter-spacing: 0.06em;
  padding: 0.4rem 0.75rem; border-radius: 4px;
}

/* ---------- Stats ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.stats .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.stat { text-align: center; }
.stat .num { font-family: "Archivo", sans-serif; font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--navy); }
.stat .label { font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 0.3rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; margin-top: 2.5rem; align-items: start; }
.about-text p { margin-top: 1.1rem; color: #34404d; }
.about-text p:first-child { margin-top: 0; }
.about-photo { float: left; width: 190px; margin: 1.4rem 1.6rem 0.8rem 0; }
.about-photo img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.about-photo figcaption {
  font-family: "IBM Plex Mono", monospace; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--steel);
  margin-top: 0.55rem; text-align: center;
}
.skills-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; position: sticky; top: 90px; }
.skills-card h3 { font-size: 1.05rem; font-family: "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); }
.skills-card ul { list-style: none; margin-top: 1rem; }
.skills-card li { padding: 0.55rem 0 0.55rem 1.5rem; position: relative; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.skills-card li:first-of-type { border-top: 0; }
.skills-card li::before { content: "▪"; color: var(--accent); position: absolute; left: 0; }

/* ---------- Clients ---------- */
.clients { text-align: center; }
.client-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 2rem; }
.client-list span {
  font-family: "Archivo", sans-serif; font-weight: 700; letter-spacing: 0.02em;
  color: var(--navy-900); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.6rem 1.3rem; font-size: 1rem;
}

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
.service {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; transition: border-color 0.15s, transform 0.15s;
}
.service:hover { border-color: var(--navy); transform: translateY(-3px); }
.service .no { font-family: "IBM Plex Mono", monospace; color: var(--steel-300); font-size: 0.85rem; font-weight: 600; }
.service h3 { font-size: 1.15rem; margin-top: 0.5rem; }
.service p { color: var(--muted); font-size: 0.92rem; margin-top: 0.5rem; }

/* ---------- References ---------- */
.video-wrap { margin-top: 2.5rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); aspect-ratio: 16/9; background: #000; }
.video-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-facade { position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; display: block; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.82; transition: opacity 0.2s; }
.video-facade:hover img { opacity: 1; }
.play-btn {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px;
  display: grid; place-items: center; border-radius: 999px;
  background: rgba(30, 58, 95, 0.92); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, transform 0.15s;
}
.video-facade:hover .play-btn { background: var(--accent); transform: scale(1.06); }
.play-btn svg { width: 30px; height: 30px; fill: #fff; margin-left: 4px; }
.video-note { margin-top: 0.8rem; font-size: 0.9rem; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2rem; }
.gallery figure {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); cursor: zoom-in;
}
.gallery img { aspect-ratio: 3/2; object-fit: cover; transition: transform 0.35s; }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.5rem 1rem 0.8rem; color: #fff; font-weight: 600; font-size: 0.95rem;
  background: linear-gradient(transparent, rgba(15, 37, 64, 0.85));
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(10, 20, 34, 0.92); align-items: center; justify-content: center; padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: var(--radius); }
.lightbox .lb-caption { position: absolute; bottom: 1.5rem; left: 0; right: 0; text-align: center; color: #fff; font-family: "IBM Plex Mono", monospace; font-size: 0.85rem; }
.lightbox .lb-close { position: absolute; top: 1.2rem; right: 1.5rem; background: none; border: 0; color: #fff; font-size: 2.2rem; cursor: pointer; line-height: 1; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 2.5rem; }
.contact-list { list-style: none; }
.contact-list li { display: flex; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.contact-list li:first-child { border-top: 0; }
.contact-list .k { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--steel); min-width: 6.5rem; padding-top: 0.15rem; }
.contact-list .v { color: var(--ink); font-weight: 500; }
.placeholder { border-bottom: 1px dashed var(--steel-300); cursor: help; }
.placeholder-note {
  font-size: 0.82rem; color: #8a6d3b; background: #fdf6e3; border: 1px solid #efe3c0;
  border-radius: var(--radius); padding: 0.7rem 1rem; margin-top: 1.5rem;
}
.contact-panel { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 2rem; }
.contact-panel h3 { color: #fff; font-size: 1.4rem; }
.contact-panel p { color: #c7d4e2; margin-top: 0.7rem; }
.contact-panel .btn-primary { background: #fff; color: var(--navy); margin-top: 1.5rem; }
.contact-panel .btn-primary:hover { background: #e8eef4; }
.contact-panel .socials { display: flex; gap: 1rem; margin-top: 1.2rem; }
.contact-panel .socials a { color: #fff; font-weight: 600; text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #b9c4d1; padding: 3rem 0; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; }
.site-footer a { color: #dbe4ee; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: 0.9rem; align-items: center; }

/* ---------- Legal pages (Impressum / Datenschutz) ---------- */
.legal-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 245, 242, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.legal-topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.legal-page .brand { display: flex; }
.legal-back { font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; }
.legal-back:hover { color: var(--accent); text-decoration: none; }
.legal-topbar .nav-ctrl { position: static; }

.legal { padding: 3.5rem 0 4.5rem; }
.legal .container { max-width: 800px; }
.legal h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-top: 0.6rem; }
.legal h2 {
  font-family: "IBM Plex Mono", monospace; font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy);
  margin-top: 2.4rem;
}
.legal p, .legal li { color: #34404d; margin-top: 0.85rem; line-height: 1.7; }
.legal ul { margin-top: 0.85rem; padding-left: 1.2rem; }
.legal li { margin-top: 0.35rem; }
.legal address { font-style: normal; }
.legal .lead { font-size: 1.05rem; color: var(--muted); }
.legal .placeholder-note { margin-top: 1.6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { padding-top: 2.25rem; }
  .hero .container, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .stats .container { grid-template-columns: repeat(2, 1fr); }
  .services-grid, .gallery { grid-template-columns: repeat(2, 1fr); }
  .skills-card { position: static; }

  /* Mobile: the banner IS the header (full-bleed, controls overlaid) */
  .site-header { position: relative; }
  .nav { display: block; position: relative; height: auto; padding: 0; max-width: none; }
  .brand { display: none; }
  .brand-banner { display: block; }
  .brand-banner img { width: 100%; display: block; }
  .hero-banner { display: none; }
  .nav-ctrl {
    position: absolute; bottom: 0.55rem; right: 0.55rem; left: auto; top: auto; z-index: 60;
    gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end;
  }
  /* socials sit on their own row above the DE/EN + menu row */
  .header-socials { order: -1; flex-basis: 100%; justify-content: flex-end; }
  /* light chips (navy glyph) so they read on the dark banner, like the other controls */
  .header-socials a {
    background: rgba(245, 245, 242, 0.92); backdrop-filter: blur(6px);
    color: var(--navy); box-shadow: 0 2px 8px rgba(15, 37, 64, 0.25);
  }
  .header-socials a:hover { background: #fff; }
  /* DE/EN keeps its own blue/white toggle; only the menu button gets a chip */
  .nav-ctrl .nav-toggle {
    display: grid; place-items: center;
    width: 2.15rem; height: 2.15rem; padding: 0;
    background: rgba(245, 245, 242, 0.92); backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(15, 37, 64, 0.3);
    border-radius: 999px; color: var(--navy-900);
  }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; z-index: 55;
    flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0.5rem 1.5rem 1rem;
  }
  .nav-links.open a { padding: 0.7rem 0; border-top: 1px solid var(--line); }
  .nav-toggle { display: block; }
}
@media (max-width: 520px) {
  section { padding: 3.5rem 0; }
  .services-grid, .gallery, .stats .container { grid-template-columns: 1fr; }
  .about-photo { float: none; width: 62%; max-width: 220px; margin: 0 auto 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}
