:root {
  color-scheme: light dark;
  --background: #f7f5ef;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #fffdf8;
  --text: #171713;
  --muted: #69675e;
  --line: rgba(24, 23, 19, 0.13);
  --accent: #5c42ee;
  --accent-text: #ffffff;
  --code: #ebe7dc;
  --shadow: 0 20px 60px rgba(42, 35, 16, 0.08);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #090a0d;
    --surface: rgba(20, 21, 26, 0.82);
    --surface-strong: #14151a;
    --text: #f4f1e8;
    --muted: #aaa79d;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #917fff;
    --accent-text: #090a0d;
    --code: #202128;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 38rem),
    var(--background);
}

a {
  color: inherit;
}

.kit-tree-header,
main,
footer {
  width: min(960px, calc(100% - 36px));
  margin-inline: auto;
}

.kit-tree-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  color: var(--muted);
  font-size: 0.9rem;
}

.kit-tree-header a {
  text-decoration: none;
}

.kit-tree-header a:hover {
  color: var(--text);
}

.kit-tree-brand {
  color: var(--text);
  font-weight: 700;
}

main {
  padding: clamp(56px, 8vw, 104px) 0 72px;
}

.kit-tree-hero {
  max-width: 760px;
}

.kit-tree-eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(2.55rem, 8vw, 5.6rem);
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.kit-tree-hero > p:not(.kit-tree-eyebrow) {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.kit-tree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.kit-tree-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
}

.kit-tree-actions a:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.kit-tree-actions .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.kit-tree-machine {
  display: grid;
  grid-template-columns: minmax(200px, 0.75fr) minmax(300px, 1.25fr);
  gap: clamp(28px, 7vw, 90px);
  margin: clamp(72px, 11vw, 130px) 0 44px;
  padding: 34px 0;
  border-block: 1px solid var(--line);
}

.kit-tree-machine h2,
.kit-tree-browser h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
}

.kit-tree-machine > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

code {
  padding: 0.14em 0.38em;
  border-radius: 5px;
  background: var(--code);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.88em;
}

.kit-tree-browser {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.kit-tree-browser-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.kit-tree-browser-head code {
  overflow: hidden;
  max-width: 52%;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kit-tree-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kit-tree-list .kit-tree-list {
  margin-left: 23px;
  border-left: 1px solid var(--line);
}

.kit-tree-directory summary,
.kit-tree-file a {
  min-height: 45px;
  border-bottom: 1px solid var(--line);
}

.kit-tree-directory summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}

.kit-tree-directory summary::-webkit-details-marker {
  display: none;
}

.kit-tree-directory summary::after {
  margin-left: 0;
  color: var(--muted);
  content: "−";
}

.kit-tree-directory details:not([open]) > summary::after {
  content: "+";
}

.kit-tree-file a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 100px 72px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  text-decoration: none;
}

.kit-tree-file a:hover,
.kit-tree-directory summary:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.kit-tree-open-node {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
}

.kit-tree-open-node:hover {
  color: var(--accent);
}

.kit-tree-file svg,
.kit-tree-directory svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.kit-tree-file-name {
  overflow: hidden;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kit-tree-file-kind,
.kit-tree-file-size {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 640px) {
  .kit-tree-header,
  main,
  footer {
    width: min(100% - 24px, 960px);
  }

  .kit-tree-header {
    min-height: 58px;
  }

  main {
    padding-top: 42px;
  }

  .kit-tree-machine {
    grid-template-columns: 1fr;
  }

  .kit-tree-browser-head {
    align-items: start;
    flex-direction: column;
  }

  .kit-tree-browser-head code {
    max-width: 100%;
  }

  .kit-tree-file a {
    grid-template-columns: 18px minmax(0, 1fr) 56px;
  }

  .kit-tree-file-kind {
    display: none;
  }

  .kit-tree-list .kit-tree-list {
    margin-left: 12px;
  }

  footer {
    flex-direction: column;
  }
}
