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

:root {
  --bg0-h: #1d2021;
  --bg0: #282828;
  --bg1: #3c3836;
  --bg2: #504945;
  --bg4: #7c6f64;
  --fg: #ebdbb2;
  --fg3: #bdae93;
  --fg4: #a89984;
  --yellow: #fabd2f;
  --green: #b8bb26;
  --aqua: #8ec07c;
  --blue: #83a598;
  --orange: #fe8019;
  --purple: #d3869b;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg0-h);
  color: var(--fg);
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd {
  font-family: inherit;
  font-size: 0.92em;
  background: var(--bg1);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--yellow);
}
kbd { color: var(--fg); border: 1px solid var(--bg2); border-bottom-width: 2px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(29, 32, 33, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bg1);
  font-size: 13px;
}
.nav-home { color: var(--aqua); font-weight: 600; }
.nav nav { display: flex; gap: 18px; }
.nav nav a { color: var(--fg4); }
.nav nav a:hover { color: var(--fg); text-decoration: none; }

main { max-width: 960px; margin: 0 auto; padding: 0 24px 40px; }

.hero { text-align: center; padding: 72px 0 56px; }
.hero-icon { border-radius: 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
h1 { font-size: 56px; line-height: 1.1; margin: 20px 0 12px; letter-spacing: -1px; }
.tagline { color: var(--fg3); max-width: 640px; margin: 0 auto 28px; font-size: 16px; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--bg2);
  background: var(--bg0);
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { background: var(--bg1); text-decoration: none; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--bg0-h); }
.btn.primary:hover { background: #fcd05c; }
.btn.disabled { opacity: 0.55; pointer-events: none; }
.btn-icon { font-weight: 700; }

.meta { margin-top: 14px; color: var(--fg4); font-size: 13px; }
.notice { margin-top: 10px; color: var(--orange); font-size: 13px; }

.shot { margin: 40px auto 0; max-width: 900px; }
.media { margin: 24px auto 0; max-width: 900px; }
.media video, .media img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--bg2); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); background: var(--bg0); }
.media figcaption { margin-top: 10px; color: var(--fg4); font-size: 13px; text-align: center; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 8px; }
.shots .media { margin-top: 16px; }
.loop-title { margin-top: 28px; margin-bottom: 10px; }
.read-format { margin-top: 18px; align-items: start; }
.read-format h3 { margin-top: 4px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--bg2); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }

section { padding: 36px 0; }
h2 { font-size: 22px; margin-bottom: 20px; }
h2 .c { color: var(--bg4); }
h3 { font-size: 15px; margin-bottom: 6px; color: var(--aqua); }
.lead { color: var(--fg3); margin-bottom: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.card { background: var(--bg0); border: 1px solid var(--bg1); border-radius: 10px; padding: 18px; }
.card p { color: var(--fg3); font-size: 14px; }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.code {
  background: var(--bg0);
  border: 1px solid var(--bg1);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre;
}
.code .c { color: var(--bg4); }
.code .k { color: var(--orange); }
.code .s { color: var(--green); }

.tools { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.small { margin-top: 12px; color: var(--fg4); font-size: 13px; }

.steps { padding-left: 22px; color: var(--fg3); }
.steps li { margin-bottom: 6px; }
.steps strong { color: var(--fg); }
.gatekeeper { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--orange); border-radius: 10px; background: rgba(254, 128, 25, 0.06); }
.gatekeeper h3 { color: var(--orange); }
.gatekeeper .code { margin-top: 10px; }

.faq dt { color: var(--fg); font-weight: 600; margin-top: 14px; }
.faq dd { color: var(--fg3); }

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--bg1);
  color: var(--fg4);
  font-size: 13px;
}

@media (max-width: 600px) {
  h1 { font-size: 42px; }
  .nav nav a:not(:last-child) { display: none; }
  .hero { padding-top: 48px; }
}

/* .btn's display would otherwise show a hidden button. */
[hidden] { display: none !important; }

/* Titan: the icon's spectrum on the name, as wide as the name. */
h1 {
  display: inline-block;
  background: linear-gradient(90deg, #5b8cff, #a66bff 35%, #ff6b9d 65%, #ffb347);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The name is inline-block now, so the icon takes its own line. */
.hero-icon { display: block; margin: 0 auto; }

/* ---- Redesign: demos, agents, actions, safety, config, keys ---- */
main { max-width: 1040px; }
.shot { max-width: 960px; }
.lead { max-width: 820px; }

/* Demo player: tabs down the left, the video beside them. */
.player { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.player-tabs { display: flex; flex-direction: column; gap: 6px; }
.player-tabs button {
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  background: var(--bg0); border: 1px solid var(--bg1); border-radius: 8px; padding: 10px 12px;
  color: var(--fg3); font: inherit; font-size: 13px; transition: border-color .15s, background .15s;
}
.player-tabs button:hover { background: var(--bg1); }
.player-tabs button .t { display: block; color: var(--fg); font-weight: 600; }
.player-tabs button .d { display: block; font-size: 11.5px; color: var(--fg4); margin-top: 2px; }
.player-tabs button[aria-selected="true"] { border-color: var(--yellow); background: var(--bg0); }
.player-tabs button[aria-selected="true"] .t { color: var(--yellow); }
/* How far the video is, along the tab's foot. */
.player-tabs button i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--yellow); }
.player-stage { position: relative; }
.player-stage video {
  display: block; width: 100%; aspect-ratio: 1728 / 994; height: auto; border-radius: 12px;
  border: 1px solid var(--bg2); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); background: var(--bg0);
}
.player-toggle {
  position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--bg2); background: rgba(29, 32, 33, 0.85); color: var(--fg); cursor: pointer; font-size: 11px;
  opacity: 0; transition: opacity .15s;
}
.player-stage:hover .player-toggle, .player-toggle:focus-visible { opacity: 1; }
.player-caption { grid-column: 2; color: var(--fg4); font-size: 13px; margin-top: -4px; min-height: 3.2em; }

/* Segmented tabs. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg0); border: 1px solid var(--bg1); border-radius: 10px; margin-bottom: 14px; }
.seg button {
  font: inherit; font-size: 13px; color: var(--fg4); background: transparent; border: 0; border-radius: 7px;
  padding: 6px 12px; cursor: pointer;
}
.seg button:hover { color: var(--fg); }
.seg button[aria-selected="true"] { background: var(--bg1); color: var(--yellow); }
.small-seg { margin-bottom: 10px; }
.small-seg button { font-size: 12px; padding: 4px 10px; }

/* A terminal window. */
.term { background: var(--bg0); border: 1px solid var(--bg1); border-radius: 10px; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--bg1); background: #232526; }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--bg2); }
.term-bar em { font-style: normal; color: var(--fg4); font-size: 12px; margin-left: 8px; flex: 1; }
.term pre, .term .code {
  margin: 0; border: 0; border-radius: 0; padding: 14px 16px; overflow-x: auto; font-family: inherit;
  font-size: 13px; line-height: 1.6; white-space: pre; color: var(--fg); min-height: 150px; background: transparent;
}
.term .p { color: var(--aqua); }
.term .m { color: var(--fg4); }
.term .r { color: var(--fg); }
.term .o { color: var(--green); }
.term .e { color: var(--orange); }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -0.2em; background: var(--fg3); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Agents. */
.agent-panels { margin-bottom: 18px; }
.agent-panel { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.agent-panel h3 { margin-top: 4px; }
.agent-panel .small:first-of-type { margin-top: 6px; }
.table-wrap { overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare th, .compare td { padding: 9px 12px; border-bottom: 1px solid var(--bg1); text-align: left; vertical-align: top; }
.compare th { color: var(--fg); font-weight: 600; }
.compare td:first-child { color: var(--fg3); }
.compare td.y { color: var(--green); white-space: nowrap; }
.compare td.y span, .compare td.n { color: var(--fg4); font-size: 12px; }

/* Actions explorer. */
.actions { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-bottom: 10px; }
.actions-list input, .keys-filter {
  width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--bg2);
  background: var(--bg0); color: var(--fg); margin-bottom: 8px;
}
.actions-list input:focus, .keys-filter:focus { outline: none; border-color: var(--yellow); }
.actions-list ul { list-style: none; max-height: 420px; overflow-y: auto; border: 1px solid var(--bg1); border-radius: 8px; background: var(--bg0); }
.actions-list li.group { padding: 8px 12px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--bg4); }
.actions-list li button {
  width: 100%; text-align: left; font: inherit; font-size: 13px; border: 0; background: transparent; color: var(--fg3);
  padding: 5px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px;
}
.actions-list li button:hover { background: var(--bg1); color: var(--fg); }
.actions-list li button[aria-current="true"] { background: var(--bg1); color: var(--yellow); }
.actions-list li button kbd { font-size: 11px; padding: 0 .35em; }
.actions-detail .term pre { min-height: 230px; white-space: pre-wrap; word-break: break-word; }

/* Safety demo. */
.safety { background: var(--bg0); border: 1px solid var(--bg1); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.safety-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.safety-controls .label, .presets .label { color: var(--orange); font-size: 13px; }
.panes-demo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 14px; }
.pane-box {
  position: relative; text-align: left; font: inherit; font-size: 13px; color: var(--fg3); padding: 14px 12px 30px;
  border: 1px solid var(--bg2); border-radius: 8px; background: var(--bg0-h); min-height: 96px; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.pane-box b { display: block; color: var(--fg); margin-bottom: 2px; }
.pane-box span { font-size: 12px; color: var(--fg4); }
.pane-box em { position: absolute; left: 12px; bottom: 9px; font-style: normal; font-size: 11.5px; font-weight: 600; }
.pane-box.agent { cursor: default; border-color: var(--purple); }
.pane-box.agent b { color: var(--purple); }
.pane-box:not(.agent):hover { border-color: var(--fg4); }
.pane-box.ok { border-color: var(--green); } .pane-box.ok em { color: var(--green); }
.pane-box.ask { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(254, 128, 25, 0.15); } .pane-box.ask em { color: var(--orange); }
.pane-box.no { border-color: #fb4934; } .pane-box.no em { color: #fb4934; }
.safety-result { font-size: 13px; color: var(--fg3); min-height: 2.6em; }

/* Config builder. */
.setup { padding-left: 22px; color: var(--fg3); margin-bottom: 20px; max-width: 860px; }
.setup li { margin-bottom: 8px; }
.setup strong { color: var(--fg); }
.builder { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.builder-form { display: flex; flex-direction: column; gap: 12px; }
.presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.presets button, .copy {
  font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--bg2);
  background: var(--bg0); color: var(--fg3); cursor: pointer;
}
.presets button:hover, .copy:hover { color: var(--fg); border-color: var(--fg4); }
.builder fieldset { border: 1px solid var(--bg1); border-radius: 10px; padding: 10px 14px 12px; background: var(--bg0); }
.builder legend { color: var(--aqua); font-size: 13px; font-weight: 600; padding: 0 6px; }
.builder label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--fg3); margin-top: 7px; flex-wrap: wrap; }
.builder label.check { justify-content: flex-start; }
.builder input:not([type]), .builder input[type="number"], .builder select {
  font: inherit; font-size: 12.5px; background: var(--bg0-h); color: var(--fg); border: 1px solid var(--bg2);
  border-radius: 6px; padding: 4px 8px; min-width: 0; width: 175px;
}
.builder input[type="number"] { width: 80px; }
.builder input[type="range"] { width: 100%; accent-color: var(--yellow); }
.builder input[type="checkbox"] { accent-color: var(--yellow); }
.builder .out { color: var(--yellow); margin-left: auto; }
.builder-out { position: sticky; top: 64px; }
.builder-out .code { max-height: 560px; overflow-y: auto; min-height: 300px; }
.code .flash { background: rgba(250, 189, 47, 0.14); border-radius: 3px; }

/* Keys. */
.keys-filter { max-width: 420px; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 18px; margin-top: 6px; }
.keys div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--bg1); font-size: 13px; color: var(--fg3); }
.keys div span:last-child { white-space: nowrap; }
.keys .none { color: var(--fg4); grid-column: 1 / -1; border: 0; }

/* Pictures open larger on click. */
.zoomable img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.82); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

@media (max-width: 860px) {
  .player, .actions, .builder, .agent-panel { grid-template-columns: 1fr; }
  .player-tabs { flex-direction: row; overflow-x: auto; }
  .player-tabs button { min-width: 190px; }
  .player-caption { grid-column: 1; }
  .panes-demo { grid-template-columns: repeat(2, 1fr); }
  .builder-out { position: static; }
}
/* Anchors land below the sticky nav. */
section[id] { scroll-margin-top: 56px; }
/* Wide lines scroll inside their box rather than widening the column. */
.player { grid-template-columns: 260px minmax(0, 1fr); }
.actions { grid-template-columns: 300px minmax(0, 1fr); }
.builder { grid-template-columns: 360px minmax(0, 1fr); }
.agent-panel { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (max-width: 860px) {
  .player, .actions, .builder, .agent-panel { grid-template-columns: minmax(0, 1fr); }
}
