/* The home page (overrides/home.html). Every rule is scoped to .ah, so the
   docs pages are untouched. Text, background and fonts are the theme's own
   variables, so the palette toggle switches this page with the rest. */

.ah {
  --ah-ink: var(--md-default-fg-color);
  --ah-muted: var(--md-default-fg-color--light);
  --ah-bg: var(--md-default-bg-color);
  --ah-line: var(--md-default-fg-color--lightest);
  --ah-trunk: var(--md-default-fg-color--lighter);
  --ah-panel: color-mix(in srgb, var(--md-default-fg-color) 3%, var(--md-default-bg-color));
  --ah-panel2: color-mix(in srgb, var(--md-default-fg-color) 6%, var(--md-default-bg-color));
  --ah-accent: #0f766e;
  --ah-on-accent: #ffffff;
  --ah-tint: rgba(15, 118, 110, .10);
  --ah-orch: #0f766e;
  --ah-data: #1d4ed8;
  --ah-rep: #6d28d9;
  --ah-nth: #c2410c;
  --ah-bolt: #d2d1c9;
  --ah-shadow: .08;
  --ah-mono: var(--md-code-font-family);

  background: var(--ah-bg);
  color: var(--ah-ink);
  font-family: var(--md-text-font-family);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[data-md-color-scheme="slate"] .ah {
  --ah-accent: #5eead4;
  --ah-on-accent: #0c0e0f;
  --ah-tint: rgba(94, 234, 212, .12);
  --ah-orch: #2dd4bf;
  --ah-data: #60a5fa;
  --ah-rep: #a78bfa;
  --ah-nth: #fb923c;
  --ah-bolt: #2a3032;
  --ah-shadow: .22;
}

.ah *, .ah *::before, .ah *::after { box-sizing: border-box; }
.ah a { color: inherit; text-decoration: none; }
.ah code { font-family: var(--ah-mono); font-size: .86em; }
.ah p code, .ah-cell code {
  padding: .12em .42em;
  border: 1px solid var(--ah-line);
  border-radius: 5px;
  background: var(--ah-panel2);
  color: var(--ah-ink);
}
.ah-wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px 40px; }

/* ── hero ─────────────────────────────────────────────────────────────── */

.ah-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 72px 0 88px;
}
.ah-gloss { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 26px; }
.ah-gloss b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--ah-ink); }
.ah-gloss i { font-family: var(--ah-mono); font-style: normal; font-size: 13px; color: var(--ah-muted); }
.ah-gloss span { font-size: 15px; color: var(--ah-muted); }
.ah-title {
  font-weight: 600;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -.04em;
  margin: 0 0 24px;
  color: var(--ah-ink);
}
.ah-title em { font-style: normal; color: var(--ah-accent); }
.ah-lede { font-size: 19px; color: var(--ah-muted); max-width: 540px; margin: 0 0 34px; }
.ah-ctas { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ah-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--ah-line);
  background: var(--ah-panel);
  color: var(--ah-ink);
  font: 500 15px var(--md-text-font-family);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.ah .ah-btn--primary { background: var(--ah-accent); border-color: var(--ah-accent); color: var(--ah-on-accent); }
.ah .ah-btn--primary:hover { filter: brightness(1.1); }
.ah .ah-btn--ghost:hover, .ah-btn--cmd:hover { border-color: var(--ah-accent); }
.ah-btn--cmd { font-family: var(--ah-mono); font-size: 13.5px; font-weight: 400; }
.ah-btn--cmd .ah-dim, .ah-btn--cmd svg { color: var(--ah-muted); }
.ah-btn:focus-visible { outline: 2px solid var(--ah-accent); outline-offset: 2px; }
.ah-done-icon { display: none; }
.ah-copied .ah-copy-icon { display: none; }
.ah-copied .ah-done-icon { display: inline; color: var(--ah-accent); }

/* The holds: one per dag node, coloured by workspace. */
.ah-vis { justify-self: end; width: 100%; max-width: 480px; }
.ah-holds { display: block; width: 100%; height: auto; overflow: visible; }
.ah-deco circle { fill: var(--ah-bolt); }
.ah-line { fill: none; stroke: var(--ah-trunk); stroke-width: 1.6; stroke-dasharray: 2 8; stroke-linecap: round; }
.ah-shadow { fill: #000; opacity: var(--ah-shadow); }
.ah-shine { fill: none; stroke: #fff; stroke-opacity: .3; stroke-width: 6; stroke-linecap: round; }
.ah-bolt { fill: var(--ah-bg); opacity: .85; }
.ah-bolt2 { fill: var(--ah-muted); }
.ah-holds .ah-orch { fill: var(--ah-orch); }
.ah-holds .ah-data { fill: var(--ah-data); }
.ah-holds .ah-rep { fill: var(--ah-rep); }
.ah-holds .ah-nth { fill: var(--ah-nth); }
.ah-tag rect { fill: var(--ah-bg); stroke: var(--ah-line); }
.ah-tag text { font-family: var(--ah-mono); font-size: 12px; fill: var(--ah-ink); }
.ah-tag .ah-tn { fill: var(--ah-accent); }

/* ── sections ─────────────────────────────────────────────────────────── */

.ah-section { padding: 104px 0; border-top: 1px solid var(--ah-line); }
.ah-label {
  font-family: var(--ah-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ah-muted);
  margin: 0 0 16px;
}
.ah-h2 {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin: 0 0 14px;
  max-width: 760px;
  color: var(--ah-ink);
}
.ah-sub { color: var(--ah-muted); font-size: 17px; max-width: 680px; margin: 0 0 44px; }

/* What it adds */
.ah-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--ah-line);
  border: 1px solid var(--ah-line);
  border-radius: 16px;
  overflow: hidden;
}
.ah-cell { display: block; background: var(--ah-bg); padding: 30px; transition: background .25s; }
.ah-cell:hover { background: var(--ah-panel); }
.ah-cell:focus-visible { outline: 2px solid var(--ah-accent); outline-offset: -2px; }
.ah-ic {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--ah-tint);
  color: var(--ah-accent);
  display: flex; align-items: center; justify-content: center;
}
.ah-ic svg { width: 22px; height: 22px; fill: currentColor; }
.ah-cell h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 18px 0 6px; color: var(--ah-ink); }
.ah-cell p { margin: 0 0 14px; color: var(--ah-muted); font-size: 15px; }
.ah-more { font-size: 14px; font-weight: 500; color: var(--ah-accent); }

/* The verbs */
.ah-help { border: 1px solid var(--ah-line); border-radius: 14px; background: var(--ah-panel); overflow: hidden; font-family: var(--ah-mono); }
.ah-help-hd { padding: 14px 22px; border-bottom: 1px solid var(--ah-line); color: var(--ah-muted); font-size: 13px; }
.ah-verb { display: grid; grid-template-columns: 180px minmax(0, 1fr) 190px; gap: 24px; align-items: center; padding: 15px 22px; border-bottom: 1px solid var(--ah-line); transition: background .2s; }
.ah-verb:last-child { border-bottom: 0; }
.ah-verb:hover { background: var(--ah-panel2); }
.ah-verb:focus-visible { outline: 2px solid var(--ah-accent); outline-offset: -2px; }
.ah-verb b { font-weight: 500; font-size: 14px; color: var(--ah-accent); }
.ah-verb span { font-family: var(--md-text-font-family); font-size: 15px; color: var(--ah-muted); }
.ah-verb:hover span { color: var(--ah-ink); }
.ah-verb i { font-style: normal; font-size: 12px; color: var(--ah-muted); text-align: right; }

/* The branch's life, as a git graph */
.ah-legend { position: relative; height: 22px; margin-bottom: 6px; font-family: var(--ah-mono); font-size: 12px; color: var(--ah-muted); }
.ah-legend { z-index: 2; }
.ah-legend span { position: absolute; left: 8px; padding: 0 4px; background: var(--ah-bg); }
.ah-legend .ah-legend-br { left: 56px; color: var(--ah-accent); }
.ah-row { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-bottom: 22px; }
.ah-row--last { padding-bottom: 0; }
.ah-graph { position: relative; }
.ah-lanes { position: relative; }
.ah-route { position: absolute; left: 0; top: 0; width: 96px; overflow: visible; pointer-events: none; }
.ah-route path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ah-route-main { stroke: var(--ah-trunk); stroke-width: 2; }
.ah-route-track { stroke: var(--ah-accent); stroke-opacity: .22; stroke-width: 2; }
.ah-route-fill { stroke: var(--ah-accent); stroke-width: 2.6; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .25s linear; }
.ah-dot {
  position: absolute; top: 20px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ah-bg);
  border: 2px solid var(--ah-trunk);
}
.ah-dot--br { left: 63px; border-color: var(--ah-accent); }
.ah-dot--main { left: 15px; }
.ah-dot { z-index: 1; transition: background .3s, border-color .3s, box-shadow .3s; }
.ah-dot--lit { background: var(--ah-accent); border-color: var(--ah-accent); box-shadow: 0 0 0 5px var(--ah-tint); }

.ah-gcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px;
  align-items: center;
  border: 1px solid var(--ah-line);
  border-radius: 14px;
  background: var(--ah-panel);
  padding: 18px 20px;
}
.ah-gcard:has(> .ah-gtxt:only-child) { grid-template-columns: minmax(0, 1fr); }
.ah-gtxt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.ah-gn { font-family: var(--ah-mono); font-size: 12px; color: var(--ah-accent); }
.ah-gtxt h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--ah-ink); }
.ah .ah-gcmd {
  padding: 6px 10px;
  border: 1px solid var(--ah-line);
  border-radius: 8px;
  background: var(--ah-bg);
  font-size: 12.5px;
  color: var(--ah-ink);
  overflow-wrap: anywhere;
}
.ah-gcmd::before { content: "$ "; color: var(--ah-accent); }

/* A group of workspaces: dashed for a branch's own, solid for an environment's */
.ah-wsg { position: relative; border: 1px dashed var(--ah-trunk); border-radius: 12px; padding: 22px 12px 12px; min-width: 0; }
.ah-wsg--env { border-style: solid; border-color: var(--ah-line); background: var(--ah-panel2); }
.ah-gl {
  position: absolute; top: -10px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 8px;
  background: var(--ah-panel);
  font-family: var(--ah-mono); font-size: 11.5px;
  color: var(--ah-accent);
}
.ah-wsg--env .ah-gl { color: var(--ah-ink); border: 1px solid var(--ah-line); border-radius: 999px; padding: 0 9px; }
.ah-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ah-tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--ah-line); border-radius: 9px;
  background: var(--ah-bg);
  font-family: var(--ah-mono); font-size: 12px;
  color: var(--ah-ink);
  min-width: 0;
}
.ah-tile i { width: 10px; height: 10px; border-radius: 3px; margin-bottom: 4px; }
.ah-tile i.ah-orch { background: var(--ah-orch); }
.ah-tile i.ah-data { background: var(--ah-data); }
.ah-tile i.ah-rep { background: var(--ah-rep); }
.ah-tile em { font-style: normal; font-size: 10.5px; color: var(--ah-muted); }
.ah-tile .ah-git { display: inline-flex; align-items: center; gap: 5px; color: var(--ah-ink); }
.ah-tile .ah-git svg { color: #f05133; flex: none; }
.ah-tile--empty { border-style: dashed; background: transparent; color: var(--ah-muted); }
.ah-tile--empty i { opacity: .45; }
.ah-tile--hot { border-color: var(--ah-accent); box-shadow: 0 0 0 3px var(--ah-tint); }
.ah-tile--hot em, .ah-tile--done em { color: var(--ah-accent); }
.ah-tiles--mini .ah-tile { padding: 8px; align-items: center; }
.ah-tiles--mini .ah-tile i { margin: 0; }
.ah-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ah-wsg--gone { opacity: .5; }
.ah-wsg--gone .ah-tile { text-decoration: line-through; background: transparent; }

/* VS Code */
.ah-vs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 48px; align-items: center; }
.ah-vs .ah-sub { margin-bottom: 24px; }
.ah-shot { display: block; border: 1px solid var(--ah-line); border-radius: 14px; overflow: hidden; background: #1e1e1e; }
.ah-shot img { display: block; width: 100%; height: auto; }

/* ── motion ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .ah-word { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(10px); animation: ah-word .9s cubic-bezier(.2, .7, .2, 1) forwards; }
  .ah-fade { opacity: 0; animation: ah-fade 1s cubic-bezier(.2, .7, .2, 1) forwards; }
  .ah-hold { opacity: 0; animation: ah-in .9s cubic-bezier(.2, .8, .2, 1) forwards; }
  .ah-n1 { animation-delay: .4s; } .ah-n2 { animation-delay: .6s; } .ah-n3 { animation-delay: .8s; } .ah-n4 { animation-delay: 1s; }
  .ah-float { animation: ah-float 8s ease-in-out infinite; }
  @supports (animation-timeline: view()) {
    .ah-rv { animation: ah-rv linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  }
}
@keyframes ah-word { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes ah-fade { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes ah-in { to { opacity: 1; } }
@keyframes ah-float { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(0, -9px) rotate(2.5deg); } }
@keyframes ah-rv { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* ── narrow screens ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .ah-wrap { padding: 0 16px 24px; }
  .ah-hero, .ah-grid, .ah-vs, .ah-gcard { grid-template-columns: minmax(0, 1fr); }
  .ah-hero { padding: 48px 0 64px; }
  .ah-title { font-size: 46px; }
  .ah-vis { justify-self: center; }
  .ah-section { padding: 72px 0; }
  .ah-h2 { font-size: 30px; }
  .ah-row { grid-template-columns: 80px minmax(0, 1fr); }
  .ah-verb { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ah-verb i { text-align: left; }
  .ah-tile { font-size: 11px; }
}

/* Once the hero is one column, its holds sit behind the title, faded and
   blurred, never below the text. */
@media (max-width: 900px) {
  .ah-hero { position: relative; display: block; overflow-x: clip; }
  .ah-hero > div:first-child { position: relative; z-index: 1; }
  .ah-vis { position: absolute; z-index: 0; top: 24px; right: -72px; width: 340px; pointer-events: none; }
  .ah-holds {
    opacity: .4;
    filter: blur(3px);
    -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent);
    mask-image: radial-gradient(closest-side, #000 40%, transparent);
  }
  .ah-tag { display: none; }
}

/* Phones: each workspace tile becomes a row so its name and state never collide. */
@media (max-width: 600px) {
  .ah-tiles:not(.ah-tiles--mini) { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ah-tiles:not(.ah-tiles--mini) .ah-tile { flex-direction: row; align-items: center; gap: 8px; }
  .ah-tiles:not(.ah-tiles--mini) .ah-tile i { margin: 0; flex: none; }
  .ah-tiles:not(.ah-tiles--mini) .ah-tile em { margin-left: auto; white-space: nowrap; }
}
