/* =========================================================
   Phobos Construction Analysis — v2
   Mobile-first stylesheet
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --ink: #010101;
  --ink-soft: #4b4b4b;
  --muted: #6b6b6b;
  --line: #e3e3e3;
  --bg: #ffffff;
  --bg-alt: #f6f7f8;
  --dark: #000000;
  --dark-soft: #999999;
  --accent: #6da8f5;

  --font-display: "Titillium Web", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --band-h: 64px;        /* white logo band */
  --navbar-h: 0px;       /* black nav bar — desktop only */
  --header-h: 64px;      /* height that actually sticks */
  --logo-h: 34px;
  --gutter: clamp(1.25rem, 5vw, 2rem);
  --measure: 68ch;
  --wrap: 1200px;

  --radius: 2px;
  --ease: cubic-bezier(0.25, 0.8, 0.35, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg { display: block; max-width: 100%; }

img { height: auto; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

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

ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 10vw, 6.5rem);
}

.section--alt { background: var(--bg-alt); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2rem);
  margin-bottom: clamp(2rem, 6vw, 3rem);
}

.section-head::before,
.section-head::after {
  content: "";
  flex: 0 0 clamp(1rem, 7vw, 2.5rem);
  height: 1px;
  background: var(--line);
}

.section-head h2 {
  flex: 0 1 auto;
  font-size: clamp(1.75rem, 6vw, 2.875rem);
  text-align: center;
}

/* ---------- Header ----------
   Two-tier, mirroring the original artwork (1280px canvas):
   white logo band 180px tall + black nav bar 60px tall.
   Ratios below are taken straight from that canvas.          */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--band-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand img {
  width: auto;
  height: var(--logo-h);
}

/* Kontakt / language buttons — black blocks in the white band */
.header-actions {
  display: none;
  align-items: center;
  gap: 20px; /* 1135 - 1115 on the original canvas */
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  min-width: 160px;
  padding: 0 1rem;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.2s var(--ease);
}

.header-btn:hover { background: var(--ink-soft); }

.header-btn--lang {
  min-width: 50px;
  padding: 0;
  letter-spacing: 0.04em;
}

/* Hamburger */
.nav-toggle {
  --bar: 1.5px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  margin-right: -10px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
}

.nav-toggle span {
  display: block;
  height: var(--bar);
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s linear;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Nav bar — black in both layouts; a dropdown panel on small screens */
.site-nav {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: var(--dark);
  color: #fff;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease);
}

.site-nav[data-open="true"] { grid-template-rows: 1fr; }

.site-nav__inner {
  overflow: hidden;
  min-height: 0;
}

.site-nav ul {
  display: flex;
  flex-direction: column;
  padding: 0.5rem var(--gutter) 1.25rem;
}

.site-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  font-size: 0.9375rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.site-nav li:last-child a { border-bottom: 0; }

.site-nav svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

.nav-lang {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  /* keep the label aligned with the icon-prefixed links above it */
  padding-left: calc(20px + 0.75rem);
}

/* ---------- Hero ---------- */
.hero {
  padding-bottom: clamp(3rem, 10vw, 6rem);
  overflow: hidden;
}

/* Lattice band sitting directly under the nav bar, left-aligned and
   1121/1280 of the width — the placement it has in the original artwork. */
.hero__band { line-height: 0; }

.hero__band img {
  width: max(87.58%, 620px);
  max-width: none;
}

.hero__inner { margin-top: clamp(1.75rem, 4vw, 2.75rem); }

.hero h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  max-width: 20ch;
  margin-bottom: clamp(1.5rem, 5vw, 2rem);
}

.hero__eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.hero__lead {
  max-width: var(--measure);
  font-size: clamp(1rem, 2.6vw, 1.125rem);
  font-weight: 300;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 5vw, 2.5rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn--solid {
  background: var(--ink);
  color: #fff;
}
.btn--solid:hover { background: var(--ink-soft); border-color: var(--ink-soft); }

.btn--ghost:hover { background: var(--ink); color: #fff; }

/* ---------- Service sections ---------- */
.service__grid {
  display: grid;
  gap: clamp(2rem, 6vw, 3rem);
}

.service__list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 1.25rem;
  font-weight: 300;
  color: var(--ink-soft);
}

.service__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--ink);
}

.service__list li:last-child { margin-bottom: 0; }

.service__figure { margin: 0; }

.service__figure img {
  width: 100%;
  border: 1px solid var(--line);
}

.service__figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  gap: clamp(1rem, 3vw, 1.5rem);
}

.gallery__item {
  display: block;
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  width: 100%;
}

.gallery__item img {
  width: 100%;
  transition: transform 0.5s var(--ease);
}

.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.gallery__item:hover img { transform: scale(1.03); }
.gallery__item:hover::after { opacity: 0.08; }

.gallery__caption {
  display: block;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: left;
  color: var(--muted);
  background: var(--bg);
  position: relative;
  z-index: 1;
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(96vw, 1200px);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.lightbox img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  background: #000;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.25rem;
  font-size: 0.8125rem;
}

.lightbox__caption {
  flex: 1 1 auto;
  color: rgba(255, 255, 255, 0.8);
}

.lightbox__nav { display: flex; gap: 0.5rem; flex: 0 0 auto; }

.lightbox__btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.lightbox__btn:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- Footer / contact ---------- */
.site-footer {
  background: var(--dark);
  color: #fff;
}

.site-footer__body {
  position: relative;
  overflow: hidden;
}

.site-footer__deco {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: clamp(720px, 130%, 1700px);
  max-width: none;
  opacity: 0.9;
  pointer-events: none;
}

.site-footer__inner {
  position: relative;
  padding-block: clamp(3rem, 10vw, 5.5rem);
  text-align: center;
}

.site-footer h2 {
  font-size: clamp(1.75rem, 6vw, 2.875rem);
  margin-bottom: clamp(1.5rem, 5vw, 2.25rem);
}

.contact__address {
  font-style: normal;
  font-weight: 300;
  font-size: clamp(1rem, 3vw, 1.25rem);
  line-height: 1.6;
  color: var(--dark-soft);
}

.contact__mail {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  font-weight: 300;
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact__mail:hover { text-decoration: underline; }

.colophon {
  position: relative;
  background: var(--dark-soft);
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.75rem;
  text-align: center;
  padding-block: 1.5rem;
}

/* ---------- Motion ---------- */
/* Scoped to .js so content stays visible when scripting is unavailable. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

/* =========================================================
   Wider viewports
   ========================================================= */

@media (min-width: 600px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery__item:first-child { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  :root {
    /* ratios of the 1280px original: band 180, logo 66.4, insets 70 / 95 */
    --band-h: clamp(120px, 14.06vw, 180px);
    --navbar-h: 60px;
    --header-h: 60px;
    --logo-h: clamp(46px, 5.19vw, 66.4px);
  }

  /* Only the black bar pins; the logo band scrolls away above it. */
  .site-header {
    top: calc(-1 * var(--band-h));
    border-bottom: 0;
  }

  .site-header .wrap {
    max-width: none;
    padding-left: clamp(1.5rem, 5.47vw, 5.6rem);
    padding-right: clamp(1.5rem, 7.42vw, 7.6rem);
  }

  .nav-toggle { display: none; }
  .header-actions { display: flex; }
  .site-nav__mobile { display: none; }

  .site-nav {
    position: static;
    display: block;
    height: var(--navbar-h);
  }

  .site-nav__inner { overflow: visible; height: 100%; }

  .site-nav ul {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 52px;
    padding: 0;
  }

  .site-nav a {
    position: relative;
    gap: 10px;
    padding: 0;
    font-size: 14px;
    border-bottom: 0;
  }

  .site-nav svg { width: 24px; height: 24px; }

  .site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
  }

  .site-nav a:hover::after,
  .site-nav a[aria-current="true"]::after { transform: scaleX(1); }

  .service__grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(2.5rem, 5vw, 4.5rem);
  }

  .service--reverse .service__figure { order: -1; }

  .service__list li { font-size: 1.0625rem; }
}

@media (min-width: 1100px) {
  .hero h1 { font-size: 3.5rem; }
}
