/* EngCentre home page - the sections. Moving parts use transform / opacity only. */

/* ---------- notice ---------- */
.notice { position: relative; margin-top: 58px; display: flex; justify-content: center; padding: 6px 16px; background: color-mix(in srgb, var(--accent) 12%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 14px; color: var(--ink); text-align: center; }
.notice b { color: var(--accent-ink); margin-right: 6px; }

/* ---------- hero ---------- */
#hero { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 50px 16px 60px; }
.hero-in { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.reallogo { display: block; width: clamp(180px, 34vh, 300px); height: auto; aspect-ratio: 1; }
@supports (width: round(down, 10.5px, 1px)) { .reallogo { width: round(down, clamp(180px, 34vh, 300px), 2px); } }
/* Each part of the real logo arrives once; every keyframe ends at "none / 1": the logo itself. */
.js .reallogo .lp { opacity: 0; }
.reallogo .lp { transform-box: fill-box; transform-origin: center; }
.reallogo.go .lp { animation: lp-in .7s cubic-bezier(.2, .8, .2, 1) forwards; }
.reallogo.go .lp-frame { animation-name: lp-draw; animation-duration: .9s; }
.reallogo.go .lp-base { animation-name: lp-up; animation-delay: .35s; }
.reallogo.go .lp-code { animation-name: lp-left; animation-delay: .6s; }
.reallogo.go .lp-gear { animation-name: lp-gear; animation-duration: 1s; animation-delay: .75s; }
.reallogo.go .lp-sub { animation-delay: 1.25s; }
.reallogo.go .lp-name { animation-name: lp-up; animation-delay: 1.4s; }
.reallogo.done .lp { animation: none; opacity: 1; }
@keyframes lp-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lp-draw { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@keyframes lp-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes lp-left { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes lp-gear { from { opacity: 0; transform: translateX(50px) rotate(240deg) scale(.4); } to { opacity: 1; transform: none; } }
.hero-title { font-size: clamp(2rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -1px; max-width: 16em; }
.hero-title span { color: var(--accent-ink); }
.hero-lead { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 36em; margin: 4px 0 18px; }
.cta { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 12px; font-weight: 700; text-decoration: none; color: #04121f; background: var(--accent); border: 1px solid var(--accent); }
.cta:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.cta svg { width: 18px; height: 18px; }
a.pill { text-decoration: none; }
a.pill:hover { text-decoration: underline; }
.cta.ghost { background: transparent; color: var(--accent-ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- what we do ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.card .ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--line); margin-bottom: 12px; }
.card .ico img, .card .ico svg { width: 30px; height: 30px; }
.card p { font-size: 16px; }

/* ---------- code becomes a machine ---------- */
#flow { height: 260vh; }
.flow-stage { display: grid; grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); gap: 14px; align-items: center; margin-top: 26px; }
.flow-code { font-size: clamp(12px, 1.4vw, 15px); background: var(--code-bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 0; line-height: 2; }
.flow-code .fl { display: block; padding: 0 16px; white-space: pre; overflow: hidden; }
.flow-code .fl i { font-style: normal; color: var(--accent-ink); }
.flow-code .fl.sent::after { content: "  \2713"; color: var(--ok); }
.flow-arrow svg { width: 100%; height: 40px; }
.machine { position: relative; aspect-ratio: 4 / 3; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.machine svg { position: absolute; display: block; overflow: visible; }
.mp { opacity: 0; }
.machine .mv, .machine .mp { will-change: transform, opacity; }

/* ---------- real-time network ---------- */
#rt { height: 240vh; }
.netbox { position: relative; margin-top: 26px; }
.netbox > #netSvg { width: 100%; height: auto; display: block; }
.netbox > svg.nd { position: absolute; height: auto; aspect-ratio: 80 / 100; z-index: 1; overflow: visible; }
.nd rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.nd .lamp { fill: var(--led-off); }
.nd.on .lamp { fill: var(--ok); }
.nd text { fill: var(--muted); font: 600 11px system-ui, "DejaVu Sans", sans-serif; text-anchor: middle; }
.nd.on rect { stroke: var(--accent); }
.cable { stroke: var(--line); stroke-width: 3; fill: none; }
/* the overlay spans the cable exactly: from x=60 to x=W-60 of the drawing (set by rt.js) */
.net-over { position: absolute; top: 50%; height: 0; pointer-events: none; }
#netOver2 { z-index: 2; }
.cable-base { position: absolute; left: 0; right: 0; top: -1.5px; height: 3px; background: var(--line); }
.cable-lit { position: absolute; left: 0; right: 0; top: -1.5px; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }
.frame-mover { position: absolute; left: 0; right: 0; top: 0; height: 0; will-change: transform; opacity: 0; }
.frame-mover b { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.beat { display: flex; gap: 6px; margin-top: 18px; align-items: flex-end; height: 40px; }
.beat i { flex: 1; height: 100%; border-radius: 3px; background: var(--line); transform-origin: 50% 100%; transform: scaleY(.15); }
.beat i.on { background: var(--accent); }

/* ---------- AI ---------- */
.ai-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: center; }
.nn { width: 100%; height: auto; display: block; touch-action: none; }
.nn .edges { stroke: var(--line); stroke-width: 1.2; fill: none; }
.nn .edges-hot { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.nn .node { fill: var(--surface); stroke: var(--steel); stroke-width: 2; cursor: pointer; transition: fill .25s, stroke .25s; }
.nn .node.hot { fill: var(--accent); stroke: var(--accent); }
.nn .node:focus-visible { outline: none; stroke: var(--ink); stroke-width: 3; }
.ai-hint { color: var(--muted); font-size: 14px; margin-top: 10px; }
a.inline { color: var(--accent-ink); font-weight: 600; text-underline-offset: 3px; white-space: nowrap; }

/* ---------- designer teaser ---------- */
#designer { text-align: center; }
.teaser { position: relative; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface)); padding: clamp(28px, 6vw, 64px) clamp(18px, 4vw, 48px); }
.teaser .pill { margin-bottom: 14px; }
.teaser h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
.teaser .lead { margin: 14px auto 0; }
.teaser ul { list-style: none; padding: 0; margin: 22px auto 26px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 760px; }
.teaser li { font-size: 14px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: var(--bg2); }
.teaser li b { color: var(--accent-ink); }

footer .contact { margin: 0 0 6px; }
footer a { color: var(--accent-ink); }

@media (max-width: 860px) {
  .cards, .ai-wrap { grid-template-columns: minmax(0, 1fr); }
  .flow-stage { grid-template-columns: minmax(0, 1fr); }
  .flow-arrow { display: none; }
  .flow-code { line-height: 1.7; }
  /* on narrow screens these two scenes are not pinned: they play while they rise into view */
  #flow, #rt { height: auto; }
  #flow .pin, #rt .pin { position: relative; height: auto; overflow: visible; padding: 70px 0 40px; }
}
@media (max-width: 520px) { .notice { font-size: 12.5px; } }

@media (prefers-reduced-motion: reduce) {
  .js .reallogo .lp { opacity: 1; }
  .mp { opacity: 1; }
  .frame-mover { display: none; }
}
