/* ============================================================
   AMPEX (inženjering) d.o.o. — light theme
   White / soft sky background, deep slate ink, one green accent.
   Sora (display) / Inter (body) / IBM Plex Mono (labels).
   ============================================================ */

:root {
  --bg: #fbfdfe;
  --bg2: #f2f7f9;
  --card: #ffffff;
  --line: #e1e9ee;
  --line2: #edf2f6;
  --ink: #122430;
  --dim: #4c6172;
  --mut: #8aa0af;
  --green: #0f9d58;
  --green-dark: #0b7a43;
  --green-soft: rgba(15, 157, 88, 0.09);
  --green-line: rgba(15, 157, 88, 0.35);
  --amber: #f2c14e;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --radius: 14px;
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #d3f3d9; color: var(--ink); }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1200px, 100% - 48px); margin: 0 auto; }
[id] { scroll-margin-top: 90px; }

/* ---------- type ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 10px;
}
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--green); flex: none; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.14; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }

.lead { color: var(--dim); font-size: 1.06rem; line-height: 1.65; max-width: 640px; text-wrap: pretty; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--mut); }

.sec-head { max-width: 760px; margin-bottom: 44px; }
.sec-head h2 { margin-top: 16px; }
.section { padding: 84px 0; }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.site-head.scrolled { border-bottom-color: var(--line); }

.head-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}
.logo .mark { width: 28px; height: 28px; flex: none; }
.logo .sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mut);
  transform: translateY(3px);
}

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 0.94rem; color: var(--dim); transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- "Rješenja" dropdown ---------- */
.nav-item { position: relative; display: inline-flex; }
.nav-item > a { display: inline-flex; align-items: center; gap: 7px; }
.nav-item .caret {
  width: 9px; height: 6px; flex: none;
  color: var(--mut);
  transition: transform 0.2s;
}
.nav-item:hover > a { color: var(--ink); }
.nav-item:hover .caret {
  transform: rotate(180deg); color: var(--ink);
}
/* NOTE: :focus-within is deliberately NOT used to open the menu —
   Firefox keeps focus on a link after it is clicked, which would leave
   the dropdown stuck open as an invisible overlay blocking all clicks.
   Keyboard access is covered by the drop-open class (JS) + focus-visible. */
.sub-menu {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translate(-50%, 6px);
  width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(18, 36, 48, 0.10);
  padding: 8px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 70;
}
.sub-menu::before {
  /* hover bridge so the menu doesn't flicker when the cursor travels to it */
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
}
.nav-item:hover .sub-menu,
.nav-item.drop-open .sub-menu {
  opacity: 1; visibility: visible;
  transform: translate(-50%, 0);
}
.sub-menu a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  transition: background 0.15s;
}
.sub-menu a:hover { background: var(--green-soft); }
.sub-menu a .t { font-size: 0.93rem; font-weight: 600; line-height: 1.3; }
.sub-menu a .d { font-size: 0.8rem; color: var(--mut); line-height: 1.35; }
.sm-sep { height: 1px; background: var(--line2); margin: 6px 8px; }

.burger {
  display: none;
  width: 44px; height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.burger span { display: block; width: 18px; height: 2px; background: var(--ink); transition: transform 0.25s, opacity 0.2s; }
.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, background 0.18s, filter 0.18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--green-line); background: var(--green-soft); }
.btn-sm { padding: 9px 16px; font-size: 0.88rem; border-radius: 9px; }

/* ============================================================
   SCROLL STORY (landing hero)
   ============================================================ */
.story { position: relative; height: 620vh; }
.story-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #f5fafc 0%, #ffffff 72%);
}
.story-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  width: min(1280px, 100% - 56px);
  margin: 0 auto;
  padding: 88px 0 64px;
}
.story-scene svg { display: block; width: 100%; height: auto; }

/* scene components start hidden; JS drives opacity/transform */
#g-pv, #g-inv, #g-bess, #g-evbox, #g-car, #g-heat, #g-flow { opacity: 0; will-change: transform, opacity; }
#g-inv, #g-evbox { transform-box: fill-box; transform-origin: 50% 25%; }

/* energy flow lines only animate in the final stage */
#sceneBox .flowline { stroke-dasharray: 5 9; }
#sceneBox.final .flowline { animation: dashmove 1.1s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -14; } }

/* captions column */
.story-caps { position: relative; }
.story-intro { transition: opacity 0.2s linear, max-height 0.4s ease 0.1s; max-height: 320px; }
.story-intro.gone { max-height: 0; opacity: 0; overflow: hidden; }
.story-intro h1 { margin-top: 18px; }
.story-intro .lead { margin-top: 18px; }
.story-hint {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
}
.story-hint .arr { display: inline-block; animation: bounce 1.6s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.cap-list { list-style: none; }
.cap {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.cap.on { opacity: 1; transform: none; }
.cap-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--green);
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 4px 10px;
  margin-top: 3px;
}
.cap h3 { font-size: 1.18rem; }
.cap p { color: var(--dim); font-size: 0.92rem; margin-top: 4px; max-width: 380px; text-wrap: pretty; }

.cap-final {
  margin-top: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: block;
}
.cap-final h3 { font-size: 1.55rem; }
.cap-final p { max-width: 400px; margin-top: 8px; }
.cap-final .btn { margin-top: 18px; }

/* step indicator */
.story-steps {
  position: absolute;
  left: 0; right: 0;
  bottom: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mut);
}
.story-steps span { display: inline-flex; align-items: center; gap: 7px; transition: color 0.3s; }
.story-steps span::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.3s, box-shadow 0.3s;
}
.story-steps span.active { color: var(--ink); }
.story-steps span.active::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ============================================================
   SOLUTION CARDS
   ============================================================ */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  border-color: var(--green-line);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(18, 36, 48, 0.07);
}
.card .c-ico {
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: 12px;
  margin-bottom: 18px;
}
.card .c-ico svg { width: 30px; height: 30px; }
.card .c-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--mut); }
.card h3 { font-size: 1.16rem; margin-top: 6px; }
.card p { color: var(--dim); font-size: 0.93rem; margin-top: 10px; flex: 1; text-wrap: pretty; }
.card .c-link {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}
.card:hover .c-link { color: var(--green-dark); }

/* ---------- process ---------- */
.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.step { border-top: 2px solid var(--line); padding-top: 20px; transition: border-color 0.3s; }
.step:hover { border-top-color: var(--green); }
.step .num { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--green); }
.step h4 { font-size: 1.1rem; margin: 10px 0 8px; }
.step p { color: var(--dim); font-size: 0.94rem; }

/* ---------- CTA band ---------- */
.band {
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: 16px;
  padding: 44px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}
.band h3 { font-size: 1.55rem; }
.band p { color: var(--dim); margin-top: 8px; max-width: 480px; }
.band .btn { flex: none; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--bg2); padding: 56px 0 36px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 40px; }
.foot-grid p { color: var(--dim); font-size: 0.92rem; max-width: 320px; margin-top: 14px; }
.foot-grid h5 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 14px;
}
.foot-grid ul { list-style: none; }
.foot-grid li { margin: 9px 0; }
.foot-grid a { color: var(--dim); font-size: 0.92rem; }
.foot-grid a:hover { color: var(--green); }
.foot-bottom {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mut);
}

/* ============================================================
   SUBPAGES
   ============================================================ */
.pagehead { padding: 92px 0 56px; }
.pagehead .lead { margin-top: 20px; }

/* photo hero (solarna.html) — scrim only; the page-wide fixed photo (body.photo-page) shows through */
.pagehead.photo-hero { position: relative; isolation: isolate; padding: 128px 0 96px; }
.pagehead.photo-hero::after {
  content: "";
  position: absolute; inset: 0 auto; left: 50%; transform: translateX(-50%); width: 100vw; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 22, 15, 0.55) 0%, rgba(8, 22, 15, 0.14) 58%, rgba(8, 22, 15, 0.26) 100%),
    linear-gradient(180deg, rgba(8, 22, 15, 0.46) 0%, rgba(8, 22, 15, 0.12) 42%, rgba(8, 22, 15, 0.42) 100%);
}
.pagehead.photo-hero h1 { color: #fff; }
.pagehead.photo-hero .lead { color: rgba(255, 255, 255, 0.84); }
.pagehead.photo-hero .kicker { color: #5fd695; }
.pagehead.photo-hero .kicker::before { background: #5fd695; }

/* photo page (solarna.html) — fixed full-page photo background behind all content */
body.photo-page { background: transparent; }
body.photo-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 22, 15, 0.78) 0%, rgba(8, 22, 15, 0.86) 100%),
    url("../img/hero-solar-bg.jpg") center 82% / cover no-repeat;
}
body.photo-page .sol-copy h2 { color: #fff; }
body.photo-page .sol-copy > p { color: rgba(255, 255, 255, 0.82); }
body.photo-page .sol-copy .kicker { color: #5fd695; }
body.photo-page .sol-copy .kicker::before { background: #5fd695; }
body.photo-page .type-card,
body.photo-page .brand-strip,
body.photo-page .band { box-shadow: 0 14px 38px rgba(5, 18, 12, 0.35); }
body.photo-page .brand-strip {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
body.photo-page .band { background: var(--card); border-color: var(--line); }

/* baterije.html — same photo treatment, BESS-field background + photo in .head-ico */
body.bess-page::before {
  background-image:
    linear-gradient(180deg, rgba(8, 22, 15, 0.78) 0%, rgba(8, 22, 15, 0.86) 100%),
    url("../img/hero-bess-bg.jpg");
}
body.bess-page .head-ico {
  background: var(--card);
  border-color: var(--line);
  padding: 14px;
  box-shadow: 0 14px 38px rgba(5, 18, 12, 0.35);
}
body.bess-page .head-ico img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}
.pagehead-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.head-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f2faf5, var(--green-soft));
  border: 1px solid var(--green-line);
  border-radius: 20px;
  padding: 44px;
}
.head-ico svg { width: min(220px, 100%); height: auto; }
.head-photo {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--green-line);
  box-shadow: 0 18px 44px rgba(15, 55, 38, 0.14);
}
.head-photo img { display: block; width: 100%; height: auto; }

.sol { padding: 56px 0; }
.sol + .sol { border-top: 1px solid var(--line2); }
.sol-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 52px; align-items: start; }
.sol-grid.flip .sol-copy { order: 2; }
.sol-grid.flip .sol-side { order: 1; }
.sol-copy h2 { margin-top: 16px; font-size: 1.7rem; }
.sol-copy > p { color: var(--dim); margin-top: 14px; text-wrap: pretty; }

.sol-list { list-style: none; margin-top: 28px; }
.sol-list li {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--line2);
  font-size: 0.97rem;
}
.sol-list li:last-child { border-bottom: 1px solid var(--line2); }
.sol-list .idx { font-family: var(--font-mono); font-size: 11px; color: var(--green); flex: none; }

.spec-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; }
.spec-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 10px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line2);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.spec-row:last-child { border-bottom: none; }
.spec-row .k { color: var(--dim); }
.spec-row .v { color: var(--ink); text-align: right; }
.spec-note { margin-top: 14px; font-family: var(--font-mono); font-size: 10.5px; color: var(--mut); letter-spacing: 0.03em; }

/* ---------- solar: type overview ---------- */
.sol-copy > p { color: var(--dim); margin-top: 14px; text-wrap: pretty; }
.type-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  margin-top: 40px;
  align-items: start;
}
.type-side { display: grid; gap: 20px; }
.type-grid.two { grid-template-columns: 1fr 1fr; }
.type-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.type-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.type-card p { font-size: 0.95rem; color: var(--dim); line-height: 1.55; }
.type-card p + p { margin-top: 10px; }
.type-card p strong { color: var(--ink); font-weight: 600; }
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px 44px;
  margin-top: 36px;
  padding: 26px 12px;
  border-top: 1px solid var(--line2);
}
.brand-strip img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.brand-strip img:hover { opacity: 1; }

/* ---------- C&I page ---------- */
.ci-cases { display: grid; gap: 22px; }
.ci-case {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 40px 34px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.ci-case:hover {
  border-color: var(--green-line);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(18, 36, 48, 0.06);
}
.cc-ico { position: absolute; top: 34px; right: 40px; width: 44px; height: 44px; opacity: 0.95; }
.cc-ico svg { width: 100%; height: 100%; }
.cc-num { position: absolute; top: 34px; right: 92px; font-family: var(--font-mono); font-size: 12px; color: var(--mut); }
.ci-case h3 { font-size: 1.45rem; margin-top: 4px; max-width: 520px; }
.ci-case > p { color: var(--dim); margin-top: 14px; max-width: 560px; text-wrap: pretty; }
.cc-list { list-style: none; margin-top: 22px; }
.cc-list li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--line2);
  font-size: 0.94rem;
}
.cc-list li::before { content: "→"; color: var(--green); font-family: var(--font-mono); font-size: 12px; flex: none; }
.cc-spec { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 28px; }
.cc-spec .spec-row { font-size: 12px; }

.ci-why { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 40px; }
.why-item { border-top: 2px solid var(--line); padding-top: 18px; transition: border-color 0.3s; }
.why-item:hover { border-top-color: var(--green); }
.why-item h4 { font-size: 1.12rem; margin-bottom: 8px; }
.why-item p { color: var(--dim); font-size: 0.94rem; text-wrap: pretty; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.info-block { border-top: 1px solid var(--line); padding: 16px 0; }
.info-block h5 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 5px;
}
.info-block a { color: var(--ink); font-size: 1.02rem; }
.info-block a:hover { color: var(--green); }
.info-block p { font-size: 1rem; }

.form-panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
}
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.97rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.form-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--mut); letter-spacing: 0.02em; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .sol-grid, .sol-grid.flip { grid-template-columns: 1fr; gap: 36px; }
  .type-grid { grid-template-columns: 1fr; margin-top: 28px; }
  .sol-grid.flip .sol-copy { order: 1; }
  .sol-grid.flip .sol-side { order: 2; }
  .pagehead-grid { grid-template-columns: 1fr; gap: 32px; }
  .head-ico { justify-self: start; width: min(320px, 100%); }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .ci-case { grid-template-columns: 1fr; gap: 22px; padding: 32px 28px 28px; }
  .cc-spec { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 18px; }
  .cc-ico { top: 28px; right: 28px; }
  .cc-num { top: 32px; right: 84px; }
  .ci-why { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 900px) {
  .story { height: 560vh; }
  .story-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 72px 0 58px;
    align-content: center;
  }
  .story-scene { max-width: 430px; margin: 0 auto; }
  .story-intro h1 { font-size: 1.55rem; }
  .story-intro .lead { display: none; }
  .story-hint { margin-top: 16px; }
  .cap { padding: 7px 0; }
  .cap h3 { font-size: 1.02rem; }
  .cap p { display: none; }
  .cap-final { margin-top: 12px; padding-top: 14px; }
  .cap-final h3 { font-size: 1.3rem; }
  .cap-final p { display: block; font-size: 0.85rem; max-width: 340px; }
  .cap-final .btn { margin-top: 12px; }
  .story-steps { gap: 12px; font-size: 10px; bottom: 12px; }
  .band { flex-direction: column; align-items: flex-start; padding: 36px; }
}

@media (max-width: 860px) {
  .burger { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 24px 24px;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s, transform 0.22s;
  }
  .nav-links a { display: block; padding: 9px 0; font-size: 1.02rem; }
  .nav-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }

  /* dropdown becomes an inline accordion */
  .nav-item { display: block; }
  .nav-item > a { width: 100%; justify-content: space-between; }
  .nav-item .caret { transition: transform 0.2s; }
  .nav-item.drop-open .caret { transform: rotate(180deg); }
  .sub-menu {
    position: static;
    transform: none;
    width: 100%;
    opacity: 1; visibility: visible;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 6px 14px;
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-item.drop-open .sub-menu { max-height: 420px; }
  .sub-menu::before { content: none; }
  .sub-menu a { padding: 8px 10px; }
  .sub-menu a .d { display: none; }
  .sm-sep { margin: 4px 8px; }
}

@media (max-width: 620px) {
  .section { padding: 60px 0; }
  .pagehead { padding: 64px 0 40px; }
  .cards { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .type-grid.two { grid-template-columns: 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   SPLIT HERO (index.html) — diagonal sections.
   Hover / click / tap / keyboard: the active panel expands
   horizontally, the others compress to diagonal slivers on its
   sides. Geometry: every panel after the first overlaps the
   previous one by var(--diag) (negative margin); the clip-path
   polygons cut the shared diagonal seams exactly.
   ============================================================ */
.split-hero {
  --diag: 7vw;
  position: relative;
  height: max(560px, calc(100vh - var(--header-h)));
  height: max(560px, calc(100svh - var(--header-h)));
  overflow: hidden;
  background: #08130e;
}
.split-panels { display: flex; height: 100%; }

.panel {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: flex-grow 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel + .panel { margin-left: calc(-1 * var(--diag)); }
.panel:nth-child(1) { z-index: 1; clip-path: polygon(0 0, 100% 0, calc(100% - var(--diag)) 100%, 0 100%); }
.panel:nth-child(2) { z-index: 2; clip-path: polygon(var(--diag) 0, 100% 0, calc(100% - var(--diag)) 100%, 0 100%); }
.panel:nth-child(3) { z-index: 3; clip-path: polygon(var(--diag) 0, 100% 0, calc(100% - var(--diag)) 100%, 0 100%); }
.panel:nth-child(4) { z-index: 4; clip-path: polygon(var(--diag) 0, 100% 0, 100% 100%, 0 100%); }
.panel.active { flex-grow: 8; }
.panel:focus-visible { outline-offset: -3px; }

.p-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.16);
  transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel.active .p-bg { transform: scale(1); }

/* placeholder backgrounds until photos exist for EMS / EV */
.panel[data-key="ems"] .p-bg {
  background-image:
    radial-gradient(130% 100% at 78% 8%, rgba(19, 122, 91, 0.55) 0%, rgba(19, 122, 91, 0) 58%),
    radial-gradient(90% 70% at 12% 92%, rgba(11, 84, 61, 0.5) 0%, rgba(11, 84, 61, 0) 55%),
    linear-gradient(165deg, #0e2d22 0%, #0a2018 55%, #07160f 100%);
}
.panel[data-key="ev"] .p-bg {
  background-image:
    radial-gradient(120% 90% at 22% 12%, rgba(43, 92, 141, 0.5) 0%, rgba(43, 92, 141, 0) 58%),
    radial-gradient(80% 60% at 88% 90%, rgba(20, 52, 84, 0.55) 0%, rgba(20, 52, 84, 0) 60%),
    linear-gradient(200deg, #10283f 0%, #0c1c2d 55%, #081221 100%);
}

.p-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 12, 8, 0.42) 0%, rgba(4, 12, 8, 0) 16%),
    linear-gradient(180deg, rgba(7, 18, 13, 0.52) 0%, rgba(7, 18, 13, 0.4) 45%, rgba(7, 18, 13, 0.62) 100%);
}

/* collapsed-state label (number + name) */
.p-idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #fff;
  transition: opacity 0.35s ease;
}
.p-num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.55);
}
.p-name {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  writing-mode: vertical-rl;
}
.panel.active .p-idle { opacity: 0; }

/* expanded-panel content */
.p-body {
  position: absolute;
  top: 50%;
  left: clamp(30px, 9vw, 150px);
  transform: translateY(-50%);
  max-width: 620px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease 0.14s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.14s;
}
.panel.active .p-body {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}
.p-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5fd695;
  display: flex;
  align-items: center;
  gap: 10px;
}
.p-kicker::before { content: ""; width: 22px; height: 1px; background: #5fd695; flex: none; }
.p-title { font-size: clamp(1.9rem, 3.2vw, 2.9rem); font-weight: 700; margin: 14px 0 16px; }
.p-lead { color: rgba(255, 255, 255, 0.82); font-size: 1.05rem; line-height: 1.65; max-width: 520px; }
.p-cta { margin-top: 26px; }

/* intro overlay — visible only while nothing is active */
.split-intro {
  position: absolute;
  z-index: 5;
  left: clamp(24px, 6vw, 88px);
  bottom: clamp(28px, 6vh, 64px);
  max-width: 640px;
  color: #fff;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.split-intro h1 { font-size: clamp(1.8rem, 3.6vw, 3rem); text-shadow: 0 2px 28px rgba(0, 0, 0, 0.4); }
.split-intro p { margin-top: 12px; color: rgba(255, 255, 255, 0.82); }
.split-hero.has-active .split-intro { opacity: 0; transform: translateY(12px); }

@media (prefers-reduced-motion: reduce) {
  .panel, .p-bg, .p-body, .p-idle, .split-intro { transition: none !important; }
}

/* ---------- split hero: mobile (stacked diagonal bands) ---------- */
@media (max-width: 820px) {
  .split-hero {
    --diag: 26px;
    height: max(520px, calc(100vh - var(--header-h)));
    height: max(520px, calc(100svh - var(--header-h)));
  }
  .split-panels { flex-direction: column; }
  .panel + .panel { margin-left: 0; margin-top: calc(-1 * var(--diag)); }
  .panel:nth-child(1) { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--diag)), 0 100%); }
  .panel:nth-child(2),
  .panel:nth-child(3) { clip-path: polygon(0 var(--diag), 100% 0, 100% calc(100% - var(--diag)), 0 100%); }
  .panel:nth-child(4) { clip-path: polygon(0 var(--diag), 100% 0, 100% 100%, 0 100%); }
  .p-idle { flex-direction: row; gap: 12px; }
  .p-name { writing-mode: horizontal-tb; }
  .p-body { left: 20px; right: 20px; max-width: none; }
  .p-title { font-size: 1.55rem; }
  .split-intro { left: 20px; right: 20px; bottom: 18px; max-width: none; }
  .split-intro h1 { font-size: 1.5rem; }
}
