:root {
  color-scheme: dark;
  --ink: #080d1a;
  --panel: #10182b;
  --line: #293a5c;
  --text: #f1f3f8;
  --muted: #8c9ab5;
  --accent: #72d6e7;
  --note: #ff806b;
  --copy: #afbad0;
  --quiet: #7383a1;
  --grid: rgba(114, 214, 231, 0.06);
  --template: #12345b;
  --template-grid: rgba(114, 214, 231, 0.13);
  --template-accent: #8be2ef;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-family: var(--mono);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background-color: var(--ink);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: var(--text);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: min(100%, 1664px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 2vw, 2rem);
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  min-height: 4rem;
  border-bottom: 1px solid var(--line);
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  background: rgba(8, 13, 26, 0.95);
  backdrop-filter: blur(12px);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-header a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  text-decoration: none;
}

#main-content,
#intro,
#exiffy {
  scroll-margin-top: 5rem;
}

.wordmark {
  font-weight: 900;
}

.wordmark span,
.location {
  color: var(--muted);
  font-weight: 400;
}

.location {
  margin: 0;
}

.location i {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--note);
  box-shadow: 0 0 0 0.2rem rgba(255, 128, 107, 0.12);
}

.header-link {
  justify-self: end;
  color: var(--accent);
}

.drafting-table {
  display: grid;
  padding-top: clamp(1rem, 3vw, 3rem);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.3vw, 1.2rem);
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(16, 24, 43, 0.97);
}

.file-label,
.meta,
.project-head {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.intro {
  display: flex;
  min-height: 30rem;
  padding: clamp(1.5rem, 3.5vw, 3.5rem);
  grid-column: span 12;
  flex-direction: column;
  justify-content: space-between;
}

.intro .file-label {
  color: var(--accent);
}

.intro h1 {
  max-width: 78rem;
  margin: 3rem 0;
  font-family: var(--sans);
  font-size: clamp(3.2rem, 7.8vw, 8.8rem);
  line-height: 0.86;
  letter-spacing: -0.07em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.intro-foot {
  display: grid;
  grid-template-columns: minmax(15rem, 38rem) 1fr;
  align-items: end;
  gap: 2rem;
}

.intro-foot p {
  margin: 0;
  color: var(--copy);
  font-family: var(--sans);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.6;
}

.intro-foot span {
  justify-self: end;
  color: var(--quiet);
  font-size: 0.62rem;
  line-height: 1.7;
  text-align: right;
  text-transform: uppercase;
}

.project {
  display: flex;
  min-height: 38rem;
  padding: clamp(1.25rem, 2vw, 2rem);
  flex-direction: column;
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease;
}

a.project:hover {
  z-index: 2;
  border-color: var(--accent);
  transform: translateY(-4px);
}

.qrdetector,
.qrlyzer,
.exiffy,
.template {
  grid-column: span 6;
}

.qrdetector {
  min-height: 38rem;
}

.project.qrdetector h2 {
  font-size: clamp(2.5rem, 4.4vw, 5rem);
}

.unicycle {
  min-height: 32rem;
  grid-column: span 6;
}

.project-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.project-head i {
  color: var(--accent);
  font-size: 1rem;
  font-style: normal;
}

.project-status {
  color: var(--note);
}

.project h2 {
  margin: auto 0 0.8rem;
  font-family: var(--sans);
  font-size: clamp(2.6rem, 5vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.project > p {
  max-width: 44rem;
  min-height: 3.2em;
  margin: 0 0 1.5rem;
  color: var(--copy);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
}

.meta {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--quiet);
}

.template-visual,
.unicycle-visual,
.detector-visual,
.qr-visual,
.exif-visual {
  position: relative;
  height: 19rem;
  margin: 2rem 0;
  overflow: hidden;
  background: #0b1220;
}


.qrdetector .detector-visual {
  height: 19rem;
}

.detector-visual {
  background-color: #08141d;
  background-image:
    linear-gradient(rgba(114, 214, 231, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 214, 231, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 48% 48%, rgba(114, 214, 231, 0.12), transparent 34%);
  background-size: 22px 22px, 22px 22px, auto;
}

.detector-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 42%, rgba(114, 214, 231, 0.07) 50%, transparent 58%);
  content: "";
}

.detector-readout,
.frame-rate {
  position: absolute;
  z-index: 3;
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detector-readout {
  top: 1rem;
  left: 1rem;
}

.detector-readout i {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin: 0 0.45rem;
  border-radius: 50%;
  background: var(--note);
  box-shadow: 0 0 0 0.2rem rgba(255, 128, 107, 0.13);
}

.frame-rate {
  right: 1rem;
  bottom: 1rem;
  color: var(--quiet);
}

.detection-box {
  position: absolute;
  z-index: 2;
  top: 3.2rem;
  left: clamp(1.5rem, 12%, 5rem);
  display: grid;
  width: min(12rem, 44%);
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  place-items: center;
  box-shadow: 0 0 1.5rem rgba(114, 214, 231, 0.12);
  transform: rotate(-3deg);
}

.detection-box::before,
.detection-box::after {
  position: absolute;
  background: var(--accent);
  content: "";
  opacity: 0.45;
}

.detection-box::before {
  width: calc(100% + 2.4rem);
  height: 1px;
}

.detection-box::after {
  width: 1px;
  height: calc(100% + 2.4rem);
}

.detection-box > b {
  position: absolute;
  top: -1.35rem;
  left: -2px;
  padding: 0.25rem 0.4rem;
  color: var(--ink);
  background: var(--accent);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
}

.detection-box .detected-code {
  width: 72%;
  gap: 2px;
  filter: drop-shadow(0 0 0.6rem rgba(241, 243, 248, 0.16));
  opacity: 0.9;
}

.detection-box .detected-code .finder {
  border-width: 3px;
}

.inference-path {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: clamp(1.5rem, 10%, 4.5rem);
  display: flex;
  width: min(29%, 9rem);
  align-items: center;
  justify-content: space-between;
}

.inference-path::before {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line), var(--accent));
  content: "";
}

.inference-path i {
  z-index: 1;
  width: 0.6rem;
  height: 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: #08141d;
}

.inference-path i:nth-child(2),
.inference-path i:nth-child(4) {
  width: 0.9rem;
  height: 0.9rem;
  background: var(--accent);
  box-shadow: 0 0 1rem rgba(114, 214, 231, 0.45);
}

.template-visual {
  background-color: var(--template);
  background-image:
    linear-gradient(var(--template-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--template-grid) 1px, transparent 1px);
  background-size: 22px 22px;
}

.template-mark {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  grid-template-columns: 1fr 1fr;
  gap: 0.22rem;
}

.template-mark i {
  background: var(--template-accent);
}

.template-mark i:nth-child(2),
.template-mark i:nth-child(3) {
  opacity: 0.35;
}

.receipt {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  display: flex;
  width: 9rem;
  height: 16rem;
  padding: 1.7rem 1.1rem;
  flex-direction: column;
  gap: 0.75rem;
  background: #eeeee7;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.25);
  transform: translateX(-50%) rotate(1deg);
}

.receipt b {
  height: 0.35rem;
  background: #92968f;
}

.receipt b:nth-child(3) {
  width: 55%;
}

.receipt b:last-child {
  height: 2rem;
  margin-top: auto;
  background: repeating-linear-gradient(90deg, #161816 0 3px, transparent 3px 6px);
}

.selection {
  position: absolute;
  top: 4rem;
  left: calc(50% - 5rem);
  width: 10rem;
  height: 3.5rem;
  border: 2px solid var(--accent);
}

.axis {
  position: absolute;
  inset: 1rem auto 1rem 50%;
  border-left: 1px dashed #596986;
}

.post {
  position: absolute;
  bottom: 7.2rem;
  left: calc(50% - 0.5rem);
  width: 1rem;
  height: 8rem;
  background: var(--note);
  transform: rotate(7deg);
  transform-origin: bottom;
}

.wheel {
  position: absolute;
  bottom: 1.2rem;
  left: calc(50% - 4.2rem);
  width: 8.4rem;
  height: 8.4rem;
  border: 0.85rem solid var(--text);
  border-radius: 50%;
}

.unicycle-visual b,
.unicycle-visual em {
  position: absolute;
  bottom: 2rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-style: normal;
}

.unicycle-visual b {
  left: 1.5rem;
}

.unicycle-visual em {
  right: 1.5rem;
}

.qr-visual {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(114, 214, 231, 0.07), transparent 62%),
    #0b1220;
}

.qr-code {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(15rem, calc(100% - 4rem));
  aspect-ratio: 1;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  gap: 3px;
}

.finder {
  display: grid;
  border: 5px solid var(--text);
  place-items: center;
}

.finder::after {
  width: 42%;
  aspect-ratio: 1;
  background: var(--text);
  content: "";
}

.finder-top-left {
  grid-area: 1 / 1 / 6 / 6;
}

.finder-top-right {
  grid-area: 1 / 11 / 6 / 16;
}

.finder-bottom-left {
  grid-area: 11 / 1 / 16 / 6;
}

.module {
  background: var(--text);
}

.m01 { grid-area: 1 / 7 / 2 / 9; }
.m02 { grid-area: 3 / 7 / 5 / 8; }
.m03 { grid-area: 5 / 9 / 6 / 10; }
.m04 { grid-area: 7 / 1 / 8 / 3; }
.m05 { grid-area: 7 / 4 / 8 / 5; }
.m06 { grid-area: 7 / 6 / 8 / 8; }
.m07 { grid-area: 7 / 9 / 8 / 10; }
.m08 { grid-area: 7 / 11 / 8 / 13; }
.m09 { grid-area: 7 / 14 / 8 / 16; }
.m10 { grid-area: 9 / 2 / 10 / 4; }
.m11 { grid-area: 9 / 5 / 10 / 6; }
.m12 { grid-area: 9 / 7 / 11 / 8; }
.m13 { grid-area: 9 / 9 / 10 / 11; }
.m14 { grid-area: 9 / 12 / 11 / 13; }
.m15 { grid-area: 9 / 14 / 10 / 16; }
.m16 { grid-area: 11 / 7 / 12 / 10; }
.m17 { grid-area: 11 / 11 / 13 / 12; }
.m18 { grid-area: 12 / 13 / 13 / 16; }
.m19 { grid-area: 13 / 7 / 15 / 8; }
.m20 { grid-area: 14 / 9 / 15 / 11; }
.m21 { grid-area: 14 / 12 / 16 / 13; }
.m22 { grid-area: 15 / 14 / 16 / 16; }

.m03,
.m07,
.m14,
.m20 {
  background: var(--accent);
}

.scan-frame {
  position: absolute;
  z-index: 2;
  width: min(17rem, calc(100% - 2rem));
  aspect-ratio: 1;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 2.4rem 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left top / 2px 2.4rem no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 2.4rem 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 2px 2.4rem no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 2.4rem 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 2px 2.4rem no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 2.4rem 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 2px 2.4rem no-repeat;
  opacity: 0.8;
}

.scan-line {
  position: absolute;
  z-index: 2;
  top: 5%;
  width: min(15rem, calc(100% - 4rem));
  height: 6.5rem;
  border-bottom: 2px solid var(--accent);
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(114, 214, 231, 0.08) 35%,
    rgba(114, 214, 231, 0.24) 72%,
    rgba(114, 214, 231, 0.46) 100%
  );
  opacity: 0;
  animation: qr-scan 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes qr-scan {
  0% {
    opacity: 0;
    translate: 0 -1rem;
  }
  14%, 86% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    translate: 0 10.5rem;
  }
}


.exif-visual {
  background:
    linear-gradient(135deg, rgba(255, 128, 107, 0.08), transparent 45%),
    #0b1220;
}

.image-file {
  position: absolute;
  top: 2.2rem;
  left: clamp(1.25rem, 7%, 3.5rem);
  display: flex;
  width: min(46%, 15rem);
  height: 13.5rem;
  padding: 1.25rem;
  border: 1px solid #405272;
  flex-direction: column;
  gap: 0.75rem;
  background:
    linear-gradient(135deg, transparent 0 62%, rgba(114, 214, 231, 0.07) 62% 100%),
    #10182b;
  box-shadow: 0.75rem 0.75rem 0 rgba(8, 13, 26, 0.65);
}

.file-marker {
  align-self: flex-start;
  color: var(--accent);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.file-marker-end {
  margin-top: auto;
  color: var(--quiet);
}

.byte-row {
  width: 72%;
  height: 0.35rem;
  background: repeating-linear-gradient(90deg, var(--muted) 0 0.35rem, transparent 0.35rem 0.65rem);
}

.byte-row-long {
  width: 100%;
}

.byte-row-short {
  width: 48%;
}

.metadata-sheet {
  position: absolute;
  top: 3.4rem;
  right: clamp(1.25rem, 7%, 3.5rem);
  z-index: 2;
  display: flex;
  width: min(54%, 19rem);
  min-width: 13rem;
  padding: 1.1rem;
  border: 1px solid var(--accent);
  flex-direction: column;
  gap: 0.65rem;
  background: #15223a;
  box-shadow: -0.75rem 0.75rem 0 rgba(8, 13, 26, 0.72);
}

.metadata-sheet > b {
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.metadata-sheet i {
  display: flex;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(140, 154, 181, 0.22);
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.59rem;
  font-style: normal;
}

.metadata-sheet em {
  color: var(--quiet);
  font-style: normal;
}

.metadata-sheet strong {
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.read-write-flow {
  position: absolute;
  right: 1.25rem;
  bottom: 0.8rem;
  color: var(--note);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.github-card {
  display: flex;
  min-height: 24rem;
  padding: clamp(1.5rem, 3vw, 3rem);
  grid-column: span 6;
  flex-direction: column;
  color: #10121a;
  background: var(--accent);
  text-decoration: none;
}

.github-card > span {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.github-card strong {
  margin: auto 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 4.5vw, 5rem);
  font-weight: 400;
  line-height: 0.93;
  letter-spacing: -0.06em;
}

.github-card i {
  align-self: end;
  font-size: 3rem;
  font-style: normal;
  transition: transform 180ms ease;
}

.github-card:hover i {
  transform: translate(5px, -5px);
}

.site-footer {
  display: flex;
  margin-top: 1.2rem;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  color: var(--quiet);
  font-size: 0.61rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  translate: 0 10px;
  animation: reveal 600ms ease forwards;
}

.reveal:nth-child(2) { animation-delay: 80ms; }
.reveal:nth-child(3) { animation-delay: 140ms; }
.reveal:nth-child(4) { animation-delay: 200ms; }
.reveal:nth-child(5) { animation-delay: 260ms; }
.reveal:nth-child(6) { animation-delay: 320ms; }
.reveal:nth-child(7) { animation-delay: 380ms; }

@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 10px;
  }
  to {
    opacity: 1;
    translate: none;
  }
}

@media (max-width: 1000px) {
  .qrdetector,
  .qrlyzer,
  .exiffy,
  .template {
    min-height: 34rem;
    grid-column: span 6;
  }

  .unicycle {
    min-height: 32rem;
    grid-column: span 6;
  }
}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .location,
  .wordmark span {
    display: none;
  }

  .drafting-table {
    display: block;
    padding-top: 0.65rem;
  }

  .panel {
    margin-bottom: 0.65rem;
  }

  .intro {
    min-height: 36rem;
    padding: 1.25rem;
  }

  .intro h1 {
    font-size: clamp(2.4rem, 12vw, 5.8rem);
  }

  .intro-foot {
    grid-template-columns: 1fr;
  }

  .intro-foot span {
    display: none;
  }

  .project {
    min-height: 37rem;
  }

  .qrdetector .detector-visual {
    height: 19rem;
  }

  .project h2 {
    overflow-wrap: anywhere;
  }

  .metadata-sheet {
    right: 1rem;
  }

  .github-card {
    min-height: 24rem;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
  }

  .site-footer span:nth-child(2) {
    display: none;
  }
}

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

  .scan-line {
    opacity: 0.6;
    animation: none;
    translate: 0 6rem;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}
