/* ==========================================================================
   Powertechnics — one-page site
   --------------------------------------------------------------------------
   Theme: the logo is a white wordmark, so the UI is black-dominant with white
   type. A single accent (LPG-flame blue, shared with LPGAYARI.COM) is used
   sparingly: the full stop after headlines, focus rings, live indicators and
   data highlights. To go fully monochrome, set --accent to #fff.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */

/* Egyptian 505 BT, the typeface of the Powertechnics logo (Regular + Bold). It has a small x-height,
   so size-adjust enlarges it to the visual size the layout was designed around. */
@font-face {
  font-family: 'Egyptian 505';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  size-adjust: 118%;
  src: url('../assets/fonts/egyptian-505-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Egyptian 505';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  size-adjust: 118%;
  src: url('../assets/fonts/egyptian-505-bold.woff2') format('woff2');
}

/* Egyptian 505 has no Greek letters, so the lambda (λ) shown in the figures is borrowed from IBM Plex Sans (SIL OFL). */
@font-face {
  font-family: 'Plex Greek';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../assets/fonts/ibm-plex-sans-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --ink-0: #000;
  --ink-1: #09090a;
  --ink-2: #111113;
  --white: #fff;
  --text: #c9c9cd;
  --text-dim: #8d8d94;
  --line: rgb(255 255 255 / 0.16);
  --line-soft: rgb(255 255 255 / 0.08);
  --accent: #15a1ed;

  --font: 'Egyptian 505', 'Clarendon', 'Rockwell', Georgia, 'Times New Roman', serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1240px;
  --header-h: 72px;
  --section-y: clamp(5rem, 11vw, 9.5rem);

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

html.nav-lock { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg { display: block; max-width: 100%; }

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection { background: var(--white); color: var(--ink-0); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--white);
  color: var(--ink-0);
  font: 700 0.9375rem/1 var(--font);
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* λ comes from the 'Plex Greek' face above. text-transform is reset so the uppercase
   labels don't turn it into a capital Λ. */
.lam { font-family: 'Plex Greek', var(--font); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ---------- Type ---------- */

/* Egyptian 505 Bold is the cut the logo itself is set in. */
.display {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
  color: var(--white);
  text-wrap: balance;
}
.display--xl { font-size: clamp(2.75rem, 0.9rem + 7.2vw, 6.75rem); line-height: 1.04; }
.display--lg { font-size: clamp(2.125rem, 1rem + 3.9vw, 4rem); }
.display--md { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); }

/* The accent full stop echoes the period in the Powertechnics wordmark. */
.stop { color: var(--accent); }

.lead {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.55;
  color: var(--text);
  max-width: 58ch;
  text-wrap: pretty;
}

/* Small uppercase labels: eyebrow, section numbers, figure captions, tags. */
.label {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border: 1px solid var(--white);
  border-radius: 2px;
  font: 700 1rem/1 var(--font);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn--primary { background: var(--white); color: var(--ink-0); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }

.btn--ghost { background: transparent; color: var(--white); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--white); }

.btn--sm { min-height: 40px; padding: 0 1rem; font-size: 0.9375rem; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
/* The blurred bar is a pseudo-element: backdrop-filter on the header itself would
   trap the fixed mobile menu inside the header's box. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  transition: opacity 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line-soft); }
.site-header.is-scrolled::before { opacity: 1; }

.site-header__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 100%;
}

.brand { display: block; flex: none; }
.brand img { width: 220px; height: auto; }

.nav { display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 2.75rem); }
.nav__list { display: flex; align-items: center; gap: clamp(1.25rem, 2.6vw, 2.25rem); }
.nav__list a {
  position: relative;
  display: block;
  padding: 0.5rem 0;
  font: 700 1rem/1 var(--font);
  color: var(--text-dim);
  transition: color 0.2s;
}
.nav__list a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav__list a:hover,
.nav__list a[aria-current] { color: var(--white); }
.nav__list a:hover::after,
.nav__list a[aria-current]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-right: -10px;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--white);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.nav-open .nav-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .brand img { width: 176px; }
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 2rem;
    padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
    background: var(--ink-0);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  .nav-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--line-soft);
    font: 700 2.25rem/1.1 var(--font);
    color: var(--white);
  }
  .nav__list a::after { display: none; }
  .nav .btn { width: 100%; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(100svh, 1000px);
  padding-top: calc(var(--header-h) + clamp(2rem, 4.5vw, 3.5rem));
  overflow: hidden;
}

/* Graph-paper background, faded out toward the edges. */
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 25%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 25%, #000 15%, transparent 72%);
  opacity: 0.9;
  pointer-events: none;
}

.hero__inner { position: relative; display: grid; gap: clamp(1.25rem, 2.4vw, 2rem); justify-items: start; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  text-wrap: balance;   /* when it wraps on a phone, split it evenly instead of leaving one word alone */
}
.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  from { transform: scale(1); opacity: 0.55; }
  to { transform: scale(3.2); opacity: 0; }
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

@media (max-width: 520px) {
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 100%; }
}

/* Fig. 01 — scrolling lambda trace, kept inside the content column. Drawn by js/main.js. */
.trace { position: relative; margin-top: auto; padding-top: clamp(2.5rem, 5vw, 3.75rem); }
.trace__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  color: var(--text-dim);
}
.trace__legend { display: inline-flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
@media (max-width: 520px) {
  .trace__bar { flex-direction: column; align-items: flex-start; gap: 0.6rem; font-size: 0.6875rem; letter-spacing: 0.08em; }
}
.key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--white); }
.key--petrol { border-top: 1.5px solid rgb(255 255 255 / 0.4); margin-left: 0.9rem; }

.trace__plot {
  position: relative;
  height: clamp(120px, 12.5vw, 180px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, transparent, rgb(255 255 255 / 0.015) 50%, transparent);
}
.trace__plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Keep the waveform clear of the axis labels at the left, then fade it in. */
  -webkit-mask-image: linear-gradient(90deg, transparent 3.25rem, #000 9rem);
  mask-image: linear-gradient(90deg, transparent 3.25rem, #000 9rem);
}
.trace__plot line,
.trace__plot path { vector-effect: non-scaling-stroke; fill: none; }
.trace__grid line { stroke: var(--line-soft); stroke-width: 1; }
.trace__grid .trace__set { stroke: var(--accent); stroke-dasharray: 2 6; stroke-width: 1.25; opacity: 0.8; }
.trace__petrol { stroke: rgb(255 255 255 / 0.4); stroke-width: 1.5; stroke-linejoin: round; }
.trace__lpg { stroke: var(--white); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }

.trace__labels { position: absolute; inset: 0; pointer-events: none; }
.trace__tick {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  font: 400 0.75rem/1 var(--font);
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.trace__tick--set { color: var(--accent); }

/* Centre sits 10px inside the plot's right edge (DOT_INSET in js/main.js), so the ring never leaves the column. */
.trace__dot {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(21 161 237 / 0.22);
}

/* ---------- Sections ---------- */

.section { position: relative; padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--line-soft); }

.kicker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 3rem);
  color: var(--text-dim);
}
.kicker::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.kicker b { font-weight: 700; color: var(--accent); }

.section__intro { display: grid; gap: 1.25rem; max-width: 60rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* Statement */
.statement { padding-block: clamp(4rem, 9vw, 8rem); }
.statement__text {
  font: 400 clamp(1.25rem, 0.75rem + 1.5vw, 1.875rem)/1.4 var(--font);
  color: var(--text-dim);
  max-width: 38em;
  text-wrap: pretty;
}
.statement__text strong { font-weight: 700; color: var(--white); }

/* Figure frames with registration marks at the corners. */
.figure {
  --plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M5.5 0v11M0 5.5h11' stroke='%23fff' stroke-opacity='.5' fill='none'/%3E%3C/svg%3E");
  position: relative;
  border: 1px solid var(--line);
  background: var(--ink-1);
}
.figure::before {
  content: '';
  position: absolute;
  inset: -6px;
  background-image: var(--plus), var(--plus), var(--plus), var(--plus);
  background-position: left top, right top, left bottom, right bottom;
  background-repeat: no-repeat;
  background-size: 11px 11px;
  pointer-events: none;
}
.figure__cap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 0.6875rem;
}

/* Two-column layout used by Diagnostics and Tuning */
.split { display: grid; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.split__copy { display: grid; gap: 1.5rem; justify-items: start; }
.split__copy p { max-width: 52ch; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .split--flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .split--flip .split__copy { order: 2; }
}

.dashes { display: grid; gap: 0.9rem; max-width: 52ch; }
.dashes li { position: relative; padding-left: 1.9rem; }
/* Whole-pixel height so every dash renders identically (a 1.5px box snaps unevenly). */
.dashes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.8em;
  top: calc(0.5lh - 1px);
  width: 0.9rem;
  height: 2px;
  background: var(--accent);
}
.dashes strong { font-weight: 700; color: var(--white); }

/* ---------- Range (products) ---------- */

.range__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 960px) { .range__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .range__grid { grid-template-columns: minmax(0, 1fr); } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 21rem;
  padding: clamp(1.5rem, 2.4vw, 2.25rem);
  background: var(--ink-0);
  transition: background-color 0.3s var(--ease);
}
.card:hover { background: var(--ink-2); }

.card__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.card__no { color: var(--text-dim); }
.card__icon {
  width: 60px;
  height: 60px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-dim);
  transition: color 0.3s var(--ease), transform 0.4s var(--ease);
}
.card:hover .card__icon { color: var(--white); transform: translateY(-3px); }

.card__title {
  font: 700 clamp(1.5rem, 1.1rem + 1vw, 1.875rem)/1.1 var(--font);
  color: var(--white);
}
.card p { font-size: 1rem; line-height: 1.6; }
.card__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 1.25rem;
  color: var(--text-dim);
}
.card__tag::before { content: ''; width: 6px; height: 6px; background: var(--accent); }

@media (max-width: 620px) {
  .card { min-height: 0; }
  .card__top { margin-bottom: 0.25rem; }
}

/* ---------- Diagnostics panel (Fig. 02) ---------- */

.panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 0.6875rem;
}
.panel__status { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); }
.panel__status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.panel__body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.panel__col { padding: 1.25rem 1.25rem 1.5rem; }
.panel__col + .panel__col { border-left: 1px solid var(--line-soft); }
.panel__title { margin-bottom: 0.9rem; color: var(--text-dim); font-size: 0.6875rem; }
@media (max-width: 640px) {
  .panel__body { grid-template-columns: minmax(0, 1fr); }
  .panel__col + .panel__col { border-left: 0; border-top: 1px solid var(--line-soft); }
}

.dtc { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0.2rem 1rem; padding: 0.95rem 0; border-top: 1px solid var(--line-soft); }
.dtc__code { font: 700 1rem/1.2 var(--font); letter-spacing: 0.03em; color: var(--white); }
.dtc__text { font-size: 0.9375rem; line-height: 1.4; }
.dtc__state {
  grid-column: 2;
  justify-self: start;
  margin-top: 0.35rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  font-size: 0.625rem;
  color: var(--text);
}
.dtc--active .dtc__state { background: var(--white); border-color: var(--white); color: var(--ink-0); }
.dtc--cleared .dtc__code { color: var(--text-dim); text-decoration: line-through; text-decoration-thickness: 1px; }
.dtc--cleared .dtc__text { color: var(--text-dim); }

.live__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line-soft);
  font: 400 0.9375rem/1.2 var(--font);
}
.live__k { color: var(--text-dim); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.live__v { color: var(--white); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.live__u { margin-left: 0.4em; color: var(--text-dim); }

/* ---------- Tuning (Fig. 03 fuel map) ---------- */

.fmap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem 0.75rem; padding: 1.25rem 1.25rem 1rem; }
.fmap__head { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.5rem; color: var(--text-dim); font-size: 0.6875rem; }
.fmap__read { color: var(--white); font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0.04em; }
.fmap__read b { font-weight: 700; color: var(--accent); }

.fmap__cols,
.fmap__rows { display: grid; font: 400 0.6875rem/1 var(--font); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.fmap__cols { grid-column: 2; grid-template-columns: repeat(12, 1fr); text-align: center; }
.fmap__rows { grid-row: 3; grid-column: 1; grid-template-rows: repeat(8, 1fr); text-align: right; align-items: center; }
.fmap__cols span,
.fmap__rows span { transition: color 0.3s; }
.fmap__cols .is-on,
.fmap__rows .is-on { color: var(--accent); }

.fmap__cells {
  position: relative;
  grid-row: 3;
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 12 / 8;
  border: 1px solid var(--line-soft);
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: calc(100% / 12) calc(100% / 8);
}
/* Each cell is a square whose size and brightness follow the correction value (--s: 0..1). */
.fmap__cells i { position: relative; }
.fmap__cells i::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: calc(14% + var(--s, 0.5) * 50%);
  aspect-ratio: 1;
  background: var(--white);
  opacity: calc(0.18 + var(--s, 0.5) * 0.55);
  transition: width 0.6s var(--ease), opacity 0.6s var(--ease), background-color 0.3s;
}
.fmap__cells i.is-active::before { background: var(--accent); opacity: 1; }

.fmap__corner { grid-row: 2; grid-column: 1; align-self: end; text-align: right; color: var(--text-dim); font-size: 0.625rem; letter-spacing: 0.04em; text-transform: none; }

/* Crosshair that follows the active cell; JS sets top / left. */
.fmap__hline,
.fmap__vline { position: absolute; background: var(--accent); opacity: 0.35; pointer-events: none; transition: top 0.5s var(--ease), left 0.5s var(--ease); }
.fmap__hline { left: 0; right: 0; top: 0; height: 1px; }
.fmap__vline { top: 0; bottom: 0; left: 0; width: 1px; }

@media (max-width: 520px) {
  .fmap { padding-inline: 0.9rem; }
  .fmap__head { flex-direction: column; gap: 0.35rem; }
  .fmap__cols span:nth-child(even) { visibility: hidden; }
}

/* Project software steps */
.sub { margin-top: clamp(4rem, 8vw, 7rem); }
.sub__head { display: grid; gap: 1.25rem; max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }

.steps { display: grid; gap: 0; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(1.5rem, 3vw, 3rem); } }
.step { position: relative; display: grid; gap: 0.7rem; align-content: start; padding: 2rem 0 2.25rem; border-top: 1px solid var(--line); }
.step::before { content: ''; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: var(--accent); }
.step__no { color: var(--accent); }
.step h4 { font: 700 1.5rem/1.15 var(--font); color: var(--white); }
.step p { font-size: 1rem; max-width: 36ch; }

/* ---------- Contact ---------- */

.contact { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.contact__head { display: grid; gap: 1.5rem; max-width: 60rem; }

/* One cell fills the row; if phone / WhatsApp / address cells are added they share it. */
.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.contact__cell {
  container-type: inline-size;   /* lets the link size itself to the cell, see .contact__link */
  display: grid;
  gap: 1.1rem;
  align-content: start;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--ink-0);
  transition: background-color 0.3s var(--ease);
}
.contact__cell:hover { background: var(--ink-2); }
.contact__label { color: var(--accent); }
.contact__cell p { max-width: 38ch; color: var(--text-dim); }

.contact__link {
  display: inline-block;
  justify-self: start;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
  font: 700 clamp(1.0625rem, 0.5rem + 2.4vw, 3rem)/1.15 var(--font);
  font-size: clamp(1.0625rem, 6.4cqi, 3rem);   /* keeps the e-mail address on one line at any cell width */
  color: var(--white);
  overflow-wrap: anywhere;
  transition: border-color 0.25s, color 0.25s;
}
.contact__link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line-soft); padding-block: clamp(2.5rem, 5vw, 4rem); }
.site-footer__inner { display: grid; gap: 2rem; }
.site-footer img { width: 200px; height: auto; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; font: 700 1rem/1.2 var(--font); }
.site-footer__nav a { color: var(--text-dim); transition: color 0.2s; }
.site-footer__nav a:hover { color: var(--white); }
.site-footer__legal { color: var(--text-dim); font-size: 0.6875rem; }
@media (min-width: 860px) {
  .site-footer__inner { grid-template-columns: 1fr auto; align-items: end; }
  .site-footer__legal { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); }
}

/* ---------- Without JavaScript ---------- */

/* The trace and fuel map are drawn by js/main.js; without it they would be empty frames. */
html:not(.js) .trace,
html:not(.js) .figure--map { display: none; }
html:not(.js) .split--flip { grid-template-columns: minmax(0, 1fr); }

/* ---------- Scroll reveal (only active when JS is running) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease) var(--d, 0ms), transform 0.8s var(--ease) var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Hero entrance: children rise in sequence (--i set inline in the markup). */
@media (prefers-reduced-motion: no-preference) {
  .hero__inner > * { animation: rise 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 100ms); }
  .trace { animation: fade 1.2s var(--ease) 0.5s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pulse::after { animation: none; opacity: 0; }
  * { scroll-behavior: auto !important; }
}
