/* Kadaken.

   This lives in its own file rather than a <style> block on purpose: the
   site's Content-Security-Policy is `style-src 'self'` with no
   'unsafe-inline', so an inline stylesheet is dropped by the browser and the
   page renders naked. A real file is served from 'self' and is allowed.

   Not styles.css — that one is the retired LOZ Labs sheet and nine pages
   under /projects still load it.

   The backdrop is Agent Workbench's own _ConversationGridPainter ported to
   CSS: the same base, the same three-stop diagonal wash, the same 96px cyan
   grid, the same fade to black. The horizon plane underneath is the part the
   app can't draw. */

:root {
  color-scheme: dark;
  --bg: #070c12;
  --panel: rgba(13, 20, 32, 0.72);
  --line: #263747;
  --accent: #27d7f2;
  --green: #33ff44;
  --text: #eaf1f7;
  --muted: #8190a5;
  --grid: rgba(39, 215, 242, 0.12);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.kadaken {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ---- backdrop ---- */
.sky, .floor, .veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
}

/* Flat grid and diagonal wash, straight from the app. */
.sky {
  background:
    linear-gradient(
      135deg,
      rgba(20, 74, 82, 0.47),
      rgba(7, 12, 18, 0.13) 50%,
      rgba(32, 42, 85, 0.4)
    ),
    repeating-linear-gradient(to right, var(--grid) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px 96px),
    var(--bg);
}

/* The horizon: a flat grid laid down and tipped away from the viewer so the
   lines converge — the arcade-cabinet trick. */
.floor {
  top: auto;
  height: 62vh;
  z-index: -2;
  perspective: 190px;
  perspective-origin: 50% 0%;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000);
}
.floor::before {
  content: "";
  position: absolute;
  left: -60%;
  right: -60%;
  top: 0;
  height: 340%;
  transform: rotateX(76deg);
  transform-origin: 50% 0%;
  background:
    repeating-linear-gradient(
      to right, rgba(39, 215, 242, 0.5) 0 2px, transparent 2px 90px
    ),
    repeating-linear-gradient(
      to bottom, rgba(51, 255, 68, 0.34) 0 2px, transparent 2px 90px
    );
  animation: run 5.5s linear infinite;
}

/* Only the lines running away from you move. One cell is 90px, so the loop
   is seamless. */
@keyframes run {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 0, 0 90px; }
}

/* The glow where the floor meets the sky. */
.floor::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--accent);
  box-shadow:
    0 0 12px 2px rgba(39, 215, 242, 0.55),
    0 0 60px 18px rgba(39, 215, 242, 0.18);
}

/* The same top-to-bottom fade the app paints last, so text stays readable
   over the busiest part. */
.veil {
  z-index: -1;
  background:
    radial-gradient(120% 60% at 50% 100%, rgba(39, 215, 242, 0.1), transparent 70%),
    linear-gradient(
      to bottom, rgba(7, 12, 18, 0.55), rgba(7, 12, 18, 0.2) 30%,
      rgba(7, 12, 18, 0.72)
    );
}

@media (prefers-reduced-motion: reduce) {
  .floor::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- page ---- */
.wrap { max-width: 820px; margin: 0 auto; padding: 0 22px; }

header {
  border-bottom: 1px solid rgba(38, 55, 71, 0.8);
  background: rgba(7, 12, 18, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}
header .wrap {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 20px;
}
.name {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--green);
  font-family: var(--mono);
  text-shadow: 0 0 18px rgba(51, 255, 68, 0.45);
}
.tag {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-family: var(--mono);
}
header nav { margin-left: auto; }
header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.04em;
}
header nav a:hover { color: var(--accent); }

.intro { padding: 86px 0 26px; }
h1 {
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(39, 215, 242, 0.25);
}
.intro p { color: var(--muted); max-width: 56ch; margin: 0; font-size: 18px; }

h2 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }

/* Beta warning. Loud enough to read, quiet enough not to be the page. */
.notice {
  border: 1px solid rgba(255, 138, 42, 0.45);
  border-left-width: 3px;
  background: rgba(255, 138, 42, 0.07);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 26px 0 4px;
  font-size: 15px;
  color: var(--muted);
}
.notice strong { color: #ffb066; display: block; margin-bottom: 4px; }

.head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}
.chip.live {
  color: var(--green);
  border-color: rgba(51, 255, 68, 0.4);
  background: rgba(51, 255, 68, 0.06);
}

/* Screenshots are evidence, not the page. Three sit side by side as small
   tiles cropped to their top-left corner — where the interesting part of a
   UI shot always is — and stack to a single readable column on a phone. */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 22px;
}
.shot { margin: 0 0 20px; }
.shots .shot { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
  border: 1px solid rgba(38, 55, 71, 0.9);
  background: #070c12;
}
.shots .shot img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: left top;
}
/* One-off shots (a game's key art, a whole product view) keep their shape but
   never dominate. */
.shot.solo img { max-width: 480px; }
.shot figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 640px) {
  .shots { grid-template-columns: 1fr; gap: 18px; }
  .shots .shot img { aspect-ratio: 16 / 10; }
  .shot.solo img { max-width: 100%; }
}

/* Numbered-feeling rule lists on the terms page. */
.rules { margin: 0; padding-left: 20px; color: #c8d4e2; }
.rules li { margin: 9px 0; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(39, 215, 242, 0.09);
  border: 1px solid rgba(39, 215, 242, 0.18);
  border-radius: 5px;
  padding: 1px 5px;
  word-break: break-word;
}

.alt { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.alt a { color: var(--accent); text-decoration: none; }
.alt a:hover { text-decoration: underline; }

.support { background: rgba(13, 20, 32, 0.6); }

.thing {
  background: var(--panel);
  border: 1px solid rgba(38, 55, 71, 0.9);
  border-radius: 14px;
  padding: 28px;
  margin: 24px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.thing > p { margin: 0 0 16px; color: #c8d4e2; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.limits {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 15px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}
.limits strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.limits ul { margin: 0; padding-left: 18px; }
.limits li { margin: 3px 0; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
a.button {
  display: inline-block;
  background: var(--accent);
  color: #04212a;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 9px;
  letter-spacing: 0.01em;
  box-shadow: 0 0 22px rgba(39, 215, 242, 0.25);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
a.button:hover {
  box-shadow: 0 0 34px rgba(39, 215, 242, 0.55);
  transform: translateY(-1px);
}
a.button .sub {
  display: block;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.03em;
  opacity: 0.72;
  margin-top: 2px;
}
a.button.quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
a.button.quiet:hover { border-color: var(--accent); box-shadow: none; }

.soon {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(39, 215, 242, 0.4);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
}

footer {
  border-top: 1px solid rgba(38, 55, 71, 0.8);
  margin-top: 64px;
  padding: 28px 0 80px;
  color: var(--muted);
  font-size: 14px;
  background: rgba(7, 12, 18, 0.6);
}
footer a { color: var(--accent); }

/* ---- 404 ---- */
body.notfound {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--text);
  background:
    linear-gradient(
      135deg,
      rgba(20, 74, 82, 0.47),
      rgba(7, 12, 18, 0.13) 50%,
      rgba(32, 42, 85, 0.4)
    ),
    repeating-linear-gradient(to right, var(--grid) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px 96px),
    var(--bg);
  font: 17px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}
.notfound .code {
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: 0.24em;
  font-size: 12px;
  text-transform: uppercase;
}
.notfound h1 { font-size: 30px; margin: 12px 0 18px; letter-spacing: -0.02em; }
.notfound a {
  color: var(--green);
  text-decoration: none;
  font-family: var(--mono);
  text-shadow: 0 0 14px rgba(51, 255, 68, 0.35);
}
.notfound a:hover { text-decoration: underline; }
