/* Pi GPUI site. Colors are the app's Ayu Dark theme, fonts are the app's:
   the macOS system font for text and JetBrains Mono NL for code. */

@font-face {
  font-family: "JetBrains Mono NL";
  src: url("/fonts/JetBrainsMonoNL-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono NL";
  src: url("/fonts/JetBrainsMonoNL-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0e14;
  --bg-2: #0d1016;
  --panel: #1f2127;
  --line: #2d2f34;
  --line-2: #3f4043;
  --ink: #bfbdb6;
  --ink-strong: #ece9df;
  --muted: #8a8986;
  --dim: #696a6a;
  --accent: #e6b450;
  --info: #5ac1fe;
  --ok: #aad94c;
  --err: #ef7177;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --mono: "JetBrains Mono NL", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }
code, .mono { font-family: var(--mono); }
code { font-size: 0.88em; color: var(--ink-strong); background: var(--panel); padding: 0.1em 0.35em; border-radius: 4px; }
.muted { color: var(--dim); }
::selection { background: rgba(230, 180, 80, 0.3); }

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
}
.nav::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(45, 47, 52, 0.6);
  z-index: -1;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-strong); font-weight: 600; letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 14px; transition: color 0.2s; }
.nav nav a:hover { color: var(--ink-strong); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink-strong);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); background: #fff; }
.btn-ghost { background: transparent; color: var(--ink-strong); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--muted); }
.btn-small { height: 34px; padding: 0 14px; font-size: 13px; }

/* Hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 110px 24px 56px;
  /* Left-aligned like x.ai, so the typed word grows to the right without moving the line. */
  text-align: left;
  position: relative;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 12px/1 var(--mono);
  color: var(--muted);
  text-decoration: none;
  background: rgba(31, 33, 39, 0.5);
  transition: border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--line-2); color: var(--ink); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pill-sep { color: var(--dim); }
h1 {
  margin: 28px 0 22px;
  font-size: clamp(40px, 7.6vw, 100px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: var(--ink-strong);
}
.rotor { display: inline-flex; white-space: nowrap; align-items: baseline; color: var(--accent); font-family: var(--mono); font-weight: 400; letter-spacing: -0.07em; }
.caret {
  display: inline-block;
  width: 0.08em;
  height: 0.82em;
  margin-left: 0.06em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
  transform: translateY(0.08em);
}
@keyframes blink { 50% { opacity: 0; } }
.lead { max-width: 640px; margin: 0; font-size: clamp(17px, 2vw, 20px); color: var(--muted); }
.cta { display: flex; gap: 12px; justify-content: flex-start; flex-wrap: wrap; margin-top: 34px; }
.hint { margin-top: 18px; font-size: 12px; color: var(--dim); }
.hint a { color: var(--muted); }

/* Demo video */
.demo { max-width: 1240px; margin: 0 auto; padding: 0 24px 40px; position: relative; }
.demo::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 6%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(230, 180, 80, 0.16), rgba(90, 193, 254, 0.07) 45%, transparent 70%);
  filter: blur(40px);
  z-index: -1;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.55; transform: scale(1.04); } }
.frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.frame video { width: 100%; aspect-ratio: 1360 / 860; }
.caption { text-align: center; color: var(--dim); font-size: 12px; margin: 16px auto 0; max-width: 680px; }

/* Built-with strip */
.strip {
  max-width: var(--max);
  margin: 40px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.strip div { padding: 26px 20px; border-left: 1px solid var(--line); }
.strip div:first-child { border-left: 0; }
.strip .label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin-bottom: 6px; }
.strip strong { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-strong); }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: 120px 24px 0; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); margin: 0 0 16px; }
h2 {
  margin: 0 0 40px;
  max-width: 20ch;
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink-strong);
}
h3 { margin: 14px 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-strong); }

/* Feature cards with a light that follows the pointer */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.card {
  position: relative;
  padding: 28px 26px 30px;
  background: var(--bg);
  transition: background 0.3s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx, -400px) var(--my, -400px), rgba(230, 180, 80, 0.09), transparent 60%);
  pointer-events: none;
}
.card:hover { background: #0e1219; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { display: inline-block; font-size: 12px; color: var(--accent); background: rgba(230, 180, 80, 0.08); border: 1px solid rgba(230, 180, 80, 0.22); padding: 3px 8px; border-radius: 6px; }

/* Tour */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button {
  font: 13px/1 var(--mono);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.2s, border-color 0.2s;
}
.tabs button:hover { color: var(--ink); border-color: var(--line-2); }
.tabs button[aria-selected="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: rgba(11, 14, 20, 0.45);
  transform-origin: left;
  animation: progress var(--tour-ms, 6000ms) linear forwards;
}
.tour.paused .tabs button::after { animation-play-state: paused; }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.gallery { display: grid; }
.gallery figure { grid-area: 1 / 1; margin: 0; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }
.gallery figure.active { opacity: 1; pointer-events: auto; }
.gallery figcaption {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  background: var(--bg-2);
}

/* How it works */
.how { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.how p { color: var(--muted); font-size: 17px; }
.diagram {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  overflow-x: auto;
}
.c-accent { color: var(--accent); }
.c-info { color: var(--info); }

/* Keys */
.keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; margin: 0; }
.keys div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.keys dt { color: var(--ink-strong); }
.keys dt::before { content: ""; }
.keys dd { margin: 0; color: var(--muted); font-family: var(--sans); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 0;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-strong);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--dim); transition: transform 0.25s; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq details p { margin: -6px 0 22px; max-width: 760px; color: var(--muted); }

.final { text-align: center; padding-bottom: 40px; }
.final h2 { margin: 0 auto 8px; }
.final .cta { justify-content: center; }

.footer {
  max-width: var(--max);
  margin: 120px auto 0;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.footer a { color: var(--muted); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav nav { display: none; }
  .nav .btn-small { margin-left: auto; }
  .grid { grid-template-columns: 1fr 1fr; }
  .how { grid-template-columns: 1fr; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip div:nth-child(3) { border-left: 0; }
  .strip div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .hero { padding-top: 72px; }
  .grid { grid-template-columns: 1fr; }
  .keys { grid-template-columns: 1fr; }
  .section { padding-top: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
