/* Vong Visalsambath: one stylesheet.
   Night (black, electric blue) for the opening and the contact, day (white, pale blue) for the work.
   html.has-3d: tall scroll-driven acts over the fixed 3D canvas. html.no-3d or no JS: a normal page with flat art. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 104%;
  ascent-override: 96.6%;
  descent-override: 28.4%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark light;
  --black: #000;
  --ink: #0b0d12;
  --blue: #2271e3;
  --bright: #3d8bff;
  --deep: #0f3bc4;
  --pale: #eef4ff;
  --grey: #3a3f48;
  --mute-night: #b6bac2;
  --mute-day: #545b67;
  --line-night: rgba(255, 255, 255, 0.14);
  --line-day: #d9dce1;

  --sans: "Geist", "Geist Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 88rem;
  --radius: 1.25rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --vh: 1vh;
}
@supports (height: 1svh) {
  :root { --vh: 1svh; }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
html:not(.has-3d) { scroll-behavior: smooth; }
html.reduce-motion { scroll-behavior: auto; }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  background: var(--black);
  color: #fff;
  font: 400 1rem/1.6 var(--sans);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
mark { background: none; color: inherit; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; border-radius: 4px; }
.day :focus-visible { outline-color: var(--blue); }
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 100; padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--blue); color: #fff; text-decoration: none; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ the 3D world */
.world {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0;
  background: var(--black); pointer-events: none;
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.world.is-on { opacity: 1; }
/* If the phone ever shows the canvas without a fresh frame, show the colour of the scene behind it, not black. */
html.world-day .world { background: #eef4ff; }
html:not(.has-3d) .world { display: none; }
main, .nav { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ type and shared pieces */
.eyebrow { display: flex; align-items: center; gap: 0.75rem; color: var(--bright); }
.day .eyebrow { color: var(--blue); }
.eyebrow .num { display: inline-grid; place-items: center; min-width: 2.2rem; height: 1.5rem; padding: 0 0.5rem; border-radius: 999px; border: 1px solid currentColor; }
.h2 { font-size: clamp(2.1rem, 5.2vw, 4.4rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 600; text-wrap: balance; }
.h3 { font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
.lead { font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.55; color: var(--mute-night); max-width: 36rem; text-wrap: pretty; }
.day .lead { color: var(--mute-day); }
.blue { color: var(--blue); }
.head { display: grid; gap: 1.1rem; }
.kicker { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--mute-night); }
.dot, .status-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--bright); box-shadow: 0 0 0 0.25rem rgba(61, 139, 255, 0.25); flex: none; }

.btn {
  --mx: 0px; --my: 0px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 3rem; padding: 0 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: 0.98rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  translate: var(--mx) var(--my);
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, translate 0.35s var(--ease);
}
.btn-sm { min-height: 2.5rem; padding: 0 1.1rem; font-size: 0.92rem; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--deep); }
.btn-ghost { border-color: var(--line-night); background: rgba(255, 255, 255, 0.04); }
.btn-ghost:hover { border-color: #fff; }
.day .btn-ghost { border-color: var(--line-day); background: #fff; color: var(--ink); }
.btn-link { background: none; border: 0; padding: 0 0.4rem; text-decoration: underline; text-underline-offset: 0.3em; text-decoration-color: rgba(255, 255, 255, 0.35); }
.btn-link:hover { text-decoration-color: currentColor; }
.btn .i { width: 0.95rem; height: 0.95rem; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem var(--gutter);
  color: #fff;
  transition: transform 0.5s var(--ease), color 0.4s, background-color 0.4s;
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-night); transition: opacity 0.4s;
}
.nav.is-scrolled::before { opacity: 1; }
.nav.is-tucked { transform: translateY(-110%); }
html.nav-day .nav { color: var(--ink); }
html.nav-day .nav::before { background: rgba(255, 255, 255, 0.72); border-bottom-color: var(--line-day); }
.brand { --mx: 0px; --my: 0px; translate: var(--mx) var(--my); transition: translate 0.35s var(--ease); display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { width: 1.6rem; height: 1.6rem; border-radius: 0.45rem; background: linear-gradient(135deg, var(--bright), var(--deep)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.nav-menu { display: flex; align-items: center; gap: 1.75rem; }
.brand { white-space: nowrap; min-width: 0; }
@media (max-width: 360px) {
  .brand { font-size: 0.92rem; gap: 0.5rem; }
  .brand-mark { width: 1.35rem; height: 1.35rem; }
  .js .nav-toggle { padding: 0 0.8rem; }
}
.nav-links { display: flex; gap: 1.6rem; }
.nav-links a { text-decoration: none; font-size: 0.95rem; opacity: 0.8; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 1; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0 1rem;
    border-radius: 999px; border: 1px solid currentColor; background: none; cursor: pointer;
  }
  .nav-toggle-icon { position: relative; width: 1rem; height: 0.6rem; }
  .nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease), top 0.3s; }
  .nav-toggle-icon::before { top: 0; }
  .nav-toggle-icon::after { top: calc(100% - 1.5px); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: calc(50% - 0.75px); transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: calc(50% - 0.75px); transform: rotate(-45deg); }
  .js .nav-menu {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2rem;
    padding: 6rem var(--gutter) 3rem; background: var(--black); color: #fff;
    opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s 0.35s;
  }
  .js .nav.is-open .nav-menu { opacity: 1; visibility: visible; transition: opacity 0.35s; }
  .js .nav.is-open { color: #fff; transform: none; }
  .js .nav.is-open::before { opacity: 0; }
  .js .nav-links { flex-direction: column; gap: 0.25rem; }
  .js .nav-links a { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.04em; opacity: 1; }
  html:not(.js) .nav { position: absolute; flex-wrap: wrap; }
  html:not(.js) .nav-menu { flex-wrap: wrap; gap: 1rem; }
  html:not(.js) .nav-links { gap: 1rem; flex-wrap: wrap; }
}

/* ------------------------------------------------------------------ sections */
.act { position: relative; padding: clamp(5rem, 12vw, 9rem) var(--gutter); }
.act > * { max-width: var(--max); margin-inline: auto; }
.night { color: #fff; }
.day { color: var(--ink); }
/* Without 3D each section paints its own sky. */
html:not(.has-3d) .night { background: radial-gradient(70rem 50rem at 92% -10%, rgba(34, 113, 227, 0.55), transparent 60%), var(--black); }
html:not(.has-3d) .act-statement { background: radial-gradient(60rem 40rem at 10% 110%, rgba(34, 113, 227, 0.3), transparent 60%), var(--black); }
html:not(.has-3d) .day { background: linear-gradient(180deg, #fff, var(--pale)); }
html:not(.has-3d) .act-process { background: #fff; }

/* ---------- hero */
.act-hero { min-height: calc(var(--vh) * 100); min-height: 100svh; display: grid; align-items: end; padding-top: 7rem; padding-bottom: clamp(3rem, 8vh, 6rem); }
.hero-inner { width: 100%; display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.hero-title { font-size: clamp(2.6rem, min(8.4vw, 12.5vh), 8rem); line-height: 0.96; letter-spacing: -0.055em; font-weight: 600; max-width: 13ch; text-wrap: balance; }
.hero-foot { display: grid; gap: 1.75rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
@media (min-width: 900px) {
  .hero-foot { grid-template-columns: minmax(0, 36rem) auto; align-items: end; justify-content: space-between; }
}
.has-3d .act-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 60%), linear-gradient(0deg, rgba(0, 0, 0, 0.5), transparent 45%);
}

/* ---------- statement */
.statement { font-size: clamp(1.7rem, min(5.6vw, 8.5vh), 5.2rem); line-height: 1.04; letter-spacing: -0.045em; font-weight: 600; max-width: 18ch; text-wrap: balance; margin-top: 1.5rem; }
.statement mark { color: var(--bright); }
.statement .w { transition: opacity 0.4s, color 0.4s; }
.statement .w.is-dim { opacity: 0.18; }

/* ---------- services */
.act-services .head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.cards { display: grid; gap: 1rem; }
@media (min-width: 761px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  display: grid; align-content: start; gap: 1rem; padding: clamp(1.4rem, 2.4vw, 2rem);
  border-radius: var(--radius); border: 1px solid var(--line-night);
  background: linear-gradient(160deg, rgba(34, 113, 227, 0.22), rgba(10, 13, 20, 0.92) 55%);
}
.card p { color: var(--mute-night); font-size: 0.98rem; }
.card-icon { width: 3.25rem; height: 3.25rem; border-radius: 0.85rem; background: linear-gradient(140deg, var(--bright), var(--deep)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 30px -10px rgba(61, 139, 255, 0.8); display: grid; place-items: center; }
.card-icon canvas { width: 100%; height: 100%; border-radius: inherit; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.tags li, .pills li { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; padding: 0.3rem 0.65rem; border-radius: 999px; border: 1px solid var(--line-night); }

/* ---------- showcase */
.show-intro { padding-block: 0 clamp(3rem, 7vw, 6rem); }
.show-intro .h2 { max-width: 14ch; }
.show-item { display: grid; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: clamp(2rem, 5vw, 4rem); }
@media (min-width: 900px) { .show-item { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }
.show-text { display: grid; gap: 1rem; align-content: start; }
.show-text p { color: var(--mute-day); }
.show-title { font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: 1.05; letter-spacing: -0.04em; font-weight: 600; text-wrap: balance; color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; text-transform: none; }
.pills li { border-color: var(--line-day); color: var(--grey); background: #fff; }
.pills .pill-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.stat { border-left: 2px solid var(--blue); padding-left: 1rem; }
.stat-num { display: block; font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 600; letter-spacing: -0.03em; color: var(--blue); line-height: 1.15; }
.meta { display: grid; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line-day); }
.meta div { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.75rem; font-size: 0.95rem; }
.meta dt { color: var(--blue); padding-top: 0.15rem; }
.meta dd { color: var(--ink); }
.layers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
.layers li { padding: 0.55rem 0.7rem; border-radius: 0.6rem; background: var(--pale); color: var(--ink); font-weight: 600; }
.layers span { display: block; font-weight: 400; color: var(--mute-day); }
.roles { display: grid; gap: 0.45rem; font-size: 0.95rem; }
.roles li { display: grid; grid-template-columns: 7.2rem 1fr; gap: 0.75rem; color: var(--grey); }
.roles b { font-family: var(--mono); font-weight: 500; font-size: 0.8rem; color: var(--blue); padding-top: 0.15rem; }
.show-art { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--pale); box-shadow: 0 40px 80px -40px rgba(15, 59, 196, 0.45); }
/* Open-source projects: the title, a button and (without 3D) the picture all open the project's site. */
.show-title a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size 0.3s; }
.show-title a:hover, .show-title a:focus-visible { background-size: 100% 2px; }
.site-link {
  justify-self: start; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.6rem 1.15rem;
  border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; font-size: 0.95rem; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(15, 59, 196, 0.6); transition: transform 0.2s, background 0.2s;
}
.site-link:hover { background: var(--deep, #0f3bc4); transform: translateY(-1px); }
.site-link:focus-visible { outline: 3px solid var(--bright, #3d8bff); outline-offset: 3px; }
.site-link span { transition: transform 0.2s; }
.site-link:hover span { transform: translateX(3px); }
.art-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.show-art canvas, .show-art img, .show-art picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.show-photo { aspect-ratio: 1; max-width: 32rem; background: #fff; }

/* ---------- more open source: each card opens its site */
.act-oss .head { margin-bottom: clamp(2rem, 5vw, 4rem); }
.oss-lead { max-width: 46rem; color: var(--mute-day); font-size: 1.1rem; }
.oss-grid { display: grid; gap: 1rem; }
@media (min-width: 700px) { .oss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .oss-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.oss-card {
  position: relative; display: grid; gap: 0.75rem; align-content: start; padding: clamp(1.4rem, 2.4vw, 2rem);
  border-radius: var(--radius); background: #fff; border: 1px solid var(--line-day); transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.oss-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 24px 48px -32px rgba(15, 59, 196, 0.5); }
.oss-card p { color: var(--mute-day); }
.oss-card .h3 { color: var(--ink); }
.oss-link { color: inherit; text-decoration: none; }
/* the whole card opens the site; the GitHub link sits above that layer */
.oss-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.oss-link:focus-visible { outline: none; }
.oss-card:has(.oss-link:focus-visible) { outline: 3px solid var(--bright); outline-offset: 3px; }
.oss-meta { font-size: 0.78rem; color: var(--blue) !important; }
.oss-links { margin-top: auto; font-size: 0.95rem; }
.oss-links a { position: relative; z-index: 1; color: var(--blue); font-weight: 600; text-decoration: none; }
.oss-links a:hover { text-decoration: underline; }

/* ---------- process */
.act-process .head, .act-stack .head { margin-bottom: clamp(2rem, 5vw, 4rem); }
.steps { display: grid; gap: 1rem; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { display: grid; gap: 1rem; align-content: start; padding: clamp(1.5rem, 2.5vw, 2.2rem); border-radius: var(--radius); background: #fff; border: 1px solid var(--line-day); }
.step p { color: var(--mute-day); }
.step-num { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 0.8rem; background: var(--blue); color: #fff; font-size: 0.9rem; }

/* ---------- stack */
.grid { display: grid; gap: 1px; border-radius: var(--radius); overflow: hidden; background: var(--line-day); border: 1px solid var(--line-day); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cell { display: grid; gap: 0.6rem; align-content: start; padding: clamp(1.4rem, 2.4vw, 2rem); background: #fff; min-height: 10rem; }
.cell h3 { color: var(--blue); }
.cell p { font-size: 1.05rem; color: var(--ink); }
.cell-blue { background: var(--blue); }
.cell-blue h3, .cell-blue p { color: #fff; }

/* ---------- contact */
.act-contact {
  overflow: hidden; overflow: clip;
  min-height: calc(var(--vh) * 100); display: grid; align-content: space-between; gap: 4rem; padding-top: clamp(7rem, 14vw, 11rem);
  color: #fff;
  background: radial-gradient(80rem 50rem at 90% 0%, rgba(34, 113, 227, 0.6), transparent 60%), radial-gradient(50rem 40rem at 0% 100%, rgba(15, 59, 196, 0.35), transparent 60%), var(--black);
}
.contact-inner { display: grid; gap: 1.75rem; width: 100%; }
.contact-inner .eyebrow { color: var(--mute-night); }
.contact-title { font-size: clamp(2.5rem, 7.5vw, 7.2rem); line-height: 0.98; letter-spacing: -0.055em; font-weight: 600; max-width: 15ch; text-wrap: balance; }
.contact-title .ch { display: inline-block; transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i) * 18ms); }
.contact-title .wd { display: inline-block; white-space: nowrap; }
.contact-title:not(.is-in) .ch { opacity: 0; transform: translateY(0.4em) rotate(6deg); }
.contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.email-link { font-size: clamp(1.3rem, 3.2vw, 2.4rem); font-weight: 500; letter-spacing: -0.03em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--bright); overflow-wrap: anywhere; }
.email-link:hover { color: var(--bright); }
.contact-links { display: grid; gap: 0; border-top: 1px solid var(--line-night); }
@media (min-width: 900px) { .contact-links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.contact-links a { display: grid; gap: 0.3rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line-night); text-decoration: none; font-size: 1.05rem; transition: color 0.2s; }
.contact-links a:hover { color: var(--bright); }
.contact-links .mono { color: var(--mute-night); font-size: 0.72rem; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; width: 100%; color: var(--mute-night); font-size: 0.72rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: #fff; }

/* ------------------------------------------------------------------ the scroll-driven layout (3D) */
.has-3d .act-hero { min-height: 100vh; min-height: 100svh; }
.has-3d .act-statement { height: calc(var(--vh) * 250); padding: 0 var(--gutter); }
.has-3d .act-services { height: calc(var(--vh) * 300); padding: 0 var(--gutter); }
.has-3d .stick {
  position: sticky; top: 0; height: calc(var(--vh) * 100);
  display: grid; align-content: center; padding-block: 4.5rem 2rem;
}
.has-3d .act-services .stick { overflow: hidden; overflow: clip; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); max-width: none; }
.has-3d .act-services .stick > * { width: 100%; max-width: var(--max); margin-inline: auto; }
.has-3d .card { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: linear-gradient(160deg, rgba(34, 113, 227, 0.3), rgba(6, 8, 14, 0.78) 55%); }
.has-3d .card[data-fly] { will-change: transform, opacity; }

.has-3d .act-show { padding: 0 var(--gutter); color: #fff; }
.has-3d .show-intro { height: calc(var(--vh) * 200); padding: 0; }
.has-3d .show-intro > .stick-intro {
  position: sticky; top: 0; height: calc(var(--vh) * 100); display: grid; align-content: center; gap: 1.1rem;
}
.has-3d .show-intro .eyebrow, .has-3d .show-intro .lead, .has-3d .show-intro .h2 { transition: color 0.6s; }
.has-3d .show-intro .eyebrow { color: var(--bright); }
.has-3d .show-intro .lead { color: var(--mute-night); }
.has-3d.world-day .show-intro { color: var(--ink); }
.has-3d.world-day .show-intro .eyebrow { color: var(--blue); }
.has-3d.world-day .show-intro .lead { color: var(--mute-day); }

.has-3d .show-item { display: block; height: calc(var(--vh) * 200); padding: 0; }
.has-3d .show-art { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); box-shadow: none; }
.has-3d .show-text {
  position: sticky; top: calc(var(--vh) * 50 + 2rem); transform: translateY(-50%);
  width: min(36vw, 30rem); min-width: 18rem; padding: clamp(1.25rem, 2vw, 1.75rem);
  border-radius: var(--radius); background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 30px 60px -30px rgba(15, 59, 196, 0.35);
  color: var(--ink);
}
.has-3d .show-text .show-title { font-size: clamp(1.6rem, 2.6vw, 2.5rem); }
/* Wide screens: each card starts lower in its section, so the next card only arrives once the one before has moved
   away. Without this a taller card would slide over a shorter one (each is pinned by its middle). */
@media (min-aspect-ratio: 21/20) { .has-3d .show-item:not(.is-flow) .show-text { margin-top: calc(var(--vh) * 30); } }
.has-3d .act-oss { background: #fff; }
.has-3d .act-process, .has-3d .act-stack { background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85) 18rem, #fff); }
.has-3d .show-item:last-child { height: calc(var(--vh) * 160); }
.has-3d .act-stack { background: #fff; }

/* Tall screens: the panel takes the top of the screen and the text rises from the bottom. */
/* Short screens: tighter cards. */
@media (max-height: 820px) and (min-aspect-ratio: 21/20) {
  .has-3d .show-text { gap: 0.7rem; padding: 1.15rem 1.35rem; }
  .has-3d .show-text p, .has-3d .roles, .has-3d .meta div { font-size: 0.9rem; line-height: 1.5; }
  .has-3d .show-text .show-title { font-size: clamp(1.4rem, 2.2vw, 2rem); }
  .has-3d .stat-num { font-size: 1.6rem; }
  .has-3d .roles { gap: 0.3rem; }
}
/* When something is taller than the screen can show, it scrolls with the page instead of being pinned
   (app.js adds .is-flow after measuring). The 3D carries on behind it. */
.has-3d .is-flow { height: auto !important; }
.has-3d .is-flow .stick { position: relative; height: auto; padding-block: 6rem 4rem; }
.has-3d .show-item.is-flow { height: calc(var(--vh) * 200) !important; }
.has-3d .show-item.is-flow:last-child { height: calc(var(--vh) * 170) !important; }
.has-3d .show-item.is-flow .show-text { position: relative; top: calc(var(--vh) * 40); transform: none; }

/* Tall screens: the panel takes the top of the screen and the text rises from the bottom. */
@media (max-aspect-ratio: 21/20) {
  .has-3d .show-item { display: flex; flex-direction: column; justify-content: flex-end; }
  .has-3d .show-text { top: auto; bottom: 1rem; transform: none; width: 100%; min-width: 0; max-width: 34rem; margin-inline: auto; padding: 1.25rem; gap: 0.75rem; margin-bottom: 1rem; }
  .has-3d .show-text p { font-size: 0.95rem; }
  .has-3d .show-text .meta { display: none; }
  .has-3d .roles { font-size: 0.85rem; gap: 0.3rem; }
  .has-3d .roles li { grid-template-columns: 6rem 1fr; }
  .has-3d .act-hero::before { background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2) 70%); }
  .has-3d .show-item.is-flow .show-text { top: auto; bottom: auto; margin-bottom: calc(var(--vh) * 15); }
}
/* Phones: the three service cards become a deck, each one landing on the last. */
@media (max-width: 760px) {
  .has-3d .cards { grid-template-columns: 1fr; }
  .has-3d .cards > .card { grid-area: 1 / 1; }
  .has-3d .act-services .stick { align-content: start; padding-top: 6rem; }
}

.low-tier .has-3d .card, .has-3d.low-tier .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(160deg, #0d2a5c, #070a12 60%); }
.has-3d.low-tier .show-text { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255, 255, 255, 0.95); }

/* ------------------------------------------------------------------ reveals (no 3D, or below the showcase) */
.motion [data-reveal] { opacity: 0; transform: translateY(2rem); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }
.motion [data-reveal].is-in { opacity: 1; transform: none; }
.motion .hero-title .wd { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.05em 0.04em 0.16em; margin: -0.05em -0.04em -0.16em; }
.motion .hero-title .wi { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease); transition-delay: calc(var(--i) * 55ms + 100ms); }
.motion .is-ready .hero-title .wi, .motion.is-ready .hero-title .wi { transform: none; }
.motion [data-fade] { opacity: 0; transform: translateY(1rem); transition: opacity 1s var(--ease) 0.6s, transform 1.2s var(--ease) 0.6s; }
.motion.is-ready [data-fade] { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ the 30-second version */
.recap {
  width: min(56rem, calc(100% - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
  padding: 0; border: 0; border-radius: 1.5rem; overflow-y: auto; overscroll-behavior: contain;
  background: var(--black); color: #fff; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.recap::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.recap-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.5rem 1.5rem 1rem; background: linear-gradient(var(--black) 75%, rgba(0, 0, 0, 0));
}
.recap-title { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.04em; font-weight: 600; margin-top: 0.4rem; }
.recap-close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; border-radius: 50%; border: 1px solid var(--line-night); background: none; cursor: pointer; }
.recap-close:hover { border-color: #fff; }
.recap-cards { display: grid; gap: 0.75rem; padding: 0 1.5rem 1.5rem; }
@media (min-width: 700px) { .recap-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .recap-cards li:last-child { grid-column: 1 / -1; } }
.recap-cards li { display: grid; gap: 0.75rem; align-content: start; padding: 1.25rem; border-radius: 1rem; border: 1px solid var(--line-night); background: rgba(255, 255, 255, 0.03); }
.recap-cards li .mono { color: var(--bright); }
.recap-cards li p { color: #e6e8ec; }
.recap-cards li a { justify-self: start; font-weight: 500; text-underline-offset: 0.25em; }
.recap-cards .is-blue { background: var(--blue); border-color: var(--blue); }
.recap-cards .is-blue .mono { color: #fff; }
.motion .recap[open] .recap-cards li { animation: card-in 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(2rem) rotate(var(--r, 0deg)); } }

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
}
.reduce-motion [data-reveal], .reduce-motion [data-fade] { opacity: 1; transform: none; }
.reduce-motion .contact-title .ch { opacity: 1 !important; transform: none !important; }

@media (forced-colors: active) {
  .world { display: none; }
  .btn, .card, .show-text, .step, .cell { border: 1px solid CanvasText; }
}

@media print {
  .world, .nav, .recap { display: none !important; }
  body, .night, .day, .act-contact { background: #fff !important; color: #000 !important; }
}
