/* 3E Engineering — site styles
   Palette and type from the redesign: ground #F4F5F3, ink #12161A, accent #0096D6 */

:root {
  --ground: #F4F5F3;
  --ground-2: #E9EBE8;
  --paper: #FFFFFF;
  --paper-2: #FBFBFA;
  --ink: #12161A;
  --ink-2: #2A3138;
  --ink-3: #3A4148;
  --ink-4: #4A535B;
  --muted: #5F6870;
  --muted-2: #8E979F;
  --line: #C9CDC8;
  --line-2: #DDE0DC;
  --line-3: #B4BAB3;
  --line-dark: #2A3138;
  --accent: #0096D6;
  --accent-dark: #0077B0;
  --accent-darker: #005A86;
  --accent-light: #2DB3EE;
  --accent-pale: #8FD0F0;
  --on-dark-muted: #C5CBD0;
  --on-dark-line: #E6EAED;
  --footer: #0B0E11;
  --black: #06121A;
  --ok: #1E7F4F;
  --err: #B3261E;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: Archivo, 'Archivo Fallback', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1280px;
  --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); }
a:hover { color: var(--accent-darker); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; z-index: 100; text-decoration: none; }
.skip-link:focus { top: 12px; }

.kicker { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
.kicker--light { color: var(--accent-pale); }
.h2 { margin: 16px 0 0; font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: clamp(34px, 4vw, 56px); line-height: 1.04; letter-spacing: -.015em; }
.label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.label--light { color: var(--muted-2); }
.gridlines { background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 64px 64px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 16px; padding: 16px 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn--accent { background: var(--accent); color: var(--black); }
.btn--accent:hover { background: var(--accent-light); color: var(--black); }
.btn--ghost { border-color: var(--ink-4); color: #fff; background: transparent; }
.btn--ghost:hover { border-color: #fff; color: #fff; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--ink-2); color: #fff; }
.btn--sm { font-size: 14px; padding: 12px 20px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: default; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(244,245,243,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.brand__name { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .01em; font-stretch: 112%; white-space: nowrap; }
.brand__name span { font-weight: 500; color: var(--ink-4); }
.nav { display: flex; flex-wrap: wrap; gap: 28px; font-size: 15px; font-weight: 500; }
.nav a { color: var(--ink-3); text-decoration: none; }
.nav a:hover { color: var(--accent-dark); }
.header-tools { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; font-family: var(--mono); font-size: 12px; }
.lang a { text-decoration: none; padding: 6px 10px; min-width: 36px; text-align: center; border-radius: 999px; color: var(--ink-3); }
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: var(--ink); color: #fff; }
.menu-btn { display: none; width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; place-items: center; color: var(--ink); border-radius: 8px; }
.menu-btn svg { width: 26px; height: 26px; }
.menu-btn .icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }
.menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .nav, .header-tools { display: none; }
  .menu-btn { display: grid; }
  .site-header__inner { padding-right: 0; }
  .mobile-nav { display: none; border-top: 1px solid var(--line-2); padding: 12px 0 32px; }
  .mobile-nav.is-open { display: block; }
  .mobile-nav a.mobile-nav__link { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
  .mobile-nav__link span:first-child { font-family: var(--display); font-weight: 700; font-size: 30px; font-stretch: 108%; }
  .mobile-nav__link span:last-child { font-family: var(--mono); font-size: 13px; color: var(--accent-dark); }
  .mobile-nav .label { margin-top: 32px; }
  .mobile-nav .lang { margin-top: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; font-size: 14px; }
  .mobile-nav .btn { margin-top: 24px; width: 100%; }
}

/* Hero */
.hero { background-color: var(--ink); color: #fff; }
.hero__inner { padding-top: 88px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero__copy { flex: 1 1 520px; min-width: 0; }
.hero__kicker { margin: 0 0 28px; font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-pale); }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: clamp(46px, 6.4vw, 92px); line-height: .98; letter-spacing: -.02em; }
.hero h1 span { color: var(--accent-light); }
.hero__lead { margin: 32px 0 0; max-width: 560px; font-size: 18px; line-height: 1.65; color: var(--on-dark-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; margin: 64px 0 0; padding-top: 28px; border-top: 1px solid var(--line-dark); }
.stats dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }
.stats dd { margin: 6px 0 0; font-family: var(--display); font-weight: 700; font-size: 30px; }
.figure { margin: 0; border: 1px solid var(--line-dark); border-radius: 6px; background: rgba(18,22,26,.6); }
.figure svg { display: block; width: 100%; height: auto; padding: 28px 20px 8px; }
.figure figcaption { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line-dark); font-size: 14px; }
.figure figcaption div { padding: 14px 20px; border-right: 1px solid var(--line-dark); }
.figure figcaption div:last-child { border-right: 0; }
.figure figcaption .label { font-size: 11px; }
.figure figcaption .v { margin-top: 4px; font-weight: 500; }
.hero__figure { flex: 1 1 460px; min-width: 0; }
.figure--light { border-color: var(--line); background: var(--paper-2); }
.figure--light figcaption { border-color: var(--line); }
.figure--light figcaption div { border-color: var(--line); }
.figure--light svg { padding: 24px 16px 4px; }

/* Capability strip */
.strip { background: var(--accent); color: var(--black); }
.strip__inner { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; gap: 10px 32px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }

/* About */
.section { padding-top: 120px; padding-bottom: 120px; }
.about__inner { display: flex; flex-wrap: wrap; gap: 64px; }
.about__copy { flex: 1 1 520px; min-width: 0; }
.about__text { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; font-size: 17px; line-height: 1.7; color: var(--ink-3); }
.about__text p { margin: 0; }
.facts { margin: 48px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border-top: 1px solid var(--line); }
.facts div { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); }
.facts dd { margin: 6px 0 0; font-weight: 600; }
.about__figure { flex: 1 1 400px; min-width: 0; align-self: center; }

/* Services */
.services { background: var(--ground-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.services__head { max-width: 720px; }
.services__grid { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.service { background: var(--ground); padding: 32px 28px 36px; display: flex; flex-direction: column; gap: 20px; }
.service__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.service__n { font-family: var(--mono); font-size: 13px; color: var(--accent-dark); }
.service__icon { width: 160px; height: 100px; flex-shrink: 0; }
.service h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.15; }
.service ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.service li { padding-left: 18px; position: relative; }
.service li::before { content: ""; position: absolute; left: 0; top: 11px; width: 8px; height: 1px; background: var(--muted); }

/* Projects */
.projects__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.projects__head > div:first-child { max-width: 640px; }
.projects__sub { margin: 14px 0 0; color: var(--muted); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { font-size: 15px; font-weight: 600; padding: 12px 20px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; background: transparent; color: var(--ink); border: 1px solid var(--line-3); }
.tab:hover { border-color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .count { font-family: var(--mono); font-size: 12px; opacity: .7; }
.projects__grid { margin-top: 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 28px; }
.card { display: flex; flex-direction: column; gap: 16px; text-decoration: none; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.card[hidden] { display: none; }
.card__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: var(--line-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__tag { position: absolute; top: 14px; left: 14px; background: rgba(18,22,26,.82); color: #fff; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 4px; }
.card__count { position: absolute; right: 14px; bottom: 14px; background: rgba(18,22,26,.82); color: #fff; font-family: var(--mono); font-size: 11px; padding: 6px 10px; border-radius: 4px; display: inline-flex; gap: 6px; align-items: center; }
.card__count svg { width: 14px; height: 14px; }
.card h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.2; }
.card dl { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.card dt { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card dd { margin: 0; text-align: right; color: var(--ink); font-weight: 500; }
.card__note { margin: 0; font-size: 13px; color: var(--muted); padding: 8px 0; border-bottom: 1px solid var(--line-2); }

/* Lightbox */
.lightbox { border: 0; padding: 0; margin: auto; width: min(100vw, 1200px); max-width: 100vw; height: 100dvh; max-height: 100dvh; background: transparent; color: #fff; }
.lightbox::backdrop { background: rgba(11,14,17,.97); }
.lightbox__inner { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; padding: 16px; }
.lightbox__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13px; color: var(--on-dark-muted); min-height: 48px; }
.lightbox__title { font-family: var(--display); font-weight: 700; font-size: 18px; color: #fff; }
.lightbox__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.lightbox__btn { width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--ink-4); background: rgba(18,22,26,.8); color: #fff; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.lightbox__btn:hover { border-color: #fff; }
.lightbox__btn svg { width: 22px; height: 22px; }
.lightbox__prev, .lightbox__next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 0; }
.lightbox__next { right: 0; }
@media (max-width: 700px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: 0; transform: none; }
  .lightbox__prev { left: 0; } .lightbox__next { right: 0; }
  .lightbox__stage { padding-bottom: 64px; }
}

/* Contact */
.contact { background-color: var(--ink); color: #fff; }
.contact__inner { display: flex; flex-wrap: wrap; gap: 64px; }
.contact__copy { flex: 1 1 420px; min-width: 0; }
.contact__intro { margin: 24px 0 0; font-size: 18px; line-height: 1.6; color: var(--on-dark-muted); max-width: 460px; }
.contact__list { margin: 48px 0 0; display: flex; flex-direction: column; border-top: 1px solid var(--line-dark); }
.contact__list div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--line-dark); }
.contact__list dd { margin: 0; font-size: 18px; font-weight: 500; }
.contact__list a { color: #fff; text-decoration: none; }
.contact__list a:hover { color: var(--accent-light); }
.contact__list a.mail { color: var(--accent-light); }
.form__footer { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.form__direct { margin: 0; font-size: 13px; color: var(--muted); }
.form__status { grid-column: 1 / -1; margin: 0; padding: 14px 16px; border-radius: 6px; font-size: 15px; line-height: 1.5; display: none; }
.form__status.is-ok { display: block; background: #E3F3EA; color: var(--ok); border: 1px solid #BFE3CC; }
.form__status.is-err { display: block; background: #FBE9E7; color: var(--err); border: 1px solid #F3C6C2; }

/* Footer */
.site-footer { background: var(--footer); color: var(--muted-2); }
.site-footer__inner { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; font-size: 14px; }
.site-footer .brand__name { color: #fff; font-size: 16px; }
.site-footer .brand__name span { color: var(--muted-2); }
.site-footer a { color: var(--muted-2); }
.site-footer a:hover { color: #fff; }
.site-footer .langs { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; display: flex; gap: 10px; }
.site-footer .langs a { text-decoration: none; }
.site-footer .langs a[aria-current="page"] { color: #fff; }

/* Simple pages (privacy) */
.page { max-width: 760px; margin: 0 auto; padding: 96px var(--gutter) 120px; }
.page h1 { font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: clamp(34px, 4vw, 56px); line-height: 1.04; letter-spacing: -.015em; margin: 16px 0 0; }
.page h2 { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 40px 0 10px; }
.page p { font-size: 17px; line-height: 1.7; color: var(--ink-3); }
.page .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 20px; }
.page .btn { margin-top: 40px; }

/* Responsive tweaks */
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .section { padding-top: 80px; padding-bottom: 80px; }
  .hero__inner { padding-top: 56px; padding-bottom: 64px; gap: 40px; }
  .hero__lead { font-size: 17px; }
  .stats { gap: 16px; margin-top: 48px; }
  .stats dd { font-size: 26px; }
  .projects__grid { gap: 32px 20px; }
  .service { padding: 28px 22px 32px; }
  .service__icon { width: 120px; height: 75px; }
  .service__icon svg { width: 120px; height: 75px; }
  .btn { width: 100%; }
  .hero__actions .btn { width: auto; flex: 1 1 auto; }
  .tabs .tab { flex: 1 1 auto; justify-content: center; }
  .card dl div { flex-direction: column; gap: 2px; }
  .card dd { text-align: left; }
}
