/* European Inference — public landing page. Zero JS, zero cookies. Mobile first. */

:root {
  --bg: #0e1116;
  --bg2: #151a22;
  --bg3: #1c2430;
  --border: #242e3c;
  --text: #e6ebf2;
  --muted: #8b98ab;
  --cyan: #02fbfd;
  --magenta: #f23ffe;
  --grad: linear-gradient(90deg, var(--cyan), var(--magenta));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Hero ambience — only on pages with a hero (landing), so it never floats
   behind inner pages like /contact where it reads as a misplaced shadow. */
body.glow {
  height: 100dvh;            /* body stops being the scroller; .page takes over */
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(242, 63, 254, 0.07), transparent 60%),
    radial-gradient(60rem 30rem at 10% -10%, rgba(2, 251, 253, 0.08), transparent 60%),
    var(--bg);
}
/* --- pure-CSS parallax -------------------------------------------------------
   .page is the scroll container with a 1px perspective. The backdrop lives on a
   deep plane (translateZ -2px) so it scrolls at 1/(1+2) = ⅓ content speed, and
   scale(3) restores its visual size at that depth. Content planes sit at Z=0 —
   mandatory, or the perspective would blur the text. Landing-only markup. */
.page {
  position: relative;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  perspective: 1px;
  perspective-origin: 50% 50%;
  scroll-behavior: smooth;
}
.bg-parallax {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Net apparent size on screen == background-size: the plane's scale(3) is
     exactly undone by the perspective at depth -2px. 85vmin => the mark fills
     ~85% of the smaller viewport dimension, centered, from the first frame. */
  background: url("/static/logo.svg") no-repeat center/85vmin;
  opacity: 0.20;
  filter: blur(4px) saturate(1.15);          /* ~1.3px effective after perspective */
  transform-origin: 50% 50%;                  /* keep the centered mark fixed while scaling */
  transform: translateZ(-2px) scale(3);       /* depth for size+blur, not for scroll rate */
  animation: bg-drift 34s ease-in-out infinite alternate;
}
.page > .top, .page > main, .page > footer {
  position: relative;
  z-index: 1;
  transform: translateZ(0);                   /* near plane: crisp content */
}
@keyframes bg-drift {
  from { transform: translateZ(-2px) scale(3); }
  to   { transform: translate3d(-1.5vw, 3vh, -2px) scale(3.1); }
}
/* Unifying the sweep across screen sizes.

   Target (per spec): centred on screen at the top of the page, and only just
   past the top edge at the bottom, i.e. an apparent travel of vh/2 + mark/2
   where the mark is 85vmin.

   A perspective plane covers ratio r = P/(P+depth) of the scrollable height, so
   the depth that hits the target depends on the device:

       phone 390x844    needs r=0.182      desktop 1440x900  needs r=0.314
       phone 414x896    needs r=0.197      desktop 1920x1080 needs r=0.415

   Desktop's existing 1/3 is already within ~6% of its target, so it is left
   alone. Phones need a far deeper plane: -4.6px under the 1px perspective gives
   r = 1/5.6 = 0.179, and scale(5.6) is its exact reciprocal, so the mark keeps
   its 85vmin size; blur is divided by the same ratio (7.5 * 0.179 ~ 1.34px) to
   keep the softness identical.

   A scroll-timeline version would express the travel directly in viewport
   units, but it does not hold in a top-level document here (the timeline kept
   reporting 0% while .page.scrollTop was at max) and it is unavailable in
   Firefox, so the plain perspective depth is used instead. */
@keyframes bg-drift-deep {
  from { transform: translateZ(-4.6px) scale(5.6); }
  to   { transform: translate3d(-1.5vw, 3vh, -4.6px) scale(5.7867); }
}
@media (max-width: 480px) {
  .bg-parallax {
    transform: translateZ(-4.6px) scale(5.6);   /* travels at ~0.18 of the scroll */
    filter: blur(7.5px) saturate(1.15);         /* 7.5 * 0.179 = 1.34px, as desktop */
    animation: bg-drift-deep 34s ease-in-out infinite alternate;
  }
}
/* Short viewports scroll a proportionally longer page (360x740 needs r=0.150,
   390x844 needs 0.182), so go one step deeper there. */
@keyframes bg-drift-deeper {
  from { transform: translateZ(-5.25px) scale(6.25); }
  to   { transform: translate3d(-1.5vw, 3vh, -5.25px) scale(6.4583); }
}
@media (max-width: 480px) and (max-height: 800px) {
  .bg-parallax {
    transform: translateZ(-5.25px) scale(6.25);  /* ~0.16 of the scroll */
    filter: blur(8.3px) saturate(1.15);          /* 8.3 * 0.16 = 1.33px, as desktop */
    animation: bg-drift-deeper 34s ease-in-out infinite alternate;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bg-parallax { animation: none; }
}
/* The layer is abs-positioned inside the scroller, so it scrolls with the
   content — just slower, which is the whole point. Keep it out of print. */
@media print { .bg-parallax { display: none; } }
a { color: var(--cyan); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; }
img { max-width: 100%; height: auto; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(14, 17, 22, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--text);
}
.brand img { width: 30px; height: 29px; }
.top nav { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 22px); flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.top nav a:hover { color: var(--text); }
.top nav a.btn { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px;
  text-decoration: none; font-weight: 600; font-size: 15px;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text);
}
.btn:hover { border-color: var(--cyan); }
.btn.primary {
  background: var(--grad); border: none; color: #081018;
}
.btn.primary:hover { filter: brightness(1.1); }
.top nav .btn { padding: 7px 14px; font-size: 13.5px; }

/* ---------- layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
main.narrow { max-width: 760px; }
section { padding: clamp(40px, 8vw, 84px) 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
h1 {
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  line-height: 1.05; margin: 18px 0 10px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); margin: 0 0 10px; }
h3 { font-size: 1.05rem; margin: 4px 0 6px; }
.lead { color: var(--muted); max-width: 56ch; margin: 0 0 26px; }
.tiny { font-size: 12.5px; }
.muted { color: var(--muted); }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: clamp(48px, 10vw, 96px); }
.hero-logo { width: clamp(96px, 22vw, 180px); opacity: .95; }
.hero .sub { font-size: clamp(1.05rem, 3vw, 1.35rem); color: var(--muted); margin: 0 0 26px; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 20px 18px;
}
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.ico { font-size: 22px; margin-bottom: 8px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- code ---------- */
pre {
  background: #0a0d12; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; overflow-x: auto; margin: 0 0 14px;
  font-size: 13px; line-height: 1.55;
}
pre code { color: #cfe3ff; }

/* ---------- footer ---------- */
footer {
  max-width: 1040px; margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 40px) 44px;
  display: flex; flex-direction: column; gap: 10px;
}
footer > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
footer img { width: 24px; height: 23px; }
footer > div:first-child span { font-weight: 600; }
.links { display: flex; gap: 18px; }
.links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.links a:hover { color: var(--text); }

/* ---------- contact page ---------- */
.contact-h { margin-bottom: 4px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.vcenter > * { margin: 0; }
.section-title {
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 18px 0 10px;
}
.banner {
  border-radius: 10px; padding: 11px 14px; font-size: 14px; margin: 10px 0;
}
.banner.err {
  background: rgba(224, 82, 82, 0.12); color: #f0938f;
  border: 1px solid rgba(224, 82, 82, 0.35);
}

.contact-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.contact-form .frow { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .contact-form .frow.two { grid-template-columns: 1fr 1fr; } }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.contact-form .lname { display: inline-flex; align-items: baseline; gap: 4px; }
.contact-form input, .contact-form textarea {
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 15px;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--cyan); }
.contact-form textarea { resize: vertical; min-height: 180px; }
.req { color: var(--magenta); }

/* honeypot: must stay out of the visual flow but remain fillable by bots */
.hp {
  position: absolute !important; left: -9999px !important; top: -9999px !important;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

.sent { padding: 22px; }
.conv-url {
  background: #0a0d12; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-top: 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  color: var(--cyan); word-break: break-all;
}

/* live printer camera tile (landing #live) — the <img> streams MJPEG
   multipart natively; no JavaScript anywhere. */
.cam-live {
  display: block; width: 100%; height: auto; border-radius: 10px;
  background: #0a0d12; border: 1px solid var(--border);
  aspect-ratio: 16 / 9; object-fit: cover; margin-top: 4px;
}
