/* ==========================================================================
   luka-stankovic.voxel-ai.ch, the contact page behind the NFC card.

   The tokens are the Voxel site's own, quoted from
   projects/voxel-website/src/assets/css/site.css (:root) on 2026-10-03, so
   the card, the site and this page read as one thing. Nothing is invented
   here: no new colour, no new face. Depth is a hairline and a translucent
   panel, as on the site; the one glow is the AIOS sphere, which is the
   subject of the page and the reason the glow is allowed.

   Three sections, in the order the card is read: the hero (photo, name, four
   links), the gather (a pinned scene driven by the scroll, see page.js), the
   contact form. Mobile first: the page is opened from a phone tap.
   ========================================================================== */

:root {
  --bg:            #0E1013;
  --bg-raised:     rgba(255, 255, 255, 0.045);
  --bg-sunken:     #0B0C0E;
  --bg-elevated:   rgba(255, 255, 255, 0.05);
  --bg-tile:       #15181C;

  --line-soft:     rgba(255, 255, 255, 0.06);
  --line:          rgba(255, 255, 255, 0.10);
  --line-strong:   rgba(255, 255, 255, 0.20);

  --fg:            #F2F4F8;
  --fg-mid:        #A7B0AC;
  --fg-dim:        #6E7873;
  --fg-faint:      #4B524F;

  --accent:        #35E0A1;
  --accent-deep:   #1E7F5C;
  --accent-wash:   rgba(53, 224, 161, 0.14);
  --accent-line:   rgba(53, 224, 161, 0.55);
  --on-accent:     #0E1013;

  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-label: 0.75rem;
  --t-small: 0.9375rem;
  --t-body:  1.0625rem;
  --t-lead:  clamp(1.0625rem, 0.98rem + 0.5vw, 1.25rem);
  --t-h2:    clamp(1.5rem, 1.15rem + 1.3vw, 2.0625rem);
  --t-h1:    clamp(2rem, 1.45rem + 2.3vw, 2.875rem);

  --container: 1100px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 18px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.2, 0.6, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.2s;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Reset and base
   -------------------------------------------------------------------------- */

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 600; }
button { font: inherit; color: inherit; }

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

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) var(--gutter) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img { width: 28px; height: 28px; }

.top__site {
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.top__site:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   1. The hero: portrait, name, the four links
   -------------------------------------------------------------------------- */

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px var(--gutter) 48px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 18px 20px;
  align-items: end;
}

/* Beside the portrait the eyebrow has 190 px: at the site's 0.16em tracking
   "Cofondateur de Voxel" wrapped onto two lines on the first capture. */
@media (max-width: 639px) {
  .hero__id .label { letter-spacing: 0.11em; }
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
}

/* The one glow the system allows behind a subject, under 0.08 alpha. */
.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 50% 28%, rgba(53, 224, 161, 0.08), transparent 70%);
  pointer-events: none;
}

.portrait img { width: 100%; height: 100%; object-fit: cover; }

.hero__id { min-width: 0; padding-bottom: 4px; }
.hero__body { grid-column: 1 / -1; min-width: 0; }

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  line-height: 1.1;
}

.label::before {
  content: "";
  flex: none;
  width: 0.5em;
  height: 0.5em;
  background: var(--accent);
}

h1 {
  font-size: var(--t-h1);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--fg-mid);
  letter-spacing: -0.005em;
  max-width: 44ch;
}

/* Four links: the two that matter most on their own line, the two profiles
   side by side. From 640 px, a two by two grid. */
.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.actions > .btn:nth-child(-n+2) { grid-column: 1 / -1; }

/* On a phone the two profiles share a line: 162 px each at 375 px, which
   holds the logo and the name but not the arrow disc too. Measured on the
   first capture: 23 px of horizontal overflow with the disc kept. */
@media (max-width: 639px) {
  .actions > .btn:nth-child(n+3) { padding-left: 1rem; }
  .actions > .btn:nth-child(n+3)::after { display: none; }
}

@media (min-width: 640px) {
  .actions > .btn:nth-child(-n+2) { grid-column: auto; }
}

@media (min-width: 900px) {
  .hero { padding-top: 56px; padding-bottom: 72px; }
  .hero__inner {
    grid-template-columns: 340px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 14px 64px;
    align-items: center;
  }
  .portrait { grid-row: 1 / span 2; max-width: 340px; }
  .hero__id { grid-column: 2; align-self: end; padding-bottom: 0; }
  .hero__body { grid-column: 2; align-self: start; }
  .actions { max-width: 640px; }
}

/* --------------------------------------------------------------------------
   Buttons, as on the site: a pill, the arrow in its own disc
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform 100ms ease-out, filter var(--dur) var(--ease);
}

.btn__logo { width: 18px; height: 18px; flex: none; object-fit: contain; }

.btn__text {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn::after {
  content: "→";
  font-size: 0.85em;
  line-height: 1;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 16, 19, 0.16);
  transition: transform 0.35s var(--ease-out);
}

.btn:hover::after { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  box-shadow: 0 10px 30px var(--accent-wash);
}

.btn--primary:hover { filter: brightness(1.08); }

.btn--outline {
  border-color: var(--line-strong);
  color: var(--fg);
}

.btn--outline::after { background: rgba(255, 255, 255, 0.08); }
.btn--outline:hover { border-color: var(--accent-line); }

/* --------------------------------------------------------------------------
   2. The gather: a pinned scene, 300vh of scroll, driven by page.js
   -------------------------------------------------------------------------- */

.gather {
  position: relative;
  height: 300vh;
  --orb: 132px;
  --tile: 50px;
  --tile-r: 14px;
}

@media (min-width: 900px) {
  .gather { --orb: 196px; --tile: 66px; --tile-r: 18px; }
}

.gather__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.scene { position: absolute; inset: 0; }

/* The three orbits, drawn as hairline ellipses sized by page.js: each one is
   the exact projection of the tilted ring its tiles travel on. */
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* The sphere: lit from the top left, darker at the rim, a soft halo behind
   it. Its scale and its halo follow the scroll (page.js writes --halo). */
.orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--orb);
  height: var(--orb);
  margin: calc(var(--orb) / -2) 0 0 calc(var(--orb) / -2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 10;
  background:
    radial-gradient(circle at 34% 30%, #BDF8E0 0%, #63EABA 16%, var(--accent) 36%, var(--accent-deep) 72%, #0C3628 100%);
  box-shadow:
    inset -14px -22px 46px rgba(0, 0, 0, 0.40),
    inset 10px 12px 28px rgba(255, 255, 255, 0.20);
  will-change: transform;
}

.orb::before {
  content: "";
  position: absolute;
  inset: -58%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(53, 224, 161, 0.36) 0%,
    rgba(53, 224, 161, 0.14) 32%,
    rgba(53, 224, 161, 0) 64%);
  opacity: var(--halo, 0.8);
  z-index: -1;
  pointer-events: none;
}

.orb__label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: calc(var(--orb) * 0.17);
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  color: var(--on-accent);
}

/* A gentle breath on the halo while the scene is live: the one perpetual
   motion on the page, on the one element that stands for a running system. */
@media (prefers-reduced-motion: no-preference) {
  .gather:not(.is-static) .orb::before { animation: breathe 3.4s ease-in-out infinite alternate; }
}

@keyframes breathe {
  from { transform: scale(0.95); }
  to   { transform: scale(1.07); }
}

.tools { position: absolute; inset: 0; }

/* A tool: a dark tile with a hairline, the logo at half its size. Position,
   scale, opacity and depth order are written per frame by page.js. */
.tool {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tile);
  height: var(--tile);
  margin: calc(var(--tile) / -2) 0 0 calc(var(--tile) / -2);
  border-radius: var(--tile-r);
  border: 1px solid var(--line);
  background: var(--bg-tile);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  opacity: 0;
  will-change: transform, opacity;
}

.tool img { width: 54%; height: 54%; object-fit: contain; }

.gather__title {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(env(safe-area-inset-bottom) + 9vh);
  margin: 0 auto;
  max-width: 18ch;
  text-align: center;
  font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
  z-index: 30;
}

/* The static scene: reduced motion, no GSAP, or no JavaScript at all. The
   section stops being 300vh, the sphere sits in the middle, the tools on a
   ring around it (page.js) or in a wrapped row (no JavaScript), the line
   below. The story is told without a single frame of motion. */
.no-js .gather,
.gather.is-static { height: auto; }

.no-js .gather__stage,
.gather.is-static .gather__stage {
  position: static;
  height: auto;
  overflow: visible;
  padding: 56px 0 48px;
  display: grid;
  justify-items: center;
  gap: 28px;
}

/* Flat, the sixteen tiles sit on two rings inside one square; on a phone
   that square is the full width, and the sphere and the tiles shrink so the
   inner ring clears the sphere (it overlapped it on the first capture). */
.gather.is-static { --orb: 112px; --tile: 42px; --tile-r: 12px; }

@media (min-width: 900px) {
  .gather.is-static { --orb: 160px; --tile: 56px; --tile-r: 16px; }
}

.gather.is-static .scene {
  position: relative;
  inset: auto;
  width: min(100%, 520px);
  aspect-ratio: 1;
}

.gather.is-static .tool { opacity: 1; }
.gather.is-static .ring { opacity: 1; }
.no-js .ring { display: none; }

.no-js .scene {
  position: relative;
  inset: auto;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 32px;
  padding-top: 12px;
}

.no-js .orb { position: relative; left: auto; top: auto; margin: 0; }

.no-js .tools {
  position: static;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 460px;
}

.no-js .tool { position: static; margin: 0; opacity: 1; }

.no-js .gather__title,
.gather.is-static .gather__title {
  position: static;
  opacity: 1;
  transform: none;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --------------------------------------------------------------------------
   3. The form, which opens the visitor's own mail application
   -------------------------------------------------------------------------- */

.contact {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px var(--gutter) 8px;
}

@media (min-width: 900px) {
  .contact { padding-top: 96px; }
}

h2 {
  font-size: var(--t-h2);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 24ch;
  text-wrap: balance;
}

.intro {
  margin-top: 12px;
  color: var(--fg-mid);
}

.form {
  margin-top: 26px;
  display: grid;
  gap: 16px;
}

.field { display: grid; gap: 7px; }

.field label {
  font-size: var(--t-small);
  font-weight: 600;
}

.opt { font-weight: 400; color: var(--fg-dim); }

.field input, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field textarea { resize: vertical; min-height: 92px; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.field.is-missing input { border-color: var(--fg-mid); }

.form__error {
  font-size: var(--t-small);
  color: var(--fg);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.form__actions { display: grid; gap: 10px; margin-top: 4px; }

.hint {
  font-size: 0.875rem;
  color: var(--fg-dim);
  line-height: 1.45;
}

.hint a { color: var(--fg-mid); }

.mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
}

.mini button {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--fg-mid);
  font-size: var(--t-small);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

.mini button:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Footer and toast
   -------------------------------------------------------------------------- */

.foot {
  max-width: 640px;
  margin: 48px auto 0;
  padding: 26px var(--gutter) calc(env(safe-area-inset-bottom) + 16px);
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 3px;
  font-size: var(--t-small);
  color: var(--fg-dim);
}

.foot a { color: var(--fg-mid); text-decoration: none; }
.foot a:hover { color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--fg);
  font-size: var(--t-small);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  z-index: 40;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Motion: a short rise on entry for the form; the scene has its own rules
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.reveal.is-in, .no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .toast, .btn::after, .tool, .gather__title { transition: none; }
  .btn:active { transform: none; }
}
