/* stean.DEV: the night side of stean.ART. Colours come from the sigil:
   blue ice, solar gold, amber, iron and a red ember at the core. */
:root {
  --void: #0b0d11;
  --deep: #10141a;
  --panel: rgba(20, 25, 33, 0.72);
  --iron: #2a3039;
  --line: rgba(139, 227, 255, 0.14);
  --text: #e9edf2;
  --muted: #8d97a5;
  --ice: #58c8f4;
  --ice-hi: #a6ecff;
  --gold: #ffc93c;
  --amber: #ff8a1f;
  --ember: #ff4632;
  --display: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.68, 0, 1.01);
  --gutter: clamp(18px, 5vw, 72px);
}

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

html {
  scroll-behavior: smooth;
  background: var(--void);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(88, 200, 244, 0.1), transparent 60%),
    radial-gradient(900px 600px at 10% 30%, rgba(255, 138, 31, 0.06), transparent 60%),
    var(--void);
  font: 17px/1.65 var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: var(--gold);
  color: var(--void);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--void);
  font: 600 14px var(--mono);
}

.skip:focus {
  top: 12px;
}

.dot {
  color: var(--gold);
}

/* Background layers */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

main,
.top,
.bottom {
  position: relative;
  z-index: 2;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px var(--gutter);
  background: linear-gradient(to bottom, rgba(11, 13, 17, 0.92), rgba(11, 13, 17, 0.55));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 10px rgba(255, 201, 60, 0.35));
  transition: transform 0.8s var(--ease);
}

.brand:hover img {
  transform: rotate(60deg);
}

.brand-word {
  font: 600 19px/1 var(--display);
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  gap: 26px;
}

.nav a {
  position: relative;
  text-decoration: none;
  font: 13px var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--ice));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.nav-index {
  color: var(--gold);
  margin-right: 8px;
  font-size: 10px;
}

.signal {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 20, 26, 0.6);
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

.signal:hover,
.signal[aria-pressed="true"] {
  color: var(--ice-hi);
  border-color: rgba(88, 200, 244, 0.45);
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.signal-bars i {
  width: 3px;
  background: currentColor;
  opacity: 0.35;
}

.signal-bars i:nth-child(1) { height: 25%; }
.signal-bars i:nth-child(2) { height: 50%; }
.signal-bars i:nth-child(3) { height: 75%; }
.signal-bars i:nth-child(4) { height: 100%; }

.signal[aria-pressed="true"] .signal-bars i {
  opacity: 1;
  animation: bars 1.4s steps(2) infinite;
}

.signal[aria-pressed="true"] .signal-bars i:nth-child(2) { animation-delay: 0.2s; }
.signal[aria-pressed="true"] .signal-bars i:nth-child(3) { animation-delay: 0.45s; }
.signal[aria-pressed="true"] .signal-bars i:nth-child(4) { animation-delay: 0.7s; }

@keyframes bars {
  50% { opacity: 0.35; }
}

/* Shared type */
.eyebrow {
  margin: 0 0 18px;
  font: 12px var(--mono);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ice);
}

.blink {
  color: var(--gold);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  min-height: calc(100svh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 40px;
  padding: 60px var(--gutter) 120px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero h1 {
  font-size: clamp(56px, 10vw, 138px);
  line-height: 0.92;
  letter-spacing: -2px;
  margin-bottom: 22px;
  text-shadow: 0 0 40px rgba(255, 201, 60, 0.18);
}

.lede {
  font: 600 clamp(20px, 2.4vw, 28px)/1.3 var(--display);
  margin: 0 0 18px;
  background: linear-gradient(90deg, var(--gold), var(--amber) 45%, var(--ice-hi));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-height: 1.3em;
}

.intro {
  color: var(--muted);
  max-width: 540px;
  margin: 0 0 34px;
}

.intro a {
  color: var(--ice-hi);
  text-decoration-color: rgba(166, 236, 255, 0.4);
  text-underline-offset: 3px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 22px;
  text-decoration: none;
  font: 600 13px var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s;
}

.btn-solar {
  background: linear-gradient(100deg, var(--gold), var(--amber));
  color: #1a1004;
}

.btn-solar:hover {
  transform: translateY(-2px);
  background: linear-gradient(100deg, #ffe08a, var(--gold));
}

.btn-ghost {
  background: rgba(88, 200, 244, 0.08);
  color: var(--ice-hi);
  box-shadow: inset 0 0 0 1px rgba(88, 200, 244, 0.4);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(88, 200, 244, 0.16);
}

/* The sigil core */
.core {
  position: relative;
  z-index: 2;
  justify-self: center;
  width: min(520px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  perspective: 900px;
}

.core-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(88, 200, 244, 0.18);
  pointer-events: none;
}

.core-orbit-1 {
  inset: -4%;
  border-style: dashed;
  border-color: rgba(255, 201, 60, 0.22);
  animation: spin 60s linear infinite;
}

.core-orbit-2 {
  inset: 6%;
  animation: spin 18s linear infinite reverse;
}

.core-orbit-3 {
  inset: -14%;
  border-color: rgba(88, 200, 244, 0.08);
  animation: spin 32s linear infinite;
}

.core-orbit i {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px 4px rgba(255, 201, 60, 0.6);
}

.core-orbit-3 i {
  background: var(--ice);
  box-shadow: 0 0 14px 4px rgba(88, 200, 244, 0.6);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.core-sigil {
  position: relative;
  width: 82%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease);
  animation: breathe 6s ease-in-out infinite;
}

.core-sigil img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 40px rgba(255, 170, 40, 0.35)) drop-shadow(0 0 80px rgba(88, 200, 244, 0.2));
}

.core-ghost {
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.core-ghost-a {
  filter: hue-rotate(160deg) saturate(2);
}

.core-ghost-b {
  filter: hue-rotate(-60deg) saturate(2);
}

@keyframes breathe {
  50% { filter: brightness(1.12); }
}

.core.is-charged .core-sigil {
  animation: charge 1.1s var(--ease);
}

.core.is-charged .core-ghost-a,
.is-glitching .core-ghost-a {
  animation: ghost-a 0.45s steps(3) 2;
}

.core.is-charged .core-ghost-b,
.is-glitching .core-ghost-b {
  animation: ghost-b 0.45s steps(3) 2;
}

@keyframes charge {
  0% { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1) rotate(0); filter: brightness(1); }
  30% { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(0.92) rotate(-12deg); filter: brightness(1.8); }
  100% { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1) rotate(60deg); filter: brightness(1); }
}

@keyframes ghost-a {
  0% { opacity: 0.7; transform: translate(-10px, 3px); clip-path: inset(10% 0 55% 0); }
  50% { opacity: 0.6; transform: translate(8px, -2px); clip-path: inset(60% 0 12% 0); }
  100% { opacity: 0; transform: none; clip-path: inset(0); }
}

@keyframes ghost-b {
  0% { opacity: 0.7; transform: translate(9px, -3px); clip-path: inset(40% 0 30% 0); }
  50% { opacity: 0.6; transform: translate(-7px, 2px); clip-path: inset(5% 0 80% 0); }
  100% { opacity: 0; transform: none; clip-path: inset(0); }
}

.core-hint {
  position: absolute;
  bottom: -6%;
  margin: 0;
  font: 10px var(--mono);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}

/* Solar horizon */
.horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 220px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%);
  mask-image: linear-gradient(to bottom, transparent, #000 40%);
}

.horizon-sun {
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: 520px;
  height: 260px;
  margin-left: -260px;
  border-radius: 260px 260px 0 0;
  background: linear-gradient(to bottom, rgba(255, 201, 60, 0.55), rgba(255, 70, 50, 0.15));
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 14px, transparent 14px 20px);
  mask-image: repeating-linear-gradient(to bottom, #000 0 14px, transparent 14px 20px);
  filter: blur(0.5px);
  opacity: 0.55;
}

.horizon-grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -40px;
  height: 140px;
  background:
    linear-gradient(rgba(88, 200, 244, 0.35) 1px, transparent 1px) 0 0 / 100% 22px,
    linear-gradient(90deg, rgba(88, 200, 244, 0.25) 1px, transparent 1px) 0 0 / 46px 100%;
  transform: perspective(260px) rotateX(62deg);
  transform-origin: top;
  animation: grid-run 2.6s linear infinite;
}

@keyframes grid-run {
  to { background-position: 0 22px, 0 0; }
}

/* Glitch text. The pseudo copies are offset in ice and ember, then sliced. */
.glitch,
.glitch-soft {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after,
.glitch-soft::before,
.glitch-soft::after,
.module-name::before,
.module-name::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.glitch::before,
.glitch-soft::before,
.module-name::before {
  color: var(--ice);
  text-shadow: none;
}

.glitch::after,
.glitch-soft::after,
.module-name::after {
  color: var(--ember);
  text-shadow: none;
}

.glitch.is-glitching::before,
.glitch-soft.is-glitching::before,
.module:hover .module-name::before {
  opacity: 0.85;
  animation: slice-a 0.42s steps(4) both;
}

.glitch.is-glitching::after,
.glitch-soft.is-glitching::after,
.module:hover .module-name::after {
  opacity: 0.85;
  animation: slice-b 0.42s steps(4) both;
}

.glitch.is-glitching,
.glitch-soft.is-glitching {
  animation: jolt 0.42s steps(3);
}

@keyframes slice-a {
  0% { clip-path: inset(8% 0 70% 0); transform: translate(-6px, -1px); }
  25% { clip-path: inset(55% 0 20% 0); transform: translate(5px, 1px); }
  50% { clip-path: inset(30% 0 52% 0); transform: translate(-3px, 0); }
  75% { clip-path: inset(78% 0 4% 0); transform: translate(4px, -1px); }
  100% { clip-path: inset(0 0 100% 0); transform: none; opacity: 0; }
}

@keyframes slice-b {
  0% { clip-path: inset(62% 0 10% 0); transform: translate(6px, 1px); }
  25% { clip-path: inset(12% 0 66% 0); transform: translate(-5px, 0); }
  50% { clip-path: inset(44% 0 34% 0); transform: translate(3px, 1px); }
  75% { clip-path: inset(2% 0 84% 0); transform: translate(-4px, 0); }
  100% { clip-path: inset(0 0 100% 0); transform: none; opacity: 0; }
}

@keyframes jolt {
  33% { transform: translateX(2px) skewX(-6deg); }
  66% { transform: translateX(-2px) skewX(4deg); }
}

/* Screen tear: a few horizontal slices that shift for a blink. */
.tear {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.tear span {
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(88, 200, 244, 0.18) 20%, rgba(255, 70, 50, 0.16) 60%, transparent);
  mix-blend-mode: screen;
  backdrop-filter: hue-rotate(90deg) saturate(1.6);
  -webkit-backdrop-filter: hue-rotate(90deg) saturate(1.6);
  animation: tear 0.32s steps(3) both;
}

@keyframes tear {
  0% { transform: translateX(-14px); opacity: 1; }
  50% { transform: translateX(18px); opacity: 0.9; }
  100% { transform: translateX(0); opacity: 0; }
}

body.is-shaking main {
  animation: shake 0.3s steps(3);
}

@keyframes shake {
  33% { transform: translate(3px, -1px); filter: hue-rotate(40deg); }
  66% { transform: translate(-3px, 1px); filter: saturate(1.6); }
}

/* Reticle cursor companion (fine pointers only) */
.reticle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 45;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s, width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease);
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 201, 60, 0.7);
  clip-path: polygon(0 0, 30% 0, 30% 2px, 2px 2px, 2px 30%, 0 30%, 0 0, 70% 0, 100% 0, 100% 30%, calc(100% - 2px) 30%, calc(100% - 2px) 2px, 70% 2px, 70% 0, 100% 70%, 100% 100%, 70% 100%, 70% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 70%, 100% 70%, 30% 100%, 0 100%, 0 70%, 2px 70%, 2px calc(100% - 2px), 30% calc(100% - 2px));
}

.reticle::after {
  border: 0;
  inset: 50% auto auto 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: var(--gold);
  clip-path: none;
}

.reticle.is-on {
  opacity: 1;
}

.reticle.is-hot {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
}

/* Sections */
.works,
.elsewhere,
.contact {
  padding: 110px var(--gutter);
}

.section-head {
  margin-bottom: 54px;
}

.section-head h2,
.contact h2 {
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -1px;
}

/* Modules */
.modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.module {
  --accent: var(--ice);
  --glow: rgba(88, 200, 244, 0.22);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 24px;
  background:
    radial-gradient(420px 260px at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 65%),
    var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform 0.5s var(--ease), border-color 0.4s;
  overflow: hidden;
}

.module-solar {
  --accent: var(--gold);
  --glow: rgba(255, 201, 60, 0.2);
}

.module-ember {
  --accent: var(--amber);
  --glow: rgba(255, 110, 40, 0.2);
}

.module::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.module:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.module-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 40%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
  pointer-events: none;
}

.module:hover .module-scan {
  animation: scan 1.6s linear infinite;
}

@keyframes scan {
  to { top: 110%; }
}

.module-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 11px var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.module-index {
  color: var(--accent);
}

.module-status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #3ee08f;
  box-shadow: 0 0 8px #3ee08f;
  animation: blink 2.4s steps(1) infinite;
}

.emblem {
  width: 100%;
  height: 130px;
  margin: 18px 0 10px;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent));
}

/* Charon: a boat carries a file from shore to shore. */
.emblem-charon .shore {
  stroke: var(--muted);
}

.emblem-charon .river {
  stroke: var(--ice);
  opacity: 0.6;
  stroke-dasharray: 6 6;
  animation: flow 3s linear infinite;
}

.emblem-charon .river-2 {
  opacity: 0.3;
  animation-duration: 4.5s;
}

.emblem-charon .arc {
  stroke-dasharray: 3 7;
  opacity: 0.5;
}

.emblem-charon .boat {
  offset-path: path("M24 78C40 22 120 22 136 78");
  offset-rotate: 0deg;
  offset-distance: 0%;
  fill: var(--void);
  animation: cross 5s var(--ease) infinite alternate;
}

.emblem-charon .file {
  fill: var(--gold);
  stroke: none;
}

.emblem-charon .f2 {
  animation: arrive 10s linear infinite;
}

@keyframes flow {
  to { stroke-dashoffset: -24; }
}

@keyframes cross {
  to { offset-distance: 100%; }
}

@keyframes arrive {
  0%, 45% { opacity: 0.2; }
  50%, 95% { opacity: 1; }
}

/* Repopus: tentacles reach out to the repositories it keeps. */
.emblem-repopus .tentacles path {
  stroke-dasharray: 120;
  stroke-dashoffset: 0;
  opacity: 0.85;
}

.module:hover .emblem-repopus .tentacles path {
  animation: reach 1.6s var(--ease) both;
}

.module:hover .emblem-repopus .tentacles path:nth-child(2n) {
  animation-delay: 0.15s;
}

.emblem-repopus .repos rect {
  fill: var(--void);
  stroke: var(--ice);
  animation: pulse 3s ease-in-out infinite;
}

.emblem-repopus .repos rect:nth-child(2n) {
  animation-delay: 1.5s;
}

.emblem-repopus .hub {
  fill: var(--void);
}

.emblem-repopus .hub-eye {
  fill: var(--ember);
  stroke: none;
  animation: blink 4s steps(1) infinite;
}

@keyframes reach {
  from { stroke-dashoffset: 120; }
  to { stroke-dashoffset: 0; }
}

@keyframes pulse {
  50% { stroke: var(--gold); }
}

/* JobSlip: a slip fills in and gets its tick. */
.emblem-jobslip .slip path {
  fill: var(--void);
}

.emblem-jobslip .slip-back {
  opacity: 0.45;
  transform: rotate(6deg);
  transform-origin: 80px 60px;
  transition: transform 0.6s var(--ease);
}

.module:hover .emblem-jobslip .slip-back {
  transform: rotate(12deg) translate(6px, -2px);
}

.emblem-jobslip .line {
  stroke: var(--muted);
  stroke-dasharray: 40;
}

.emblem-jobslip .check {
  stroke: var(--gold);
  stroke-width: 3;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: tick 4s var(--ease) infinite;
}

.module:hover .emblem-jobslip .line {
  animation: write 1s var(--ease) both;
}

.module:hover .emblem-jobslip .l2 { animation-delay: 0.15s; }
.module:hover .emblem-jobslip .l3 { animation-delay: 0.3s; }

@keyframes tick {
  30%, 85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 30; }
}

@keyframes write {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: 0; }
}

.module-name {
  position: relative;
  font-size: 34px;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.module-tag {
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.4;
}

.module-text {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 0 22px;
  padding: 0;
}

.chips li {
  padding: 4px 10px;
  border: 1px solid var(--line);
  font: 11px var(--mono);
  letter-spacing: 0.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.module-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  font: 13px var(--mono);
  letter-spacing: 1px;
  color: var(--accent);
}

/* The whole card is clickable through the link. */
.module-link-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.module:focus-within {
  border-color: var(--accent);
}

/* Portals */
.portals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.portal {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 250px;
  padding: 26px;
  text-decoration: none;
  border: 1px solid var(--line);
  background:
    radial-gradient(380px 220px at var(--mx, 0%) var(--my, 0%), rgba(255, 201, 60, 0.12), transparent 65%),
    rgba(16, 20, 26, 0.55);
  transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform 0.5s var(--ease), border-color 0.4s;
}

.portal:hover {
  border-color: rgba(255, 201, 60, 0.5);
}

.portal-key {
  align-self: flex-start;
  padding: 3px 9px;
  margin-bottom: 30px;
  font: 11px var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--void);
  background: var(--ice);
}

.portal-art .portal-key {
  background: var(--ember);
  color: #fff;
}

.portal-name {
  font: 700 28px/1.1 var(--display);
  margin-bottom: 12px;
}

.portal-text {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 22px;
}

.portal-url {
  margin-top: auto;
  font: 12px var(--mono);
  letter-spacing: 1px;
  color: var(--gold);
}

/* Contact */
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 140px;
}

.contact h2 {
  margin-bottom: 30px;
}

.mail {
  display: inline-block;
  font: 600 clamp(20px, 3.4vw, 36px) var(--mono);
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 201, 60, 0.4);
  padding-bottom: 6px;
  transition: color 0.3s, border-color 0.3s, letter-spacing 0.5s var(--ease);
}

.mail:hover {
  color: var(--ice-hi);
  border-color: var(--ice-hi);
  letter-spacing: 1px;
}

/* Footer console */
.bottom {
  padding: 22px var(--gutter) 30px;
  border-top: 1px solid var(--line);
  font: 11px var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.bottom p {
  margin: 0;
}

.console {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.console-ok {
  color: #3ee08f;
}

.console-msg {
  color: var(--gold);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

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

/* Smaller screens */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
    padding-top: 40px;
  }

  .core {
    order: -1;
    width: min(380px, 82vw);
  }

  .modules,
  .portals {
    grid-template-columns: 1fr;
  }

  .module,
  .portal {
    max-width: 640px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .top {
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .nav {
    display: none;
  }

  .signal-label {
    display: none;
  }

  .hero h1 {
    letter-spacing: -1px;
  }

  .works,
  .elsewhere,
  .contact {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .module {
    padding: 22px 20px;
  }

  .horizon-sun {
    width: 340px;
    height: 170px;
    margin-left: -170px;
  }
}

/* Quiet mode: no motion for those who ask for it, or who turn the signal off. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

.is-quiet .tear,
.is-quiet .reticle {
  display: none;
}

/* 404 */
.lost-main {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 40px var(--gutter);
  text-align: center;
}

.lost-sigil {
  width: 140px;
  height: auto;
  margin-bottom: 26px;
  opacity: 0.85;
  filter: grayscale(0.5) drop-shadow(0 0 30px rgba(255, 170, 40, 0.25));
  animation: breathe 6s ease-in-out infinite;
}

.lost h1 {
  font-size: clamp(36px, 7vw, 72px);
  margin-bottom: 14px;
}

.glitch.is-looping::before {
  opacity: 0.8;
  animation: slice-a 2.4s steps(4) infinite;
}

.glitch.is-looping::after {
  opacity: 0.8;
  animation: slice-b 2.4s steps(4) infinite;
}
