/* BrainStorm landing — design: Figma "Desktop - 1" (1440px) */

:root {
  --navy: #13264e;
  --navy-10: rgba(19, 38, 78, 0.1);
  --white: #ffffff;
  --black: #000000;
  --error: #c62828;
  --success: #1b7f3b;

  --container: 1254px;          /* 93px side margins on 1440 design */
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 110px;

  --radius-card: 27px;
  --radius-pill: 999px;

  --fs-h2: clamp(28px, 2.5vw + 12px, 36px);
  --fs-nav: clamp(16px, 0.9vw + 8px, 22px);
  --fs-btn: clamp(16px, 1vw + 8px, 24px);
  --fs-card: clamp(17px, 1vw + 8px, 24px);
  --fs-body: clamp(17px, 1.1vw + 10px, 28px);

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--navy);
  background: var(--white);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.center { text-align: center; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--navy); color: var(--white); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid #4f7cff; outline-offset: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 64px; padding: 16px 32px;
  border: 0; border-radius: var(--radius-pill);
  font: 600 var(--fs-btn)/1.2 var(--font);
  text-align: center; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(19, 38, 78, .3); }
.btn:active { transform: translateY(0); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-wide { width: min(620px, 100%); }
@media (min-width: 1024px) { .btn { min-height: 89px; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  box-shadow: 0 4px 26px rgba(19, 38, 78, .25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand img { width: auto; height: calc(var(--header-h) - 20px); }

.site-nav ul { display: flex; align-items: center; gap: clamp(20px, 4.5vw, 83px); }
.site-nav a { font-weight: 600; font-size: var(--fs-nav); text-decoration: none; white-space: nowrap; position: relative; padding: 6px 0; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transition: transform .2s ease; }
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }

.nav-toggle { display: none; }

@media (max-width: 899px) {
  :root { --header-h: 72px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 48px; height: 48px; padding: 10px; border: 0; background: transparent; cursor: pointer;
  }
  .nav-toggle-bar { display: block; height: 3px; border-radius: 2px; background: var(--navy); transition: transform .2s ease, opacity .2s ease; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(9px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(4) { transform: translateY(-9px) rotate(-45deg); }

  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--white);
    box-shadow: 0 16px 24px rgba(19, 38, 78, .15);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .25s ease, visibility .25s;
  }
  .site-nav.is-open { max-height: 420px; visibility: visible; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 16px; }
  .site-nav a { display: block; padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--navy-10); }
  .site-nav a::after { display: none; }
}

/* ---------- hero (slider; one slide = static banner) ---------- */
.hero { position: relative; margin-top: clamp(24px, 4.7vw, 68px); background: var(--navy); }
.hero-slide { position: relative; display: none; }
.hero-slide.is-active { display: block; }
/* fade only when switching (JS adds .is-sliding after the first slide is shown), never on page load */
.hero.is-sliding .hero-slide.is-active { animation: hero-fade .6s ease; }
@keyframes hero-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero.is-sliding .hero-slide.is-active { animation: none; } }
.hero-media img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.hero-caption { padding: 20px var(--gutter) 0; color: var(--white); }
.hero-title { font-weight: 700; font-size: clamp(26px, 3.4vw + 8px, 64px); line-height: 1.1; }
.hero-subtitle { margin-top: .6em; font-weight: 600; font-size: clamp(16px, 1vw + 10px, 28px); line-height: 1.3; }

.hero-actions { display: grid; gap: 12px; padding: 16px var(--gutter) 24px; }
@media (max-width: 899px) { .hero-actions .btn-dark { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); } }

.hero-dots { display: flex; justify-content: center; gap: 10px; padding: 0 0 18px; }
.hero-dot { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 2px solid var(--white); background: transparent; cursor: pointer; }
.hero-dot.is-active { background: var(--white); }

@media (min-width: 900px) {
  .hero { background: transparent; }
  .hero-caption {
    position: absolute; left: 0; right: 0; top: 0; bottom: 35%;
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 4.4%; max-width: 1440px; margin-inline: auto;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .45);
  }
  .hero-slide--caption .hero-media { position: relative; }
  .hero-slide--caption .hero-media::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(19, 38, 78, .72) 0%, rgba(19, 38, 78, .35) 55%, rgba(19, 38, 78, 0) 85%);
  }
  .hero-title { max-width: 16em; }
  .hero-subtitle { max-width: 32em; }
  /* overlay buttons on the banner like in the design (bottom ~17%) */
  .hero-actions {
    position: absolute; left: 0; right: 0; bottom: 10.4%;
    grid-template-columns: 1fr 1fr; gap: 5.1%;
    padding: 0 4.4%;
    max-width: 1440px; margin-inline: auto;
  }
  .hero-actions--single { grid-template-columns: minmax(0, 47.45%); }
  .hero-dots { position: absolute; left: 0; right: 0; bottom: 3%; padding: 0; }
}

/* ---------- sections ---------- */
.section { padding-top: clamp(48px, 4.7vw, 68px); }
.section-title { font-weight: 700; font-size: var(--fs-h2); line-height: 1.2; margin-bottom: clamp(24px, 3.5vw, 52px); padding-left: clamp(0px, 3.5vw, 51px); }

/* ---------- services ---------- */
.services-grid { display: grid; gap: clamp(20px, 2.7vw, 42px) clamp(20px, 2.7vw, 39px); grid-template-columns: 1fr; }
@media (min-width: 768px) { .services-grid { grid-template-columns: 1fr 1fr; } }
.service-card { position: relative; border-radius: var(--radius-card); overflow: hidden; aspect-ratio: 4 / 3; background: var(--navy); }
.service-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.service-card:hover img { transform: scale(1.04); }
.service-card h3 {
  position: absolute; left: 0; right: 0; bottom: 0;
  min-height: 76px; padding: 14px 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--white);
  font-weight: 600; font-size: var(--fs-card); line-height: 1.2; text-align: center;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* ---------- portfolio ---------- */
.portfolio-band { position: relative; background: var(--navy); padding: 28px 0 20px; }
.portfolio-track {
  display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px;
  padding: 0 20px 8px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent;
}
.portfolio-track::-webkit-scrollbar { height: 6px; }
.portfolio-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,.35); border-radius: 3px; }
.portfolio-item { flex: 0 0 auto; width: min(533px, 82vw); scroll-snap-align: start; color: var(--white); }
.portfolio-item--portrait { width: min(300px, 46vw); }
.portfolio-item img { width: 100%; height: clamp(260px, 28vw, 400px); object-fit: cover; }
.portfolio-item p { margin-top: 8px; font-weight: 600; font-size: 16px; text-align: center; }

.portfolio-nav {
  position: absolute; top: calc(28px + clamp(260px, 28vw, 400px) / 2); transform: translateY(-50%); z-index: 2;
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.9); color: var(--navy);
  font-size: 34px; line-height: 1; padding-bottom: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: opacity .2s ease;
}
.portfolio-nav:disabled { opacity: 0; pointer-events: none; }
.portfolio-prev { left: 12px; }
.portfolio-next { right: 12px; }
@media (hover: none) { .portfolio-nav { display: none; } }

.section-portfolio .btn { margin-top: clamp(32px, 4.2vw, 60px); }

/* ---------- how we work ---------- */
.how-card {
  border-radius: clamp(24px, 3.5vw, 50px); overflow: hidden;
  background: var(--navy) var(--how-bg, none) center / cover no-repeat;
  color: var(--white);
  min-height: clamp(420px, 50vw, 730px);
  display: flex; align-items: center;
}
@media (max-width: 767px) {
  .how-card { background-image: linear-gradient(rgba(19,38,78,.55), rgba(19,38,78,.55)), var(--how-bg-sm, none); background-position: 70% center; }
}
.how-content { width: min(593px, 100%); padding: clamp(28px, 6.5vw, 94px); font-size: var(--fs-card); line-height: 1.18; }
.how-lead { font-weight: 600; margin-bottom: 1.2em; }
.how-steps { list-style: disc; padding-left: 1.5em; display: grid; gap: 1.2em; }
.how-steps li { font-weight: 400; }
.how-steps strong { font-weight: 600; }

/* ---------- about ---------- */
.about-text { max-width: 1178px; padding-left: clamp(0px, 3.5vw, 51px); font-weight: 600; font-size: var(--fs-body); line-height: 1.31; }
.about-text h3 { font: inherit; margin: 1.3em 0; }
.about-text h3:first-child { margin-top: 0; }
.about-text p + p { margin-top: 1.3em; }

/* ---------- contact form ---------- */
.section-form { padding-bottom: clamp(48px, 7vw, 104px); }
.form-stage { position: relative; overflow: hidden; padding-inline: var(--gutter); }
.form-watermark {
  position: absolute; z-index: 0; pointer-events: none; opacity: .25;
  width: clamp(420px, 71vw, 1025px); height: auto;
  left: calc(50% + 4.3vw); top: -52px;
}
@media (max-width: 899px) { .form-watermark { display: none; } }

.lead-form {
  position: relative; z-index: 1;
  width: min(857px, 100%); margin-inline: auto;
  background: var(--white);
  border: 1px solid var(--navy); border-radius: 37px;
  padding: clamp(24px, 5vw, 47px) clamp(18px, 6.8vw, 58px) clamp(24px, 3.8vw, 33px);
  display: grid; gap: clamp(20px, 3vw, 38px);
}
/* design: card sits left of centre on wide screens, leaving room for the logo watermark */
@media (min-width: 1200px) { .lead-form { transform: translateX(-170px); } }

.field { display: grid; gap: 12px; }
.field > label { font-weight: 600; font-size: var(--fs-card); padding-left: clamp(12px, 5.5vw, 47px); }
.field input:not([type="file"]), .field textarea {
  width: 100%; border: 2px solid transparent; border-radius: 20px;
  background: var(--navy-10); color: var(--navy);
  font: 400 18px/1.4 var(--font);
  padding: 18px 24px; min-height: 69px;
  transition: border-color .15s ease, background-color .15s ease;
}
.field textarea { min-height: 153px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: rgba(19, 38, 78, .45); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); background: var(--white); }
.field.has-error input, .field.has-error textarea { border-color: var(--error); }
.field-error { color: var(--error); font-size: 14px; min-height: 0; padding-left: 24px; }
.field-error:empty { display: none; }

.file-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--navy); font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.file-btn:hover { background: var(--navy); color: var(--white); }
#f-file:focus-visible + .file-name, .file-row:focus-within .file-btn { outline: 3px solid #4f7cff; outline-offset: 2px; }
.file-name { font-size: 14px; color: rgba(19, 38, 78, .7); word-break: break-all; }
.file-clear { border: 0; background: none; color: var(--navy); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 6px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn-submit {
  width: min(690px, 100%); justify-self: center;
  min-height: clamp(64px, 7vw, 103px); border-radius: 39px;
  font-size: clamp(20px, 2vw + 8px, 36px); text-transform: uppercase;
  margin-top: clamp(4px, 1.5vw, 20px);
}
.btn-submit[disabled] { opacity: .7; cursor: progress; transform: none; box-shadow: none; }

.form-status { text-align: center; font-weight: 600; font-size: 16px; }
.form-status:empty { display: none; }
.form-status.is-success { color: var(--success); }
.form-status.is-error { color: var(--error); }

/* ---------- footer ---------- */
.site-footer { background: var(--black); color: var(--white); padding: clamp(56px, 12.8vw, 185px) 0 28px; }
.footer-inner { display: flex; align-items: center; justify-content: space-around; gap: 40px; flex-wrap: wrap; }
.footer-logo { width: min(342px, 80vw); height: auto; }
.footer-contacts { font-style: normal; font-weight: 600; font-size: var(--fs-card); line-height: 1.44; display: grid; gap: 1.44em; }
.footer-contacts a { text-decoration: none; }
.footer-contacts a:hover { text-decoration: underline; }
.copyright { margin-top: clamp(48px, 8vw, 115px); text-align: center; color: rgba(255,255,255,.25); font-weight: 600; font-size: clamp(14px, 1vw + 6px, 24px); padding-inline: var(--gutter); }
@media (max-width: 767px) { .footer-inner { flex-direction: column; text-align: center; } }
