/* Ephemeral Phone — console + project shell
   Brand: violet → indigo → cyan on near-black. Dark only, by design. */

:root {
  color-scheme: dark;

  --bg: #07090f;
  --surface: #0d1017;
  --surface-2: #12161f;
  --raised: #171d28;
  --line: #1e2532;
  --line-strong: #2b3446;

  --text: #f2f5fa;
  --text-dim: #c3ccdb;
  --muted: #8b95a8;
  --faint: #667186;

  --violet: #6a53ff;
  --brand: #5b7cff;
  --cyan: #2fd3e8;
  --brand-soft: #9db3ff;
  --mint: #3ddc97;
  --amber: #f2c46b;
  --red: #ff6b7d;

  --brand-gradient: linear-gradient(135deg, var(--violet), var(--brand) 52%, var(--cyan));

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -24px rgba(0, 0, 0, .9);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand);

  --ease: cubic-bezier(.2, .7, .3, 1);

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: var(--brand-soft); }

:where(a, button, input, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 60;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-weight: 700; font-size: 13px;
  text-decoration: none; transform: translateY(-180%);
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- ambience ---------- */

.backdrop {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(680px 460px at 78% -8%, rgba(106, 83, 255, .30), transparent 70%),
    radial-gradient(560px 420px at 100% 22%, rgba(47, 211, 232, .10), transparent 70%),
    radial-gradient(700px 500px at 8% 6%, rgba(91, 124, 255, .12), transparent 70%);
}

.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 68px;
  padding: 0 max(22px, calc((100vw - 1220px) / 2));
  display: flex; align-items: center; gap: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(7, 9, 15, .72);
  backdrop-filter: blur(18px) saturate(140%);
}

.brand {
  display: flex; align-items: center; gap: 11px;
  color: var(--text); text-decoration: none;
  font-size: 15.5px; letter-spacing: -.015em; white-space: nowrap;
}
.brand-mark { width: 30px; height: 30px; display: block; flex: none; }
.brand-mark svg {
  width: 100%; height: 100%; display: block;
  border-radius: 8px;
  box-shadow: 0 4px 18px -4px rgba(106, 83, 255, .7);
}
.brand-word { font-weight: 350; color: var(--text-dim); }
.brand-word b { font-weight: 750; color: var(--text); }

.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 550;
  padding: 8px 11px; border-radius: 9px;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

.top-actions { display: flex; gap: 9px; align-items: center; }

.identity {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--text-dim); font-size: 11.5px; font-weight: 650;
}
.identity img {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line);
}

.gh-button { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.gh-button:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- layout ---------- */

.shell { max-width: 1220px; margin: 0 auto; padding: 76px 22px 96px; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase;
  color: var(--brand-soft);
}

h1 {
  margin: 0;
  font-size: clamp(46px, 6.6vw, 84px);
  line-height: .96;
  letter-spacing: -.045em;
  font-weight: 780;
}
h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; font-weight: 720; }
h3 { margin: 0; letter-spacing: -.02em; font-weight: 700; }

.gradient-text {
  background: linear-gradient(100deg, #a89bff, #7ea3ff 44%, #52e0f0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.lede {
  color: var(--muted); font-size: 17.5px; line-height: 1.62;
  max-width: 620px; margin: 26px 0 0;
}

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: 1fr 340px;
  align-items: end; gap: 56px;
  margin-bottom: 74px;
}

.trust {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; margin: 30px 0 0; padding: 0;
}
.trust li {
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  color: var(--text-dim);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, .02);
}

.hero-status {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(19, 24, 34, .9), rgba(11, 14, 20, .9));
  box-shadow: var(--shadow-card);
  padding: 19px 20px;
}
.hero-status strong, .hero-status span { display: block; }
.hero-status span { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }

.pulse {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(61, 220, 151, .1), 0 0 16px rgba(61, 220, 151, .6);
  animation: pulse 2.6s var(--ease) infinite;
}
.pulse.demo {
  background: var(--brand);
  box-shadow: 0 0 0 6px rgba(91, 124, 255, .1), 0 0 16px rgba(91, 124, 255, .65);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .62; transform: scale(.9); }
}

/* ---------- dashboard ---------- */

.dashboard { display: grid; gap: 28px; }

.demo-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px solid rgba(91, 124, 255, .3); border-radius: 13px;
  background: linear-gradient(100deg, rgba(106, 83, 255, .12), rgba(47, 211, 232, .06));
  color: #cdd8ee; padding: 13px 16px; font-size: 12.5px; line-height: 1.5;
}
.demo-notice b { color: #fff; }
.demo-notice a { color: var(--brand-soft); font-weight: 700; text-decoration: none; white-space: nowrap; }
.demo-notice a:hover { color: #fff; }

.section-heading, .panel-heading, .modal-title {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.phone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.phone-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 250px; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(23, 29, 40, .92), rgba(11, 14, 20, .95));
  box-shadow: var(--shadow-card);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.phone-card::after {
  content: ""; position: absolute; right: -70px; top: -70px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 124, 255, .16), transparent 70%);
}
.phone-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.card-top { display: flex; justify-content: space-between; gap: 12px; }
.phone-name { font-size: 21px; font-weight: 730; letter-spacing: -.03em; }
.phone-id {
  margin-top: 6px; font-size: 10.5px; color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.state {
  display: inline-flex; align-items: center; height: 23px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; flex: none;
}
.state.running { color: var(--mint); border-color: rgba(61, 220, 151, .32); background: rgba(61, 220, 151, .08); }
.state.locked { color: var(--amber); border-color: rgba(242, 196, 107, .32); background: rgba(242, 196, 107, .08); }
.state.error { color: var(--red); border-color: rgba(255, 107, 125, .32); background: rgba(255, 107, 125, .08); }

.phone-spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 26px 0 22px; }
.spec { border-left: 1px solid var(--line); padding-left: 11px; }
.spec:first-child { border-left: 0; padding-left: 0; }
.spec b, .spec small { display: block; }
.spec b { font-size: 14.5px; font-weight: 700; }
.spec small { margin-top: 4px; font-size: 10px; color: var(--muted); letter-spacing: .02em; }

.card-actions { position: relative; z-index: 1; margin-top: auto; display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------- controls ---------- */

.button, .mini-button, .icon-button {
  border: 0; cursor: pointer; border-radius: var(--radius-sm);
  transition: transform .15s var(--ease), background .15s var(--ease),
              border-color .15s var(--ease), color .15s var(--ease), filter .15s var(--ease);
}
.button:hover, .mini-button:hover, .icon-button:hover { transform: translateY(-1px); }
.button:active, .mini-button:active, .icon-button:active { transform: none; }

.button { padding: 10px 16px; font-weight: 680; font-size: 13px; }
.button.primary {
  color: #fff; background: var(--brand-gradient);
  box-shadow: 0 8px 22px -8px rgba(91, 124, 255, .85);
}
.button.primary:hover { filter: brightness(1.08); }
.button.ghost {
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line-strong); color: var(--text-dim);
}
.button.ghost:hover { background: rgba(255, 255, 255, .06); }
.button.full { width: 100%; margin-top: 6px; }

/* "Continue with GitHub" — app.js adds .github to the auth submit button. */
.button.github {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, #232a36, #171c26);
  border: 1px solid #39445a; color: #fff;
  box-shadow: none;
}
.button.github:hover { filter: none; background: linear-gradient(135deg, #2b3341, #1d232e); }
.button.github::before {
  content: ""; width: 17px; height: 17px; flex: none;
  background: currentColor;
  -webkit-mask: var(--gh-mask) center / contain no-repeat;
  mask: var(--gh-mask) center / contain no-repeat;
  --gh-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.4 7.4 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z'/%3E%3C/svg%3E");
}

.mini-button {
  padding: 8px 11px; font-size: 11.5px; font-weight: 620;
  color: var(--text-dim); background: var(--raised); border: 1px solid var(--line-strong);
}
.mini-button:hover { background: #1e2532; color: var(--text); }
.mini-button.primary { color: #fff; background: #2a49a8; border-color: #3a63d6; }
.mini-button.primary:hover { background: #3255bd; }
.mini-button.danger { color: #ff9aa6; }
.mini-button.danger:hover { color: #ffbcc4; border-color: rgba(255, 107, 125, .45); }

.icon-button {
  width: 33px; height: 33px; display: grid; place-items: center;
  color: var(--muted); background: var(--raised); border: 1px solid var(--line);
  font-size: 16px; line-height: 1;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }

.badge {
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--muted); padding: 6px 11px; font-size: 10.5px; letter-spacing: .04em;
  white-space: nowrap;
}

.preview-label {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint);
}

/* ---------- panels ---------- */

.lower-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 16px; }

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(17, 21, 30, .88), rgba(11, 14, 20, .92));
  box-shadow: var(--shadow-card);
  padding: 22px; min-height: 290px;
}

.capabilities { display: grid; margin: 20px 0 0; }
.capabilities div {
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); padding: 13px 0; font-size: 13.5px;
}
.capabilities dt { color: var(--muted); }
.capabilities dd { margin: 0; font-weight: 650; }

.events { margin-top: 16px; max-height: 300px; overflow: auto; }
.event {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 11px; align-items: start;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.event-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--mint); }
.event.failure .event-dot { background: var(--red); }
.event b { display: block; font-size: 12.5px; font-weight: 650; }
.event small {
  display: block; margin-top: 4px; font-size: 10px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.event time { font-size: 10px; color: var(--faint); white-space: nowrap; }

.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 58px 20px; text-align: center; color: var(--muted);
}
.empty-icon { color: var(--brand); display: flex; justify-content: center; }
.empty h3 { margin-top: 16px; color: var(--text); }
.empty p { max-width: 480px; margin: 10px auto 0; line-height: 1.55; font-size: 14px; }

/* ---------- project strip (preview only) ---------- */

.project { display: grid; gap: 24px; margin-top: 60px; padding-top: 60px; border-top: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(19, 24, 34, .8), rgba(11, 14, 20, .9));
  padding: 24px;
}
.step-index {
  display: inline-block; margin-bottom: 14px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.step h3 { font-size: 17px; }
.step p { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 10px 0 0; }
.step code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--brand-soft);
}

.cta {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 220px at 88% 0%, rgba(106, 83, 255, .16), transparent 70%),
    linear-gradient(160deg, rgba(19, 24, 34, .9), rgba(11, 14, 20, .94));
  padding: 30px;
}
.cta-copy p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 10px 0 0; }

.snippet { position: relative; }
.snippet pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #05070b;
}
.snippet code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.75; color: #c9d5ea; white-space: pre;
}
.snippet .mini-button { position: absolute; top: 10px; right: 10px; }

.honesty {
  color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0;
  border-left: 2px solid var(--amber); padding-left: 14px;
}
.honesty b { color: var(--text-dim); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 11, .5);
  padding: 52px max(22px, calc((100vw - 1220px) / 2)) 40px;
}
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 44px; align-items: start; }
.footer-brand { display: flex; gap: 13px; align-items: center; }
.footer-brand b { display: block; font-size: 14.5px; letter-spacing: -.01em; }
.footer-brand span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }

.footer-links { display: flex; gap: 56px; }
.footer-links h4 {
  margin: 0 0 12px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.footer-links a {
  display: block; margin-bottom: 9px; font-size: 13px;
  color: var(--muted); text-decoration: none;
  transition: color .15s var(--ease);
}
.footer-links a:hover { color: var(--text); }

.footer-note {
  max-width: 1220px; margin: 40px auto 0;
  padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 12.5px;
}

/* ---------- dialogs ---------- */

.modal {
  width: min(430px, calc(100vw - 30px));
  padding: 0; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: linear-gradient(170deg, #141926, #0c0f16);
  box-shadow: 0 40px 110px rgba(0, 0, 0, .7);
}
.modal.wide { width: min(580px, calc(100vw - 30px)); }
.modal::backdrop { background: rgba(3, 4, 8, .76); backdrop-filter: blur(8px); }
.modal form { padding: 26px; }
.modal h2 { margin-bottom: 10px; }
.modal p:not(.eyebrow):not(.error) { color: var(--muted); font-size: 13px; line-height: 1.55; }

label, legend { color: var(--text-dim); font-size: 12px; font-weight: 650; }
input {
  width: 100%; margin-top: 8px; padding: 12px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #080b11; color: #fff; outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 124, 255, .16); }

fieldset { border: 0; padding: 0; margin: 22px 0; display: grid; gap: 9px; }
legend { margin-bottom: 9px; }
.choice {
  display: flex; gap: 11px; cursor: pointer; padding: 13px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.choice:hover { background: rgba(255, 255, 255, .03); }
.choice:has(input:checked) { border-color: var(--brand); background: rgba(91, 124, 255, .08); }
.choice input { width: auto; margin: 3px 0 0; accent-color: var(--brand); }
.choice b, .choice small { display: block; }
.choice small { margin-top: 4px; color: var(--muted); font-weight: 400; line-height: 1.4; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }

.error { color: #ff9ba5; font-size: 12px; border-left: 2px solid var(--red); padding-left: 10px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 40;
  max-width: 360px; padding: 13px 16px;
  border-radius: 12px; background: #eaf0fa; color: #101620;
  font-size: 12.5px; font-weight: 650;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.hidden { display: none !important; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .topnav { display: none; }
  .top-actions { margin-left: auto; }
}

@media (max-width: 950px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-status { max-width: 480px; }
  .phone-grid { grid-template-columns: repeat(2, 1fr); }
  .lower-grid, .steps { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 34px; }
  .footer-links { flex-wrap: wrap; gap: 36px; }
}

@media (max-width: 620px) {
  .shell { padding: 46px 20px 72px; }
  .topbar { height: 62px; gap: 12px; }
  .badge, .gh-button span, .identity span { display: none; }
  .gh-button { padding: 10px 12px; }
  .identity { padding: 4px; }
  .hero { margin-bottom: 52px; }
  .trust { gap: 6px; }
  .phone-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .demo-notice { flex-direction: column; align-items: flex-start; gap: 9px; }
  .project { margin-top: 46px; padding-top: 46px; }
  .cta { padding: 22px; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
