:root {
  --bg: #e8eef2;
  --bg-accent: #d4e0e8;
  --ink: #1a2332;
  --muted: #4a5568;
  --line: #9aafbd;
  --accent: #0d5c63;
  --accent-soft: #b8d4d6;
  --font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-display: "IBM Plex Serif", Georgia, serif;
  --space: clamp(1.25rem, 4vw, 2.5rem);
  --max: 40rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 10% -10%, var(--accent-soft) 0%, transparent 50%),
    radial-gradient(ellipse 90% 60% at 100% 20%, var(--bg-accent) 0%, transparent 45%),
    linear-gradient(165deg, var(--bg) 0%, #f2f5f7 55%, #dce6ec 100%);
  background-attachment: scroll;
}

.page {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: calc(var(--space) * 1.15) 0 var(--space);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin-bottom: 1.25rem;
  animation: rise 0.7s ease-out both;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 0.25rem 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

.hero {
  margin-bottom: calc(var(--space) * 1.2);
  animation: rise 0.7s ease-out both;
}

.hero-art {
  margin: 0 0 1.25rem;
}

.hero-art-frame {
  overflow: hidden;
  border-radius: 0.45rem;
  box-shadow: 0 10px 28px rgba(26, 35, 50, 0.12);
}

.hero-art-credit {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: right;
  opacity: 0.75;
}

.scene {
  display: block;
  width: 100%;
  height: auto;
  background: #0f2a32;
}

.scene-grid path {
  fill: none;
  stroke: #5eead4;
  stroke-width: 1;
}

.neural-link {
  fill: none;
  stroke: #5eead4;
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.55;
  stroke-dasharray: 4 6;
  animation: neural-flow 2.8s linear infinite;
}

.neural-link-2 {
  animation-delay: 0.4s;
}

.neural-link-3 {
  animation-delay: 0.8s;
}

.neural-node {
  fill: #99f6e4;
  animation: node-pulse 2.4s ease-in-out infinite;
}

.neural-node-b {
  animation-delay: 0.35s;
}

.neural-node-c {
  animation-delay: 0.7s;
}

.chip rect {
  fill: rgba(15, 42, 50, 0.72);
  stroke: #5eead4;
  stroke-width: 1.25;
}

.chip text {
  fill: #ccfbf1;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  text-anchor: middle;
}

.chip-a {
  animation: chip-float 3.6s ease-in-out infinite;
}

.chip-b {
  animation: chip-float 3.6s ease-in-out 0.5s infinite;
}

.chip-c {
  animation: chip-float 3.6s ease-in-out 1s infinite;
}

.desk-top,
.desk-leg {
  fill: #3d2a1d;
}

.monitor-bezel {
  fill: #0b161c;
  stroke: #2dd4bf;
  stroke-width: 1.25;
  stroke-opacity: 0.35;
}

.monitor-stand,
.monitor-neck {
  fill: #1a2830;
}

.chat-pane,
.code-pane {
  fill: #0d1c24;
  stroke: #234652;
  stroke-width: 1;
}

.pane-label {
  fill: #5eead4;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.msg-user {
  fill: #1e3a46;
}

.msg-ai {
  fill: #134e4a;
  animation: msg-glow 2.8s ease-in-out infinite;
}

.msg-ai-2 {
  animation-delay: 0.6s;
}

.msg-user-2 {
  animation: msg-appear 3.2s ease-in-out infinite;
}

.code-line {
  fill: #2dd4bf;
  opacity: 0.35;
  animation: code-type 2.2s ease-in-out infinite;
}

.code-line-2 {
  fill: #67e8f9;
  animation-delay: 0.15s;
}

.code-line-3 {
  animation-delay: 0.3s;
}

.code-line-4 {
  fill: #a7f3d0;
  animation-delay: 0.45s;
}

.code-line-5 {
  animation-delay: 0.6s;
}

.code-line-6 {
  fill: #67e8f9;
  animation-delay: 0.75s;
}

.code-line-7 {
  animation-delay: 0.9s;
}

.code-cursor {
  fill: #ecfeff;
  animation: cursor-blink 1s steps(1, end) infinite;
}

.ai-orb {
  animation: orb-bob 3s ease-in-out infinite;
}

.ai-orb-label {
  fill: #99f6e4;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
}

.head,
.ear {
  fill: #f0c7a0;
}

.hair {
  fill: #e09a5a;
}

.body {
  fill: #0d5c63;
}

.collar {
  fill: #ccfbf1;
}

.arm-l,
.arm-r {
  fill: #f0c7a0;
}

.chair {
  fill: #1f2d36;
}

.glasses {
  fill: rgba(94, 234, 212, 0.12);
  stroke: #1a2332;
  stroke-width: 2.2;
}

.eye {
  fill: #1a2332;
}

.mouth {
  fill: none;
  stroke: #1a2332;
  stroke-width: 2;
  stroke-linecap: round;
}

.marc {
  transform-origin: 212px 318px;
  animation: marc-focus 4s ease-in-out infinite;
}

.arm-r {
  transform-origin: 236px 256px;
  animation: type-steady 0.55s ease-in-out infinite;
}

.keys {
  fill: #24343d;
  stroke: #3d5560;
  stroke-width: 1;
}

.cat-body,
.cat-head,
.cat-ear {
  fill: #f4a261;
}

.cat-ear {
  stroke: #f4a261;
}

.cat-eye {
  fill: #1a2332;
}

.cat-tail {
  fill: none;
  stroke: #f4a261;
  stroke-width: 5;
  stroke-linecap: round;
  transform-origin: 404px 262px;
  animation: tail 1.4s ease-in-out infinite;
}

.cat {
  animation: cat-breathe 3.5s ease-in-out infinite;
}

.toast rect {
  fill: rgba(15, 42, 50, 0.92);
  stroke: #2dd4bf;
  stroke-width: 1.25;
}

.toast text {
  fill: #ecfeff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
}

.toast-dot {
  fill: #34d399;
  animation: node-pulse 1.6s ease-in-out infinite;
}

.toast {
  animation: toast-in 4.5s ease-in-out infinite;
}

@keyframes neural-flow {
  to {
    stroke-dashoffset: -40;
  }
}

@keyframes node-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes chip-float {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes msg-glow {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes msg-appear {
  0%,
  30% {
    opacity: 0.2;
  }
  45%,
  100% {
    opacity: 1;
  }
}

@keyframes code-type {
  0%,
  100% {
    opacity: 0.25;
    transform: scaleX(0.92);
    transform-origin: left center;
  }
  50% {
    opacity: 0.85;
    transform: scaleX(1);
    transform-origin: left center;
  }
}

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

@keyframes orb-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes marc-focus {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes type-steady {
  50% {
    transform: translateY(1.5px);
  }
}

@keyframes tail {
  50% {
    transform: rotate(12deg);
  }
}

@keyframes cat-breathe {
  50% {
    transform: translateY(-2px);
  }
}

@keyframes toast-in {
  0%,
  15% {
    opacity: 0;
    transform: translateY(6px);
  }
  30%,
  75% {
    opacity: 1;
    transform: translateY(0);
  }
  90%,
  100% {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 3.35rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lede {
  margin: 1.15rem 0 0;
  max-width: 34rem;
  color: var(--muted);
}

.hero-cta {
  margin: 1.15rem 0 0;
}

.hero-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-soft);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hero-cta a:hover,
.hero-cta a:focus-visible {
  border-bottom-color: var(--accent);
  outline: none;
}

.section {
  margin-bottom: calc(var(--space) * 1.15);
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
  animation: rise 0.7s ease-out both;
  scroll-margin-top: 1rem;
}

.section:nth-of-type(1) {
  animation-delay: 0.08s;
}

.section:nth-of-type(2) {
  animation-delay: 0.16s;
}

h2 {
  margin: 1.1rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-lede {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.videos {
  display: grid;
  gap: 1.5rem;
}

.video-block h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 600;
}

.video-frame {
  position: relative;
  overflow: hidden;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--ink) 88%, #0d5c63);
  aspect-ratio: 16 / 9;
}

.player {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  object-fit: cover;
}

.video-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  color: #d7e4e8;
  font-size: 0.95rem;
  line-height: 1.45;
}

.video-placeholder[hidden] {
  display: none;
}

.video-placeholder code {
  font-size: 0.85em;
  color: #fff;
}

.project-list {
  display: grid;
  gap: 1.5rem;
}

.project {
  padding: 1.15rem 0 0.25rem;
  border-top: 1px dashed var(--line);
}

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

.project-header {
  margin-bottom: 0.85rem;
}

.project-kind {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.project h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-summary {
  margin: 0;
  color: var(--muted);
}

.project-summary + .project-summary {
  margin-top: 0.75rem;
}

.project-prose {
  margin: 0 0 1.15rem;
}

.project-prose h4 {
  margin: 1.15rem 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-prose p,
.project-prose li {
  color: var(--muted);
}

.project-prose p {
  margin: 0 0 0.75rem;
}

.project-prose ul {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
}

.project-prose li + li {
  margin-top: 0.35rem;
}

.project-facts {
  margin: 0 0 1rem;
}

.project-facts > div {
  margin-top: 0.75rem;
}

.project-facts dt {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.project-facts dd {
  margin: 0;
  color: var(--muted);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.tech-tags li {
  padding: 0.2rem 0;
  font-size: 0.88rem;
  color: var(--ink);
  border-bottom: 1px solid var(--accent-soft);
}

.feature-list {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 1.15rem;
}

.feature h4 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.project-shot {
  margin: 0;
}

.project-shot img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.35rem;
  border: 1px solid var(--line);
  background: #fff;
}

.project-shot figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-diagram {
  margin: 0 0 1rem;
}

.project-diagram svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.35rem;
}

.arch-bg {
  fill: color-mix(in srgb, var(--bg-accent) 70%, #fff);
}

.arch-node rect {
  fill: #fff;
  stroke: var(--line);
  stroke-width: 1.5;
}

.arch-node text {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
}

.arch-node-muted rect {
  fill: color-mix(in srgb, var(--accent-soft) 45%, #fff);
}

.arch-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
}

.project-diagram figcaption {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-details {
  margin: 0 0 0.35rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.project-details summary {
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 0;
  font-weight: 600;
  color: var(--accent);
}

.project-details summary::-webkit-details-marker {
  display: none;
}

.project-details summary::before {
  content: "+ ";
  font-weight: 500;
}

.project-details[open] summary::before {
  content: "− ";
}

.project-details summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-details-body {
  padding: 0 0 0.85rem;
  color: var(--muted);
}

.project-details-body ul {
  margin: 0 0 0.75rem;
  padding-left: 1.15rem;
}

.project-details-body li + li {
  margin-top: 0.35rem;
}

.project-details-body p {
  margin: 0 0 0.65rem;
}

.todo {
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--line);
  background: color-mix(in srgb, var(--bg-accent) 55%, transparent);
  color: var(--ink);
  font-size: 0.92rem;
}

.todo code {
  font-size: 0.88em;
}

.project-future {
  opacity: 0.92;
}

.footer {
  margin-top: var(--space);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  animation: rise 0.7s ease-out 0.28s both;
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .section,
  .footer {
    animation: none !important;
  }

  .scene * {
    animation: none !important;
  }
}

@media (max-width: 639px) {
  body {
    font-size: 1rem;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.6rem);
  }

  .page {
    width: min(100% - 1.25rem, var(--max));
    padding-top: 1rem;
  }

  .site-nav a {
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
  }

  .hero-cta a {
    min-height: 2.75rem;
  }

  .project-diagram {
    overflow-x: auto;
  }
}

@media (min-width: 640px) {
  body {
    font-size: 1.08rem;
  }

  .page {
    padding-top: calc(var(--space) * 1.5);
  }

  .videos {
    gap: 1.75rem;
  }

  .project-list {
    gap: 1.85rem;
  }

  body {
    background-attachment: fixed;
  }
}
