:root {
  --bg: #070708;
  --fg: #e8e8ea;
  --acc: #ff2e3d;
  --surface: #121215;
  --line: rgba(232, 232, 234, .14);
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* side padding; on very wide screens it grows so the content stays ~1800px wide in the middle */
  --pad: max(clamp(20px, 4vw, 64px), calc((100vw - 1800px) / 2));
  --display: "Wix Madefor Display", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--fg); scroll-behavior: smooth; }
body { font-family: var(--display); -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .15em; }

.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* entrance */
.rise { opacity: 0; transform: translateY(28px); filter: blur(14px); }
.is-in .rise {
  opacity: 1; transform: none; filter: blur(0);
  transition: opacity 900ms var(--ease) var(--d, 0ms),
              transform 900ms var(--ease) var(--d, 0ms),
              filter 900ms var(--ease) var(--d, 0ms);
}
.d1 { --d: 300ms; } .d2 { --d: 420ms; } .d3 { --d: 900ms; }
.d4 { --d: 1040ms; } .d5 { --d: 1200ms; } .d6 { --d: 1300ms; }

/* header */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px var(--pad); mix-blend-mode: difference;
}
.logo { text-transform: none; letter-spacing: .04em; font-size: 14px; }
.logo__caret {
  display: inline-block; width: .6em; height: 1.1em; margin-left: 4px; vertical-align: -.2em;
  background: var(--acc); animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.nav { display: flex; gap: 32px; margin-left: auto; }
.nav a { opacity: .6; transition: opacity 320ms; position: relative; padding: 14px 0; }
.nav a::before {
  content: "["; position: absolute; left: -12px; opacity: 0; color: var(--acc);
  transform: translateX(6px); transition: transform 520ms var(--ease), opacity 320ms;
}
.nav a:hover { opacity: 1; }
.nav a:hover::before { opacity: 1; transform: none; }

/* music player in the header */
.player { display: flex; align-items: center; gap: 4px; margin-left: 40px; color: var(--fg); }
.player__btn {
  display: grid; place-items: center; width: 30px; height: 30px; opacity: .6;
  transition: opacity 320ms, color 320ms;
}
.player__btn:hover { opacity: 1; }
.player__btn svg { width: 14px; height: 14px; }
.player__play svg { width: 16px; height: 16px; }
.player__ico-pause, .is-playing .player__ico-play { display: none; }
.is-single [data-prev], .is-single [data-next] { display: none; }
.is-playing .player__ico-pause { display: block; }
.is-playing .player__play { opacity: 1; }
.player__eq { width: 46px; height: 16px; margin: 0 8px; color: var(--acc); }
.player__cross, .is-muted .player__wave { display: none; }
.is-muted .player__cross { display: block; }
.player__vol {
  -webkit-appearance: none; appearance: none; width: 64px; height: 20px; background: transparent; cursor: pointer; opacity: .6;
  transition: opacity 320ms;
}
.player__vol:hover { opacity: 1; }
.player__vol::-webkit-slider-runnable-track { height: 1px; background: currentColor; }
.player__vol::-moz-range-track { height: 1px; background: currentColor; }
.player__vol::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; margin-top: -3.5px; background: currentColor; border: 0; }
.player__vol::-moz-range-thumb { width: 8px; height: 8px; background: currentColor; border: 0; border-radius: 0; }
.project .player__eq { color: rgb(var(--pa)); }

/* hero: pinned while the object plays out */
.hero { position: relative; height: 240vh; }
.hero__pin { position: sticky; top: 0; height: 100svh; min-height: 620px; overflow: hidden; }
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; }

.frame { position: absolute; z-index: 2; pointer-events: none; }
.frame i {
  position: absolute; width: 26px; height: 26px; border: 0 solid rgba(232, 232, 234, .7);
  transition: transform 1400ms var(--ease) 1500ms, opacity 600ms 1500ms; opacity: 0;
}
.frame i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; transform: translate(40%, 40%); }
.frame i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; transform: translate(-40%, 40%); }
.frame i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; transform: translate(40%, -40%); }
.frame i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; transform: translate(-40%, -40%); }
.is-in .frame i { opacity: 1; transform: none; }

.hero__copy { position: absolute; z-index: 3; left: var(--pad); bottom: 18svh; max-width: 40ch; }

/* nickname glitch: slower, louder */
.glitch {
  position: relative; font-weight: 500; font-size: clamp(3.6rem, 9vw, 10rem);
  line-height: .85; letter-spacing: -.04em; hyphens: none;
}
/* .gl — the same glitch for any heading or link; nav.js copies its text into data-text and fires it */
.gl { position: relative; }
.glitch::before, .glitch::after, .gl::before, .gl::after {
  content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.glitch::before { color: var(--acc); }
.glitch::after, .gl::after { color: var(--fg); }
/* on a project the ghost takes the project colour */
.gl::before { color: rgb(var(--pa, 255, 46, 61)); }
:is(.glitch, .gl).is-glitching { animation: jolt 720ms steps(1) both; }
:is(.glitch, .gl).is-glitching::before { opacity: 1; animation: slice-a 720ms steps(1) both; }
:is(.glitch, .gl).is-glitching::after { opacity: 1; animation: slice-b 720ms steps(1) both; }

@keyframes jolt {
  0%, 100% { transform: none; color: var(--fg); }
  12% { transform: translateX(-4px) skewX(-8deg); }
  30% { transform: translateX(3px); color: transparent; }
  48% { transform: none; color: var(--fg); }
  70% { transform: translateX(-2px) skewX(6deg); color: transparent; }
  86% { transform: none; color: var(--fg); }
}
@keyframes slice-a {
  0% { clip-path: inset(8% 0 72% 0); transform: translate(-18px, 0); }
  15% { clip-path: inset(48% 0 30% 0); transform: translate(14px, 0); }
  30% { clip-path: inset(0 0 55% 0); transform: translate(-10px, 0); }
  45% { clip-path: inset(70% 0 6% 0); transform: translate(22px, 0); }
  60% { clip-path: inset(30% 0 50% 0); transform: translate(-6px, 0); }
  75% { clip-path: inset(82% 0 0 0); transform: translate(12px, 0); }
  90%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
}
@keyframes slice-b {
  0% { clip-path: inset(38% 0 44% 0); transform: translate(20px, 0); }
  15% { clip-path: inset(4% 0 80% 0); transform: translate(-16px, 0); }
  30% { clip-path: inset(60% 0 18% 0); transform: translate(12px, 0); }
  45% { clip-path: inset(18% 0 66% 0); transform: translate(-24px, 0); }
  60% { clip-path: inset(52% 0 34% 0); transform: translate(8px, 0); }
  75% { clip-path: inset(10% 0 74% 0); transform: translate(-12px, 0); }
  90%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
}

.lead { margin-top: 28px; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.6; opacity: .72; max-width: 36ch; text-wrap: pretty; }
.cta { display: flex; align-items: center; gap: 18px; margin-top: 32px; flex-wrap: wrap; }
.note { font-size: 13px; opacity: .55; }

.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center;
  min-height: 52px; padding: 0 28px; font-size: 15px;
  border: 1px solid rgba(232, 232, 234, .5); transition: border-color 320ms;
}
.btn--sm { min-height: 44px; padding: 0 20px; font-size: 14px; border-color: rgba(232, 232, 234, .28); }
.btn__fill {
  position: absolute; inset: 0; background: var(--acc);
  transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease);
}
.btn:hover .btn__fill { transform: scaleX(1); }
.btn:hover { border-color: transparent; }
.btn__label { position: relative; z-index: 2; transition: color 320ms; }

.hero__status {
  position: absolute; z-index: 3; left: var(--pad); right: var(--pad); bottom: var(--pad);
  display: flex; justify-content: space-between; align-items: center; font-size: 11px;
}
.hero__status > span { opacity: .5; }
.dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 10px; vertical-align: 1px;
  background: var(--acc); animation: caret 1.6s steps(1) infinite;
}

/* cases */
.cases { padding: 18svh var(--pad) 8svh; }
.cases__title {
  font-weight: 500; font-size: clamp(2.4rem, 6vw, 6rem);
  line-height: .95; letter-spacing: -.035em; margin-bottom: 6svh;
}
/* each project carries its own accent; red of the site by default */
.case { --pa: 255, 46, 61; }
.case--vpn { --pa: 168, 85, 247; }
.case--game { --pa: 56, 232, 255; --glow: .12; }
.case--sites { --pa: 110, 224, 74; --glow: .2; }

.case {
  display: grid; grid-template-columns: minmax(280px, 4fr) 8fr; gap: 6vw; align-items: end;
  padding: 12svh 0; border-top: 1px solid var(--line);
}
.case--flip { grid-template-columns: 8fr minmax(280px, 4fr); }
.case--flip .case__head { order: 2; }
.case__num { display: block; color: rgb(var(--pa)); opacity: .8; margin-bottom: 24px; }
.case__name {
  font-weight: 500; font-size: clamp(2.4rem, 4.6vw, 5rem);
  line-height: .95; letter-spacing: -.035em; text-wrap: balance; hyphens: none;
}
.case__desc { margin-top: 24px; font-size: 16px; line-height: 1.6; opacity: .65; max-width: 36ch; text-wrap: pretty; }
.case__stack { margin-top: 18px; font-size: 11px; opacity: .5; }
.case__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.case__links .btn { border-color: rgba(var(--pa), .55); }
.case__links .btn__fill { background: rgb(var(--pa)); }
.case__links .btn__icon { color: rgb(var(--pa)); transition: transform 520ms var(--ease), color 320ms; }
.case__links .btn:hover .btn__icon { color: #fff; }
/* link to the project page: its own line under the buttons, a line grows under it on hover */
.case__more {
  position: relative; display: inline-flex; align-items: center; gap: 12px; margin-top: 28px; padding-bottom: 8px;
  font-size: 11px; color: rgb(var(--pa));
}
.case__more::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; opacity: .4; transform: scaleX(.3); transform-origin: left; transition: transform 600ms var(--ease), opacity 320ms;
}
.case__more:hover::after { transform: none; opacity: 1; }
.case__more-ico { width: 16px; height: 16px; transition: transform 520ms var(--ease); }
.case__more:hover .case__more-ico { transform: translateX(4px); }

.case__shots { position: relative; aspect-ratio: 16 / 11; perspective: 2200px; }
.case__stage {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateY(calc(var(--ry, -18deg) * var(--k, 1))) rotateX(calc(7deg * var(--k, 1)));
}
.case--flip .case__stage { --ry: 18deg; }
.case__stage::before {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -16%; height: 34%;
  background: radial-gradient(closest-side, rgba(var(--pa), var(--glow, .38)), transparent),
              radial-gradient(closest-side, rgba(0, 0, 0, .9), transparent);
  filter: blur(26px); transform: translateZ(-80px); pointer-events: none;
}

/* a shot is a thin device body around the screen */
.shot {
  position: absolute; padding: 7px; border-radius: 14px;
  background: linear-gradient(160deg, #202026, #0d0d10);
  /* no accent glow here: on overlapping devices it would spill onto the screen behind */
  box-shadow: 0 0 0 1px rgba(232, 232, 234, .1), 0 60px 110px -30px rgba(0, 0, 0, .9);
  transform: translateZ(var(--z, 0px));
  transition: translate 620ms var(--ease);
}
.shot:hover { translate: 0 -8px; }
.shot__screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 8px;
  background-color: var(--surface);
  background-image:
    linear-gradient(rgba(232, 232, 234, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 232, 234, .04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.shot__screen > img, .shot__screen > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* glass sheen over the screen */
.chat::before { opacity: .4; }
.shot__screen::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 38%);
}
.shot__label { position: absolute; left: 18px; bottom: 16px; font-size: 10px; line-height: 1.7; opacity: .4; }

.shot--phone { padding: 6px; border-radius: 30px; }
.shot--phone .shot__screen { border-radius: 24px; }

.case--vpn .shot--desk { top: 0; right: 0; width: 82%; aspect-ratio: 16 / 10; }
.case--vpn .shot--bot { left: 3%; bottom: 0; width: 29%; aspect-ratio: 390 / 844; --z: 150px; container-type: inline-size; }

/* Telegram chat drawn in markup (Android, night theme), scales with the phone width.
   Button colours and texts follow the real bot; the header floats over the feed. */
.chat {
  position: relative; display: flex; flex-direction: column;
  background: #0e0e10 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='none' stroke='%23ffffff' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round' opacity='.07'%3E%3Cpath d='M14 20l14-6-4 14-3-5z'/%3E%3Ccircle cx='86' cy='22' r='7'/%3E%3Cpath d='M62 54l4 8 9 1-7 6 2 9-8-5-8 5 2-9-7-6 9-1z'/%3E%3Cpath d='M18 86c6-8 14-8 20 0M18 96c6-8 14-8 20 0'/%3E%3Crect x='84' y='80' width='18' height='14' rx='3'/%3E%3Cpath d='M88 80v-4a5 5 0 0 1 10 0v4'/%3E%3Cpath d='M100 50h10M105 45v10'/%3E%3Ccircle cx='46' cy='108' r='2.5'/%3E%3Cpath d='M30 50c4-4 10-4 12 2s-6 10-10 6'/%3E%3C/svg%3E") 0 0 / 36cqw;
  color: #fff;
  font-family: Roboto, "Segoe UI", -apple-system, "Helvetica Neue", sans-serif;
  font-size: 3.85cqw; line-height: 1.32; -webkit-font-smoothing: antialiased;
}
.chat__bar {
  position: absolute; z-index: 3; inset: .9em 0 auto; display: flex; align-items: center; gap: .45em;
  padding: .4em .6em 1.4em;
  background: linear-gradient(#0e0e10 30%, rgba(14, 14, 16, .7) 70%, transparent);
}
.chat__round {
  display: grid; place-items: center; flex: none; width: 2.7em; height: 2.7em; border-radius: 50%;
  background: rgba(42, 42, 46, .92);
}
.chat__round svg { width: 1.35em; height: 1.35em; }
.chat__pill {
  flex: 1; display: flex; align-items: center; gap: .6em; height: 2.7em; padding: 0 .9em 0 .25em;
  border-radius: 1.4em; background: rgba(42, 42, 46, .92);
}
.chat__ava { width: 2.25em; height: 2.25em; border-radius: 50%; object-fit: cover; }
.chat__who { display: grid; line-height: 1.2; }
.chat__who b { font-weight: 500; font-size: 1.04em; }
.chat__who small { font-size: .8em; color: rgba(255, 255, 255, .55); }

.chat__feed {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: .45em;
  padding: 0 .55em .5em; overflow: hidden;
}
.chat__about {
  align-self: center; max-width: 86%; padding: .6em .85em; border-radius: 1em;
  background: rgba(36, 36, 40, .95); font-size: .92em;
}
.chat__about p { margin-top: .25em; }
.chat__link { color: #8ab4ff; }
.chat__date {
  align-self: center; margin: .25em 0; padding: .2em .75em; border-radius: 1em;
  background: rgba(40, 52, 66, .9); font-size: .82em; font-weight: 500;
}
.chat__msg { position: relative; max-width: 86%; padding: .45em .7em .4em; border-radius: 1.05em; }
.chat__msg--me {
  align-self: flex-end; display: flex; align-items: flex-end; gap: .55em;
  background: #4f5bc4; border-bottom-right-radius: .3em; font-size: 1.04em;
}
.chat__msg--me .chat__link { color: #fff; }
.chat__msg--bot { align-self: flex-start; max-width: 90%; background: #242428; border-bottom-left-radius: .3em; }
.chat__msg--bot p + p { margin-top: .7em; }
.chat__msg--bot b { font-weight: 500; }
.chat__emo { width: 1.05em; height: 1.05em; margin-right: .25em; vertical-align: -.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat__time {
  display: inline-flex; align-items: center; gap: .2em; float: right;
  margin: .55em 0 -.15em .7em; font-size: .72em; color: rgba(255, 255, 255, .45);
}
.chat__msg--me .chat__time { float: none; margin: 0 0 -.05em; color: rgba(255, 255, 255, .75); }
.chat__time svg { width: 1.35em; }
.chat__typing { display: flex; gap: .3em; align-self: flex-start; padding: .7em .9em; border-radius: 1em; background: #242428; }
.chat__typing i { width: .4em; height: .4em; border-radius: 50%; background: currentColor; opacity: .5; }

/* inline keyboard: colours as set by the bot */
.chat__kb { display: flex; flex-wrap: wrap; gap: .32em; }
.chat__btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: .4em;
  flex: 1 1 100%; padding: .78em .4em; border-radius: .6em; font-size: .9em; font-weight: 500;
  background: rgba(96, 72, 128, .5);
}
.chat__btn--half { flex-basis: calc(50% - .2em); }
.chat__btn--go { background: #3e8b41; }
.chat__btn--blue { background: #a35fd2; }
.chat__btn--url::after {
  content: ""; position: absolute; top: .4em; right: .45em; width: .45em; height: .45em;
  border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
}
.chat__btn--url .chat__ico { color: #b77ce6; }
.chat__ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.chat__input { display: flex; align-items: center; gap: .4em; padding: .45em .5em .35em; }
.chat__menu {
  display: flex; align-items: center; gap: .35em; flex: none; height: 2.6em; padding: 0 .85em; border-radius: 1.3em;
  background: #a774d6; font-weight: 500;
}
.chat__menu svg { width: .9em; }
.chat__field {
  flex: 1; display: flex; align-items: center; gap: .5em; height: 2.6em; padding: 0 .7em; border-radius: 1.3em;
  background: #1f1f22; color: rgba(255, 255, 255, .45);
}
.chat__ph { flex: 1; border-left: 1.5px solid #b77ce6; padding-left: .15em; }
.chat__tool { width: 1.4em; height: 1.4em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat__mic { display: grid; place-items: center; flex: none; width: 2.6em; height: 2.6em; border-radius: 50%; background: #a774d6; }
.chat__mic svg { width: 1.3em; height: 1.3em; }
.chat__home { display: block; height: 1.5em; position: relative; }
.chat__home::before {
  content: ""; position: absolute; left: 50%; top: .55em; width: 30%; height: .25em;
  translate: -50% 0; border-radius: 1em; background: rgba(255, 255, 255, .6);
}

/* the dialog plays once the case is on screen */
.chat__msg, .chat__typing, .chat__btn { opacity: 0; }
:is(.case, .reveal).is-shown .chat__msg--me { animation: chat-in 420ms var(--ease) 900ms forwards; }
:is(.case, .reveal).is-shown .chat__typing { animation: chat-typing 1200ms steps(1) 1350ms forwards; }
:is(.case, .reveal).is-shown .chat__typing i { animation: chat-dot 600ms ease-in-out infinite alternate; }
:is(.case, .reveal).is-shown .chat__typing i:nth-child(2) { animation-delay: 200ms; }
:is(.case, .reveal).is-shown .chat__typing i:nth-child(3) { animation-delay: 400ms; }
:is(.case, .reveal).is-shown .chat__msg--bot { animation: chat-in 520ms var(--ease) 2550ms forwards; }
:is(.case, .reveal).is-shown .chat__btn { animation: chat-in 420ms var(--ease) calc(2900ms + var(--b, 0) * 70ms) forwards; }
.chat__btn:nth-child(2) { --b: 1; } .chat__btn:nth-child(3) { --b: 2; } .chat__btn:nth-child(4) { --b: 3; }
.chat__btn:nth-child(5) { --b: 4; } .chat__btn:nth-child(6) { --b: 5; } .chat__btn:nth-child(7) { --b: 6; }
@keyframes chat-in { from { opacity: 0; transform: translateY(.8em); } to { opacity: 1; transform: none; } }
@keyframes chat-typing { 0% { opacity: 1; } 100% { opacity: 0; height: 0; padding: 0; margin: 0; } }
@keyframes chat-dot { to { opacity: 1; transform: translateY(-.2em); } }

.case--game .shot--wide { top: 0; left: 0; width: 86%; aspect-ratio: 16 / 9; }
.case--game .shot--small { right: 0; bottom: 0; width: 42%; aspect-ratio: 16 / 10; --z: 90px; }

/* cut-out object floats in front of the devices and overlaps them */
.case__cutout {
  position: absolute; right: 2%; top: -6%; width: 20%; height: auto;
  transform: translateZ(180px);
  filter: drop-shadow(0 40px 40px rgba(0, 0, 0, .7)) drop-shadow(0 0 24px rgba(var(--pa), .12));
  opacity: 0; scale: .92; pointer-events: none;
}
.case.is-shown .case__cutout {
  opacity: 1; scale: 1;
  transition: opacity 900ms var(--ease) 700ms, scale 900ms var(--ease) 700ms;
  animation: float 3.2s var(--ease) 1.6s infinite alternate;
}
@keyframes float { from { translate: 0 0; } to { translate: 0 -14px; } }

.case--sites .shot { width: 58%; aspect-ratio: 16 / 10; }
.case--sites .shot--a { top: 0; left: 0; }
.case--sites .shot--b { top: 22%; left: 21%; --z: 60px; }
.case--sites .shot--c { bottom: 0; right: 0; --z: 120px; }

/* screenshots enter through a stepped glitch */
.case:not(.is-shown) .shot { clip-path: inset(0 100% 0 0); }
.shot__screen::after {
  content: ""; position: absolute; inset: 0; z-index: 3; background: var(--acc);
  mix-blend-mode: screen; opacity: 0; pointer-events: none;
}
.case.is-shown .shot { animation: shot-in 900ms steps(7) backwards; }
.case.is-shown .shot__screen::after { animation: shot-flash 900ms steps(7) backwards; }
.case.is-shown .shot:nth-child(2), .case.is-shown .shot:nth-child(2) .shot__screen::after { animation-delay: 180ms; }
.case.is-shown .shot:nth-child(3), .case.is-shown .shot:nth-child(3) .shot__screen::after { animation-delay: 360ms; }
@keyframes shot-in {
  0% { clip-path: inset(0 100% 0 0); translate: -24px 0; }
  40% { clip-path: inset(30% 20% 40% 0); translate: 14px 0; }
  70% { clip-path: inset(0 0 60% 0); translate: -6px 0; }
  100% { clip-path: inset(0 0 0 0); translate: 0 0; }
}
@keyframes shot-flash {
  0%, 60% { opacity: .35; }
  100% { opacity: 0; }
}

/* link buttons with icons */
.btn__label { display: inline-flex; align-items: center; gap: 10px; }
.btn__icon { width: 16px; height: 16px; flex: none; transition: transform 520ms var(--ease); }
.btn:hover .btn__icon { transform: translate(2px, -2px); }
.btn--off { cursor: default; opacity: .45; }
.case__links .btn--off:hover { border-color: rgba(var(--pa), .55); }
.btn__soon { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }

/* github: contribution map */
.gh { padding: 10svh var(--pad) 16svh; border-top: 1px solid var(--line); }
.gh__head { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin-bottom: 7svh; }
.gh__total {
  font-weight: 500; font-size: clamp(4rem, 11vw, 12rem);
  line-height: .8; letter-spacing: -.045em; font-variant-numeric: tabular-nums;
}
.gh__caption { font-size: 16px; line-height: 1.5; opacity: .6; padding-bottom: .4em; }
.gh__link { margin-left: auto; }

.gh__map { --cols: 53; }
.gh__months {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px;
  height: 22px; font-size: 10px; letter-spacing: .1em; opacity: .45;
}
.gh__months span { white-space: nowrap; }
.gh__cells {
  display: grid; grid-auto-flow: column;
  grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(7, auto); gap: 4px;
}
.gh__cells i, .gh__legend i { display: block; aspect-ratio: 1; border-radius: 0; }
.l0 { background: rgba(232, 232, 234, .06); }
.l1 { background: rgba(255, 46, 61, .36); }
.l2 { background: rgba(255, 46, 61, .58); }
.l3 { background: rgba(255, 46, 61, .8); }
.l4 { background: var(--acc); }

/* cells switch on column by column, like a signal coming through */
.gh__cells i { opacity: 0; }
.gh.is-shown .gh__cells i { animation: cell-on 420ms steps(3) both; animation-delay: calc(var(--c) * 22ms); }
@keyframes cell-on {
  0% { opacity: 0; transform: translateX(-6px); }
  60% { opacity: 1; filter: brightness(2.2); }
  100% { opacity: 1; transform: none; filter: none; }
}

.gh__legend { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 20px; font-size: 10px; opacity: .55; }
.gh__legend i { width: 12px; }
.gh__legend span { margin: 0 6px; }

/* contact */
.contact {
  min-height: 70svh; padding: 16svh var(--pad) var(--pad);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 28px;
  border-top: 1px solid var(--line);
}
.contact__link {
  align-self: flex-start; font-weight: 500;
  font-size: clamp(3rem, 10vw, 12rem); line-height: .85; letter-spacing: -.045em;
  transition: color 320ms, transform 620ms var(--ease);
}
.contact__link:hover { color: var(--acc); transform: translateX(12px); }

/* project page */
.project { --pa: 56, 232, 255; }
.project--vpn { --pa: 168, 85, 247; }
.project .dot { background: rgb(var(--pa)); }
.p-hero { padding: 22svh var(--pad) 10svh; }
.p-hero__kicker { opacity: .7; }
.p-hero__title {
  margin-top: 28px; font-weight: 500; font-size: clamp(3.6rem, 11vw, 12rem);
  line-height: .85; letter-spacing: -.045em; hyphens: none;
}
.p-hero__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.p-hero__row .lead { max-width: 46ch; }
.p-hero__row .case__links { margin-top: 0; }
.p-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: 8svh; padding-top: 24px; border-top: 1px solid var(--line);
}
.p-meta dt { font-size: 10px; opacity: .45; margin-bottom: 10px; }
.p-meta dd { font-size: 15px; line-height: 1.45; opacity: .85; }
/* never taller than the screen */
.p-hero__shot { position: relative; width: min(100%, calc(72svh * 16 / 9)); margin: 8svh auto 0; aspect-ratio: 16 / 9; }
.p-hero__shot--site { width: min(100%, calc(72svh * 16 / 10)); aspect-ratio: 16 / 10; }
.p-hero__shot::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -12%; height: 30%; z-index: -1;
  background: radial-gradient(closest-side, rgba(var(--pa), .12), transparent); filter: blur(30px);
}

.p-sec { padding: 14svh var(--pad); border-top: 1px solid var(--line); }
.p-sec__head { display: flex; align-items: baseline; gap: 28px; margin-bottom: 6svh; }
.p-sec__num { color: rgb(var(--pa)); opacity: .8; }
.p-sec__title {
  font-weight: 500; font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: .95; letter-spacing: -.035em; text-wrap: balance;
}
.p-sec__body { max-width: 62ch; margin-left: calc(28px + 2ch); }
.p-text { font-size: 18px; line-height: 1.65; opacity: .78; text-wrap: pretty; }
.p-text + .p-text, .p-formula + .p-text { margin-top: 20px; }
.p-text--dim { font-size: 16px; opacity: .55; }
/* text block and device composition side by side, like a case on the home page */
.p-sec--split > * { min-width: 0; }
.p-sec--split { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 6vw; align-items: center; }
.p-sec--flip { grid-template-columns: 7fr minmax(300px, 5fr); }
.p-sec--flip .p-sec__col { order: 2; }
.p-sec__col .p-sec__head { margin-bottom: 4svh; }

.p-vis { position: relative; width: min(100%, calc(74svh * 16 / 11)); aspect-ratio: 16 / 11; justify-self: center; perspective: 2200px; }
.p-stage {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateY(calc(var(--ry, -16deg) * var(--k, 1))) rotateX(calc(6deg * var(--k, 1)));
}
.p-sec--flip .p-stage { --ry: 16deg; }
.p-stage::before {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -14%; height: 30%;
  background: radial-gradient(closest-side, rgba(var(--pa), .12), transparent),
              radial-gradient(closest-side, rgba(0, 0, 0, .9), transparent);
  filter: blur(26px); transform: translateZ(-80px); pointer-events: none;
}
.p-vis--play .p-shot--wide { top: 0; left: 0; width: 88%; aspect-ratio: 16 / 9; }
.p-vis--play .p-shot--phone { right: 0; bottom: 4%; width: 52%; aspect-ratio: 1688 / 780; --z: 110px; }
.p-vis--play .p-shot--phone, .p-vis--play .p-shot--phone .shot__screen { border-radius: 18px; }
.p-vis--market .p-shot--ui { top: 8%; left: 0; width: 100%; aspect-ratio: 16 / 10; }
/* the phone needs height, not width: a square stage lets it fill the block */
.p-vis--bot { width: min(100%, 80svh); aspect-ratio: 1; }
.p-vis--bot .shot--bot { top: 0; left: 26.9%; width: 46.2%; aspect-ratio: 390 / 844; container-type: inline-size; }
.p-vis--site .p-shot--trial { top: 6%; left: 0; width: 84%; aspect-ratio: 16 / 10; }
.p-vis--site .p-shot--mob { right: 0; bottom: 0; width: 24%; aspect-ratio: 390 / 844; --z: 120px; }
.p-vis--cab .p-shot--cab { top: 8%; left: 0; width: 100%; aspect-ratio: 16 / 10; }
.p-vis--world .p-shot--detail { top: 6%; left: 0; width: 82%; aspect-ratio: 16 / 10; }
.p-cutout {
  position: absolute; right: 0; bottom: 0; width: 30%; height: auto; transform: translateZ(160px);
  filter: drop-shadow(0 40px 40px rgba(0, 0, 0, .7)) drop-shadow(0 0 24px rgba(var(--pa), .12));
  animation: float 3.2s var(--ease) infinite alternate;
}

.p-loop { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 5svh; background: var(--line); border: 1px solid var(--line); }
.p-loop li { background: var(--bg); padding: 22px 24px 26px; font-size: 16px; line-height: 1.5; }
/* list items carry a short accent dash, not numbers: numbers belong to sections */
.p-loop li::before { content: ""; display: block; width: 18px; height: 2px; margin-bottom: 16px; background: rgb(var(--pa)); opacity: .8; }

.p-formula {
  margin-top: 28px; padding: 18px 22px; border-left: 2px solid rgb(var(--pa));
  background: var(--surface); font-size: 13px; letter-spacing: .06em; text-transform: none;
  white-space: pre-wrap; color: rgb(var(--pa));
}

.p-arch { display: grid; grid-template-columns: 1fr auto 1.15fr auto 1fr; align-items: stretch; margin-top: 7svh; }
.p-arch__node { display: grid; align-content: start; gap: 12px; padding: 26px 24px 28px; border: 1px solid var(--line); background: var(--surface); }
.p-arch__node .mono { font-size: 10px; opacity: .5; }
.p-arch__node b { font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.p-arch__node small { font-size: 14px; line-height: 1.55; opacity: .6; }
.p-arch__node--core { border-color: rgba(var(--pa), .55); box-shadow: inset 0 0 60px rgba(var(--pa), .06); }
.p-arch__wire {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 30px;
  min-width: 130px; padding: 0 14px; font-size: 9px; text-align: center; opacity: .55;
}
.p-arch__wire i {
  position: absolute; left: 0; right: 0; top: 50%; height: 1px; overflow: hidden;
  background: rgba(var(--pa), .35);
}
.p-arch__wire i::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgb(var(--pa)), transparent);
  animation: wire 2.4s var(--ease) infinite;
}
@keyframes wire { from { translate: -100% 0; } to { translate: 340% 0; } }

.p-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 6vw; margin-top: 7svh; max-width: 1100px; }
.p-facts li { font-size: 15px; line-height: 1.6; color: rgba(232, 232, 234, .58); }
.p-facts b { display: block; margin-bottom: 6px; font-weight: 500; color: var(--fg); }

/* what's next: three pixel question marks, drawn cell by cell */
.p-next { display: flex; justify-content: center; padding: 18svh var(--pad); }
.p-qs { display: flex; gap: clamp(24px, 4vw, 64px); }
.p-q { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: clamp(80px, 9vw, 140px); }
.p-q b { aspect-ratio: 1; }
.p-q b.on { background: rgb(var(--pa)); opacity: 0; }
.p-next.is-shown .p-q b.on { animation: cell-on 420ms steps(3) both; animation-delay: calc(var(--c) * 40ms); }
.p-next.is-shown .p-q:last-child { animation: caret 1.1s steps(1) 2.4s infinite; }

/* subheading inside a split block that continues the previous section */
.p-sub { font-weight: 500; font-size: clamp(1.6rem, 2.6vw, 2.6rem); line-height: 1.05; letter-spacing: -.025em; margin-bottom: 4svh; text-wrap: balance; }

/* terminal line in a story: the address fixes itself, an underscore blinks after it */
.p-types { display: grid; gap: .35em; margin: -1svh 0 4svh; }
.p-type {
  min-height: 1.6em; color: rgb(var(--pa));
  font-size: clamp(16px, 1.5vw, 21px); letter-spacing: .03em; text-transform: none; white-space: pre;
}
.p-type b { font-weight: inherit; }
.p-type .is-bad { color: var(--acc); background: rgba(255, 46, 61, .14); }
.p-type .is-space { background: rgba(255, 46, 61, .35); }
.p-type__caret {
  display: inline-block; width: .62em; height: 2px; margin-left: 2px; vertical-align: -.12em;
  background: currentColor; animation: caret 1.1s steps(1) infinite;
}

/* code window */
.p-code { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); background: #0c0c0f; box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9); }
.p-code__bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: .06em; text-transform: none;
}
.p-code__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(232, 232, 234, .14); }
.p-code__bar i:nth-child(3) { margin-right: 12px; }
.p-code__tab {
  padding: 6px 12px; border-bottom: 1px solid transparent; font: inherit; letter-spacing: inherit;
  opacity: .45; transition: opacity 320ms, border-color 320ms;
}
.p-code__tab:hover { opacity: .8; }
.p-code__tab[aria-selected="true"] { opacity: 1; border-bottom-color: rgb(var(--pa)); }
.p-code__path { padding: 14px 22px 0; font-size: 9px; letter-spacing: .06em; text-transform: none; opacity: .35; }
.p-code__body {
  margin: 0; padding: 14px 22px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: rgba(232, 232, 234, .82);
}
.p-code__body .ln { display: block; min-height: 1.65em; }

/* switching tabs: the code is typed in line by line, the story next to it rises in */
.p-code__panel.is-typing .ln { animation: ln-in 360ms steps(12) backwards; animation-delay: calc(var(--i) * 26ms); }
@keyframes ln-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.p-tabtext.is-typing > * { animation: text-in 700ms var(--ease) backwards; }
.p-tabtext.is-typing > :nth-child(2) { animation-delay: 90ms; }
.p-tabtext.is-typing > :nth-child(3) { animation-delay: 180ms; }
.p-tabtext.is-typing > :nth-child(4) { animation-delay: 270ms; }
@keyframes text-in { from { opacity: 0; translate: 0 16px; } }
.p-code .k { color: rgb(var(--pa)); }
.p-code .s { color: #8fd6a9; }
.p-code .f { color: #fff; }
.p-code .c { color: rgba(232, 232, 234, .4); font-style: italic; }
/* all tabs share one grid cell, so the block keeps the height of the longest one and the page does not jump */
[data-tabs] .p-sec__col { display: grid; align-items: center; }
.p-code { display: grid; grid-template-rows: auto 1fr auto; }
.p-tabtext, .p-code__panel { grid-area: 1 / 1; }
.p-code__panel { grid-row: 2; min-width: 0; }
.p-code__bar { grid-row: 1; }
.p-code__note { grid-row: 3; }
.p-code__panel[hidden], .p-tabtext[hidden] { display: block; visibility: hidden; }
.p-code__note { padding: 0 22px 16px; font-size: 9px; opacity: .35; }

/* scene from /start to a connected device: the chat on the left, the code it runs on the right.
   project.js plays the steps from <template data-sim-step> in a loop while the block is on screen */
/* the scene is a presentation: the section takes exactly one screen and nothing inside changes size */
.p-sec--stage { height: max(100svh, 680px); display: flex; flex-direction: column; padding-top: 11svh; padding-bottom: 5svh; }
.p-sec--stage .p-sec__head { margin-bottom: 3svh; }
.p-sim {
  flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  gap: 3svh 4vw;
}
.p-sim__steps { grid-column: 1 / -1; display: flex; font-size: 10px; }
/* steps work like stories: the current segment fills up for as long as its step plays */
.p-sim__steps li {
  position: relative; flex: 1; padding-top: 12px; border-top: 2px solid var(--line); opacity: .35;
  transition: opacity 400ms, color 400ms;
}
.p-sim__steps li + li { margin-left: 4px; }
.p-sim__steps li::after {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
  background: rgb(var(--pa)); transform: scaleX(0); transform-origin: left;
}
.p-sim__steps li.is-done { opacity: .6; }
.p-sim__steps li.is-done::after { transform: none; opacity: .45; }
.p-sim__steps li.is-on { opacity: 1; color: rgb(var(--pa)); }
.p-sim__steps li.is-on::after { animation: sim-fill var(--dur, 4s) linear forwards; }
@keyframes sim-fill { to { transform: none; } }

.p-sim__phone {
  height: 100%; width: auto; aspect-ratio: 390 / 760;
  display: flex; flex-direction: column; overflow: hidden; container-type: inline-size;
  border: 6px solid #17171b; border-radius: 32px; background: #0e0e10;
  box-shadow: 0 0 0 1px rgba(232, 232, 234, .1), 0 50px 100px -40px rgba(0, 0, 0, .9);
  font-family: Roboto, "Segoe UI", -apple-system, sans-serif; line-height: 1.32; color: #fff;
}
/* cqw counts from the phone, so the size is set on its parts, not on the phone itself */
.p-sim__phone > * { font-size: 4.1cqw; }
.p-sim__bar { display: flex; align-items: center; gap: .6em; padding: .8em .9em; background: #1a1a1d; }
.p-sim__bar b { display: block; font-weight: 500; }
.p-sim__bar small { font-size: .8em; opacity: .5; }
.p-sim__ava { width: 2.3em; height: 2.3em; border-radius: 50%; object-fit: cover; }
.p-sim__feed {
  flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: .45em;
  padding: .7em .6em; overflow: hidden; background: radial-gradient(120% 60% at 50% 100%, rgba(var(--pa), .14), transparent 70%);
}
.p-sim__input { padding: .55em .6em .8em; }
.p-sim__input span { display: block; padding: .55em .9em; border-radius: 1.3em; background: #1f1f22; color: rgba(255, 255, 255, .4); font-size: .92em; }
.sim-msg, .sim-btn, .sim-qr, .sim-note { flex: none; animation: sim-in 420ms var(--ease) both; }
@keyframes sim-in { from { opacity: 0; translate: 0 .7em; } }
.sim-msg { max-width: 86%; padding: .5em .75em; border-radius: 1em; }
.sim-msg--me { align-self: flex-end; background: #4f5bc4; border-bottom-right-radius: .3em; }
.sim-msg--bot { align-self: flex-start; background: #242428; border-bottom-left-radius: .3em; }
.sim-btn { padding: .62em; border-radius: .6em; background: rgba(96, 72, 128, .5); text-align: center; font-size: .9em; font-weight: 500; }
.sim-btn--go { background: #3e8b41; }
.sim-qr { align-self: flex-start; display: grid; justify-items: center; gap: .5em; padding: .7em; border-radius: 1em; background: #242428; font-size: .85em; }
.sim-qr i {
  width: 7.5em; aspect-ratio: 1; border: .45em solid #fff; border-radius: .3em;
  background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 1.1em 1.1em;
}
.sim-note { align-self: center; padding: .25em .9em; border-radius: 1em; background: rgba(62, 139, 65, .25); color: #8fd6a9; font-size: .82em; }

.p-sim__term { height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.p-sim__title { margin-left: 12px; opacity: .45; text-transform: none; letter-spacing: .04em; }
.p-sim__out {
  grid-row: 2; min-height: 0; height: 100%; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; white-space: pre;
}
.p-sim__out .ln { display: block; min-height: 1.65em; }
.p-sim__out .is-old { opacity: .32; transition: opacity 600ms; }
.p-sim__out .sim-log { color: #8fd6a9; }
.p-sim__out .sim-log b { font-weight: inherit; padding: 0 .4em; margin-right: .6em; background: rgba(143, 214, 169, .14); }
.p-sim__out .d { color: #f0c674; }
/* a header line opens every step in the terminal */
.p-sim__out .sim-sep { margin-top: .6em; color: rgb(var(--pa)); animation: sim-sep 700ms steps(6) both; }
.p-sim__out .sim-sep:first-child { margin-top: 0; }
@keyframes sim-sep {
  0% { clip-path: inset(0 100% 0 0); }
  60% { clip-path: inset(0 0 0 0); text-shadow: 0 0 12px rgba(var(--pa), .9); }
  100% { clip-path: inset(0 0 0 0); text-shadow: none; }
}

.p-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.p-stats div { background: var(--bg); padding: 30px 26px 34px; }
.p-stats dt {
  font-weight: 500; font-size: clamp(2.4rem, 4.4vw, 4.6rem); line-height: .9;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.p-stats dd { margin-top: 18px; font-size: 14px; line-height: 1.55; opacity: .6; }
.p-note { margin-top: 14px; font-size: 10px; opacity: .4; }
.p-content { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6svh; }
.p-content li { padding: 10px 14px; border: 1px solid var(--line); font-size: 11px; opacity: .75; }

.p-back { align-self: flex-start; opacity: .6; transition: opacity 320ms, color 320ms; }
.p-back:hover { opacity: 1; color: rgb(var(--pa)); }
.project .contact__link:hover { color: rgb(var(--pa)); }

/* sections slide in once */
.reveal > * { opacity: 0; translate: 0 32px; transition: opacity 900ms var(--ease), translate 900ms var(--ease); }
.reveal > :nth-child(2) { transition-delay: 120ms; }
.reveal > :nth-child(3) { transition-delay: 240ms; }
.reveal > :nth-child(4) { transition-delay: 360ms; }
.reveal.is-shown > * { opacity: 1; translate: 0 0; }

/* tablets: one column, compositions under the text */
@media (max-width: 1024px) {
  .case, .case--flip { grid-template-columns: 1fr; gap: 40px; }
  .case--flip .case__head { order: 0; }
  .case__shots { width: 100%; max-width: 760px; justify-self: center; }
  .p-sec__body, .p-sec--split .p-sec__body { margin-left: 0; }
  .p-sec--split, .p-sec--flip { grid-template-columns: 1fr; row-gap: 6svh; }
  .p-sec--flip .p-sec__col { order: 0; }
  .p-vis { width: 100%; max-width: 760px; }
  .p-arch { grid-template-columns: 1fr; max-width: 560px; }
  .p-arch__wire { min-height: 70px; flex-direction: row; justify-content: center; gap: 60px; }
  .p-arch__wire i { left: 50%; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .p-arch__wire i::after { display: none; }
}

/* portrait tablets and phones: the scene stacks, a shorter phone over a compact terminal, both on one screen */
@media (max-width: 1024px) and (orientation: portrait) {
  .p-sec--stage { height: auto; min-height: 100svh; }
  .p-sim { grid-template-columns: 1fr; grid-template-rows: none; gap: 2svh; }
  .p-sim__phone { height: auto; width: min(100%, 300px); aspect-ratio: 390 / 600; justify-self: center; }
  .p-sim__term { height: 30svh; min-height: 240px; }
}

/* phones */
@media (max-width: 760px) {
  .nav { gap: 16px; }
  .nav a[href$="#github"] { display: none; }
  .logo { white-space: nowrap; }
  .player { margin-left: 16px; }
  .player [data-prev], .player [data-next], .player__vol, .player__mute { display: none; }
  .player__eq { width: 32px; margin: 0 0 0 4px; }
  .hero__copy { bottom: 16svh; }
  .hero__status > span:last-child { display: none; }
  /* compositions turn less on a narrow screen, so devices stay inside it */
  .case__stage { --ry: -6deg; }
  .case--flip .case__stage { --ry: 6deg; }
  .p-stage { --ry: -6deg; }
  .p-sec--flip .p-stage { --ry: 6deg; }
  /* the whole year fits the screen: smaller cells, hairline gaps */
  .gh__months, .gh__cells { gap: 2px; }
  .gh__months { font-size: 8px; letter-spacing: .04em; }
  .gh__months span:nth-child(even) { visibility: hidden; }
  .gh__link { margin-left: 0; }
  .p-meta, .p-stats { grid-template-columns: 1fr 1fr; }
  .p-stats div { padding: 22px 16px 24px; }
  .p-stats dt { font-size: 2.1rem; white-space: normal; }
  .p-loop, .p-facts { grid-template-columns: 1fr; }
  .p-sim__steps li { font-size: 0; }
  .p-sim__phone { width: min(100%, 240px); }
  .p-sim__term { height: 27svh; min-height: 200px; }
  .p-code__body { font-size: 11px; padding: 12px 14px 16px; }
  .p-code__bar { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .is-in .rise, .frame i { transition-delay: 0ms; transition-duration: 1ms; }
  .case:not(.is-shown) .shot { clip-path: none; }
  .case.is-shown .shot, .case.is-shown .shot__screen::after { animation: none; }
  .chat__msg, .chat__btn { opacity: 1; }
  .chat__typing { display: none; }
  .case__cutout { opacity: 1; scale: 1; }
  .case.is-shown .case__cutout { animation: none; }
  :is(.case, .reveal).is-shown .chat__msg, :is(.case, .reveal).is-shown .chat__btn { animation: none; }
  .gh__cells i { opacity: 1; }
  .gh.is-shown .gh__cells i { animation: none; }
  .reveal > * { opacity: 1; translate: none; transition: none; }
  .p-arch__wire i::after, .p-cutout { animation: none; }
  .p-q b.on { opacity: 1; }
  .p-type__caret { animation: none; }
  .p-next.is-shown .p-q b.on, .p-next.is-shown .p-q:last-child { animation: none; }
  html { scroll-behavior: auto; }
}
