.md-container:has(.home-hero) {
  overflow-x: clip;
}

.md-content--home {
  min-width: 0;
  max-width: none;
}

html:has(.home-hero) {
  scroll-behavior: smooth;
}

.md-content--home .home-hero {
  --home-ink: var(--md-default-fg-color);
  --home-muted: var(--md-default-fg-color--light);
  --home-line: #111111;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  width: 100%;
  min-height: calc(100svh - 6rem);
  padding: clamp(2.5rem, 7vw, 6.5rem) clamp(1.25rem, 4vw, 3.5rem);
  overflow: visible;
  color: var(--home-ink);
  outline: none;
}

.home-hero::after {
  position: absolute;
  right: 0;
  bottom: 0.4rem;
  left: 0;
  height: 1px;
  background: color-mix(in srgb, var(--home-ink) 14%, transparent);
  content: "";
}

.home-hero__copy {
  position: relative;
  z-index: 7;
  align-self: center;
  max-width: min(46rem, 52%);
  padding-bottom: 0;
}

.home-hero__copy h1 {
  margin: 0;
  color: var(--home-ink);
  font-family: "Huiwen-mincho", "Songti SC", "STSong", serif;
  font-size: clamp(2.7rem, 7vw, 6.6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.home-title__line {
  display: block;
  width: max-content;
  max-width: 100%;
}

.home-hero__copy p {
  margin: clamp(1rem, 2vw, 1.5rem) 0 0;
  color: var(--home-muted);
  font-family: "Huiwen-mincho", "Songti SC", "STSong", serif;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.home-brain-anchor {
  position: relative;
  z-index: 1;
  display: inline-block;
  isolation: isolate;
}

.home-brain {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: clamp(13rem, 21vw, 19rem);
  height: auto;
  overflow: visible;
  color: var(--home-line);
  opacity: 0.28;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.home-brain path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.home-hero__art {
  position: absolute;
  top: 50%;
  right: clamp(-13rem, -9vw, -7rem);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(35rem, 52vw, 52rem);
  pointer-events: none;
  transform: translate(20%, -50%);
  user-select: none;
}

.home-terminal {
  --terminal-bg: #0d0f12;
  --terminal-bar: #13161b;
  --terminal-border: #3f444d;
  --terminal-text: #f1f3f5;
  --terminal-muted: #8f96a3;
  --terminal-accent: #7aa2ff;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  color: var(--terminal-text);
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: clamp(0.65rem, 1vw, 0.9rem);
  box-shadow:
    0 0.8rem 2.2rem color-mix(in srgb, var(--home-ink) 8%, transparent),
    inset 0 1px color-mix(in srgb, white 4%, transparent);
}

.home-terminal__bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 2.7rem;
  padding: 0 1rem;
  color: var(--terminal-muted);
  background: var(--terminal-bar);
  border-bottom: 1px solid color-mix(in srgb, var(--terminal-border) 72%, transparent);
  font: 500 0.75rem/1 ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.home-terminal__controls {
  display: flex;
  grid-column: 1;
  gap: 0.55rem;
  justify-self: start;
}

.home-terminal__controls span {
  width: 0.72rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 -1px 1px rgb(0 0 0 / 20%);
}

.home-terminal__controls span:nth-child(2) {
  background: #febc2e;
}

.home-terminal__controls span:nth-child(3) {
  background: #28c840;
}

.home-terminal__title {
  grid-column: 2;
  letter-spacing: 0.015em;
}

.home-terminal__screen {
  box-sizing: border-box;
  min-height: clamp(15.5rem, 25vw, 22rem);
  padding: clamp(1.2rem, 2.4vw, 2rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 32%, rgb(70 111 203 / 4%), transparent 32%),
    var(--terminal-bg);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-ligatures: none;
}

.home-terminal__command,
.home-terminal__ready {
  display: block;
  color: var(--terminal-muted);
  font-size: clamp(0.72rem, 0.86vw, 0.92rem);
  line-height: 1.5;
  white-space: pre;
}

.home-terminal__command::before {
  margin-right: 0.7em;
  color: var(--terminal-accent);
  content: attr(data-ty-prompt);
}

.home-terminal__command[data-ty-cursor]::after {
  margin-left: 0.18em;
  color: var(--terminal-text);
  content: attr(data-ty-cursor);
}

.home-terminal__logo {
  display: block;
  width: max-content;
  max-width: none;
  margin: clamp(1.25rem, 2.5vw, 2.2rem) 0 clamp(1rem, 2vw, 1.6rem);
  padding: 0;
  overflow: visible;
  color: transparent;
  background: linear-gradient(
    180deg,
    #777e89 0%,
    #aeb4bd 24%,
    #f4f6f8 48%,
    #c9ced5 70%,
    #747b86 100%
  );
  background-clip: text;
  border: 0;
  font: 700 clamp(0.8rem, 0.94vw, 1rem)/0.7 ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: -0.26em;
  white-space: pre;
  -webkit-background-clip: text;
  text-shadow: none;
  transform: scaleX(1.2);
  transform-origin: left center;
}

.home-terminal__logo span {
  display: block;
  min-height: 0.86em;
}

.home-terminal__ready {
  color: #78d89b;
}

.home-terminal[data-terminal-state="running"] .home-terminal__ready {
  visibility: hidden;
}

.home-terminal__cursor {
  display: inline-block;
  margin-left: 0.2em;
  color: var(--terminal-text);
}

.home-terminal[data-terminal-initialized="true"][data-terminal-state="complete"] .home-terminal__cursor {
  animation: home-terminal-cursor 1s steps(1, end) infinite;
}

.home-scroll-cue {
  position: absolute;
  bottom: clamp(1.25rem, 3vh, 2rem);
  left: 50%;
  z-index: 10;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--home-muted);
  transform: translateX(-50%);
}

.home-scroll-cue svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
  animation: home-scroll-cue 1.8s ease-in-out infinite;
}

.home-scroll-cue:hover {
  color: var(--home-ink);
}

.home-introduction {
  width: min(100% - 2rem, 61rem);
  min-height: min(32rem, 60svh);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) clamp(0rem, 2vw, 1.5rem) clamp(5rem, 12vw, 10rem);
  color: var(--md-default-fg-color);
  font-family: "Huiwen-mincho", "Songti SC", "STSong", serif;
  font-size: clamp(1.35rem, 3.5vw, 3.3rem);
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
}

.home-introduction > :first-child {
  margin-top: 0;
}

.home-introduction :is(h1, h2, h3, h4, h5, h6) {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

[data-md-color-scheme="slate"] .home-hero {
  --home-line: #ffffff;
}

@keyframes home-scroll-cue {
  0%,
  100% {
    opacity: 0.42;
    transform: translateY(-0.18rem);
  }

  50% {
    opacity: 1;
    transform: translateY(0.22rem);
  }
}

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

@media screen and (max-width: 76.2344em) {
  .md-content--home .home-hero {
    min-height: calc(100svh - 4.8rem);
  }

  .home-hero__art {
    right: -7rem;
    width: min(50rem, 57vw);
  }
}

@media screen and (max-width: 48em) {
  .md-content--home .home-hero {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(15rem, 1fr) auto;
    gap: 1.5rem;
    min-height: calc(100svh - 3rem);
    padding: 1.5rem 1rem 2.75rem;
  }

  .home-hero__copy {
    grid-row: 2;
    max-width: none;
    padding: 0;
  }

  .home-hero__copy h1 {
    max-width: 9em;
    font-size: clamp(2.45rem, 14vw, 4.5rem);
    line-height: 1.02;
  }

  .home-introduction {
    font-size: clamp(1.225rem, 7vw, 2.25rem);
  }

  .home-brain {
    width: clamp(11rem, 48vw, 15rem);
  }

  .home-hero__copy p {
    margin-top: clamp(1rem, 4vw, 1.35rem);
  }

  .home-hero__art {
    position: static;
    grid-row: 1;
    align-self: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    transform: none;
  }

  .home-terminal__bar {
    min-height: 2.3rem;
    padding: 0 0.8rem;
  }

  .home-terminal__controls {
    gap: 0.42rem;
  }

  .home-terminal__controls span {
    width: 0.58rem;
  }

  .home-terminal__screen {
    min-height: clamp(12rem, 45vw, 16rem);
    padding: clamp(0.85rem, 3.2vw, 1.3rem);
  }

  .home-terminal__logo {
    margin-block: clamp(0.9rem, 3.5vw, 1.35rem);
    font-size: clamp(0.37rem, 1.5vw, 0.48rem);
  }
}

@media screen and (max-width: 30em) {
  .home-hero__copy p {
    font-size: 0.95rem;
  }

  .home-terminal__title {
    font-size: 0.68rem;
  }

  .home-terminal__command,
  .home-terminal__ready {
    font-size: 0.66rem;
  }
}

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

  .home-scroll-cue svg,
  .home-terminal__cursor {
    animation: none;
  }
}
