/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Helvetica Now Display';
  src: url('assets/fonts/HelveticaNowDisplay-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto Mono';
  src: url('assets/fonts/RobotoMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* ---------- Base ---------- */
:root {
  --black: #111111;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray-mid: #ececec;
  --gray-dark: #dcdcdc;
  --yellow: #f5f32e;
  --font-sans: 'Helvetica Now Display', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --gutter: clamp(16px, 3vw, 32px);
  --max-width: 1600px;
  --col1-w: calc(clamp(20px, 4vw, 40px) + 290px);
  --col2-offset: calc(var(--col1-w) + clamp(16px, 3vw, 40px) + clamp(20px, 4vw, 40px));
  --logo-w: calc(var(--col1-w) * 0.75);
  --header-h: calc(40px + var(--logo-w) * 510 / 1870);
  --frame-bottom-h: 48px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 24px;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Every top-level section fills at least the space between the fixed
   header and the fixed bottom bar. min-height (not height) lets a section
   grow taller than the viewport when its content needs it, instead of
   clipping and scrolling internally — a section with its own internal
   scroll container fights the document's scroll-snap for touch gestures
   on mobile, which is what caused content to "bleed" between sections. */
.hero,
.services,
.kits,
.manifesto,
.site-footer {
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
  padding-top: var(--header-h);
  padding-bottom: var(--frame-bottom-h);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

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

p { margin: 0; }

.placeholder-img {
  background: repeating-linear-gradient(
    45deg,
    #d8d8d8,
    #d8d8d8 12px,
    #cfcfcf 12px,
    #cfcfcf 24px
  );
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px var(--gutter);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 1px 0 0 var(--white);
  z-index: 200;
}

.logo {
  display: inline-flex;
  color: var(--black);
}

.logo-mark {
  width: var(--logo-w);
  height: auto;
  display: block;
}

.site-nav {
  display: flex;
  flex: 1;
  justify-content: space-between;
  margin-left: calc(var(--col2-offset) - var(--logo-w));
  gap: clamp(20px, 4vw, 56px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav a {
  display: inline-block;
  line-height: 1;
  padding: 0 1ch;
  margin: 0 -1ch;
  color: var(--black);
  background-color: transparent;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover:not(.active) {
  color: #c2c2c2;
}

.site-nav a.active {
  color: var(--black);
  background-color: var(--yellow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--black);
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
}

.hero-media {
  position: relative;
  margin: 0 var(--gutter);
  width: 100%;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
}

/* Backstage slideshow: images are injected by script.js and cross-fade
   in place over the placeholder. Empty until real photos are added. */
.hero-slideshow {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-headline {
  position: absolute;
  right: clamp(16px, 4vw, 48px);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  color: var(--white);
  font-size: clamp(43.2px, calc(43.2px + (100vw - 375px) * 0.0318), 72px);
  line-height: 1.2;
  font-weight: 400;
  text-align: right;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.site-frame-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--frame-bottom-h);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--white);
  z-index: 200;
}

/* Items are pinned to exact percentages of the content width (0/25/50/100)
   rather than flex-distributed, so each one sits at a precise point. */
.frame-bottom-inner {
  position: relative;
  height: 100%;
  margin: 0 var(--gutter);
}

.meta-instagram,
.meta-linkedin,
.meta-center,
.meta-right {
  position: absolute;
  top: 50%;
  white-space: nowrap;
}

.meta-instagram { left: 0%; transform: translateY(-50%); }
.meta-linkedin { left: 25%; transform: translate(-50%, -50%); }
.meta-center { left: 50%; transform: translate(-50%, -50%); text-align: center; }
.meta-right { left: 100%; transform: translate(-100%, -50%); }

.meta-link { opacity: 0.85; }
.meta-link:hover { opacity: 1; }
.meta-center { opacity: 0.7; }
.meta-right { opacity: 0.7; }

/* Hidden + inert until there's a real destination for it (e.g. Linkedin). */
.disabled-link {
  display: none;
}

/* ---------- Services ---------- */
.services {
  margin: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  background: var(--gray-mid);
}

.services-list {
  flex: 0 0 auto;
  background: var(--gray-mid);
}

.service-item {
  display: grid;
  grid-template-columns: var(--col1-w) 1fr;
  column-gap: clamp(16px, 3vw, 40px);
  align-items: start;
  background: var(--gray-light);
  cursor: pointer;
  transition: background-color 0.5s ease;
}

.service-item.open { background: var(--yellow); }

.service-toggle {
  grid-column: 1 / 2;
  grid-row: 1;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 16px 12px 16px clamp(20px, 4vw, 40px);
  font-family: var(--font-mono);
  font-size: clamp(10.8px, calc(10.8px + (100vw - 375px) * 0.008), 18px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: inherit;
  white-space: nowrap;
}

.service-panel {
  grid-column: 2 / 3;
  grid-row: 1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  align-self: center;
}

.service-panel-inner { overflow: hidden; }

.service-panel-inner p {
  font-size: clamp(28.8px, calc(28.8px + (100vw - 375px) * 0.0212), 48px);
  line-height: 1;
  padding: 1em clamp(20px, 4vw, 40px) 1em;
  margin: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.service-item.open .service-panel-inner p {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.service-item.open .service-panel {
  grid-template-rows: 1fr;
}

/* ---------- Kits ---------- */
.kits {
  position: relative;
  margin: 0 var(--gutter);
  display: flex;
  flex-direction: column;
}

.kits-table {
  flex: 0 0 auto;
  background: var(--gray-mid);
  position: relative;
}

.kit-row {
  display: grid;
  grid-template-columns: 290px 1.4fr 1fr;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(20px, 3vw, 36px) clamp(20px, 4vw, 40px);
  transition: background-color 0.2s ease;
}

.kit-row { background: var(--gray-mid); }

.kit-row:hover {
  background: var(--yellow);
}

.kit-label {
  font-family: var(--font-mono);
  font-size: clamp(10.8px, calc(10.8px + (100vw - 375px) * 0.008), 18px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kit-specs {
  margin-left: clamp(20px, 4vw, 40px);
}

.kit-specs p,
.kit-extras p {
  font-size: clamp(14.4px, calc(14.4px + (100vw - 375px) * 0.0106), 24px);
  line-height: 1.6;
}

.kit-row-custom .kit-specs p {
  max-width: 480px;
}

/* ---------- Manifesto ---------- */
.manifesto {
  background: var(--yellow);
  display: flex;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* margin-top/bottom: auto centers vertically when the text fits, but
   — unlike align-items: center on the parent — never pushes content
   above the scrollable area when it doesn't, so nothing gets clipped
   and stranded above an unreachable scroll position. */
.manifesto-text {
  flex: 1 1 auto;
  margin-left: var(--col2-offset);
  margin-top: auto;
  margin-bottom: auto;
  /* Guarantees breathing room above/below even when the auto margins
     above collapse to 0 because the text is too tall to fully center. */
  padding-top: clamp(20px, 5vw, 40px);
  padding-bottom: clamp(20px, 5vw, 40px);
}

.manifesto-text p {
  font-size: clamp(28.8px, calc(28.8px + (100vw - 375px) * 0.0212), 48px);
  line-height: 1.5;
  margin-bottom: 28px;
}

.manifesto-text p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  display: flex;
  flex-direction: column;
}

.footer-label {
  font-family: var(--font-mono);
  font-size: clamp(10.8px, calc(10.8px + (100vw - 375px) * 0.008), 18px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 20px;
  opacity: 0.7;
}

.footer-clients {
  display: grid;
  grid-template-columns: calc(var(--col2-offset) - 24px) repeat(3, 1.4fr);
  gap: 24px;
  margin-top: auto;
  margin-bottom: clamp(32px, 6vh, 100px);
}

.clients-col ul li {
  font-size: clamp(10.8px, calc(10.8px + (100vw - 375px) * 0.008), 18px);
  line-height: 1.7;
}

.footer-contact {
  display: grid;
  grid-template-columns: calc(var(--col2-offset) - 24px) repeat(3, 1.4fr);
  gap: 24px;
  margin-bottom: auto;
}

.footer-contact::before { content: ""; }

.contact-block {
  grid-column: span 1;
}

.footer-contact .contact-block:first-child {
  grid-column: 2 / 3;
}

.contact-block p {
  font-size: clamp(10.8px, calc(10.8px + (100vw - 375px) * 0.008), 18px);
  line-height: 1.6;
  margin-bottom: 12px;
}

.contact-block a:hover { opacity: 0.7; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root {
    --header-h: 90px;
  }

  .logo-mark {
    height: 48px;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: var(--gutter);
    left: var(--gutter);
    background: var(--white);
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    display: none;
  }

  .site-nav.open { display: flex; }

  .nav-toggle { display: flex; }

  .hero-headline {
    text-align: left;
    left: clamp(16px, 4vw, 24px);
    right: clamp(16px, 4vw, 24px);
    top: clamp(16px, 4vw, 24px);
    transform: none;
    max-width: none;
  }

  .site-nav { font-size: 15px; }

  .service-item {
    grid-template-columns: 1fr;
  }

  .service-toggle {
    grid-column: 1 / 2;
    grid-row: 1;
    padding-right: clamp(20px, 4vw, 40px);
    white-space: normal;
  }

  .service-panel {
    grid-column: 1 / 2;
    grid-row: 2;
    align-self: start;
  }

  .service-panel-inner p {
    padding-left: clamp(20px, 4vw, 40px);
  }

  .kit-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kit-specs {
    margin-left: 0;
  }

  .manifesto-text {
    margin-left: 0;
  }

  .footer-clients,
  .footer-contact {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-contact .contact-block:first-child {
    grid-column: auto;
  }
}

/* Narrow phones: the four 0/25/50/100% points get too tight for real
   content, so fall back to a simple stacked, left-aligned list. */
@media (max-width: 600px) {
  :root {
    --frame-bottom-h: 90px;
  }

  .site-frame-bottom {
    height: auto;
    padding: 14px var(--gutter);
    font-size: 12px;
  }

  .frame-bottom-inner {
    position: static;
    height: auto;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 4px;
  }

  .meta-instagram,
  .meta-linkedin,
  .meta-center,
  .meta-right {
    position: static;
    transform: none;
  }

  .meta-center {
    flex: none;
    text-align: left;
  }
}
