@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400&display=swap");

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

:root {
  --content-max-width: 592px;
  --page-padding-x: 22px;
  --page-padding-y: 43px;
  --color-primary: #ffefef;
  --color-secondary: #f97316;
  --color-tertiary: #a855f7;
  --color-bg: #ffffff;
  --color-surface: #fafdf4;
  --color-surface-elevated: #fafdf4;
  --color-text: #656565;
  --color-text-secondary: #000000;
  --color-text-muted: #949494;
  --color-border: #0000001a;
  --color-border-subtle: #0000000d;
  --color-border-soft: #2f292214;
  --color-visual-bg: #f3f3f3;
  --color-visual-mesh: #00000033;
  --color-visual-mesh-soft: #00000020;
  --color-visual-node: #656565;
  --color-visual-active: #111111;
  --shadow-soft: 0 3px 3px #0000000d, 0 4px 4px #00000008;
  --shadow-card:
    0 3px 3px #0000000d, 0 4px 4px #00000008, 0 7px 7px #00000029,
    0 1px 1px -0.5px #00000008, 0 0 2px #0003, 0 0 10px #0000004d;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;
  --font-ui: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.dark {
  --color-bg: #080a0e;
  --color-surface: #0e1117;
  --color-surface-elevated: #16191f;
  --color-text: #ffffff9c;
  --color-text-secondary: #ffffffe0;
  --color-text-muted: #ffffff66;
  --color-border: #ffffff1a;
  --color-border-subtle: #ffffff0d;
  --color-border-soft: #ffffff14;
  --color-visual-bg: #0e1117;
  --color-visual-mesh: #ffffff2e;
  --color-visual-mesh-soft: #ffffff17;
  --color-visual-node: #ffffff99;
  --color-visual-active: #ffefef;
  --shadow-soft: 0 0 0 0 transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

a,
.card,
.theme-toggle {
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

[data-theme-switching] *,
[data-theme-switching] *::before,
[data-theme-switching] *::after {
  transition: none !important;
}

:focus-visible {
  border-radius: var(--radius-sm);
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.page-wrapper {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: var(--page-padding-y) var(--page-padding-x);
}

.page-content {
  width: 100%;
  max-width: var(--content-max-width);
}

.home {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bio {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.bio__left {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}

.bio__avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
  object-fit: cover;
}

.bio__copy {
  min-width: 0;
}

.bio__name,
.section-label {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: inherit;
  line-height: 1.5;
}

.bio__name {
  display: inline;
}

.bio__name + p {
  display: inline;
}

.bio__links {
  position: relative;
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-self: stretch;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2px;
}

.bio__link,
.inline-link {
  display: inline-block;
  width: fit-content;
  border-bottom: 1px dashed transparent;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
}

.bio__link:hover,
.bio__link:active,
.inline-link:hover,
.inline-link:active {
  border-bottom-color: #c5c5c5;
  color: var(--color-text-secondary);
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 24px;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-elevated);
  box-shadow: inset 0 0 0 1px var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

.theme-toggle__track {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  overflow: hidden;
}

.theme-toggle__icon {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition:
    opacity 150ms ease,
    transform 200ms ease;
}

.theme-toggle__icon--moon {
  fill: currentColor;
  stroke: none;
}

.theme-toggle__icon--sun {
  opacity: 0;
  transform: translateY(12px) rotate(-45deg);
}

html:not(.dark) .theme-toggle__icon--moon {
  opacity: 0;
  transform: translateY(-12px) rotate(45deg);
}

html:not(.dark) .theme-toggle__icon--sun {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

[data-theme-switching] .theme-toggle,
[data-theme-switching] .theme-toggle__tooltip {
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    color 150ms ease !important;
}

[data-theme-switching] .theme-toggle__icon {
  transition:
    opacity 150ms ease,
    transform 200ms ease !important;
}

.theme-toggle__tooltip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  z-index: 2;
  width: max-content;
  max-width: 150px;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
  box-shadow:
    inset 0 0 0 1px var(--color-border),
    var(--shadow-soft);
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition:
    opacity 150ms ease,
    transform 200ms ease;
  white-space: nowrap;
}

.theme-toggle:hover .theme-toggle__tooltip,
.theme-toggle:focus-visible .theme-toggle__tooltip {
  opacity: 1;
  transform: translate(0, -50%);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.card {
  display: flex;
  min-height: 196px;
  flex-direction: column;
  gap: 11px;
  padding: 9px;
  border-radius: var(--radius-md);
  color: inherit;
}

.card:hover {
  background: var(--color-surface-elevated);
}

.card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card__icon {
  display: flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
  box-shadow: inset 0 0 0 1px var(--color-border);
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1;
}

.card__title,
.card__subtitle {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: inherit;
  line-height: 1.5;
}

.card__title {
  color: var(--color-text);
}

.card__subtitle {
  color: var(--color-text-muted);
}

.card__visual {
  position: relative;
  width: 100%;
  height: 101px;
  margin-top: auto;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-visual-bg);
  box-shadow:
    inset 0 0 0 1px var(--color-border),
    var(--shadow-soft);
}

.card__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 28px 38px var(--color-border-subtle);
}

.network {
  position: absolute;
  inset: -8px -10px;
  width: calc(100% + 20px);
  height: calc(100% + 16px);
  overflow: visible;
}

.network__mesh path,
.network__trace {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.network__mesh path {
  stroke: var(--color-visual-mesh);
  stroke-dasharray: 4 7;
  stroke-width: 0.9;
  animation: network-drift 11s linear infinite;
}

.network__mesh path:nth-child(2) {
  stroke: var(--color-visual-mesh-soft);
  animation-duration: 14s;
  animation-direction: reverse;
}

.network__mesh path:nth-child(3) {
  stroke: var(--color-visual-mesh-soft);
  animation-duration: 17s;
}

.network__trace {
  stroke: var(--color-visual-active);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  animation: network-trace 4.8s ease-in-out infinite;
}

.network__node {
  fill: var(--color-visual-node);
  opacity: 0.9;
  transform-box: fill-box;
  transform-origin: center;
  animation: network-node 4.8s ease-in-out infinite;
}

.network__node--active {
  fill: var(--color-visual-active);
  animation-name: network-node-active;
}

.network__nodes .network__node:nth-child(2) {
  animation-delay: 0.35s;
}

.network__nodes .network__node:nth-child(3) {
  animation-delay: 0.7s;
}

.network__nodes .network__node:nth-child(4) {
  animation-delay: 1.05s;
}

.network__nodes .network__node:nth-child(5) {
  animation-delay: 1.4s;
}

.network__nodes .network__node:nth-child(6) {
  animation-delay: 1.75s;
}

.network__ghosts circle {
  fill: var(--color-visual-node);
  opacity: 0.1;
  animation: network-ghost 5.4s ease-in-out infinite;
}

.network__ghosts circle:nth-child(2) {
  animation-delay: 1.4s;
}

.network--systems .network__trace {
  animation-delay: 0.7s;
}

.network--systems .network__node {
  animation-delay: 0.45s;
}

.network--design .network__trace {
  animation-delay: 1.2s;
}

.network--design .network__node {
  animation-delay: 0.9s;
}

.card:hover .network {
  animation: network-float 3.2s ease-in-out infinite;
}

@keyframes network-drift {
  to {
    stroke-dashoffset: -44;
  }
}

@keyframes network-trace {
  0% {
    opacity: 0.5;
    stroke-width: 1.4;
  }

  18%,
  68% {
    opacity: 1;
    stroke-width: 1.9;
  }

  88%,
  100% {
    opacity: 0.5;
    stroke-width: 1.4;
  }
}

@keyframes network-node {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.92);
  }

  45%,
  65% {
    opacity: 0.95;
    transform: scale(1.08);
  }
}

@keyframes network-node-active {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.92);
  }

  45%,
  65% {
    opacity: 1;
    transform: scale(1.55);
  }
}

@keyframes network-ghost {
  0%,
  100% {
    opacity: 0.06;
    transform: scale(0.82);
  }

  50% {
    opacity: 0.16;
    transform: scale(1.08);
  }
}

@keyframes network-float {
  50% {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .network,
  .network__mesh path,
  .network__trace,
  .network__node,
  .network__ghosts circle {
    animation: none;
  }

  .network__trace {
    opacity: 0.9;
  }
}

.home-extras {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.link-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}

.link-row .section-label {
  color: var(--color-text-muted);
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.link-row > .inline-link {
  margin-left: auto;
}

@media (max-width: 640px) {
  .page-wrapper {
    align-items: flex-start;
  }

  .bio {
    flex-direction: column;
    gap: 13px;
  }

  .home {
    gap: 13px;
  }

  .bio__left {
    flex-direction: column;
    gap: 13px;
  }

  .bio__links {
    flex-flow: row wrap;
    align-self: flex-start;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 9px 13px;
  }

  .theme-toggle {
    align-self: flex-start;
    margin-top: 0;
  }

  .theme-toggle__tooltip {
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    transform: translateY(-4px);
  }

  .theme-toggle:hover .theme-toggle__tooltip,
  .theme-toggle:focus-visible .theme-toggle__tooltip {
    transform: translateY(0);
  }

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

  .card {
    min-height: 172px;
  }

  .home-extras {
    gap: 32px;
  }

  .link-row,
  .inline-links {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0px;
    margin-left: 0;
  }

  .link-row > .inline-link {
    margin-left: 0;
  }
}
