:root {
  color-scheme: dark;
  --bg: #11110f;
  --panel: #191916;
  --fg: #f1eee6;
  --muted: #aaa49a;
  --line: #34322d;
  --accent: #d8ef8e;
  --accent-ink: #14150f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

main {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(360px, 1fr);
  align-items: center;
  gap: 52px;
  overflow: hidden;
  padding: 48px clamp(20px, 5vw, 72px) clamp(190px, 24vw, 290px);
  border-bottom: 1px solid var(--line);
}

.heroCopy {
  position: relative;
  z-index: 3;
  max-width: 620px;
}

.heroMedia {
  position: relative;
  z-index: 1;
  width: 100%;
}

.preview {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e0e0c;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

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

h1 {
  max-width: 10ch;
  margin-bottom: 22px;
  font-size: clamp(56px, 8vw, 118px);
  line-height: 0.9;
  font-weight: 680;
}

.lede {
  max-width: 54ch;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  appearance: none;
  display: inline-flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  text-align: left;
  font-size: 16px;
  font-weight: 650;
}

.buttonLabel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.appleLogo {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1;
}

.buttonMeta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button.primary .buttonMeta {
  color: rgba(20, 21, 15, 0.68);
}

.copyButton {
  min-width: 230px;
}

.button.heroDownloadButton {
  min-width: 230px;
  min-height: 58px;
  flex-direction: row;
  align-items: center;
  padding: 14px 22px;
}

.button.heroDownloadButton .buttonLabel {
  font-size: 17px;
}

.button.compactCopy {
  min-width: 0;
  min-height: 44px;
  flex-direction: row;
  align-items: center;
  padding: 10px 14px;
}

.button.compactCopy .buttonLabel {
  gap: 7px;
  font-size: 15px;
  text-transform: lowercase;
}

.button.githubButton {
  min-height: 58px;
  flex-direction: row;
  align-items: center;
}

.button.githubButton .buttonLabel {
  gap: 7px;
  text-transform: lowercase;
}

.button.guideButton {
  min-height: 50px;
  background: rgba(25, 25, 22, 0.56);
  color: var(--fg);
}

.button.guideButton .buttonMeta {
  text-transform: lowercase;
}

.copyIcon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.githubIcon {
  width: 17px;
  height: 17px;
  color: inherit;
  fill: currentColor;
}

.heroMountainRange {
  position: absolute;
  right: -5vw;
  bottom: -2px;
  left: -5vw;
  z-index: 2;
  --mountain-range-width: clamp(900px, 116vw, 1600px);
  height: clamp(230px, 30vw, 340px);
  contain: layout;
  overflow: visible;
  pointer-events: none;
}

.heroMountainRange::before {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 50%;
  z-index: 1;
  width: var(--mountain-range-width);
  aspect-ratio: 1983 / 443;
  background: url("./assets/hero-mountain-range.webp") center bottom / contain no-repeat;
  filter:
    blur(18px)
    brightness(1.28)
    saturate(1.16);
  opacity: 0.17;
  mix-blend-mode: screen;
  transform: translateX(-50%) scale(1.018);
}

.mountainSmoke {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: calc(100% + 12px);
  mix-blend-mode: screen;
  opacity: 0.43;
  filter: blur(0.3px) saturate(1);
  pointer-events: none;
}

.mountainRangeImage {
  display: block;
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: var(--mountain-range-width);
  max-width: none;
  height: auto;
  opacity: 0.96;
  z-index: 2;
  filter:
    drop-shadow(0 -8px 18px rgba(126, 78, 255, 0.07))
    drop-shadow(0 0 0.65px rgba(17, 17, 15, 0.58));
  transform: translateX(-50%);
  user-select: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 54%,
    rgba(0, 0, 0, 0.68) 74%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 54%,
    rgba(0, 0, 0, 0.68) 74%,
    transparent 100%
  );
}

.steps,
.install {
  padding: 46px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.steps h2,
.install h2 {
  margin-bottom: 22px;
  font-size: 24px;
}

.install p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.installHeader {
  display: flex;
  max-width: 980px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.installHeader h2 {
  margin-bottom: 10px;
}

.installHeader p {
  margin-bottom: 0;
}

pre {
  max-width: 980px;
  overflow-x: auto;
  margin: 18px 0 34px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e0e0c;
  color: var(--fg);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.commandPreview {
  position: relative;
  max-width: 980px;
  margin: 18px 0 34px;
}

.commandPreview pre {
  margin: 0;
}

.installCommandLine {
  padding-right: 24px;
}

.installCommandLine code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.installScriptLink {
  border-bottom: 1px solid rgba(216, 239, 142, 0.72);
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

.installScriptLink:hover,
.installScriptLink:focus-visible {
  border-bottom-color: var(--accent);
  color: #efffb6;
}

.installScriptPreview {
  position: fixed;
  top: clamp(16px, 7vh, 64px);
  left: 50%;
  z-index: 12;
  width: min(860px, calc(100vw - 40px));
  max-height: min(560px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(216, 239, 142, 0.52);
  border-radius: 8px;
  background: #10100e;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
  visibility: hidden;
}

.installScriptPreview[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  visibility: visible;
}

.installScriptPreviewTitle {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.installScriptPreview pre {
  max-height: calc(min(560px, calc(100vh - 40px)) - 39px);
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.installScriptPreview code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

ol,
ul {
  max-width: 880px;
  margin: 0;
  padding-left: 22px;
}

li {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

li strong {
  color: var(--fg);
}

.guideHero {
  padding: 28px clamp(20px, 5vw, 72px) 72px;
  border-bottom: 1px solid var(--line);
}

.guideNav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 92px;
}

.quietButton {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid rgba(52, 50, 45, 0.78);
  border-radius: 8px;
  background: rgba(25, 25, 22, 0.45);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.quietButton:hover,
.button:hover {
  border-color: rgba(216, 239, 142, 0.72);
}

.guideHeroInner {
  max-width: 840px;
}

.eyebrow,
.stepKicker {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.guideHero h1 {
  max-width: 11ch;
  margin-bottom: 24px;
}

.guideIntro,
.guideStep {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(360px, 1fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: 56px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.guideStep[hidden] {
  display: none;
}

.firstStep {
  align-items: start;
}

.guideIntro p,
.stepCopy p {
  max-width: 660px;
  color: var(--muted);
  line-height: 1.6;
}

.choiceButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.choiceButtons .button {
  min-height: 50px;
  flex-direction: row;
  align-items: center;
}

.choiceButtons .button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.guideStep h2,
.guideIntro h2 {
  margin-bottom: 16px;
  font-size: 28px;
  line-height: 1.12;
}

.guideFigure {
  position: relative;
  margin: 0;
}

.guideImage {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e0e0c;
}

.annotatedFigure {
  border-radius: 8px;
}

.annotatedFigure .guideImage {
  border-radius: 8px;
}

.annotationFrame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.annotation {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 2;
  max-width: min(230px, 34%);
  padding: 8px 10px;
  border: 1px solid rgba(216, 239, 142, 0.8);
  border-radius: 8px;
  background: rgba(216, 239, 142, 0.95);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  transform: translate(-50%, -50%);
}

.firstNoteAnnotation {
  --x: 32%;
  --y: 62%;
}

.emptyEditorAnnotation {
  --x: 78%;
  --y: 18%;
}

.agentPromptAnnotation {
  --x: 65%;
  --y: 58%;
}

.mainGraphAnnotation {
  --x: 24%;
  --y: 66%;
}

.mainInfoAnnotation {
  --x: 86%;
  --y: 35%;
}

.graphOpenAnnotation {
  --x: 22%;
  --y: 48%;
}

.graphCreateAnnotation {
  --x: 76%;
  --y: 20%;
}

.graphArrangeAnnotation {
  --x: 31%;
  --y: 78%;
}

.graphMoveAnnotation {
  --x: 76%;
  --y: 78%;
}

.connectionSourceAnnotation {
  --x: 32%;
  --y: 36%;
}

.connectionTargetAnnotation {
  --x: 74%;
  --y: 32%;
}

.connectionParentAnnotation {
  --x: 45%;
  --y: 76%;
}

.connectionContextAnnotation {
  --x: 76%;
  --y: 76%;
}

.parentPickerAnnotation {
  --x: 55%;
  --y: 57%;
}

.graphBasicsFigure .annotation {
  max-width: min(190px, 30%);
  text-align: center;
}

.connectionsFigure .annotation {
  max-width: min(210px, 32%);
  text-align: center;
}

.guideOverlay {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 1;
  width: 100%;
  aspect-ratio: 894 / 556;
  overflow: visible;
  pointer-events: none;
}

.connectionOverlay path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connectionOverlay marker path {
  fill: var(--accent);
  stroke: none;
}

.connectionPreview {
  stroke: var(--accent);
  stroke-width: 4;
  stroke-dasharray: 11 12;
  filter: drop-shadow(0 0 9px rgba(216, 239, 142, 0.2));
  marker-end: url("#connectionArrow");
}

.connectionParentLine {
  stroke: rgba(85, 196, 126, 0.8);
  stroke-width: 6;
  opacity: 0.5;
}

.mutedAnnotation {
  border-color: rgba(52, 50, 45, 0.95);
  background: rgba(25, 25, 22, 0.92);
  color: var(--fg);
}

.compactFigure {
  max-width: 760px;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guideCallout {
  max-width: 720px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 25, 22, 0.58);
  color: var(--muted);
  line-height: 1.55;
}

.guideCallout strong {
  color: var(--fg);
}

.finalStep {
  align-items: start;
}

.guideTextBlock {
  padding: 56px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.guideTextBlock h2 {
  margin-bottom: 18px;
  font-size: 28px;
}

.plainSteps {
  display: grid;
  max-width: 980px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.plainSteps li {
  min-height: 128px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 25, 22, 0.58);
}

.stepCopy .plainSteps {
  grid-template-columns: 1fr;
  max-width: 660px;
}

.stepCopy .plainSteps li {
  min-height: 0;
}

.copyBlock {
  position: relative;
  max-width: 760px;
}

.copyBlock .copyButton {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.frontmatterExample {
  margin: 0;
  width: 100%;
}

.siteFooter {
  padding: 24px clamp(20px, 5vw, 72px) 30px;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  text-align: center;
}

.siteFooter p {
  margin: 0;
}

.siteFooter a {
  text-underline-offset: 4px;
}

@media (max-width: 860px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding-bottom: 112px;
  }

  .heroMountainRange {
    --mountain-range-width: 600px;
    height: 134px;
  }

  h1 {
    max-width: 9ch;
    font-size: 58px;
  }

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

  .guideNav {
    margin-bottom: 54px;
  }

  .guideIntro,
  .guideStep {
    grid-template-columns: 1fr;
    padding-top: 42px;
    padding-bottom: 42px;
  }

  .guideHero {
    padding-bottom: 56px;
  }

  .choiceButtons .button {
    width: 100%;
  }

  .annotation {
    display: inline-flex;
    position: static;
    max-width: none;
    margin: 8px 8px 0 0;
    transform: none;
  }

  .annotatedFigure {
    overflow: visible;
  }

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

  .plainSteps li {
    min-height: 0;
  }

  .copyBlock .copyButton {
    position: static;
    margin-bottom: 12px;
  }
}

@media (max-width: 860px), (hover: none), (pointer: coarse) {
  .mountainSmoke,
  .heroMountainRange::before {
    display: none;
  }
}
