/* offstage.viraat.dev: the stage and the wings.
   Paper is the house lights; --wings is offstage, where the agent works.
   The brand ramp (violet, magenta, amber) comes from the icon and wordmark and
   is spent in two places only: the wordmark and the stage lip. */

:root {
  --paper: #f3f4f8;
  --paper-2: #e6e8ef;
  --ink: #1d2130;
  --ink-2: #545b70;
  --ink-3: #7a8196;
  --rule: #d6d9e3;
  --wings: #17132a;
  --wings-2: #241e3f;
  --wings-ink: #ece9f7;
  --wings-ink-2: #aaa4c4;
  --violet: #7c3aed;
  --amber: #f5a524;
  --refused: #a3271b;
  --ramp: linear-gradient(90deg, #7c3aed, #d946ef 50%, #f59e0b);

  --display: "Big Shoulders Display", "Arial Narrow", system-ui, sans-serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 32px);
  --overlap: clamp(56px, 11vw, 150px);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
}

:not(pre) > code {
  background: var(--paper-2);
  padding: 0.08em 0.36em;
  border-radius: 4px;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1168px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* header */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 28px;
}

.brand img {
  width: 176px;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
  font-weight: 500;
  font-size: 0.96rem;
}

.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* hero */

.hero {
  padding-top: clamp(40px, 7vw, 88px);
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.9rem, 6.6vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.005em;
  margin: 0;
}

h1 span {
  display: block;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 36em;
  margin: 28px 0 36px;
}

.hero-note {
  color: var(--ink-3);
  font-size: 0.95rem;
  margin: 14px 0 0;
}

/* install tabs: radios, so they work with scripting off */

.install {
  max-width: 820px;
}

.tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}

.tabs label {
  flex: none;
  padding: 8px 14px 10px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs label:hover {
  color: var(--ink);
}

#tab-claude:checked ~ .tabs [for="tab-claude"],
#tab-codex:checked ~ .tabs [for="tab-codex"],
#tab-opencode:checked ~ .tabs [for="tab-opencode"],
#tab-cli:checked ~ .tabs [for="tab-cli"] {
  color: var(--ink);
  border-bottom-color: var(--violet);
}

#tab-claude:focus-visible ~ .tabs [for="tab-claude"],
#tab-codex:focus-visible ~ .tabs [for="tab-codex"],
#tab-opencode:focus-visible ~ .tabs [for="tab-opencode"],
#tab-cli:focus-visible ~ .tabs [for="tab-cli"] {
  outline: 2px solid var(--violet);
  outline-offset: -2px;
  border-radius: 6px 6px 0 0;
}

.tab-panel {
  display: none;
  position: relative;
}

#tab-claude:checked ~ .panel-claude,
#tab-codex:checked ~ .panel-codex,
#tab-opencode:checked ~ .panel-opencode,
#tab-cli:checked ~ .panel-cli {
  display: block;
}

/* code */

.code {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.65;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 92px 14px 16px;
  overflow-x: auto;
  white-space: pre;
}

.code code {
  font-size: inherit;
}

.prompt,
.dim {
  color: var(--ink-3);
  user-select: none;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 500 0.85rem/1 var(--text);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--ink-3);
}

.copy.is-done {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

/* the stage */

.stage {
  margin-top: clamp(56px, 8vw, 96px);
}

.onstage {
  position: relative;
  z-index: 2;
  margin-bottom: calc(var(--overlap) * -1);
}

.onstage::before {
  /* the spotlight on your screen: a warm wash from above, nothing more */
  content: "";
  position: absolute;
  inset: -140px 4% 10% 4%;
  background: radial-gradient(closest-side, rgba(245, 165, 36, 0.2), rgba(245, 165, 36, 0));
  z-index: -1;
  pointer-events: none;
}

figure {
  margin: 0;
}

.shot-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 14px;
}

.shot-label strong {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  line-height: 1.1;
}

.shot-label span {
  color: var(--ink-2);
  max-width: 60ch;
}

.shot-label q {
  font-family: var(--mono);
  font-size: 0.9em;
  quotes: none;
  white-space: nowrap;
}

.shot {
  width: 100%;
  border-radius: 12px;
}

.shot-mine {
  box-shadow:
    0 0 0 1px rgba(23, 19, 42, 0.1),
    0 28px 60px -18px rgba(23, 19, 42, 0.55);
}

.wings {
  position: relative;
  background:
    var(--ramp) top / 100% 3px no-repeat,
    var(--wings);
  color: var(--wings-ink);
  padding-top: calc(var(--overlap) + clamp(40px, 6vw, 72px));
  padding-bottom: clamp(56px, 8vw, 96px);
}

.wings .shot-label strong {
  color: #fff;
}

.wings .shot-label span {
  color: var(--wings-ink-2);
}

.desk {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.desk::after {
  /* the screenshot flash */
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.desk.is-capture::after {
  animation: capture 0.5s ease-out;
}

@keyframes capture {
  0% {
    opacity: 0.32;
  }
  100% {
    opacity: 0;
  }
}

.agent-cursor {
  position: absolute;
  left: 60%;
  top: 55%;
  width: clamp(16px, 2vw, 24px);
  margin: -2px 0 0 -4px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  transition:
    left 1.1s cubic-bezier(0.45, 0.05, 0.25, 1),
    top 1.1s cubic-bezier(0.45, 0.05, 0.25, 1);
  z-index: 2;
}

.agent-ripple {
  position: absolute;
  left: 60%;
  top: 55%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 2px solid var(--amber);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.agent-ripple.is-click {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    opacity: 1;
    transform: scale(0.3);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

.agent-log {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  min-height: 1.6em;
}

.agent-log-tool {
  color: var(--amber);
}

.agent-log-args {
  color: var(--wings-ink);
}

.wings-note {
  margin: 20px 0 0;
  color: var(--wings-ink-2);
  font-size: 0.95rem;
  max-width: 64ch;
}

/* sections */

.section {
  padding-top: clamp(72px, 10vw, 128px);
}

.section-head {
  margin-bottom: 36px;
}

h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.003em;
  max-width: 24ch;
  margin: 0;
  text-wrap: balance;
}

.section-head p {
  color: var(--ink-2);
  font-size: 1.125rem;
  max-width: 60ch;
  margin: 18px 0 0;
}

/* routes table */

.table-scroll {
  overflow-x: auto;
}

.routes {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.routes th {
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-2);
  padding: 0 24px 12px 0;
  border-bottom: 1.5px solid var(--ink);
}

.routes td {
  vertical-align: top;
  padding: 20px 24px 20px 0;
  border-bottom: 1px solid var(--rule);
}

.routes td:first-child {
  width: 46%;
  line-height: 2;
}

.routes td:last-child {
  color: var(--ink-2);
}

.routes td:last-child strong {
  color: var(--ink);
  font-weight: 600;
}

.routes tr:first-child td:last-child strong {
  color: var(--violet);
}

.routes .refused td:last-child strong {
  color: var(--refused);
}

/* agent prompt */

.prompt-block {
  position: relative;
  max-width: 900px;
}

.code-long {
  max-height: 34rem;
  overflow: auto;
  font-size: 0.84rem;
  padding-right: 16px;
  padding-top: 52px;
}

.copy-block {
  z-index: 1;
}

/* setup steps: a real sequence, so they are numbered */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  max-width: 820px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 8px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}

.steps li:last-child {
  border-bottom: 1px solid var(--rule);
}

.steps li::before {
  content: counter(step);
  grid-row: 1 / span 3;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 0.85;
  color: var(--ink-3);
}

.steps h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.steps .code {
  padding-right: 16px;
}

.steps p {
  margin: 12px 0 0;
  color: var(--ink-2);
  max-width: 62ch;
}

/* questions */

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 56px;
}

.qa {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}

.qa h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.qa p {
  margin: 10px 0 28px;
  color: var(--ink-2);
  max-width: 60ch;
}

/* footer */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  margin-top: clamp(80px, 11vw, 140px);
  padding-top: 32px;
  padding-bottom: 48px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.95rem;
}

.foot-main {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 62ch;
}

.foot-main img {
  flex: none;
  border-radius: 7px;
}

.foot-main p {
  margin: 0;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.foot-nav a {
  text-decoration: none;
}

.foot-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* small screens */

@media (max-width: 760px) {
  .faq {
    grid-template-columns: 1fr;
  }

  .routes thead {
    display: none;
  }

  .routes,
  .routes tbody,
  .routes tr,
  .routes td {
    display: block;
    width: 100%;
  }

  .routes tr {
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
  }

  .routes tr:first-child {
    border-top: 1.5px solid var(--ink);
  }

  .routes td,
  .routes td:first-child {
    width: auto;
    padding: 0;
    border: 0;
  }

  .routes td:last-child {
    margin-top: 8px;
  }

  :not(pre) > code {
    white-space: normal;
  }

  .steps li {
    grid-template-columns: 40px 1fr;
  }

  .steps li::before {
    font-size: 2rem;
  }
}

@media (max-width: 620px) {
  .tabs label {
    padding-inline: 10px;
    font-size: 0.9rem;
  }

  .tab-panel .code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding-right: 16px;
  }

  .tab-panel .copy {
    position: static;
    margin-top: 10px;
  }
}

@media (max-width: 520px) {
  .site-nav a:nth-child(3) {
    display: none;
  }

  .brand img {
    width: 132px;
  }

  .code {
    font-size: 0.8rem;
  }

  .shot-label q {
    white-space: normal;
  }
}

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

  .agent-cursor,
  .agent-ripple {
    transition: none;
    animation: none;
  }

  .desk.is-capture::after,
  .agent-ripple.is-click {
    animation: none;
  }
}
