/* Petronex Engineering: site styles. Mobile-first; wider screens add to these rules. */

:root {
  --navy: #071a3d;
  --navy-2: #0d2e62;
  --navy-3: #04132e;
  --orange: #c94f00;          /* text and buttons on light backgrounds (passes AA with white) */
  --orange-hover: #b04400;
  --orange-bright: #ff7a1a;   /* accents on dark backgrounds */
  --orange-soft: #fff2e8;
  --ink: #172033;
  --muted: #556275;
  --line: #dce3ec;
  --soft: #f4f7fb;
  --shadow: 0 18px 48px rgba(7, 26, 61, .12);
  --shadow-sm: 0 8px 24px rgba(7, 26, 61, .08);
  --radius: 20px;
  --gutter: 20px;
  --header-h: 64px;
  --container: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (min-width: 768px) { :root { --gutter: 32px; --header-h: 72px; } }
@media (min-width: 1024px) { :root { --header-h: 80px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(201, 79, 0, .14);
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, summary, select { touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange-bright); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0; color: var(--navy); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 7.6vw, 4.6rem); line-height: 1.06; }
h2 { font-size: clamp(1.65rem, 5.4vw, 3rem); }
h3 { font-size: 1.125rem; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; color: var(--muted); text-wrap: pretty; }

.container { width: min(var(--container), 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 300; padding: 12px 18px; border-radius: 12px; background: #fff; color: var(--navy); font-weight: 700; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.eyebrow--light { color: var(--orange-bright); }

.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head h2 { margin-top: 12px; }
@media (min-width: 900px) {
  .section-head { grid-template-columns: 1.25fr .75fr; align-items: end; gap: 56px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px;
  font-weight: 800; font-size: 1rem; line-height: 1.1; text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px rgba(201, 79, 0, .28); }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid #c5d0df; }
.btn-block { width: 100%; }
@media (hover: hover) {
  .btn-primary:hover { background: var(--orange-hover); transform: translateY(-2px); }
  .btn-ghost:hover { background: rgba(255, 255, 255, .2); }
  .btn-outline:hover { border-color: var(--navy); }
}

/* ---------- Header ---------- */
.topline { display: none; }
@media (min-width: 900px) {
  .topline { display: block; background: var(--navy); color: #cbd7e9; font-size: .82rem; }
  .topline .container { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; }
  .topline strong { color: #fff; }
}

.site-header { position: sticky; top: 0; z-index: 60; isolation: isolate; border-bottom: 1px solid rgba(7, 26, 61, .08); }
/* The blur lives on a pseudo-element: backdrop-filter on the header itself would trap the fixed mobile menu inside it. */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .95); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; flex: none; min-height: 48px; }
.brand img { height: 38px; width: auto; }
@media (min-width: 768px) { .brand img { height: 46px; } }

.menu-btn { width: 48px; height: 48px; margin-right: -10px; display: grid; place-items: center; border: 0; border-radius: 14px; background: transparent; }
.menu-btn .bars { position: relative; display: block; width: 24px; height: 16px; }
.menu-btn .bars span { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--navy); transition: transform .25s ease, opacity .2s ease, top .25s ease; }
.menu-btn .bars span:nth-child(1) { top: 0; }
.menu-btn .bars span:nth-child(2) { top: 7px; }
.menu-btn .bars span:nth-child(3) { top: 14px; }
.menu-btn[aria-expanded="true"] .bars span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bars span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

.nav-panel {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 59;
  display: flex; flex-direction: column;
  padding: 8px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  background: #fff; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.nav-panel.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-links { display: flex; flex-direction: column; }
.nav-links a {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 62px; border-bottom: 1px solid var(--line);
  font-size: 1.25rem; font-weight: 700; color: var(--navy);
}
.nav-links a::after { content: "\203A"; font-size: 1.6rem; font-weight: 400; color: #9aa7bb; }
.nav-cta { margin-top: 26px; }
.nav-meta { margin-top: 22px; display: grid; gap: 4px; font-size: .95rem; }
.nav-meta a { color: var(--navy); font-weight: 700; padding: 8px 0; }

@media (min-width: 900px) {
  .menu-btn { display: none; }
  .nav-panel {
    position: static; inset: auto; z-index: auto; flex-direction: row; align-items: center; gap: 30px;
    padding: 0; background: transparent; overflow: visible;
    opacity: 1; visibility: visible; transform: none; transition: none;
  }
  .nav-links { flex-direction: row; gap: 28px; }
  .nav-links a { position: relative; min-height: 44px; border: 0; font-size: .93rem; color: #32415a; }
  .nav-links a::after { content: ""; position: absolute; left: 0; bottom: 6px; width: 0; height: 2px; background: var(--orange); transition: width .25s ease; }
  .nav-links a:hover::after, .nav-links a[aria-current="true"]::after { width: 100%; }
  .nav-links a[aria-current="true"] { color: var(--navy); }
  .nav-cta { margin: 0; }
  .nav-cta .btn { min-height: 46px; padding: 0 22px; font-size: .93rem; }
  .nav-meta { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; color: #fff; background: var(--navy); overflow: clip; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7, 26, 61, .78) 0%, rgba(7, 26, 61, .66) 40%, rgba(4, 19, 46, .94) 100%);
}
.hero-inner { display: flex; flex-direction: column; justify-content: flex-end; min-height: min(calc(100svh - var(--header-h)), 780px); padding-top: 48px; }
.hero h1 { margin-top: 16px; color: #fff; max-width: 18ch; }
.dialog-cta { margin-top: 12px; }
.hero h1 .accent { color: var(--orange-bright); }
.hero-lead { margin-top: 20px; max-width: 620px; font-size: 1.0625rem; color: rgba(255, 255, 255, .86); }
.hero-actions { display: grid; gap: 12px; margin-top: 28px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 36px; border-top: 1px solid rgba(255, 255, 255, .22); }
.stat { padding: 16px 10px 22px 0; }
.stat + .stat { padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .16); }
.stat strong { display: block; font-size: .95rem; line-height: 1.2; white-space: nowrap; color: #fff; }
.stat span { display: block; margin-top: 4px; font-size: .75rem; line-height: 1.35; color: rgba(255, 255, 255, .72); }
.hero-card { display: none; }

@media (min-width: 560px) {
  .hero-actions { grid-template-columns: repeat(2, auto); justify-content: start; }
  .stat strong { font-size: 1.35rem; }
  .stat span { font-size: .85rem; }
}
@media (min-width: 1024px) {
  .hero::after { background: linear-gradient(90deg, rgba(4, 19, 46, .92) 0%, rgba(7, 26, 61, .74) 48%, rgba(7, 26, 61, .28) 100%), linear-gradient(180deg, transparent 60%, rgba(4, 19, 46, .7) 100%); }
  .hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: end; column-gap: 64px; padding: 96px 0 0; }
  .hero-copy { grid-column: 1; }
  .hero-stats { grid-column: 1 / -1; max-width: 760px; }
  .hero-card { display: block; grid-column: 2; grid-row: 1; margin-bottom: 8px; padding: 22px; border-radius: 20px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow); }
  .hero-card .mini { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
  .hero-card strong { display: block; margin: 6px 0; font-size: 1.15rem; line-height: 1.25; color: var(--navy); }
  .hero-card p { font-size: .9rem; }
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: 36px; }
.about-media { position: relative; }
.about-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.about-stamp { position: relative; margin: -34px 14px 0; padding: 20px 22px; border-radius: 18px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.about-stamp strong { display: block; font-size: 1.6rem; line-height: 1.1; }
.about-stamp span { display: block; margin-top: 6px; font-size: .9rem; line-height: 1.45; color: #cbd7e9; }
.about-copy h2 { margin: 12px 0 18px; }
.about-copy p + p { margin-top: 14px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); font-size: .82rem; font-weight: 800; color: var(--navy); }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: .92fr 1.08fr; gap: 72px; align-items: center; }
  .about-media img { aspect-ratio: 1 / 1; }
  .about-stamp { position: absolute; right: -24px; bottom: -26px; width: 240px; margin: 0; }
}

/* ---------- Services ---------- */
.services { position: relative; overflow: clip; background: var(--navy); color: #fff; }
.services::after { content: ""; position: absolute; right: -220px; top: -180px; width: 600px; height: 600px; border: 100px solid rgba(255, 255, 255, .025); border-radius: 50%; pointer-events: none; }
.services h2 { color: #fff; }
.services .section-head p { color: #b8c5d8; }
.services-grid { position: relative; z-index: 1; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.service-card {
  display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-items: start;
  padding: 18px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
}
.service-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(245, 100, 0, .16); color: #ff9a4d; }
.service-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.service-card h3 { color: #fff; }
.service-card p { margin-top: 6px; font-size: .92rem; line-height: 1.55; color: #b9c6da; }
@media (min-width: 640px) { .services-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1024px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
  .service-card { display: block; min-height: 270px; padding: 26px 22px; border-radius: 22px; transition: transform .3s ease, background .3s ease, border-color .3s ease; }
  .service-icon { width: 54px; height: 54px; margin-bottom: 22px; border-radius: 16px; }
  .service-icon svg { width: 28px; height: 28px; }
  .service-card h3 { margin-bottom: 12px; }
  .service-card p { margin: 0; }
}
@media (hover: hover) and (min-width: 1024px) {
  .service-card:hover { transform: translateY(-8px); background: linear-gradient(180deg, rgba(245, 100, 0, .25), rgba(255, 255, 255, .06)); border-color: rgba(255, 132, 43, .45); }
}

/* ---------- Process ---------- */
.process { background: var(--soft); }
.steps { position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
.step { position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: 18px; padding-bottom: 28px; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 27px; top: 58px; bottom: 2px; width: 2px; background: linear-gradient(var(--navy), var(--orange)); opacity: .35; }
.step-num { grid-row: 1 / span 2; display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid #dbe3ed; border-radius: 18px; background: #fff; box-shadow: 0 10px 24px rgba(7, 26, 61, .08); font-size: 1.05rem; font-weight: 900; color: var(--navy); }
.step:nth-child(n+4) .step-num { background: var(--orange); border-color: var(--orange); color: #fff; }
.step h3 { align-self: end; }
.step p { margin-top: 4px; font-size: .92rem; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .steps::before { content: ""; position: absolute; left: 10%; right: 10%; top: 34px; height: 2px; background: linear-gradient(90deg, var(--navy), var(--orange)); }
  .step { display: block; padding: 0 10px; text-align: center; }
  .step:not(:last-child)::before { display: none; }
  .step-num { position: relative; width: 70px; height: 70px; margin: 0 auto 18px; font-size: 1.15rem; border-radius: 22px; }
  .step p { margin-top: 8px; font-size: .88rem; }
}

/* ---------- Projects ---------- */
.filters {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  margin: 0 calc(var(--gutter) * -1) 6px; padding: 4px var(--gutter) 14px;
}
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; min-height: 46px; padding: 0 20px; border: 1.5px solid #cfd8e5; border-radius: 999px; background: #fff; font-weight: 700; color: #34435b; scroll-snap-align: start; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.filter[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }

.project-grid {
  display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 20px; list-style: none;
}
.project-grid::-webkit-scrollbar { display: none; }
.project-card {
  position: relative; flex: 0 0 min(82vw, 340px); scroll-snap-align: start; overflow: hidden;
  border: 1px solid #dfe5ed; border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease;
}
.project-card[hidden] { display: none; }
.project-image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #d6dee7; }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-tag { position: absolute; left: 14px; top: 14px; padding: 6px 11px; border-radius: 999px; background: rgba(7, 26, 61, .9); font-size: .72rem; font-weight: 800; color: #fff; }
.project-body { padding: 20px 20px 22px; }
.project-body h3 { color: var(--navy); margin-bottom: 8px; }
.project-body p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; }
.project-open { margin-top: 14px; padding: 0; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font-size: .88rem; font-weight: 800; color: var(--orange); }
.project-open::after { content: ""; position: absolute; inset: 0; } /* the whole card opens the project */
.project-open:focus-visible { outline: none; }
.project-card:focus-within { outline: 3px solid var(--orange-bright); outline-offset: 3px; }
@media (min-width: 768px) {
  .filters { flex-wrap: wrap; overflow: visible; margin: 0 0 14px; padding: 0 0 14px; }
  .project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; overflow: visible; margin: 0; padding: 0; }
  .project-card { flex: initial; }
}
@media (min-width: 1024px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
@media (hover: hover) {
  .project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
  .project-card:hover img { transform: scale(1.05); }
}

/* ---------- Industries ---------- */
.industries-grid { display: grid; gap: 16px; }
.industry-main { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 340px; padding: 28px 24px; border-radius: 24px; overflow: hidden; color: #fff; }
.industry-main img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.industry-main::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 26, 61, .55), rgba(7, 26, 61, .94)); }
.industry-main h2 { margin-top: 12px; color: #fff; }
.industry-main p { max-width: 600px; margin-top: 14px; color: #d2dced; }
.industry-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.industry-item { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid #dbe3ed; border-radius: 20px; background: #fff; }
.industry-dot { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--orange-soft); font-weight: 900; color: var(--orange); }
.industry-item b { display: block; margin-bottom: 2px; color: var(--navy); font-size: 1.02rem; }
.industry-item p { font-size: .92rem; }
@media (min-width: 900px) {
  .industries-grid { grid-template-columns: 1.15fr .85fr; gap: 24px; }
  .industry-main { min-height: 440px; padding: 46px; border-radius: 28px; }
  .industry-item { padding: 24px; gap: 18px; }
}

/* ---------- References ---------- */
.clients { background: #f8fafc; }
.client-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.client { padding: 11px 15px; border: 1px solid #dfe5ed; border-radius: 14px; background: #fff; font-size: .88rem; font-weight: 700; color: #31415a; box-shadow: 0 6px 18px rgba(7, 26, 61, .04); }
.clients-toggle { margin-top: 18px; }
@media (max-width: 767px) {
  .client-cloud:not(.expanded) .client:nth-child(n+9) { display: none; }
}
@media (min-width: 768px) { .clients-toggle { display: none; } }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; gap: 0; overflow: hidden; border-radius: 26px; background: var(--navy); box-shadow: var(--shadow); grid-template-areas: "intro" "form" "points"; }
.contact-intro { grid-area: intro; padding: 30px 22px 26px; color: #fff; background: radial-gradient(circle at top right, rgba(245, 100, 0, .3), transparent 42%); }
.contact-intro h2 { margin: 12px 0 14px; color: #fff; }
.contact-intro p { color: #c5d1e2; }
.contact-form { grid-area: form; padding: 26px 22px 30px; background: #fff; }
.contact-points { grid-area: points; display: grid; gap: 12px; padding: 24px 22px 30px; }
.contact-point { padding: 16px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; background: rgba(255, 255, 255, .06); color: #fff; }
.contact-point small { display: block; margin-bottom: 4px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9fb3d1; }
.contact-point strong { display: block; font-size: 1rem; line-height: 1.4; }
.contact-point a { display: flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 4px; }

.form-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .875rem; font-weight: 700; color: #2d3c55; }
.field .opt { font-weight: 500; color: #6b7a90; }
input, select, textarea {
  width: 100%; min-height: 52px; padding: 13px 14px; border: 1.5px solid #cfd8e5; border-radius: 14px;
  background: #fbfcfe; font-size: 1rem; color: var(--ink); -webkit-appearance: none; appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23556275' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
textarea { min-height: 140px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8795aa; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 4px rgba(201, 79, 0, .14); }
.was-validated :is(input, select, textarea):invalid { border-color: #b42318; background: #fffafa; }
.field-error { display: none; font-size: .82rem; font-weight: 600; color: #b42318; }
.was-validated .field:has(:invalid) .field-error { display: block; }
.form-actions { display: grid; gap: 14px; margin-top: 6px; }
.form-actions .btn { width: 100%; }
.form-status { display: none; padding: 14px 16px; border-radius: 14px; font-size: .92rem; line-height: 1.5; }
.form-status.show { display: block; }
.form-status.info { background: #eef4ff; color: #173a73; border: 1px solid #c9dbff; }
.form-status.success { background: #ecfdf3; color: #14532d; border: 1px solid #b7ebcb; }
.form-status.error { background: #fef3f2; color: #912018; border: 1px solid #fecdca; }
.form-status .btn { margin-top: 12px; min-height: 48px; }
.form-privacy { font-size: .78rem; line-height: 1.5; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field.full { grid-column: 1 / -1; }
  .form-actions .btn { width: auto; justify-self: start; }
}
@media (min-width: 1024px) {
  .contact-wrap { grid-template-columns: .92fr 1.08fr; grid-template-areas: "intro form" "points form"; border-radius: 32px; }
  .contact-intro { padding: 54px 54px 20px; }
  .contact-form { padding: 48px; }
  .contact-points { align-content: start; padding: 8px 54px 54px; }
}

/* ---------- Footer ---------- */
.site-footer { padding: 44px 0 calc(28px + 84px + env(safe-area-inset-bottom)); background: var(--navy-3); color: #c0ccdd; }
.footer-grid { display: grid; gap: 32px; }
.footer-logo { width: 220px; padding: 10px 14px; border-radius: 14px; background: #fff; }
.footer-about p { max-width: 470px; margin-top: 16px; font-size: .92rem; color: #aebbd0; }
.site-footer h4 { margin-bottom: 8px; color: #fff; font-size: 1rem; }
.footer-links { display: grid; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
.footer-links a { display: flex; align-items: center; min-height: 44px; font-size: .95rem; color: #aebbd0; }
.footer-bottom { display: flex; flex-direction: column; gap: 6px; margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; color: #93a3bb; }
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .site-footer { padding-bottom: 28px; }
  .footer-grid { grid-template-columns: 1.3fr .7fr .9fr; gap: 40px; }
  .footer-about { grid-column: auto; }
  .footer-links a { min-height: 36px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}
@media (hover: hover) { .footer-links a:hover { color: #fff; } }

/* ---------- Project dialog (bottom sheet on phones) ---------- */
dialog.project-dialog {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 92dvh; margin: 0; padding: 0;
  border: 0; border-radius: 24px 24px 0 0; background: #fff; color: var(--ink); overflow: hidden;
}
dialog.project-dialog[open] { display: flex; flex-direction: column; animation: sheet-in .28s ease; }
.project-dialog::backdrop { background: rgba(2, 10, 25, .78); backdrop-filter: blur(6px); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-media { flex: none; background: #08182f; }
.dialog-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.dialog-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom)); }
.dialog-body h2 { margin: 10px 0 12px; font-size: clamp(1.4rem, 5vw, 2rem); }
.dialog-close { position: absolute; right: 12px; top: 12px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: rgba(7, 26, 61, .78); color: #fff; font-size: 1.6rem; line-height: 1; }
.dialog-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.dialog-nav .btn { min-height: 48px; padding: 0 14px; font-size: .9rem; }
@media (min-width: 900px) {
  dialog.project-dialog { inset: 0; width: min(1040px, 94vw); max-height: 86vh; margin: auto; border-radius: 24px; }
  dialog.project-dialog[open] { flex-direction: row; }
  .dialog-media { flex: 1.15; display: grid; }
  .dialog-media img { height: 100%; aspect-ratio: auto; }
  .dialog-body { flex: .85; padding: 40px 36px; }
}

/* ---------- Mobile action bar and back-to-top ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: flex; gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(7, 26, 61, .08);
  transform: translateY(110%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s;
}
.action-bar.show { transform: none; visibility: visible; transition-delay: 0s; }
.action-bar .btn { flex: 1; min-height: 50px; }
.action-bar .btn-icon { flex: none; width: 50px; padding: 0; }
.action-bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back-top { display: none; }
@media (min-width: 900px) {
  .action-bar { display: none; }
  .back-top { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--orange); color: #fff; font-size: 1.2rem; box-shadow: 0 14px 30px rgba(201, 79, 0, .3); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
  .back-top.show { opacity: 1; visibility: visible; transition-delay: 0s; }
}

/* ---------- 404 page ---------- */
.notfound { display: grid; place-items: center; min-height: 100svh; padding: 24px var(--gutter); background: var(--soft); }
.notfound-card { width: min(520px, 100%); padding: 40px 28px; border-radius: 26px; background: #fff; text-align: center; box-shadow: var(--shadow); }
.notfound-card img { width: 200px; margin: 0 auto 28px; }
.notfound-code { font-size: .8rem; font-weight: 800; letter-spacing: .16em; color: var(--orange); }
.notfound-card h1 { margin: 8px 0 12px; font-size: clamp(1.6rem, 6vw, 2.2rem); }
.notfound-card .btn { margin-top: 26px; }

/* ---------- Scroll reveal (only when scripting runs; content is visible otherwise) ---------- */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.visible { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
