/* =====================================================
   IMC+ — STYLE SYSTEM
   Sober industrial identity: graphite, anthracite,
   off-white, copper accent.
   ===================================================== */

/* -----------------------------------------------------
   1. TOKENS
   ----------------------------------------------------- */
:root {
  /* Palette */
  --graphite: #151618;
  --anthracite: #1e2125;
  --steel: #2c3035;
  --offwhite: #f2efe8;
  --offwhite-deep: #e6e2d8;
  --copper: #d0803f;
  --copper-hover: #dd9354;
  --copper-dark: #a35a25;

  /* Contextual colors (redefined by light sections) */
  --bg: var(--graphite);
  --ink: #f2efe8;
  --ink-dim: #a9aaa8;
  --line: var(--steel);
  --accent-text: var(--copper);

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --container-w: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --header-h: 76px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 180ms;
  --dur-med: 400ms;
}

/* -----------------------------------------------------
   2. RESET
   ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body, h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
:where(ul[class], ol[class]) { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
address { font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -----------------------------------------------------
   3. BASE
   ----------------------------------------------------- */
body {
  background: var(--graphite);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(72px, 9vw, 120px);
  background: var(--bg);
  color: var(--ink);
}
.section--alt { --bg: var(--anthracite); }
.section--light {
  --bg: var(--offwhite);
  --ink: #18191c;
  --ink-dim: #55575b;
  --line: #d6d1c5;
  --accent-text: var(--copper-dark);
}

.section-head { max-width: 680px; margin-bottom: clamp(40px, 5vw, 56px); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
.section-head .section-title + .text { margin-top: 18px; }

.text { color: var(--ink-dim); max-width: 60ch; }
.split-text .text { margin-top: 18px; }
.text--lead { font-size: 1.12rem; line-height: 1.6; color: var(--ink); }

.item-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 8px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 999;
  background: var(--copper);
  color: var(--graphite);
  padding: 10px 18px;
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 16px; }

.text-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.text-link:hover { color: var(--copper-hover); }

/* -----------------------------------------------------
   4. BUTTONS
   ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.btn-primary { background: var(--copper); color: var(--graphite); }
.btn-primary:hover { background: var(--copper-hover); }
.btn-ghost { border-color: rgba(242, 239, 232, 0.45); color: var(--offwhite); }
.btn-ghost:hover { border-color: var(--offwhite); }

/* -----------------------------------------------------
   5. HEADER
   ----------------------------------------------------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
}
.site-header.is-scrolled {
  background: rgba(21, 22, 24, 0.96);
  box-shadow: 0 1px 0 var(--steel);
}
.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo { display: flex; align-items: center; gap: 10px; color: var(--offwhite); }
.logo-mark { color: var(--copper); }
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.logo-plus { color: var(--copper); }

.nav-list { display: flex; gap: clamp(18px, 2vw, 30px); }
.nav-link {
  display: block;
  padding-block: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(242, 239, 232, 0.75);
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.nav-link:hover { color: var(--offwhite); }
.nav-link.is-active { color: var(--offwhite); border-bottom-color: var(--copper); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--offwhite);
}

/* -----------------------------------------------------
   6. HERO
   ----------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--offwhite);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  background: var(--anthracite);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 15, 17, 0.9) 0%, rgba(14, 15, 17, 0.72) 38%, rgba(14, 15, 17, 0.25) 70%, rgba(14, 15, 17, 0.15) 100%),
    linear-gradient(0deg, rgba(14, 15, 17, 0.75) 0%, rgba(14, 15, 17, 0) 30%),
    linear-gradient(180deg, rgba(14, 15, 17, 0.7) 0%, rgba(14, 15, 17, 0) 20%);
}

.hero-content {
  position: relative;
  width: 100%;
  padding-top: calc(var(--header-h) + 48px);
  padding-bottom: 120px;
}
.hero-content > * { max-width: 620px; }
.hero .eyebrow { color: var(--copper); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero-subtitle {
  margin-top: 22px;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  color: rgba(242, 239, 232, 0.82);
  max-width: 52ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero-facts {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid rgba(242, 239, 232, 0.16);
}
.hero-facts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 40px;
  padding-block: 22px;
  font-size: 0.88rem;
  color: rgba(242, 239, 232, 0.78);
}

/* -----------------------------------------------------
   7. SPLIT LAYOUT (About, Technology)
   ----------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.split > * { min-width: 0; }
.split--reverse .split-media { order: -1; }
.split-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 1672 / 941;
  object-fit: cover;
  background: var(--anthracite);
}

/* Key facts table (About, Contact) */
.facts { margin-top: 36px; border-top: 1px solid var(--line); }
.facts-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
.facts dt { font-size: 0.85rem; font-weight: 500; color: var(--ink-dim); }
.facts dd { color: var(--ink); }
.facts dd a:not(.text-link):hover { color: var(--accent-text); }

/* -----------------------------------------------------
   8. EXPERTISE
   ----------------------------------------------------- */
.expertise-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 88px);
}
.expertise-grid > * { min-width: 0; }
.expertise-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 40px;
}
.expertise-point { padding-top: 20px; border-top: 2px solid var(--copper); }

/* -----------------------------------------------------
   9. SERVICES
   ----------------------------------------------------- */
.service-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 clamp(32px, 5vw, 72px);
}
.service {
  padding-block: 28px;
  border-top: 1px solid var(--line);
}

/* -----------------------------------------------------
   10. TECHNOLOGY
   ----------------------------------------------------- */
.process {
  margin-top: 32px;
  counter-reset: step;
  display: grid;
  gap: 18px;
}
.process-step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 14px;
}
.process-step::before {
  content: counter(step);
  grid-row: span 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--copper);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--copper);
}
.process-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--ink);
}
.process-step .text { margin-top: 0; font-size: 0.95rem; }

.tech-benefits {
  margin-top: 32px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.tech-benefits span { color: var(--copper); margin-inline: 6px; }

/* -----------------------------------------------------
   11. APPLICATIONS
   ----------------------------------------------------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
}
.app { min-width: 0; }
.app img {
  width: 100%;
  height: auto;
  aspect-ratio: 1672 / 941;
  object-fit: cover;
  background: var(--offwhite-deep);
  margin-bottom: 18px;
}
.app .text { font-size: 0.95rem; }

/* -----------------------------------------------------
   12. GALLERY — justified rows, native proportions
   ----------------------------------------------------- */
.gallery-grid {
  --row-h: 240px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gallery-grid::after { content: ""; flex-grow: 1000; }
.gallery-item {
  position: relative;
  flex: var(--r) 1 calc(var(--r) * var(--row-h));
  aspect-ratio: var(--r);
  overflow: hidden;
  background: var(--anthracite);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--dur-fast) var(--ease);
}
.gallery-item:hover img { opacity: 0.82; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 13, 15, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 88px;
}
.lightbox[hidden] { display: none; }
.lightbox-figure { max-width: 100%; }
.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  margin-inline: auto;
}
.lightbox-caption {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--ink-dim);
  text-align: center;
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--offwhite);
  border-radius: 50%;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.lightbox-close:hover, .lightbox-nav:hover { color: var(--copper); background: rgba(242, 239, 232, 0.06); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* -----------------------------------------------------
   13. CONTACT
   ----------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: stretch;
}
.contact-grid > * { min-width: 0; }
.contact-info .text { margin-top: 18px; }
.contact-map {
  min-height: 420px;
  background: var(--steel);
}
.contact-map iframe { display: block; min-height: 420px; }

/* -----------------------------------------------------
   14. FOOTER
   ----------------------------------------------------- */
.site-footer { background: var(--graphite); color: var(--offwhite); border-top: 1px solid var(--steel); }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
  padding-block: 48px;
}
.footer-tagline { margin-top: 10px; font-size: 0.9rem; color: #a9aaa8; max-width: 40ch; }
.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 10px 32px;
  font-size: 0.9rem;
}
.footer-nav a { color: #a9aaa8; transition: color var(--dur-fast) var(--ease); }
.footer-nav a:hover { color: var(--offwhite); }
.footer-bottom {
  padding-bottom: 20px;
  font-size: 0.82rem;
  color: #7d7f82;
}
.footer-bottom p { padding-top: 20px; border-top: 1px solid var(--steel); }

/* -----------------------------------------------------
   15. BACK TO TOP
   ----------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--anthracite);
  border: 1px solid var(--steel);
  color: var(--offwhite);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { color: var(--copper); }
.back-to-top[hidden] { display: flex; }

/* -----------------------------------------------------
   16. REVEAL ON SCROLL (one-shot, subtle)
   ----------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* -----------------------------------------------------
   17. RESPONSIVE
   ----------------------------------------------------- */
@media (max-width: 1080px) {
  .nav-toggle { display: flex; }
  .main-nav { display: none; }
  .main-nav.is-open {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 99;
    background: var(--graphite);
    padding: 16px var(--gutter) 32px;
    overflow-y: auto;
  }
  .main-nav.is-open .nav-list { flex-direction: column; gap: 0; }
  .main-nav.is-open .nav-link {
    padding-block: 16px;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--steel);
  }
  .main-nav.is-open .nav-link.is-active { color: var(--copper); border-bottom-color: var(--steel); }
  .site-header:has(.main-nav.is-open) { background: var(--graphite); }

  .app-grid { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
}

@media (max-width: 900px) {
  .split,
  .expertise-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .split--reverse .split-media { order: 0; }
  .contact-map, .contact-map iframe { min-height: 340px; }
  .footer-inner { grid-template-columns: 1fr; }
  .gallery-grid { --row-h: 180px; }
}

@media (max-width: 640px) {
  .hero-content { padding-bottom: 150px; }
  .hero-facts-list { gap: 6px 24px; font-size: 0.82rem; padding-block: 16px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .expertise-points,
  .service-list,
  .app-grid { grid-template-columns: 1fr; }
  .facts-row { grid-template-columns: 1fr; gap: 2px; }
  .gallery-grid { --row-h: 140px; gap: 6px; }
  .footer-nav { grid-template-columns: repeat(2, auto); justify-content: start; }
  .lightbox { padding: 64px 16px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 12px; transform: none; }
  .lightbox-prev { left: calc(50% - 60px); }
  .lightbox-next { right: calc(50% - 60px); }
  .lightbox-close { top: 12px; right: 12px; }
}
