@font-face {
  font-family: "Jost";
  src: url("./assets/fonts/jost-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bone: #f4f2ec;
  --ink: #292722;
  --muted: #6e695f;
  --sandstone: #887254;
  --line: #d6d1c6;
  --white: #fffdf7;
  --font: "Jost", "Avenir Next", "Century Gothic", sans-serif;
  --page-gutter: clamp(24px, 6.2vw, 104px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font);
  color: var(--ink);
  background: var(--bone);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; scrollbar-gutter: stable; }
body { margin: 0; }
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4 { margin: 0; }
button, a, summary, input { outline-offset: 6px; }
:focus-visible { outline: 2px solid currentColor; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
svg { display: block; }
svg use { fill: none; stroke: currentColor; stroke-width: 1.4; }
.drafting-icon { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; stroke-linejoin: miter; }
.drafting-hatch { stroke-width: 0.7; opacity: 0.5; }
.drafting-register { stroke-width: 0.65; opacity: 0.45; }
::selection { color: var(--white); background: #69513a; }

.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 16px;
  padding: 14px 20px;
  background: var(--bone);
  color: var(--ink);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.section-shell { padding-inline: var(--page-gutter); max-width: 1680px; margin-inline: auto; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 700px;
  height: 100svh;
  max-height: 1040px;
  color: var(--white);
  background: #3d3930;
}
.hero-landscape, .hero-landscape img, .hero::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-landscape { z-index: -3; overflow: hidden; }
.hero-landscape img {
  object-fit: cover;
  object-position: center 40%;
  animation: vista-arrival 1600ms var(--ease-out) both;
}
.hero::after {
  z-index: -2;
  content: "";
  background: linear-gradient(180deg, rgb(19 25 24 / 32%) 0%, rgb(26 25 21 / 8%) 24%, rgb(29 25 20 / 31%) 48%, rgb(22 22 19 / 58%) 100%);
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 112px;
  margin-inline: var(--page-gutter);
  border-bottom: 1px solid rgb(255 253 247 / 25%);
}
.brand { display: inline-flex; align-items: center; gap: 15px; min-height: 48px; }
.brand-symbol { width: 48px; height: 48px; }
.brand span, .footer-wordmark {
  font-weight: 450;
  font-size: 16px;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}
.masthead nav { display: flex; gap: 42px; }
.masthead nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-underline-offset: 7px;
}
.masthead nav a:hover { text-decoration: underline; }
.hero-content {
  text-align: center;
  margin-block: auto;
  padding: 88px 24px 58px;
}
.hero h1 {
  font-size: clamp(3rem, 6.8vw, 6rem);
  font-weight: 300;
  line-height: 1.17;
  letter-spacing: 0.105em;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 3px 30px rgb(22 22 19 / 12%);
}
.hero h1 span { display: block; }
.hero-content > p {
  margin-top: 26px;
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 350;
  letter-spacing: 0.035em;
  line-height: 1.6;
  text-wrap: balance;
}
.explore-link {
  display: inline-flex;
  align-items: center;
  gap: 38px;
  margin-top: 40px;
  padding: 17px 24px;
  background: var(--bone);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: background 180ms ease-out, gap 260ms var(--ease-out);
}
.explore-link svg { width: 18px; height: 18px; }
.explore-link:hover { gap: 48px; background: #fff; }
.hero-foot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 var(--page-gutter) 36px;
  padding-top: 23px;
  border-top: 1px solid rgb(255 253 247 / 28%);
  font-size: 10px;
  font-weight: 450;
  letter-spacing: 0.16em;
  line-height: 1.6;
  text-transform: uppercase;
}

.projects { padding-top: 108px; padding-bottom: 120px; }
.introduction { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12%; align-items: center; }
.introduction h2, .connection h2 {
  font-size: clamp(34px, 3.4vw, 52px);
  font-weight: 350;
  line-height: 1.22;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.introduction > p {
  max-width: 430px;
  font-size: 18px;
  font-weight: 350;
  line-height: 1.8;
  color: var(--muted);
}
.security-layout { display: grid; grid-template-columns: 0.68fr 1.6fr; gap: 8%; margin-top: 100px; }
.section-aside { padding-top: 33px; }
.section-aside h3 { font-size: 17px; font-weight: 450; }
.section-aside > p { margin-top: 21px; font-size: 15px; font-weight: 350; line-height: 1.85; color: var(--muted); }
.frontier-symbol { width: 155px; height: 108px; margin-top: 55px; color: var(--sandstone); }
.project-list { border-top: 1px solid var(--line); }
.project-row {
  display: grid;
  grid-template-columns: 65px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 28px;
  padding: 33px 0;
  border-bottom: 1px solid var(--line);
}
.project-illustration { width: 65px; height: 65px; color: var(--sandstone); }
.project-copy h4 { font-size: 29px; line-height: 1.2; font-weight: 400; letter-spacing: -0.025em; }
.project-copy .gridline-title { font-size: 25px; letter-spacing: 0.08em; }
.project-copy p { margin-top: 9px; font-size: 15px; font-weight: 350; line-height: 1.6; color: var(--muted); }
.project-domain { display: block; margin-top: 11px; font-size: 11px; font-weight: 400; letter-spacing: 0.055em; color: var(--muted); }
.project-arrow { width: 23px; height: 23px; color: var(--sandstone); transition: transform 240ms var(--ease-out); }
.project-row:hover .project-arrow { transform: translate(3px, -3px); }
.project-row:hover h4 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.project-row:focus-visible { outline-offset: 8px; }

.games { position: relative; isolation: isolate; overflow: hidden; background: #3a3931; color: var(--white); }
.games-landscape { position: absolute; z-index: -3; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 49% center; }
.games::after { content: ""; position: absolute; z-index: -2; inset: 0; background: rgb(22 28 25 / 65%); }
.games-inner { display: grid; grid-template-columns: 0.85fr 1fr; gap: 15%; padding-block: 108px; }
.games-intro h2 { font-size: clamp(56px, 6vw, 86px); line-height: 1.08; font-weight: 300; letter-spacing: -0.02em; }
.games-intro p { margin-top: 31px; font-size: 16px; font-weight: 350; line-height: 1.8; color: #f1f1e8; }
.game-project { display: block; padding-block: 30px; border-top: 1px solid rgb(255 253 247 / 36%); }
.game-project:last-child { border-bottom: 1px solid rgb(255 253 247 / 36%); }
.game-project-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.game-project-top h3 { font-size: 28px; font-weight: 350; line-height: 1.3; letter-spacing: -0.01em; }
.game-project-top > svg { width: 23px; height: 23px; flex-shrink: 0; transition: transform 240ms var(--ease-out); }
.game-project > p { margin-top: 15px; max-width: 390px; font-size: 15px; font-weight: 350; line-height: 1.75; color: #f1f1e8; }
.game-destination { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 11px; font-weight: 450; letter-spacing: 0.08em; text-transform: uppercase; }
.game-destination > svg { width: 16px; height: 16px; flex-shrink: 0; }
.game-project:hover > .game-project-top > svg { transform: translate(3px, -3px); }
a.game-project:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

.site-footer { padding-top: 94px; padding-bottom: 26px; }
.connection { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 13%; align-items: start; }
.connection-links { padding-top: 5px; }
.connection-links > p { margin-bottom: 21px; color: var(--muted); font-size: 15px; font-weight: 350; }
.connection-links > a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 400; }
.connection-links > a svg { width: 19px; height: 19px; transition: transform 240ms var(--ease-out); }
.connection-links > a:hover svg { transform: translate(3px, -3px); }
.connection-links > a:hover { color: #71583a; }
.footer-baseline { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 96px; border-top: 1px solid var(--line); padding-top: 28px; }
.footer-wordmark { font-size: 12px; }
.footer-baseline > span { font-size: 11px; font-weight: 400; letter-spacing: 0.045em; color: var(--muted); }
.photo-credits { margin-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.photo-credits summary { display: inline-block; cursor: pointer; padding-block: 10px; text-decoration: underline; text-underline-offset: 3px; }
.photo-credits p { max-width: 660px; margin-top: 6px; }
.photo-credits p a { text-decoration: underline; text-underline-offset: 2px; }

.backdoor-trigger {
  position: fixed;
  z-index: 10;
  bottom: max(10px, env(safe-area-inset-bottom));
  right: max(11px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #514c42;
}
.backdoor-trigger span { display: grid; place-items: center; width: 23px; height: 23px; background: var(--bone); border-radius: 50%; }
.backdoor-trigger svg { width: 17px; height: 17px; }
.backdoor-trigger:hover span { color: var(--ink); background: #fff; }
.backdoor-trigger:focus-visible { outline-color: var(--sandstone); outline-offset: -2px; }

.terminal {
  --terminal-bg: #0c1713;
  --terminal-text: #cbded1;
  --terminal-dim: #8ca497;
  --terminal-accent: #a8e3ba;
  --terminal-line: #3c5548;
  color-scheme: dark;
  width: min(540px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #79917e;
  background: var(--terminal-bg);
  color: var(--terminal-text);
  box-shadow: 0 24px 100px rgb(0 0 0 / 46%);
  font-family: "Courier New", Courier, monospace;
  scrollbar-color: #5c7766 var(--terminal-bg);
  overscroll-behavior: contain;
}
.terminal[open] { animation: terminal-arrival 200ms var(--ease-out); }
.terminal::backdrop { background: rgb(11 16 12 / 82%); }
.terminal-chrome { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 49px; padding: 0 8px 0 21px; background: #21372c; border-bottom: 1px solid #516c59; font-size: 11px; letter-spacing: 0.035em; }
.terminal-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--terminal-text); background: none; border: 0; }
.terminal-close svg { width: 21px; height: 21px; }
.terminal-close:hover { background: #395241; }
.terminal-body { padding: 30px; }
.terminal-command { margin-bottom: 25px; font-size: 12px; color: var(--terminal-dim); }
.cursor { color: var(--terminal-accent); }
.game-intro h2 { font-size: clamp(27px, 6vw, 39px); font-weight: 400; line-height: 1.12; letter-spacing: -0.025em; color: var(--terminal-accent); }
.game-intro > p:not(.terminal-command, .game-homage) { margin-top: 22px; font-size: 13px; line-height: 1.7; }
.game-rules { display: grid; gap: 14px; margin: 27px 0; padding-left: 23px; font-size: 12px; line-height: 1.65; }
.game-rules li { padding-left: 7px; }
.game-rules li::marker { color: var(--terminal-accent); }
.game-rules strong { font-weight: 700; color: var(--terminal-accent); }
.untimed-option { display: flex; align-items: center; gap: 11px; margin-bottom: 23px; min-height: 44px; font-size: 11px; line-height: 1.6; cursor: pointer; }
.untimed-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--terminal-accent); flex-shrink: 0; }
.terminal-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 44px; padding: 12px 18px; border: 1px solid #789883; color: var(--terminal-accent); background: transparent; font-size: 12px; line-height: 1.4; }
.terminal-button > svg { width: 18px; height: 18px; flex-shrink: 0; }
.terminal-button:hover { background: #203b2d; }
.primary-terminal-button { width: 100%; background: var(--terminal-accent); color: #102017; border-color: var(--terminal-accent); font-weight: 700; }
.primary-terminal-button:hover { background: #c5f6d4; }
.text-terminal-button { border-color: transparent; color: var(--terminal-dim); }
.text-terminal-button:hover { color: var(--terminal-text); }
.game-homage { margin-top: 23px; text-align: center; color: var(--terminal-dim); font-size: 10px; line-height: 1.7; }
.game-hud { display: flex; justify-content: space-between; gap: 20px; }
.hud-label { display: block; margin-bottom: 5px; color: var(--terminal-dim); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; }
.game-hud strong { font-size: 27px; font-weight: 400; font-variant-numeric: tabular-nums; }
.moves-readout { text-align: right; }
#trace-progress { display: block; width: 100%; height: 3px; margin: 16px 0 21px; accent-color: var(--terminal-accent); border: 0; background: #293d31; }
#trace-progress::-webkit-progress-bar { background: #293d31; }
#trace-progress::-webkit-progress-value { background: var(--terminal-accent); }
#trace-progress::-moz-progress-bar { background: var(--terminal-accent); }
.terminal.is-urgent #game-timer { color: #ffd59b; }
.terminal.is-urgent #trace-progress { accent-color: #ffd59b; }
.terminal.is-urgent #trace-progress::-webkit-progress-value { background: #ffd59b; }
.terminal.is-urgent #trace-progress::-moz-progress-bar { background: #ffd59b; }
.fragment-list { display: flex; gap: 10px; justify-content: space-between; padding: 0; margin: 0 0 21px; list-style: none; font-size: 11px; }
.fragment-list li { display: flex; align-items: center; gap: 7px; color: var(--terminal-dim); }
.fragment-list li > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--terminal-line); font-size: 10px; }
.fragment-list li.is-recovered { color: var(--terminal-accent); }
.fragment-list li.is-recovered > span:first-child { background: var(--terminal-accent); color: var(--terminal-bg); border-color: var(--terminal-accent); }
.board-labels { display: flex; justify-content: space-between; gap: 12px; font-size: 9px; line-height: 1.7; color: var(--terminal-dim); margin-bottom: 10px; }
.board-shell { position: relative; max-width: 370px; margin-inline: auto; }
.relay-board { display: grid; gap: 5px; }
.relay-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.relay-cell { min-width: 0; }
.relay {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #3c5548;
  background: #13231b;
  color: #8da997;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.relay svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; }
.relay .relay-junction { fill: currentColor; stroke: none; }
.relay.is-connected { color: #baf4cb; background: #274937; }
.relay.is-terminal { border-color: #a8e3ba; }
.relay:not(:disabled):hover { background: #34503d; }
.relay:focus-visible { z-index: 2; outline: 2px solid #fff2c4; outline-offset: 2px; }
.fragment-mark { position: absolute; top: 3px; right: 4px; display: grid; place-items: center; width: 14px; height: 14px; font-size: 10px; background: var(--terminal-bg); color: #e1cf93; }
.board-cover { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: rgb(12 23 19 / 94%); color: var(--terminal-accent); text-align: center; font-size: 14px; letter-spacing: 0.055em; }
.game-instructions { margin-top: 15px; font-size: 10px; line-height: 1.7; color: var(--terminal-dim); text-align: center; }
.game-status { min-height: 36px; margin-top: 16px; font-size: 12px; line-height: 1.6; color: var(--terminal-accent); text-align: center; }
.game-controls { display: flex; justify-content: space-between; gap: 15px; margin-top: 12px; }
.game-result { margin-top: 10px; border-top: 1px solid var(--terminal-line); padding-top: 21px; }
.game-result h3 { font-size: 21px; font-weight: 400; color: var(--terminal-accent); }
.game-result p { margin-top: 12px; margin-bottom: 20px; font-size: 12px; line-height: 1.7; }
.game-result .text-terminal-button { display: flex; margin: 8px auto 0; }

@keyframes vista-arrival {
  from { transform: scale(1.035); }
  to { transform: scale(1); }
}
@keyframes terminal-arrival {
  from { transform: translateY(8px); clip-path: inset(2% 0); }
  to { transform: translateY(0); clip-path: inset(0); }
}

@media (min-width: 1680px) {
  .masthead, .hero-foot { width: calc(1680px - 208px); margin-inline: auto; }
}

@media (max-width: 900px) {
  .hero { min-height: 660px; max-height: 1000px; }
  .hero h1 { font-size: clamp(42px, 6.5vw, 70px); }
  .introduction { gap: 8%; }
  .introduction > p { font-size: 16px; }
  .security-layout { grid-template-columns: 0.55fr 1.5fr; gap: 6%; margin-top: 70px; }
  .project-row { grid-template-columns: 48px minmax(0, 1fr) 21px; gap: 19px; }
  .project-illustration { width: 48px; height: 48px; }
  .project-copy h4 { font-size: 26px; }
  .project-copy p { font-size: 14px; }
  .games-inner { gap: 8%; grid-template-columns: 0.8fr 1.2fr; padding-block: 85px; }
  .game-project-top { flex-wrap: wrap; gap: 12px; }
  .game-project-top h3 { font-size: 25px; }
  .game-project-top > svg { margin-left: auto; }
  .connection { gap: 8%; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 20px; }
  .hero { min-height: 640px; max-height: 960px; }
  .hero-landscape img { object-position: 45% center; }
  .hero::after { background: linear-gradient(180deg, rgb(19 25 24 / 36%), rgb(29 25 20 / 25%) 40%, rgb(22 22 19 / 64%) 100%); }
  .masthead { min-height: 87px; gap: 16px; }
  .brand { gap: 8px; }
  .brand-symbol { width: 36px; height: 36px; }
  .brand span { font-size: 11px; letter-spacing: 0.16em; }
  .masthead nav { gap: 20px; }
  .masthead nav a { font-size: 10px; letter-spacing: 0.075em; }
  .hero-content { padding: 86px 20px 69px; }
  .hero h1 { font-size: clamp(29px, 8.2vw, 50px); line-height: 1.3; letter-spacing: 0.075em; }
  .hero-content > p { max-width: 280px; margin: 23px auto 0; font-size: 16px; line-height: 1.7; }
  .explore-link { margin-top: 31px; padding: 17px 20px; font-size: 10px; gap: 30px; }
  .hero-foot { margin-bottom: 26px; padding-top: 18px; display: grid; gap: 5px; font-size: 8px; letter-spacing: 0.13em; }
  .hero-foot span:last-child { color: #e3dfd3; }
  .projects { padding-top: 64px; padding-bottom: 70px; }
  .introduction { grid-template-columns: 1fr; gap: 25px; }
  .introduction h2, .connection h2 { font-size: clamp(32px, 7.8vw, 43px); }
  .introduction > p { max-width: 440px; font-size: 16px; line-height: 1.8; }
  .security-layout { grid-template-columns: 1fr; gap: 28px; margin-top: 57px; }
  .section-aside { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding-top: 0; }
  .section-aside h3 { font-size: 15px; }
  .section-aside > p { margin: 0; font-size: 12px; line-height: 1.6; text-align: right; }
  .frontier-symbol { display: none; }
  .project-row { grid-template-columns: 43px minmax(0, 1fr) 19px; gap: 17px; padding-block: 28px; }
  .project-illustration { width: 43px; height: 43px; }
  .project-copy h4 { font-size: 26px; }
  .project-copy .gridline-title { font-size: 23px; }
  .project-copy p { font-size: 14px; line-height: 1.6; }
  .project-domain { font-size: 10px; }
  .project-arrow { width: 19px; height: 19px; }
  .games-inner { grid-template-columns: 1fr; gap: 46px; padding-block: 67px; }
  .games-landscape { object-position: 53% center; }
  .games-intro h2 { font-size: 63px; }
  .games-intro p { margin-top: 23px; font-size: 15px; }
  .game-project { padding-block: 28px; }
  .game-project-top h3 { font-size: 27px; }
  .game-project > p { font-size: 15px; }
  .site-footer { padding-top: 65px; padding-bottom: 25px; }
  .connection { grid-template-columns: 1fr; gap: 35px; }
  .connection-links > p { margin-bottom: 13px; }
  .footer-baseline { flex-wrap: wrap; justify-content: flex-start; gap: 17px; margin-top: 58px; padding-top: 25px; padding-right: 30px; }
  .footer-wordmark { width: 100%; font-size: 11px; }
  .footer-baseline > span { font-size: 10px; }
  .photo-credits { padding-right: 28px; font-size: 10px; }
  .backdoor-trigger { right: max(4px, env(safe-area-inset-right)); bottom: max(5px, env(safe-area-inset-bottom)); }
  .terminal-body { padding: 22px 18px; }
  .terminal-chrome { padding-left: 18px; }
  .board-labels { font-size: 8px; gap: 8px; }
  .relay-board, .relay-row { gap: 4px; }
  .game-status { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
