@font-face {
  font-family: Agave;
  src: url("fonts/Agave-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Agave;
  src: url("fonts/Agave-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #0a090b;
  --text: #f4f0f7;
  --muted: #b6aebf;
  --dim: #968c9e;
  --line: #2c2631;
  --rule: #4f3d64;
  --accent: #bb99ff;
  --accent-bright: #d7c1ff;
  --page-gutter: clamp(16px, 3vw, 48px);
  --header-height: 62px;
  font: 17px/1.55 Agave, "Cascadia Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 20px); }
body { margin: 0; color: var(--text); background: var(--bg); }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.12; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: .21em; }
a:hover { color: var(--accent-bright); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 4px; }
[hidden] { display: none !important; }
code, kbd { color: var(--accent-bright); font: .95em Agave, monospace; }
summary { cursor: pointer; }

.site-width {
  width: min(1500px, 100% - var(--page-gutter) * 2);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: var(--page-gutter);
  z-index: 20;
  transform: translateY(-170%);
  padding: .5em .8em;
  color: var(--bg);
  background: var(--accent);
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #000;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .32em;
  justify-self: start;
  color: var(--accent);
  font-size: 1.32rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img { object-fit: contain; }
.site-nav { display: flex; align-items: stretch; gap: clamp(14px, 3vw, 44px); }
.site-nav a, .header-download, .site-footer nav a { text-decoration: none; }

.site-nav a {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  color: var(--muted);
  font-size: .96rem;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover, .site-nav [aria-current="page"] { color: var(--text); border-color: var(--accent); }
.header-download { justify-self: end; font-weight: 700; white-space: nowrap; }

.opening {
  background: radial-gradient(ellipse 46% 320px at 50% 175px, #100916, transparent);
}

.hero-copy {
  padding-block: clamp(26px, 3.2vw, 46px) clamp(31px, 3vw, 42px);
  text-align: center;
}

.hero-mark { margin: 0 auto .7rem; }
.hero-copy h1 { font-size: clamp(2.55rem, 5.8vw, 4.9rem); letter-spacing: -.055em; }
.hero-copy h1 em { font-style: normal; color: var(--accent); }
.hero-copy p { max-width: 72ch; margin: .75rem auto 0; color: var(--muted); font-size: clamp(1rem, 1.55vw, 1.12rem); }
.actions { display: flex; justify-content: center; align-items: center; gap: .85rem 1.6rem; flex-wrap: wrap; margin-top: 1.35rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75em;
  padding: .48em .85em;
  min-height: 40px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
}

.button:hover { border-color: var(--accent); }
.button-small { font-size: .9rem; }
.button-primary { background: var(--accent); color: var(--bg); font-weight: 700; border-color: var(--accent); }
.button-primary:hover { background: var(--accent-bright); color: var(--bg); }
.text-link { display: inline-block; font-weight: 700; text-decoration-thickness: 1px; }
.text-link span, .caption-actions a span { display: inline-block; text-decoration: none; }

.theme-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: .75rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 12px;
}
.theme-label { color: var(--muted); font-size: .9rem; }
.theme-options {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(2px, .35vw, 6px);
}
.theme-strip .caption-actions {
  padding-block: .36em;
  gap: .35rem .85rem;
  font-size: .89rem;
}

.theme-options a, .theme-options button {
  display: inline-flex;
  align-items: center;
  gap: .38em;
  margin: 0;
  min-height: 30px;
  padding: .22em .38em;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .84rem;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

.theme-options a span, .theme-options button span { width: .45em; height: .45em; background: var(--swatch); }
.theme-options a[aria-current], .theme-options button[aria-pressed="true"] { color: var(--text); border-color: var(--swatch); }
.theme-options a:hover, .theme-options button:hover { color: var(--text); background: var(--surface); }

.window-figure {
  min-width: 0;
  width: min(100%, var(--window-width, 100%));
}

.window-media {
  display: block;
  outline: 1px solid var(--line);
  outline-offset: -1px;
}

.window-media img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
}

.window-media[data-actual-size] {
  max-height: min(72vh, 900px);
  overflow: auto;
  overscroll-behavior-inline: contain;
}

.window-media[data-actual-size] img {
  width: var(--window-width);
  max-width: none;
}

.window-media:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.window-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .3rem 1rem;
  margin-top: .65rem;
  color: var(--muted);
  font-size: .9rem;
}

.theme-caption { color: var(--dim); }
.theme-caption::before { content: " · "; }
.window-caption:first-child { margin-block: 0 .65rem; }
.caption-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; }
.caption-actions a, .caption-actions button { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .24em; }
.caption-actions a:hover, .caption-actions button:hover { text-decoration-color: currentColor; }
.caption-actions button { margin: 0; padding: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: inherit; }

.workflow-index, .gallery-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 2rem clamp(35px, 9vw, 140px);
  padding-block: clamp(27px, 4vw, 58px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--line);
  margin-top: clamp(64px, 8vw, 115px);
}

.workflow-index h2, .gallery-entry h2 { font-size: clamp(1.65rem, 4.2vw, 3.2rem); }
.workflow-index p, .gallery-entry p { color: var(--muted); max-width: 62ch; margin: .75rem 0; }
.workflow-index nav, .gallery-entry nav { display: grid; align-content: center; align-items: start; }

.workflow-index nav a, .gallery-entry nav a {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  padding-block: .58em;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}

.workflow-index nav a:first-child, .gallery-entry nav a:first-child { border-top: 1px solid var(--line); }
.workflow-index nav span, .gallery-entry nav span { color: var(--accent); }
.workflow-index nav a:hover, .gallery-entry nav a:hover { color: var(--accent); }
.workflow { padding-top: clamp(52px, 8vw, 120px); scroll-margin-top: -24px; }

.editorial-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  align-items: end;
  column-gap: clamp(35px, 7vw, 105px);
  row-gap: .6rem;
  margin-bottom: 1.55rem;
}

.editorial-head h2 { max-width: 18ch; font-size: clamp(2rem, 4.4vw, 4.05rem); letter-spacing: -.035em; }
.editorial-head p { color: var(--muted); max-width: 61ch; font-size: clamp(.98rem, 1.5vw, 1.12rem); }
.editorial-head p strong { color: var(--text); }
.editorial-head p + a { margin-top: .55rem; }

.story-copy { max-width: 56ch; }
.story-copy h2 { font-size: clamp(1.7rem, 3.4vw, 3.05rem); letter-spacing: -.034em; }
.story-copy p { margin-block: .65rem; color: var(--muted); }
.story-copy strong { color: var(--text); }

.router-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.25fr);
  gap: clamp(1.4rem, 5vw, 4.4rem);
  align-items: center;
}

.router-story .window-figure { justify-self: end; }

.transcript-story {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  grid-template-areas: "history text" "history diff";
  grid-template-rows: auto 1fr;
  gap: clamp(1.4rem, 4vw, 3.5rem);
  align-items: start;
}

.long-shot { grid-area: history; }
.transcript-copy { grid-area: text; padding-top: clamp(.35rem, 3vw, 2rem); }
.diff-shot { grid-area: diff; }

.work-pair {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: clamp(2.8rem, 5.5vw, 5.4rem) clamp(1rem, 2vw, 1.5rem);
}

.work-pair section { min-width: 0; }
.work-pair .story-copy { margin-bottom: 1.3rem; }
.work-pair #agents {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  grid-template-areas: "media text";
  align-items: center;
  gap: clamp(1.4rem, 5vw, 4.4rem);
}
.work-pair #agents .window-figure { grid-area: media; }
.work-pair #agents .story-copy { grid-area: text; margin-bottom: 0; }
.work-pair #tech { grid-column: 4 / -1; }

.download-section, .pricing { padding-top: clamp(64px, 9vw, 126px); }
.platform-list, .plan-list { border-top: 1px solid var(--rule); }

.platform-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2.25fr);
  align-items: center;
  gap: .5rem 1.2rem;
  padding-block: .95rem;
  border-bottom: 1px solid var(--line);
}

.platform-list dt { font-size: 1.26rem; font-weight: 700; }
.platform-list dt small { display: block; color: var(--muted); font-size: .84rem; font-weight: 400; }
.platform-list dd { display: flex; flex-wrap: wrap; gap: .38rem clamp(.8rem, 3vw, 2.1rem); }
.platform-list dd a { white-space: nowrap; }

.download-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; margin-block: 1rem .65rem; }
.checksums { color: var(--muted); }
.checksums dl { padding: .65rem 0; font-size: .87rem; }
.checksums dt { color: var(--text); }
.checksums dd { margin: 0 0 .65em; overflow-wrap: anywhere; }

.plan-list { margin: 0 0 .85rem; padding: 0; list-style: none; }

.plan-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.75fr) auto;
  align-items: baseline;
  gap: .36rem 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

.plan-list h3 { font-size: 1.13rem; text-wrap: nowrap; }
.plan-list p { color: var(--muted); }
.plan-list p:first-of-type { color: var(--text); font-size: 1.3rem; font-weight: 700; }
.plan-list small { color: var(--muted); font-size: .68em; font-weight: 400; white-space: nowrap; }
.plan-list a { white-space: nowrap; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-top: clamp(58px, 7vw, 104px);
  padding-block: 1.25rem 1.7rem;
  border-top: 1px solid var(--line);
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: .45rem 1.3rem; }
.site-footer nav a { color: var(--muted); font-size: .94rem; }
.site-footer nav a:hover { color: var(--accent); }

/* The gallery is a continuous set of windows with deep links to each view. */
.gallery-heading { padding-block: clamp(31px, 4.8vw, 62px) clamp(18px, 3vw, 34px); }
.gallery-heading h1, .guide-article h1 { font-size: clamp(2.65rem, 6vw, 5rem); letter-spacing: -.05em; }
.gallery-heading p { color: var(--muted); margin-top: .55rem; max-width: 70ch; }
.gallery-jumps { position: sticky; top: calc(var(--header-height) + 1px); z-index: 4; background: var(--bg); border-bottom: 1px solid var(--line); }
.gallery-jumps > div { display: flex; align-items: center; gap: .35rem clamp(10px, 2.2vw, 38px); overflow-x: auto; padding: 3px; }
.gallery-jumps a { padding: .48rem .22rem; min-height: 39px; color: var(--muted); white-space: nowrap; text-decoration: none; }
.gallery-jumps a:hover, .gallery-jumps a[aria-current="location"] { color: var(--accent-bright); text-decoration: underline; }
.gallery-section { padding-block: clamp(29px, 4vw, 58px) clamp(25px, 5vw, 52px); scroll-margin-top: 39px; }
.gallery-section + .gallery-section { border-top: 1px solid var(--rule); }
.gallery-section h2 { font-size: clamp(2rem, 4.6vw, 3.55rem); letter-spacing: -.035em; }

.view-jumps {
  display: flex;
  gap: .3rem 1.15rem;
  flex-wrap: wrap;
  padding-block: .62rem .9rem;
}

.view-jumps a { font-size: .89rem; color: var(--muted); text-decoration-color: var(--rule); }
.view-jumps a:hover { color: var(--accent); }
.gallery-views {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 66px) clamp(18px, 2.2vw, 36px);
  padding-top: clamp(15px, 3vw, 38px);
}

.gallery-view { grid-column: span 12; scroll-margin-top: 46px; }
.gallery-view--medium { grid-column: 1 / span 10; }
.gallery-view--end { grid-column: 3 / -1; justify-self: end; }
.gallery-view--compact { grid-column: span 6; }
.gallery-view .window-media { scroll-margin-top: 45px; }

.gallery-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .2rem 1rem;
  align-items: end;
  margin-bottom: .66rem;
}

.gallery-caption h3 { font-size: clamp(1.2rem, 2.4vw, 1.85rem); text-wrap: pretty; }
.gallery-caption p { color: var(--muted); margin-top: .24em; }
.gallery-caption .caption-actions { justify-content: flex-end; font-size: .91rem; white-space: nowrap; }
.gallery-theme { color: var(--dim); }
.gallery-view--compact .gallery-caption { grid-template-columns: 1fr; align-items: start; }
.gallery-view--compact .caption-actions { justify-content: flex-start; }

.themes-intro { margin-top: .5rem; color: var(--muted); max-width: 70ch; }
.theme-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px) clamp(18px, 3vw, 42px);
  padding-top: clamp(20px, 3vw, 42px);
}
.theme-gallery figure { scroll-margin-top: 46px; }
.theme-gallery h3 { font-size: 1.12rem; }

/* The guides share the same type and navigation as the landing page. */
.guide-layout { display: grid; grid-template-columns: minmax(155px, 205px) minmax(0, 1fr); gap: clamp(30px, 6vw, 88px); align-items: start; }
.guide-nav { position: sticky; top: calc(var(--header-height) + 1.2rem); padding-block: 1.1rem; display: grid; gap: .35rem; }
.guide-nav a { color: var(--muted); text-decoration: none; border-left: 1px solid var(--line); padding: .28rem .6rem; line-height: 1.3; }
.guide-nav a:hover, .guide-nav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.guide-article { max-width: 1100px; padding-block: clamp(25px, 5vw, 64px) 1.4rem; min-width: 0; font-size: 1.03rem; }
.guide-article h1 { margin-bottom: 1.1rem; }
.guide-article h2 { margin-top: 2.1rem; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.guide-article h3 { margin-top: 1.7rem; font-size: 1.23rem; }
.guide-article p, .guide-article ol, .guide-article ul { color: var(--muted); margin: .7em 0; max-width: 79ch; }
.guide-article strong { color: var(--text); }
.guide-article p:has(> img) { max-width: none; }
.guide-article img { width: auto; max-width: 100%; height: auto; margin-block: 1.4rem; outline: 1px solid var(--line); }
.guide-article ol, .guide-article ul { padding-left: 1.35em; }
.guide-article li { margin-block: .35em; }
.guide-article table { margin: 1.15rem 0; width: 100%; border-collapse: collapse; }
.guide-article th { text-align: left; }
.guide-article td { color: var(--muted); }
.guide-article th, .guide-article td { padding: .52em .69em; border: 1px solid var(--line); vertical-align: top; }
.guide-article pre { padding: .74em; max-width: 100%; overflow: auto; border: 1px solid var(--line); }

@media (max-width: 980px) {
  .router-story, .transcript-story, .work-pair { grid-template-columns: minmax(0, 1fr); }
  .router-story .window-figure { justify-self: start; }
  .transcript-story { grid-template-areas: "text" "history" "diff"; }
  .transcript-copy { padding-top: 0; }
  .work-pair #agents, .work-pair #tech { grid-column: auto; }
  .work-pair #agents { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "media"; }
  .gallery-views { grid-template-columns: minmax(0, 1fr); }
  .gallery-view { grid-column: auto; justify-self: start; }
  .theme-gallery { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  :root { --header-height: 52px; }
  .workflow-index, .gallery-entry, .editorial-head { grid-template-columns: minmax(0, 1fr); }
  .editorial-head h2 { max-width: 23ch; }
  .hero-mark { width: 63px; height: 63px; }
  .workflow-index, .gallery-entry { gap: 1.3rem; }
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide-nav { position: static; display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); gap: .45rem; }
  .guide-article td, .guide-article th { padding-inline: .4em; overflow-wrap: anywhere; }
}

@media (max-width: 525px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 9px; }
  .site-nav { gap: 12px; justify-self: center; }
  .site-nav a, .header-download { font-size: .85rem; }
  .header-inner .brand img { width: 25px; height: 25px; }
  .header-inner .brand { font-size: 1.08rem; gap: .15em; }
  .header-download span { display: none; }
  .hero-copy h1 em { display: block; }
  .theme-strip { grid-template-columns: minmax(0, 1fr); }
  .theme-label { padding-top: .35rem; }
  .theme-strip .caption-actions { gap: .28rem .55rem; font-size: .81rem; }
  .theme-options a, .theme-options button { padding-inline: .2em; gap: .26em; }
  .gallery-jumps > div { display: grid; grid-template-columns: 1.2fr .72fr 1.1fr .98fr; gap: 0 .28rem; }
  .gallery-jumps a { display: grid; align-items: center; min-height: 37px; padding: .24rem .07rem; font-size: .86rem; }
  .gallery-view, .gallery-section, .gallery-view .window-media, .theme-gallery figure { scroll-margin-top: 59px; }
  .gallery-caption { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .gallery-caption .caption-actions { justify-content: flex-start; }
  .plan-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .plan-list li > :nth-child(even) { justify-self: end; }
  .platform-list > div { grid-template-columns: minmax(0, 1fr); }
  .platform-list dt small { display: inline; margin-left: .45em; }
}

@media (max-width: 350px) {
  .header-inner { gap: 7px; }
  .site-nav { gap: 8px; }
  .header-inner .brand img { display: none; }
}
