/*
 * Codename Nika Free: the app shell.
 * Same look as the front door (/homepage2): black ground, the pixel title face, the yellow main button,
 * lavender accents. The company a visitor builds brings its own colors and type, inside the preview.
 */
@font-face {
  font-family: "Geist Pixel Square";
  src: url("/free/fonts/GeistPixel-Square.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --site: #000;
  --bg: #121214;
  --panel: #18181a;
  --card: #242428;
  --control: #3c3c40;
  --fill-1: rgba(252, 252, 252, .06);
  --fill-2: rgba(252, 252, 252, .1);
  --fill-3: rgba(252, 252, 252, .16);
  --line: rgba(252, 252, 252, .14);
  --ink-1: #fcfcfc;
  --ink-2: #a4a4aa;
  --ink-3: #8e8e94;
  --lavender: #c8a9eb;
  --yellow: #e2e626;
  --yellow-hi: #ecf04a;
  --coral: #f0634f;
  --grad-golden: linear-gradient(90deg, #caaaeb 0%, #d1c0a6 45%, #e4e728 100%);
  --font-text: "Helvetica Neue", Helvetica, Inter, "Segoe UI", Arial, sans-serif;
  --font-pixel: "Geist Pixel Square", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-xs: 6px;
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --dock-h: 76px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--site);
  color: var(--ink-1);
  font: 400 16px/1.45 var(--font-text);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: var(--r-s); background: var(--yellow); color: #121214; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ── Top bar ─────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(252, 252, 252, .08);
}
.top__brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; font-weight: 500; font-size: 15px; }
.top__brand img { width: 34px; height: 34px; border-radius: 50%; background: #fff; flex: none; }
.top__brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__brand em {
  font: 400 12px/1 var(--font-pixel); font-style: normal; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 7px 4px; border-radius: var(--r-xs); background: var(--yellow); color: #121214;
}
.top__nav { display: flex; align-items: center; gap: 8px; flex: none; }

/* ── Buttons and chips ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--r-s);
  font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .16s var(--ease), transform .16s var(--ease), border-color .16s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--main { background: var(--yellow); color: #121214; }
.btn--main:hover { background: var(--yellow-hi); }
.btn--ghost { background: var(--fill-2); color: var(--ink-1); }
.btn--ghost:hover { background: var(--fill-3); }
.btn--line { background: transparent; color: var(--ink-1); border-color: rgba(252, 252, 252, .3); }
.btn--line:hover { border-color: var(--ink-1); }
.btn[disabled] { opacity: .55; cursor: default; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 12px; border: 0; border-radius: var(--r-xs);
  background: var(--fill-2); color: #e4e4ea; font-size: 13px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .16s var(--ease);
}
.chip:hover { background: var(--fill-3); }
.chip--quiet { background: transparent; color: var(--ink-2); }
.chip--quiet:hover { background: var(--fill-1); color: var(--ink-1); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink-1); color: #121214; }

/* ── Screen 1: the box ───────────────────────────────────── */
main { display: block; }
.home { width: min(1080px, 100%); margin: 0 auto; padding: clamp(36px, 8vh, 96px) var(--gutter) 72px; }
.eyebrow { font: 400 13px/1.2 var(--font-pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--lavender); }
.title {
  margin-top: 14px;
  font: 400 clamp(42px, 13.4vw, 132px)/.92 var(--font-pixel);
  letter-spacing: -.03em;
  text-wrap: balance;
}
.title span { display: block; }
.title span + span { background: var(--grad-golden); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin-top: 22px; max-width: 46ch; font-size: clamp(17px, 2.1vw, 22px); line-height: 1.35; color: var(--ink-2); }
.lede b { color: var(--ink-1); font-weight: 500; }

.composer {
  margin-top: 32px; padding: 6px;
  border-radius: var(--r-l); border: 1px solid var(--line);
  background: rgba(64, 64, 72, .42);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  transition: border-color .2s var(--ease);
}
.composer:focus-within { border-color: rgba(200, 169, 235, .7); }
.composer textarea {
  display: block; width: 100%; min-height: 84px; resize: none;
  padding: 16px 16px 8px; border: 0; outline: 0; background: transparent;
  font-size: clamp(18px, 2.4vw, 24px); line-height: 1.3; color: var(--ink-1);
}
.composer textarea::placeholder { color: var(--ink-3); }
.composer__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 6px 6px 16px; }
.composer__count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.composer .btn { min-height: 48px; padding: 0 26px; font-size: 16px; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.examples .chip { min-height: 36px; white-space: normal; text-align: left; line-height: 1.2; padding: 8px 12px; }
.fine { margin-top: 18px; font-size: 13px; color: var(--ink-3); max-width: 60ch; }

.mine { margin-top: 56px; }
.h2 { font: 400 13px/1.2 var(--font-pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.mine__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 14px; }
.mine__item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 40px 12px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel); text-align: left; min-width: 0; }
.mine__item:hover { background: var(--card); }
.mine__item svg { width: 40px; height: 40px; flex: none; }
.mine__item b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine__item span { display: block; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine__item > div { min-width: 0; }
.mine__x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 18px; line-height: 1; }
.mine__x:hover { background: var(--fill-2); color: var(--ink-1); }

.gets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 64px; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--line); }
.gets > div { background: var(--bg); padding: 22px; }
.gets b { display: block; font-weight: 500; font-size: 17px; }
.gets p { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.gets i { display: block; font: 400 12px/1 var(--font-pixel); font-style: normal; letter-spacing: .06em; color: var(--lavender); margin-bottom: 14px; }
@media (max-width: 900px) { .gets { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .gets { grid-template-columns: 1fr; } }

/* ── Screen 2: the company ───────────────────────────────── */
.kit { width: min(1440px, 100%); margin: 0 auto; padding: 20px var(--gutter) calc(var(--dock-h) + 40px); }
.note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-bottom: 16px; padding: 12px 14px; border-radius: var(--r-m);
  background: rgba(200, 169, 235, .14); border: 1px solid rgba(200, 169, 235, .36); font-size: 14px;
}
.note div { display: flex; gap: 8px; flex-wrap: wrap; }
.kit__head { display: flex; align-items: center; gap: 14px; }
.kit__mark { flex: none; width: 60px; height: 60px; }
.kit__mark svg { width: 100%; height: 100%; display: block; }
.kit__id { flex: 1; min-width: 0; }
.kit__name {
  display: block; width: 100%; padding: 2px 6px; margin-left: -6px; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent;
  font-size: clamp(24px, 3.4vw, 36px); font-weight: 500; line-height: 1.15; letter-spacing: -.025em; color: var(--ink-1); text-overflow: ellipsis;
}
.kit__name:hover { border-color: var(--line); }
.kit__name:focus { border-color: rgba(200, 169, 235, .7); outline: 0; background: var(--fill-1); }
.kit__tag { margin-top: 2px; color: var(--ink-2); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit__acts { display: flex; gap: 8px; flex: none; }
.kit__reads { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.kit__reads q { quotes: "\201C" "\201D"; color: var(--ink-1); display: inline-block; max-width: 100%; }
.sel { appearance: none; -webkit-appearance: none; min-height: 30px; padding: 0 28px 0 10px; border: 0; border-radius: var(--r-xs); background: var(--fill-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23fcfcfc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center / 10px; color: #e4e4ea; font-size: 13px; font-weight: 500; }
.sel option { background: #242428; color: #fcfcfc; }

.kit__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 20px; margin-top: 18px; align-items: start; }
@media (max-width: 1000px) { .kit__cols { grid-template-columns: minmax(0, 1fr); } }

.stage { border: 1px solid var(--line); border-radius: var(--r-l); background: #0d0d10; overflow: hidden; position: sticky; top: 68px; }
@media (max-width: 1000px) { .stage { position: static; } }
.stage__bar { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.stage__hint { flex: 1; min-width: 0; text-align: center; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--fill-1); flex: none; }
.seg button { min-height: 28px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--control); color: var(--ink-1); }
.stage__frame { position: relative; height: clamp(440px, calc(100vh - 274px - var(--dock-h)), 920px); height: clamp(440px, calc(100dvh - 274px - var(--dock-h)), 920px); overflow: hidden; background: #0d0d10; }
.stage__frame iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; background: #fff; transform-origin: 0 0; }
.stage__frame.is-phone { display: grid; place-items: center; padding: 14px; }
.stage__frame.is-phone iframe { position: static; width: min(390px, 100%); height: 100%; border-radius: 22px; box-shadow: 0 0 0 6px #242428, 0 20px 60px rgba(0, 0, 0, .6); transform: none !important; }
@media (max-width: 700px) {
  .stage__bar .seg { display: none; }
  .stage__hint { text-align: left; padding-left: 6px; }
  .stage__frame { height: min(72vh, 640px); height: min(72dvh, 640px); }
  .stage__frame.is-phone { padding: 0; }
  .stage__frame.is-phone iframe { width: 100%; border-radius: 0; box-shadow: none; }
}
.building { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: #0d0d10; transition: opacity .35s var(--ease); }
.building.is-out { opacity: 0; pointer-events: none; }
.building ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font: 400 15px/1.2 var(--font-pixel); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.building li { display: flex; align-items: center; gap: 10px; transition: color .2s; }
.building li::before { content: ""; width: 8px; height: 8px; background: var(--control); transition: background-color .2s; }
.building li.is-done { color: var(--ink-1); }
.building li.is-done::before { background: var(--yellow); }

.side { display: grid; gap: 14px; min-width: 0; }
.tabs { display: flex; padding: 3px; border-radius: 10px; background: var(--fill-1); }
.tabs button { flex: 1; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--control); color: var(--ink-1); }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); min-width: 0; }
.panel__lede { color: var(--ink-2); font-size: 14px; }
.h { margin: 22px 0 10px; font: 400 12px/1.2 var(--font-pixel); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.h:first-child { margin-top: 0; }
.hint { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row--start { justify-content: flex-start; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.quote { font-size: 17px; line-height: 1.3; min-width: 0; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); height: 52px; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line); }
.swatches span { display: block; }
.swatch-meta { margin-top: 10px; }
.swatch-meta span { font-size: 14px; color: var(--ink-2); }
.typebox { padding: 14px 16px; border-radius: var(--r-s); background: var(--card); min-width: 0; overflow: hidden; }
.typebox b { display: block; font-size: 30px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.typebox span { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.markrow { display: flex; align-items: center; gap: 16px; }
.markrow > div:first-child { width: 84px; height: 84px; flex: none; padding: 10px; border-radius: var(--r-s); background: var(--card); }
.markrow svg { width: 100%; height: 100%; display: block; }
.markrow .chips { flex: 1; }

.team { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.team li { display: flex; gap: 12px; padding: 12px; border-radius: var(--r-s); background: var(--card); }
.team i { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: rgba(200, 169, 235, .18); color: var(--lavender); font: 400 12px/1 var(--font-pixel); font-style: normal; letter-spacing: .04em; }
.team li:first-child i { background: var(--yellow); color: #121214; }
.team b { font-weight: 500; }
.team p { margin-top: 3px; font-size: 14px; color: var(--ink-2); }
.moves { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: move; display: grid; gap: 8px; }
.moves li { counter-increment: move; display: flex; gap: 12px; padding: 14px 12px; border-radius: var(--r-s); background: var(--card); font-size: 15px; line-height: 1.4; }
.moves li::before { content: counter(move); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill-3); font-size: 13px; font-weight: 600; }
.post { display: block; width: 100%; margin-top: 14px; padding: 14px; min-height: 150px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); font-size: 15px; line-height: 1.45; }
.post:focus { outline: 0; border-color: rgba(200, 169, 235, .7); }
.panel .row--start { margin-top: 12px; }

.ai { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-l); border: 1px dashed rgba(200, 169, 235, .5); background: rgba(200, 169, 235, .07); }
.ai b { font-weight: 500; font-size: 17px; }
.ai p { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.ai .btn { justify-self: start; }
.ai__status { min-height: 0; margin: 0 !important; font-size: 14px; color: var(--ink-1) !important; }
.ai__status:empty { display: none; }
.ai__status.is-bad { color: #ffb4a6 !important; }

.real { padding: 22px; border-radius: var(--r-l); background: var(--bg); border: 1px solid var(--line); }
.real h3 { margin-top: 10px; font: 400 clamp(30px, 4vw, 40px)/1 var(--font-pixel); letter-spacing: -.02em; }
.real p { margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.real .btn { margin-top: 18px; }
.real small { display: block; margin-top: 12px; font-size: 13px; color: var(--ink-3); }

/* ── Bottom bar ──────────────────────────────────────────── */
.dock {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 8px; padding: 8px; width: max-content; max-width: calc(100% - 24px);
  border-radius: 18px; border: 1px solid var(--line);
  background: rgba(40, 40, 46, .78);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.dock .btn { min-height: 44px; padding: 0 18px; }
@media (max-width: 420px) { .dock { width: calc(100% - 24px); } .dock .btn { flex: 1; padding: 0 10px; } }

/* ── Dialogs and toast ───────────────────────────────────── */
.dlg { width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); color: var(--ink-1); overflow: auto; }
.dlg::backdrop { background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg__in { padding: 22px; display: grid; gap: 14px; }
.dlg__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dlg h2 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.dlg p { color: var(--ink-2); font-size: 14px; }
.dlg__x { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--fill-2); font-size: 20px; line-height: 1; }
.dlg__x:hover { background: var(--fill-3); }
.linkrow { display: flex; gap: 8px; }
.linkrow input { flex: 1; min-width: 0; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); font-size: 14px; color: var(--ink-2); }
.cardwrap { border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.cardwrap canvas { display: block; width: 100%; height: auto; }
.shares { display: flex; flex-wrap: wrap; gap: 6px; }
.steps-list { margin: 0; padding-left: 20px; color: var(--ink-1); font-size: 15px; display: grid; gap: 8px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 22px); transform: translate(-50%, 12px); z-index: 60;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: var(--ink-1); color: #121214; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
body.no-dock .toast { bottom: 24px; }

.foot { padding: 28px var(--gutter) 36px; border-top: 1px solid rgba(252, 252, 252, .08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: 13px; color: var(--ink-3); }
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink-1); }
body.has-dock .foot { padding-bottom: calc(var(--dock-h) + 36px); }

@media (max-width: 640px) {
  .kit__head { flex-wrap: wrap; }
  .kit__acts { width: 100%; }
  .kit__acts .chip { flex: 1; }
  .top__nav .chip--quiet { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
