@font-face {
  font-family: "SF Pixelate";
  src: url("../fonts/SF-Pixelate.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("../fonts/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("../fonts/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #030604;
  --panel: #07100a;
  --panel-raised: #0a160e;
  --grid: #163321;
  --grid-strong: #245236;
  --low: #137443;
  --mid: #42df79;
  --peak: #c8ff62;
  --accent: #ff9a4d;
  --ink: #e5efe7;
  --copy: #b4c3b7;
  --muted: #738078;
  --hairline: rgba(229, 239, 231, 0.13);
  --hairline-soft: rgba(229, 239, 231, 0.07);
  --pixel: "SF Pixelate", "Space Mono", monospace;
  --mono: "Space Mono", ui-monospace, monospace;
  --header-height: 68px;
}

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

html {
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a,
button {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  border: 0;
}

::selection {
  color: var(--page);
  background: var(--peak);
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 10px;
  left: 10px;
  padding: 11px 14px;
  color: var(--page);
  background: var(--peak);
  font-family: var(--pixel);
  font-size: 12px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: fixed;
  z-index: 6;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding:
    max(14px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    12px
    max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--hairline-soft);
  background: rgba(3, 6, 4, 0.88);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  font-family: var(--pixel);
  font-size: clamp(17px, 2.2vw, 23px);
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand-mark::before {
  width: 7px;
  height: 7px;
  background: var(--mid);
  box-shadow: 9px 0 var(--peak);
  content: "";
}

.mode-nav {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--grid-strong);
  background: rgba(7, 16, 10, 0.92);
}

.mode-nav a {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 37px;
  padding: 0 11px;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.mode-nav a[aria-current="page"] {
  color: var(--page);
  background: var(--peak);
}

.mode-nav a:not([aria-current="page"]):hover {
  color: var(--peak);
}

.experience-track {
  position: relative;
  height: max(190svh, 1100px);
  background: var(--page);
}

.dot-track {
  height: max(300svh, 1700px);
}

.experience-stage {
  position: sticky;
  z-index: 0;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 45%, rgba(66, 223, 121, 0.045), transparent 36rem),
    var(--page);
}

.experience-stage::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(22, 51, 33, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 51, 33, 0.16) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, transparent, black 24%, black 76%, transparent);
  content: "";
}

.stage-shell {
  display: grid;
  grid-template-columns: minmax(250px, 0.62fr) minmax(460px, 1.38fr);
  gap: clamp(34px, 6vw, 100px);
  align-items: center;
  width: min(1400px, 100%);
  height: 100%;
  margin: 0 auto;
  padding:
    calc(var(--header-height) + 34px)
    max(28px, env(safe-area-inset-right))
    max(30px, env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-left));
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  min-width: 0;
}

.hero-kicker,
.section-kicker,
.instrument-label,
.project-copy > p,
.detail-label {
  margin: 0;
  color: var(--mid);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-title {
  margin: 18px 0 16px;
  font-family: var(--pixel);
  font-size: clamp(54px, 6.2vw, 98px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.78;
}

.hero-positioning {
  max-width: 17ch;
  margin: 0;
  color: var(--copy);
  font-size: clamp(17px, 2vw, 25px);
  line-height: 1.34;
  text-wrap: balance;
}

.hero-positioning strong {
  color: var(--peak);
  font-weight: 400;
}

.hero-action {
  display: inline-flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-width: min(250px, 100%);
  min-height: 50px;
  margin-top: clamp(28px, 4vw, 50px);
  padding: 0 15px;
  border: 1px solid var(--grid-strong);
  color: var(--ink);
  background: rgba(7, 16, 10, 0.74);
  font-family: var(--pixel);
  font-size: 12px;
  letter-spacing: 0.09em;
}

.hero-action:hover,
.hero-action:focus-visible {
  border-color: var(--peak);
  color: var(--page);
  background: var(--peak);
}

.instrument-column {
  position: relative;
  min-width: 0;
}

.instrument-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.instrument-meta span:last-child {
  color: var(--low);
}

.instrument-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--grid-strong);
  border-radius: 8px;
  background: #020503;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
}

.instrument-frame::before,
.instrument-frame::after {
  position: absolute;
  z-index: 2;
  width: 13px;
  height: 13px;
  pointer-events: none;
  content: "";
}

.instrument-frame::before {
  top: 8px;
  left: 8px;
  border-top: 1px solid var(--mid);
  border-left: 1px solid var(--mid);
}

.instrument-frame::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid var(--mid);
  border-bottom: 1px solid var(--mid);
}

.instrument-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

@media (hover: hover) and (pointer: fine) {
  .grid-stage .instrument-frame canvas {
    cursor: crosshair;
  }
}

.canvas-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--peak);
  font-family: var(--pixel);
  font-size: clamp(28px, 7vw, 76px);
}

.has-js .canvas-fallback {
  display: none;
}

.clock-control {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--grid-strong);
  background: rgba(3, 6, 4, 0.9);
}

.clock-control button {
  min-height: 35px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.clock-control button[aria-pressed="true"] {
  color: var(--page);
  background: var(--mid);
}

.phase-key {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.phase-key span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.phase-key i {
  width: 5px;
  height: 5px;
  background: var(--grid-strong);
}

.phase-key .is-live i {
  background: var(--mid);
}

.dot-stage .instrument-frame {
  aspect-ratio: 16 / 11;
}

.dot-stage .instrument-frame::before {
  border-color: var(--accent);
}

.dot-progress {
  position: absolute;
  z-index: 3;
  bottom: 16px;
  left: 16px;
  width: min(190px, 45%);
  height: 3px;
  background: var(--grid);
}

.dot-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--peak);
}

.noscript-note {
  padding: 18px;
  border: 1px solid var(--grid-strong);
  color: var(--copy);
  background: var(--panel);
}

.portfolio-directory {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  border-top: 1px solid var(--grid-strong);
  background:
    linear-gradient(rgba(22, 51, 33, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 51, 33, 0.13) 1px, transparent 1px),
    var(--page);
  background-size: 40px 40px;
  scroll-margin-top: 0;
}

.directory-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding:
    clamp(80px, 10vw, 150px)
    max(22px, env(safe-area-inset-right))
    max(36px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
}

.directory-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
  gap: clamp(34px, 7vw, 110px);
  align-items: end;
  padding-bottom: clamp(54px, 8vw, 96px);
  border-bottom: 1px solid var(--hairline);
}

.directory-header h2,
.contact-intro h2 {
  margin: 14px 0 0;
  font-family: var(--pixel);
  font-size: clamp(43px, 7vw, 92px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.88;
}

.directory-header h2 span {
  color: var(--muted);
}

.directory-bio {
  max-width: 54ch;
  margin: 0;
  color: var(--copy);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.75;
}

.project-list {
  border-bottom: 1px solid var(--hairline);
}

.project-card {
  display: grid;
  grid-template-columns: 42px 64px minmax(0, 1fr) auto;
  gap: clamp(14px, 2.5vw, 36px);
  align-items: center;
  min-height: 158px;
  padding: 24px 0;
  border-top: 1px solid var(--hairline);
  transition: background 180ms ease, padding 180ms ease;
}

.project-card:first-child {
  border-top: 0;
}

.project-card.is-selected {
  padding-right: 18px;
  padding-left: 18px;
  background: var(--panel-raised);
}

.project-index {
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 11px;
}

.project-symbol {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--grid-strong);
  color: var(--mid);
  background: var(--panel);
  border-radius: 6px;
}

.project-icon {
  width: 32px;
  height: 32px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.project-icon rect {
  fill: currentColor;
  stroke: none;
}

.project-copy {
  min-width: 0;
}

.project-copy h3 {
  margin: 6px 0 8px;
  font-family: var(--pixel);
  font-size: clamp(27px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.92;
}

.project-status {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.project-status span {
  width: 6px;
  height: 6px;
  border: 1px solid var(--low);
}

.project-action {
  display: inline-flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-width: 172px;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--grid-strong);
  color: var(--ink);
  background: transparent;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.project-action:hover,
.project-action:focus-visible,
.project-action[aria-expanded="true"] {
  border-color: var(--peak);
  color: var(--page);
  background: var(--peak);
}

.project-detail {
  display: grid;
  grid-template-columns: minmax(140px, 0.32fr) minmax(0, 1fr);
  gap: 24px;
  min-height: 138px;
  padding: 34px 0;
  border-bottom: 1px solid var(--hairline);
}

.detail-copy {
  max-width: 68ch;
  margin: 0;
  color: var(--copy);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.7;
}

.detail-copy strong {
  color: var(--ink);
  font-weight: 400;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1fr);
  gap: clamp(40px, 8vw, 120px);
  padding: clamp(74px, 10vw, 140px) 0;
}

.contact-intro h2 {
  font-size: clamp(38px, 5vw, 68px);
}

.link-directory {
  display: grid;
  align-content: start;
}

.link-directory a {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--hairline);
}

.link-directory a:first-child {
  border-top: 1px solid var(--hairline);
}

.link-directory span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.link-directory strong {
  overflow: hidden;
  font-family: var(--pixel);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-directory i {
  color: var(--low);
  font-style: normal;
}

.link-directory a:hover strong,
.link-directory a:hover i,
.link-directory a:focus-visible strong,
.link-directory a:focus-visible i {
  color: var(--peak);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.no-js-directory {
  width: min(900px, calc(100% - 44px));
  margin: 0 auto;
  padding: 100px 0;
}

.no-js-directory h2 {
  font-family: var(--pixel);
  font-size: 42px;
  font-weight: 400;
}

.no-js-directory a {
  color: var(--peak);
}

@media (max-width: 899px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .mode-nav a {
    gap: 5px;
    min-height: 44px;
    padding: 0 8px;
    font-size: 9px;
  }

  .stage-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.2fr) auto;
    gap: clamp(18px, 3svh, 28px);
    padding:
      calc(var(--header-height) + 22px)
      max(16px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }

  .instrument-column {
    grid-row: 1;
    align-self: end;
    width: min(100%, 660px);
    margin: 0 auto;
  }

  .hero-copy {
    grid-row: 2;
    width: min(100%, 660px);
    margin: 0 auto;
  }

  .hero-title {
    margin: 12px 0 9px;
    font-size: clamp(44px, 15vw, 82px);
  }

  .hero-positioning {
    max-width: none;
    font-size: clamp(14px, 4vw, 19px);
  }

  .hero-action {
    min-width: min(220px, 100%);
    min-height: 46px;
    margin-top: 18px;
  }

  .instrument-meta {
    margin-bottom: 7px;
  }

  .directory-header,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .directory-header {
    align-items: start;
  }

  .directory-bio {
    max-width: 64ch;
  }
}

@media (max-width: 620px) {
  .experience-track {
    height: max(205svh, 1200px);
  }

  .dot-track {
    height: max(315svh, 1800px);
  }

  .brand-mark::before {
    box-shadow: none;
  }

  .stage-shell {
    grid-template-rows: auto auto;
    align-content: center;
  }

  .instrument-frame,
  .dot-stage .instrument-frame {
    aspect-ratio: 1.28 / 1;
  }

  .clock-control {
    right: 9px;
    bottom: 9px;
  }

  .clock-control button {
    min-height: 44px;
    padding: 0 8px;
  }

  .phase-key {
    gap: 10px;
    margin-top: 8px;
    font-size: 8px;
  }

  .directory-shell {
    padding-top: 82px;
  }

  .directory-header h2 {
    font-size: clamp(39px, 12vw, 58px);
  }

  .directory-bio {
    font-size: 14px;
  }

  .project-card {
    grid-template-columns: 30px 52px minmax(0, 1fr);
    min-height: 152px;
  }

  .project-symbol {
    width: 50px;
    height: 50px;
  }

  .project-icon {
    width: 28px;
    height: 28px;
  }

  .project-copy h3 {
    font-size: clamp(25px, 8vw, 36px);
  }

  .project-action {
    grid-column: 2 / -1;
    width: 100%;
    min-width: 0;
  }

  .project-card.is-selected {
    padding-right: 12px;
    padding-left: 12px;
  }

  .project-detail {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .contact-grid {
    gap: 36px;
  }

  .link-directory a {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .link-directory strong {
    font-size: 9px;
  }

  .site-footer {
    gap: 14px;
    font-size: 8px;
  }
}

@media (max-width: 320px) {
  .project-card {
    grid-template-columns: 24px 44px minmax(0, 1fr);
    gap: 10px;
  }

  .project-symbol {
    width: 42px;
    height: 42px;
  }

  .project-icon {
    width: 24px;
    height: 24px;
  }

  .project-copy h3 {
    font-size: 22px;
  }

  .link-directory a {
    grid-template-columns: 58px minmax(0, 1fr) auto;
  }

  .link-directory strong {
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (max-height: 680px) and (min-width: 621px) {
  .stage-shell {
    grid-template-columns: minmax(220px, 0.55fr) minmax(400px, 1.45fr);
    gap: 28px;
    padding-top: calc(var(--header-height) + 18px);
    padding-bottom: 18px;
  }

  .hero-title {
    margin: 10px 0 8px;
    font-size: clamp(42px, 8vw, 86px);
  }

  .hero-positioning {
    font-size: 15px;
  }

  .hero-action {
    margin-top: 18px;
  }
}

@media (max-height: 650px) and (max-width: 620px) and (orientation: landscape) {
  .stage-shell {
    grid-template-columns: minmax(0, 1.1fr) minmax(180px, 0.9fr);
    grid-template-rows: 1fr;
    gap: 16px;
    padding-top: calc(var(--header-height) + 12px);
    padding-bottom: 12px;
  }

  .instrument-column,
  .hero-copy {
    grid-row: 1;
    width: 100%;
  }

  .instrument-column {
    grid-column: 1;
  }

  .hero-copy {
    grid-column: 2;
  }

  .instrument-frame,
  .dot-stage .instrument-frame {
    aspect-ratio: 1.35 / 1;
  }

  .hero-title {
    font-size: clamp(32px, 8vw, 54px);
  }

  .hero-positioning {
    font-size: 12px;
  }

  .hero-action {
    min-width: 0;
    min-height: 42px;
    margin-top: 12px;
    font-size: 9px;
  }

  .phase-key {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .experience-track,
  .dot-track {
    height: 100svh;
  }

  .experience-stage {
    position: relative;
  }

  .clock-control {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
