/* Elettranova Engineering — site styles */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Jost"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/jost-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Crimson Pro"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/crimson-pro-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Crimson Pro"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/crimson-pro-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --ink: #081b33;
  --text: #46546b;
  --navy: #062575;
  --navy-deep: #05123d;
  --accent: #1f4fe0;
  --accent-soft: #e8eeff;
  --line: #e2e7f0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(8, 27, 51, .04), 0 12px 32px -12px rgba(8, 27, 51, .14);
  --sans: "Jost", "Futura PT", Futura, "Century Gothic", "Trebuchet MS", sans-serif;
  --serif: "Crimson Pro", Georgia, "Times New Roman", serif;
  --wrap: 1160px;
  --pad: clamp(20px, 5vw, 48px);
  --section: clamp(64px, 9vw, 120px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 700; color: var(--ink); }
h1, h2, h3, p, ul { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: -.015em; line-height: 1.08; text-wrap: balance; }
h2 { font-size: clamp(32px, 4vw, 46px); }
h3 { font-size: 20px; font-weight: 500; color: var(--ink); line-height: 1.3; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--pad) * 2); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: var(--section) 0; }
.section-soft { background: var(--bg-soft); }
.eyebrow {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.6; }
.prose p + p { margin-top: 1.1em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 26px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--navy); }
.btn-light { background: #fff; color: var(--navy-deep); }
.btn-light:hover { background: var(--accent-soft); }
.btn-ghost { border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.logo { flex: none; }
.logo img { width: auto; height: 42px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a.nav-cta { margin-left: 8px; background: var(--ink); color: #fff; }
.site-nav a.nav-cta:hover { background: var(--accent); }
.mobile-nav-toggle { display: none; }

/* ---------- Home hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--navy-deep);
  color: rgba(255, 255, 255, .82);
}
.hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  opacity: .75;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 18, 61, .96) 0%, rgba(5, 18, 61, .82) 45%, rgba(5, 18, 61, .35) 100%),
    radial-gradient(60% 80% at 85% 10%, rgba(31, 79, 224, .45), transparent 70%);
}
.hero-inner { padding-top: clamp(88px, 13vw, 168px); padding-bottom: clamp(88px, 13vw, 168px); }
.hero .eyebrow { color: #9db6ff; }
.hero h1 { max-width: 15ch; color: #fff; font-size: clamp(44px, 7vw, 84px); line-height: 1; }
.hero .lead { max-width: 56ch; margin-top: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* ---------- Page hero (about / contact) ---------- */
.page-hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.page-hero .wrap { padding-top: clamp(64px, 9vw, 112px); padding-bottom: clamp(56px, 8vw, 96px); }
.page-hero h1 { max-width: 16ch; font-size: clamp(44px, 7vw, 80px); line-height: 1; }
.page-hero .lead { max-width: 60ch; margin-top: 24px; }

/* ---------- Split intro ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head p { margin-top: 16px; }

/* ---------- Service cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card {
  padding: clamp(26px, 3.2vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: #c6d2ee; }
.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 22px; }
.card > p { margin-top: 10px; }
.checklist { list-style: none; margin-top: 22px; padding: 22px 0 0; border-top: 1px solid var(--line); }
.checklist li { position: relative; padding-left: 30px; color: var(--ink); line-height: 1.45; }
.checklist li + li { margin-top: 11px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .12em;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.6 10.4l2.9 2.9 6-6.3' fill='none' stroke='%231f4fe0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

/* ---------- Compact service tiles (about) ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.tile {
  display: block;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.tile:hover { transform: translateY(-3px); border-color: #c6d2ee; text-decoration: none; }
.tile .card-icon { margin-bottom: 18px; }
.tile p { margin-top: 8px; font-size: 16px; line-height: 1.55; }

/* ---------- Two-column feature (about) ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 80px); }
.duo h2 { margin-bottom: 20px; font-size: clamp(30px, 3.4vw, 40px); }

/* ---------- CTA band ---------- */
.cta {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 48px;
  padding: clamp(36px, 5.5vw, 72px);
  border-radius: calc(var(--radius) + 8px);
  background: radial-gradient(70% 140% at 100% 0%, #1f4fe0 0%, transparent 60%), var(--navy-deep);
  color: rgba(255, 255, 255, .8);
}
.cta h2 { color: #fff; }
.cta p { max-width: 46ch; margin-top: 14px; }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.cta-actions .email { color: #fff; font-weight: 500; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.form-card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.contact-aside h2 { font-size: 30px; }
.contact-aside .email { display: inline-block; margin-top: 12px; font-family: var(--serif); font-size: 26px; color: var(--ink); }
.contact-aside p { margin-top: 16px; }
.contact-aside hr { height: 1px; margin: 28px 0; border: 0; background: var(--line); }

.contact-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.contact-form .form-item { margin-bottom: 24px; }
.contact-form .title, .contact-form legend {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.contact-form .required { margin-left: 6px; color: #8391a7; font-size: 13px; font-weight: 400; }
.contact-form .name-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-form .caption { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 13px 15px;
  border: 1px solid #cfd7e6;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form input:not([type="checkbox"]):focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 79, 224, .16); }
.contact-form .options { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-form .option { position: relative; }
.contact-form .option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.contact-form .option span {
  display: block;
  padding: 9px 16px;
  border: 1px solid #cfd7e6;
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.contact-form .option span:hover { border-color: var(--accent); }
.contact-form .option input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.contact-form .option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.contact-form .description { margin-bottom: 8px; font-size: 14px; color: #8391a7; }
.contact-form .hp { position: absolute; left: -5000px; }
.contact-form .field-error { display: none; margin-top: 8px; font-size: 14px; color: #c8322b; }
.contact-form .invalid .field-error { display: block; }
.contact-form .invalid input:not([type="checkbox"]),
.contact-form .invalid textarea { border-color: #c8322b; }
.contact-form button { border: 0; }
.form-submitted { color: var(--ink); font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: rgba(255, 255, 255, .68); font-size: 16px; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 2fr) minmax(0, 3fr); gap: 40px; padding-top: 64px; padding-bottom: 48px; }
.footer-logo { width: auto; height: 44px; }
.footer-logo + p { max-width: 44ch; margin-top: 18px; }
.site-footer h3 { margin-bottom: 14px; color: rgba(255, 255, 255, .5); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li + li { margin-top: 8px; }
.site-footer a { color: #fff; }
.footer-bottom { padding-top: 22px; padding-bottom: 28px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .header-inner { min-height: 64px; }
  .logo img { height: 34px; }
  .mobile-nav-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink);
    cursor: pointer;
  }
  .mobile-nav-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .mobile-nav-toggle .icon-close { display: none; }
  .mobile-menu-open .mobile-nav-toggle .icon-close { display: block; }
  .mobile-menu-open .mobile-nav-toggle .icon-hamburger { display: none; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px var(--pad) 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 24px 32px -24px rgba(8, 27, 51, .25);
  }
  .mobile-menu-open .site-nav { display: flex; }
  .site-nav a { padding: 13px 14px; border-radius: 10px; font-size: 18px; }
  .site-nav a.nav-cta { margin: 8px 0 0; text-align: center; border-radius: 999px; }
  .cards, .duo { grid-template-columns: minmax(0, 1fr); }
  .hero::after { background: linear-gradient(180deg, rgba(5, 18, 61, .9), rgba(5, 18, 61, .8)); }
  .contact-form .name-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .tiles, .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn, .cta-actions .btn { width: 100%; }
}

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