/* historoo for AI apps (mcp.html). The artwork palette (gradients) is the page's art: the aurora behind the
   hero, the shine on the headline, the chat window's moving border. Everything moving stops for
   prefers-reduced-motion. */

html:has(.mcp-page), .mcp-page { overflow-x: clip; }

/* ---------- Hero ---------- */
.ai-hero { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding-top: 88px; }
.ai-aurora {
  position: absolute; inset: -120px -20vw auto; height: 760px; z-index: -1; pointer-events: none; opacity: .55;
  background:
    radial-gradient(40% 50% at 70% 40%, var(--violet) 0%, transparent 70%),
    radial-gradient(35% 45% at 88% 70%, var(--pink) 0%, transparent 70%),
    radial-gradient(35% 40% at 55% 75%, var(--blue) 0%, transparent 70%);
  filter: blur(60px);
  animation: aurora 18s ease-in-out infinite alternate;
}
@media (prefers-color-scheme: light) { .ai-aurora { opacity: .28; } }
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-4%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.02); }
}
.ai-hero h1 { font: 600 clamp(46px, 6.4vw, 88px)/.95 var(--font); letter-spacing: -.05em; margin: 0 0 26px; }
.shine {
  background: linear-gradient(100deg, var(--blue), var(--violet) 30%, var(--pink) 60%, var(--orange) 80%, var(--violet));
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: -250% 0; } }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 6px 12px 6px 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--muted); background: var(--panel); }
.kicker .tag { font: 600 11px/1 var(--font); letter-spacing: .08em; padding: 4px 6px; border-radius: 4px; background: var(--text); color: var(--bg); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.ai-hero .fine a { color: var(--muted); }

/* The chat that plays itself */
.chat { position: relative; display: flex; flex-direction: column; height: 540px; border-radius: 14px; background: #0C0C10; isolation: isolate; box-shadow: 0 30px 80px -20px rgba(60, 40, 160, .45); }
.chat::before { /* a moving gradient border */
  content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: 15px; padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), var(--blue), var(--violet), var(--pink), var(--orange), var(--blue));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }
.chat-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid #1E1E25; font-size: 13px; color: #8A8A95; }
.chat-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2A2A32; }
.chat-bar span:first-of-type { margin-left: 8px; }
.chat-live { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: #CFCFD6; }
.chat-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 18px; -webkit-mask: linear-gradient(transparent, #000 60px); mask: linear-gradient(transparent, #000 60px); }
.chat-input { display: flex; align-items: center; min-height: 48px; margin: 0 14px 14px; padding: 0 14px; border: 1px solid #24242C; border-radius: 10px; background: #111116; color: #EDEDF0; font-size: 15px; }
.caret { width: 2px; height: 18px; margin-left: 2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }

.msg { max-width: 88%; font-size: 15px; line-height: 1.5; animation: rise .35s var(--ease) both; }
.msg.user { align-self: flex-end; padding: 10px 14px; border-radius: 12px 12px 4px 12px; background: #23232B; color: #EDEDF0; }
.msg.ai { align-self: flex-start; color: #D6D6DD; }
.msg.ai b { color: #fff; font-weight: 600; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.call { align-self: flex-start; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #2A2A35; border-radius: 8px; background: #121218; font: 500 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #A9A9B4; animation: rise .3s var(--ease) both; overflow: hidden; position: relative; }
.call b { color: #CFFF4A; font-weight: 600; }
.call .args { color: #8A8AFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.call.working::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(124, 77, 255, .25), transparent); transform: translateX(-100%); animation: sweep 1.1s linear infinite; }
@keyframes sweep { to { transform: translateX(100%); } }
.call .ok { color: #CFFF4A; }
.call .wait { color: #FF8A3D; }
.hits { align-self: flex-start; display: flex; gap: 8px; animation: rise .35s var(--ease) both; }
.hit { width: 104px; border-radius: 8px; overflow: hidden; background: #16161C; border: 1px solid #24242C; font-size: 11.5px; color: #A9A9B4; }
.hit .pic { position: relative; height: 66px; background-size: cover; background-position: center; }
.hit .pic.video::after { content: '▶'; position: absolute; left: 6px; bottom: 5px; font-size: 10px; padding: 2px 5px; border-radius: 3px; background: rgba(0,0,0,.6); color: #fff; }
.hit span { display: block; padding: 6px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #8A8A95; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Works with ---------- */
.works { padding-top: 72px !important; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.works h2 { margin: 0; font-size: 14px; font-weight: 500; color: var(--dim); }
.apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.apps li { padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 15px; color: var(--muted); }
.apps li:last-child { border-style: dashed; }

/* ---------- How it works ---------- */
.flow { display: grid; grid-template-columns: 1fr 120px 1fr 120px 1fr; align-items: center; }
.node { padding: 22px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); display: grid; gap: 6px; }
.node.mid { border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(120deg, var(--blue), var(--violet), var(--pink)) border-box; border: 1px solid transparent; }
.node-k { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.node b { font-size: 20px; letter-spacing: -.02em; }
.node > span:last-child { color: var(--muted); font-size: 15px; }
.wire { position: relative; height: 2px; margin: 0 10px; background: var(--line-2); overflow: hidden; }
.wire i { position: absolute; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-mark); animation: travel 2.4s linear infinite; }
.wire i:nth-child(2) { animation-delay: .8s; background: var(--violet); }
.wire i:nth-child(3) { animation-delay: 1.6s; animation-direction: reverse; background: var(--pink); }
@keyframes travel { from { left: -6px; } to { left: 100%; } }
.flow-note { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; color: var(--muted); font-size: 16px; }
.cross { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--dim); flex: none; }
.cross::after { content: ''; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1.5px; background: var(--dim); transform: rotate(45deg); }
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 56px 0 0; padding: 0; }
.steps li { counter-increment: s; padding-top: 18px; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.steps li::before { content: '0' counter(s); font: 600 13px var(--font); color: var(--accent-text); }
.steps b { font-size: 19px; }
.steps span { color: var(--muted); }

/* ---------- Set it up ---------- */
.head p a { color: var(--text); }
.setup { display: grid; gap: 14px; max-width: 900px; }
.setup-step { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.setup-step h3 { margin: 6px 0 8px; font-size: 20px; letter-spacing: -.02em; }
.setup-step p { margin: 0 0 14px; color: var(--muted); }
.setup-step p b { color: var(--text); font-weight: 600; }
.num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.code-field { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.code-field input { font: 500 16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); outline: 0; width: 100%; max-width: 420px; }
.code-field input:focus { border-color: var(--accent-mark); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs button { font: 500 14px var(--font); padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--text); border-color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.panel code, .small code { font: 500 .92em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.snippet { position: relative; margin: 0 0 12px; border-radius: 8px; background: #0C0C10; border: 1px solid #24242C; }
.snippet pre { margin: 0; padding: 16px 70px 16px 16px; overflow-x: auto; }
.snippet code { font: 500 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #EDEDF0; white-space: pre; overflow-wrap: normal; }
.snippet code .k { color: #9DA9FF; } .snippet code .s { color: #CFFF4A; } .snippet code .hl { color: #FF8AC0; }
.copy { position: absolute; top: 10px; right: 10px; font: 600 12px var(--font); padding: 6px 10px; border-radius: 5px; border: 1px solid #33333D; background: #17171D; color: #EDEDF0; cursor: pointer; }
.copy:hover { border-color: #66666F; }
.small { font-size: 14px !important; color: var(--dim) !important; }
.prompts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.prompts li { padding: 8px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 15px; }

/* ---------- Tools ---------- */
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tools li { position: relative; display: grid; gap: 8px; align-content: start; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); transition: transform .25s var(--ease), border-color .25s; }
.tools li:hover { transform: translateY(-3px); border-color: var(--line-2); }
.tools code { justify-self: start; font: 500 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 3px 7px; border-radius: 4px; background: var(--panel-3); color: var(--accent-text); }
.tools b { font-size: 18px; letter-spacing: -.01em; }
.tools span { color: var(--muted); font-size: 15px; }
.tools li.guarded { background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(140deg, var(--orange), var(--pink)) border-box; border-color: transparent; }
.tools li.guarded code { color: var(--orange); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) { .tools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 960px) {
  .ai-hero { grid-template-columns: 1fr; gap: 40px; }
  .flow { grid-template-columns: 1fr; gap: 0; }
  .wire { width: 2px; height: 44px; margin: 0 auto; }
  .wire i { left: -2px !important; animation-name: travel-down; }
  @keyframes travel-down { from { top: -6px; } to { top: 100%; } }
  .steps { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
}
@media (max-width: 640px) {
  .ai-hero { padding-top: 40px; }
  .chat { height: 480px; }
  .setup-step { grid-template-columns: 1fr; padding: 18px; gap: 10px; }
  .tools { grid-template-columns: 1fr; }
  .hit { width: 88px; }
  .call .args { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-aurora, .shine, .chat::before, .pulse::after, .wire i, .caret, .call.working::after, .dots i { animation: none !important; }
  .msg, .call, .hits { animation: none !important; }
}

/* Install buttons: one click where the app has it (Cursor, VS Code), else the tab with what to paste */
.installs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 10px; }
.install { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); text-decoration: none; font: 600 15px/1.2 var(--font); text-align: left; cursor: pointer; overflow: hidden; isolation: isolate; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.install svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.install small { display: block; font: 500 12px var(--font); color: var(--dim); margin-bottom: 3px; }
.install::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s; background: radial-gradient(120% 140% at 0% 0%, rgba(124, 77, 255, .28), transparent 60%), radial-gradient(120% 140% at 100% 100%, rgba(255, 79, 154, .22), transparent 60%); }
.install:hover { transform: translateY(-2px); border-color: var(--violet); box-shadow: 0 10px 30px -12px rgba(124, 77, 255, .55); }
.install:hover::before, .install.ready::before { opacity: 1; }
.install.ready { border-color: var(--accent-mark); }
.install.ready small { color: var(--accent-text); }
.install:focus-visible { outline: 2px solid var(--accent-mark); outline-offset: 2px; }
.install-note { margin: 0 0 18px !important; }
.code-field input.nudge { animation: nudge .5s; border-color: var(--accent-mark); }
@keyframes nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (max-width: 1080px) { .installs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .installs { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .install, .code-field input.nudge { transition: none; animation: none; } }
