/* ============================================================
   Ctrl Technologies — Production site styles
   Mobile-first · 8px spacing scale · Flexbox / Grid
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* color */
  --bg: #0B0C02;
  --fg: #F1F0EC;
  --white: #ffffff;
  --stroke-card: rgba(178, 178, 178, 0.9);
  --hover-wash: rgba(255, 255, 255, 0.5);

  /* type */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --track: -0.035em;

  /* 8px spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;
  --space-9: 72px;
  --space-10: 80px;
  --space-12: 96px;

  /* layout */
  --container: 1200px;
  --gutter: 28px;
  --section-y: clamp(72px, 10vw, 120px);

  /* radii */
  --radius-card: 31px;
  --radius-pill: 75px;
  --radius-sm: 5px;

  /* motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 320ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font);
  letter-spacing: var(--track);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
main { position: relative; z-index: 1; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; text-wrap: pretty; }
button { font: inherit; }
::selection { background: rgba(27, 117, 206, 0.4); }
:focus-visible { outline: 1px solid rgba(241, 240, 236, 0.7); outline-offset: 3px; }

/* ---------- Type hierarchy ---------- */
.h1 {
  font-size: clamp(32px, 6.1vw, 43px);
  line-height: 1.18;
  letter-spacing: var(--track);
  font-weight: 400;
}
.h2 {
  font-size: clamp(20px, 2.6vw, 22px);
  line-height: 1.25;
  letter-spacing: var(--track);
  font-weight: 400;
}
.title { font-size: 20px; line-height: 1.3; letter-spacing: var(--track); font-weight: 400; }
.lead { font-size: 15px; line-height: 1.3; letter-spacing: var(--track); }
.body { font-size: 12px; line-height: 1.6; letter-spacing: var(--track); }
.small { font-size: 12px; line-height: 1.55; letter-spacing: var(--track); }
.label { font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: var(--track); }
.callout {
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--flat { background: var(--bg); }
/* gradient sections are transparent so the fixed animated gradient layer shows through */
.section--gradient {
  background: transparent;
}

/* ---------- Animated brand gradient ("lava") ---------- */
.bg-anim {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;          /* additive glow over the dark base */
  will-change: transform, opacity;
}
.blob--blue {
  width: 75vw; height: 75vw;
  left: -12vw; bottom: -18vw;
  background: radial-gradient(circle at center, #1B75CE 0%, rgba(27, 117, 206, 0) 64%);
  animation: lava-blue 30s ease-in-out infinite, pulse-blue 17s ease-in-out infinite;
}
.blob--gold {
  width: 64vw; height: 64vw;
  right: -10vw; bottom: -14vw;
  background: radial-gradient(circle at center, #D37546 0%, rgba(211, 117, 70, 0) 64%);
  animation: lava-gold 38s ease-in-out infinite, pulse-gold 23s ease-in-out infinite;
}
.blob--grey {
  width: 52vw; height: 52vw;
  left: 28vw; bottom: -22vw;
  background: radial-gradient(circle at center, rgba(220, 220, 220, 0.30) 0%, rgba(220, 220, 220, 0) 60%);
  animation: lava-grey 44s ease-in-out infinite, pulse-grey 29s ease-in-out infinite;
}

@keyframes lava-blue {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(10vw, -8vh) scale(1.18); }
  66%      { transform: translate(-5vw, 5vh) scale(0.92); }
}
@keyframes lava-gold {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30%      { transform: translate(-9vw, -6vh) scale(0.9); }
  70%      { transform: translate(6vw, 6vh) scale(1.2); }
}
@keyframes lava-grey {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-6vw, -7vh) scale(1.25); }
}
@keyframes pulse-blue {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}
@keyframes pulse-gold {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
@keyframes pulse-grey {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: var(--track);
  color: var(--white);
  background: transparent;
  border: 1px solid var(--white);
  border-radius: var(--radius-pill);
  padding: 11px 30px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur) var(--ease);
}
.btn:hover,
.btn:focus-visible { background: var(--hover-wash); }
.btn--sm { padding: 8px 22px; font-size: 12px; }
.btn--block { width: 100%; }

/* ---------- Text links ---------- */
.link {
  font-size: 11px;
  letter-spacing: var(--track);
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  text-underline-offset: 3px;
  transition: opacity var(--dur) var(--ease);
}
.link:hover,
.link:focus-visible { text-decoration: underline; opacity: 0.75; }

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: linear-gradient(var(--bg) 54%, rgba(11, 12, 2, 0) 100%);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-3) var(--space-4);
}
.nav__logo { display: block; }
.nav__logo img { width: 128px; height: auto; }

/* hamburger */
.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0 8px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav__toggle-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--fg);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

/* menu — mobile: collapsible panel */
.nav__menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--gutter) var(--space-6);
  background: var(--bg);
  border-top: 1px solid rgba(241, 240, 236, 0.12);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility var(--dur);
}
.nav__menu.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   Hero
   ============================================================ */
.hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-top: clamp(104px, 14vw, 150px);
}
.hero__lead {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 560px;
}
.hero__lead .body { max-width: 380px; }
.hero__aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 380px;
  padding-right: var(--space-5);
}
.hero__aside .lead { font-weight: 600; }

/* ============================================================
   What we offer
   ============================================================ */
.offer__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  margin-bottom: clamp(80px, 13vw, 184px);
}
.offer__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  justify-items: center;
}
.card {
  position: relative;
  width: 100%;
  max-width: 340px;
  min-height: 303px;
  border-radius: var(--radius-card);
  border: 1px solid var(--stroke-card);
  background: var(--bg);
  overflow: hidden;
  padding: var(--space-3);
  padding-top: 136px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-1);
  transition: border-color var(--dur) var(--ease);
}
/* hover gradient layer — unique supplied gradient per card */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  z-index: 0;
  pointer-events: none;
}
.card > * { position: relative; z-index: 1; }
.card:hover,
.card:focus-within { border-color: transparent; }
.card:hover::before,
.card:focus-within::before { opacity: 1; }

/* per-card hover gradient (from the .figma source) */
.offer__grid .card:nth-child(1)::before { background-image: url("assets/hover/card-1.png"); }
.offer__grid .card:nth-child(2)::before { background-image: url("assets/hover/card-2.png"); }
.offer__grid .card:nth-child(3)::before { background-image: url("assets/hover/card-3.png"); }
.offer__grid .card:nth-child(4)::before { background-image: url("assets/hover/card-4.png"); }

.card__icon {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 70px;
  height: 70px;
  transform-origin: center;
  transition: transform var(--dur) var(--ease);
}
.card:hover .card__icon,
.card:focus-within .card__icon { transform: rotate(-12deg); }
.card__title { font-size: 13px; }
.card .small { margin: 0; font-size: 11px; line-height: 1.45; }

/* ============================================================
   About
   ============================================================ */
.about__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.about__col { display: flex; flex-direction: column; gap: var(--space-8); }
.about__diagram { width: 100%; max-width: 360px; margin-top: var(--space-4); margin-left: var(--space-5); }
.about__copy { display: flex; flex-direction: column; gap: var(--space-2); max-width: 380px; }

/* ============================================================
   Partners
   ============================================================ */
.partners__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}
.partners__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4) var(--space-8);
}
.partners__row img { height: 52px; width: auto; object-fit: contain; opacity: 0.9; }

/* ============================================================
   Philosophy / Contact
   ============================================================ */
.contact {
  /* transparent so the animated gradient layer shows through */
  background: transparent;
}
.contact__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: var(--section-y);
}
.contact__block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.contact__block .callout { max-width: 640px; }
.contact__cta-title { max-width: 440px; line-height: 1.4; }

/* closing screen wrapper (CTA + footer) */
.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: var(--section-y);
}

/* connecting line */
.contact__line {
  width: 1px;
  background: var(--fg);
  opacity: 0.55;
}
.contact__line--down { height: clamp(80px, 16vw, 150px); margin-top: var(--space-6); }
.contact__line--up { height: clamp(80px, 16vw, 150px); margin-bottom: var(--space-6); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--bg); padding-block: var(--space-5); }
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
  justify-content: space-between;
}
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer__copy {
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: var(--track);
  text-align: left;
  margin: 0;
}
.footer__whatsapp { color: #59B566; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   Responsive — tablet (≥ 640px)
   ============================================================ */
@media (min-width: 640px) {
  .offer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__inner { flex-direction: row; align-items: center; }
}

/* ============================================================
   Responsive — desktop (≥ 960px)
   ============================================================ */
@media (min-width: 960px) {
  :root { --gutter: 56px; }

  /* nav becomes inline row, hamburger hidden */
  .nav__toggle { display: none; }
  .nav__menu {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: var(--space-5);
    padding: 0;
    background: none;
    border: none;
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .hero__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: var(--space-8);
    gap: var(--space-10);
  }
  .hero__lead { flex: 1 1 0; }
  .hero__aside { flex: 0 0 370px; margin-top: clamp(160px, 22vw, 300px); }

  .offer__grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
  .card { width: 235px; height: 279px; max-width: none; min-height: 0; }

  .about__grid { flex-direction: row; justify-content: space-between; gap: var(--space-12); }
  .about__col { flex: 1 1 0; }
  .about__copy { flex: 0 0 370px; padding-top: var(--space-1); }

  /* Every section fills the desktop viewport, content vertically centered */
  .section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
  }
  .section > .container { width: 100%; }
  /* hero is centered by the section, so it no longer needs its own top offset */
  .hero__inner { padding-top: 0; padding-bottom: 0; }

  /* partners is a compact band (shorter than 100vh) so it never leaves a blank screen on either side */
  .section--banner { min-height: 58vh; padding-block: var(--space-12); justify-content: center; }
  .section--banner .partners__inner { gap: var(--space-6); }
  .section--banner .partners__row { justify-content: space-between; gap: var(--space-6); width: 100%; }

  /* Contact: philosophy text sits near the top; line fills down to the fold */
  .contact__panel { min-height: 100vh; justify-content: center; padding-block: 0; }
  .contact__line { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; }
  .contact__panel--philosophy { justify-content: flex-start; padding-top: 19vh; }
  .contact__panel--philosophy .contact__block { transform: none; }
  .contact__line--down {
    position: static;
    transform: none;
    flex: 1;
    width: 1px;
    height: auto;
    min-height: 0;
    margin: 63px 0 0;
  }

  /* Closing screen: line in from top, CTA centered, footer pinned at bottom */
  .closing { position: relative; min-height: 100vh; padding-top: 0; justify-content: flex-start; }
  .closing .contact__line--up {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: calc(50% - 190px - 6vh);
    margin: 0;
  }
  .closing .contact__cta { flex: 1; justify-content: center; transform: translateY(-6vh); }
  .closing .site-footer { width: 100%; }
}
