:root {
  --ink: #171714;
  --paper: #f3f0e8;
  --paper-deep: #e8e3d8;
  --line: rgba(23, 23, 20, 0.18);
  --lime: #c9ff45;
  --blue: #4e6cff;
  --coral: #ff795f;
  --violet: #a66cff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(23, 23, 20, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 20, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 36px;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand span span,
.footer-brand span {
  color: var(--blue);
}

.brand-mark {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 2px solid var(--ink);
  background: var(--lime);
  transform: rotate(45deg);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #31ad62;
  box-shadow: 0 0 0 4px rgba(49, 173, 98, 0.15);
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 60px;
  padding: 74px 0 64px;
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 32px;
  font-size: clamp(4.25rem, 8.4vw, 8.3rem);
  line-height: 0.83;
  letter-spacing: -0.075em;
  font-weight: 850;
}

h1 em {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.intro {
  max-width: 530px;
  margin-bottom: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.5;
  color: rgba(23, 23, 20, 0.7);
}

.hero-orbit {
  position: relative;
  width: min(390px, 34vw);
  aspect-ratio: 1;
  justify-self: end;
}

.orbit {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(23, 23, 20, 0.5);
  border-radius: 50%;
}

.orbit-two {
  inset: 23%;
  border-style: dashed;
  animation: orbit-spin 24s linear infinite reverse;
}

.orbit-one {
  animation: orbit-spin 32s linear infinite;
}

.hub-core {
  position: absolute;
  inset: 34%;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 9px 9px 0 var(--ink);
}

.hub-core span {
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.09em;
}

.hub-core small {
  position: absolute;
  right: 14%;
  top: 18%;
  font-family: monospace;
  font-weight: 800;
}

.satellite {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.satellite-a {
  top: 4%;
  left: 47%;
  background: var(--coral);
}

.satellite-b {
  right: 3%;
  bottom: 28%;
  background: var(--blue);
}

.satellite-c {
  left: 7%;
  bottom: 18%;
  background: var(--violet);
}

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

.projects {
  padding: 84px 0 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 38px;
}

.section-heading .eyebrow {
  margin-bottom: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.15rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  --accent: var(--lime);
  position: relative;
  min-height: 510px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: auto -30% -52% 46%;
  height: 78%;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.18;
  filter: blur(5px);
  z-index: -1;
  transition: transform 300ms ease, opacity 300ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translate(-5px, -5px);
  box-shadow: 9px 9px 0 var(--ink);
  background: #fffef9;
}

.project-card:hover::before,
.project-card:focus-visible::before {
  transform: scale(1.14);
  opacity: 0.3;
}

.project-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.card-math { --accent: var(--blue); }
.card-memory { --accent: var(--coral); }
.card-chess { --accent: var(--violet); }

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-number {
  opacity: 0.55;
}

.project-tag {
  padding: 8px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--accent);
}

.card-visual {
  height: 215px;
  display: grid;
  place-items: center;
  margin: 28px 0 30px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.36);
  overflow: hidden;
}

.visual-abakus {
  align-content: center;
  gap: 23px;
  padding: 28px 12%;
}

.rail {
  position: relative;
  width: 100%;
  height: 3px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--ink);
}

.rail i {
  width: 29px;
  height: 29px;
  display: block;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
}

.rail-one i:nth-child(3) { margin-left: auto; }
.rail-two i:first-child { margin-left: 23%; }
.rail-two i:last-child { margin-left: auto; }
.rail-three i:nth-child(4) { margin-left: auto; }

.visual-math {
  position: relative;
  grid-template-columns: repeat(4, auto);
  align-content: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 34px);
}

.math-symbol,
.math-number,
.math-star {
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
}

.math-number {
  display: grid;
  width: 1.2em;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
  color: white;
  transform: rotate(-8deg);
}

.math-star {
  color: #ffcd3c;
  -webkit-text-stroke: 2px var(--ink);
  transform: rotate(9deg);
}

.visual-memory {
  grid-template-columns: repeat(4, minmax(45px, 72px));
  gap: 12px;
}

.memory-tile {
  aspect-ratio: 0.78;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--coral);
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ink);
}

.tile-two,
.tile-three {
  background: var(--paper);
}

.tile-one { transform: rotate(-5deg) translateY(5px); }
.tile-two { transform: rotate(3deg) translateY(-4px); }
.tile-three { transform: rotate(-2deg) translateY(2px); }
.tile-four { transform: rotate(6deg) translateY(-6px); }

.visual-chess svg {
  width: min(250px, 70%);
  overflow: visible;
  fill: var(--violet);
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
}

.visual-chess .chess-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.card-content {
  max-width: 520px;
}

.card-content h3 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.card-content p {
  max-width: 430px;
  margin-bottom: 24px;
  color: rgba(23, 23, 20, 0.68);
  font-size: 1rem;
  line-height: 1.5;
}

.card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-link svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

.project-card:hover .card-link svg,
.project-card:focus-visible .card-link svg {
  transform: translateX(5px);
}

footer {
  min-height: 104px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--ink);
  font-size: 0.78rem;
}

footer p {
  margin: 0;
  color: rgba(23, 23, 20, 0.62);
  text-align: center;
}

footer > span:last-child {
  justify-self: end;
  font-family: monospace;
}

@media (max-width: 900px) {
  .page-shell { padding: 0 22px; }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 58px;
  }

  .hero-orbit {
    width: min(420px, 78vw);
    justify-self: center;
    margin-top: -10px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page-shell { padding: 0 14px; }
  .topbar { min-height: 70px; }
  .topbar-meta { font-size: 0; }
  .topbar-meta .status-dot { display: block; }
  h1 { font-size: clamp(3.7rem, 19vw, 5.2rem); }
  .hero { gap: 34px; padding-bottom: 48px; }
  .projects { padding: 58px 0 68px; }
  .project-card { min-height: 470px; padding: 19px; }
  .card-visual { height: 190px; }
  .visual-memory { grid-template-columns: repeat(4, minmax(34px, 54px)); }
  .memory-tile { font-size: 1.25rem; box-shadow: 3px 3px 0 var(--ink); }
  footer { grid-template-columns: 1fr auto; }
  footer p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
