/* The landing page: navigation, the hero with its phone demo, the sections
   below it, and the log in / sign up dialog. Builds on base.css and device.css. */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  position: relative;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.55;
}

/* A soft glow behind the top of the page. */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 980px;
  background:
    radial-gradient(52% 46% at 78% 30%, rgba(124, 108, 255, 0.24), transparent 72%),
    radial-gradient(40% 36% at 10% 4%, rgba(79, 163, 255, 0.15), transparent 72%);
  pointer-events: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  width: min(1160px, 100% - 40px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 40;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.btn-lg {
  height: 48px;
  padding: 0 22px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 650;
}

.btn-lg .icon {
  width: 18px;
  height: 18px;
}

/* ---- navigation ------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  background: rgba(10, 12, 16, 0.74);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s;
}

.nav.is-stuck {
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 30px;
  height: 66px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 26px;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.nav .btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 15px;
}

.nav-brand:focus-visible,
.nav-links a:focus-visible,
.idea-chip:focus-visible,
.demo-tabs button:focus-visible,
.auth-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.hero {
  padding: 56px 0 84px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 11px;
  border: 1px solid rgba(124, 108, 255, 0.4);
  border-radius: 999px;
  background: rgba(124, 108, 255, 0.12);
  color: #cdc7ff;
  font-size: 13px;
  font-weight: 600;
}

.hero h1 {
  margin-top: 20px;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.grad {
  background: linear-gradient(100deg, #a99cff 0%, #6fb6ff 55%, #7ee0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 33em;
  margin-top: 22px;
  color: var(--text-dim);
  font-size: clamp(17px, 1.5vw, 19px);
  text-wrap: pretty;
}

/* The idea box. The demo types into the "ghost" layer; once the visitor
   clicks in or types (.is-own), it is an ordinary text field. */
.prompt {
  max-width: 600px;
  margin-top: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--bg-1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.prompt:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 24px 60px rgba(0, 0, 0, 0.38);
}

.prompt-field {
  position: relative;
}

.prompt textarea,
.prompt-ghost {
  padding: 20px 22px 4px;
  font-size: 18px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.prompt textarea {
  display: block;
  width: 100%;
  min-height: 78px;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
}

.prompt:not(.is-own) textarea::placeholder {
  color: transparent;
}

.prompt-ghost {
  position: absolute;
  inset: 0;
  overflow: hidden;
  white-space: pre-wrap;
  pointer-events: none;
}

.prompt.is-own .prompt-ghost {
  display: none;
}

.ghost-caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 2px;
  background: var(--accent-2);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(2, jump-none) infinite;
}

.prompt-ghost.is-typing .ghost-caret {
  animation: none;
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0; }
}

.prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 10px 22px;
}

.prompt-hint {
  color: var(--text-faint);
  font-size: 13px;
}

#buildBtn {
  transition: background 0.15s, filter 0.15s, transform 0.12s;
}

#buildBtn.is-pressed {
  filter: brightness(1.25);
  transform: scale(0.94);
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-dim);
  font-size: 14px;
}

.hero-notes li,
.ticks li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-notes .icon,
.ticks .icon {
  color: var(--ok);
}

/* The phone. Its width is set here; landing.js scales the device to fit it. */
.demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  isolation: isolate;
}

.demo-phone {
  position: relative;
  width: clamp(236px, min(29vw, (100vh - 220px) * 0.462), 340px);
  width: clamp(236px, min(29vw, (100svh - 220px) * 0.462), 340px);
}

.demo-phone::before {
  content: "";
  position: absolute;
  inset: 6% -34%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(124, 108, 255, 0.4), transparent);
  filter: blur(24px);
}

.demo-layer,
.demo-app,
.demo-taps {
  position: absolute;
  inset: 0;
}

.demo-app {
  animation: app-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes app-in {
  from { opacity: 0; transform: scale(0.94); }
}

.demo-taps {
  overflow: hidden;
  pointer-events: none;
}

/* The pretend fingertip that shows an app being used. */
.demo-tap {
  position: absolute;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: rgba(150, 150, 165, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 3.5px rgba(0, 0, 0, 0.22), 0 8px 22px rgba(0, 0, 0, 0.35);
  animation: tap 0.78s ease-out forwards;
}

@keyframes tap {
  0% { opacity: 0; transform: scale(1.7); }
  35% { opacity: 1; transform: scale(1); }
  50% { opacity: 1; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.45); }
}

.demo-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-1);
}

.demo-tabs button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.demo-tabs button:hover {
  color: var(--text);
}

.demo-tabs button[aria-pressed="true"] {
  background: var(--bg-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.demo-caption {
  color: var(--text-faint);
  font-size: 13px;
}

/* ---- sections -------------------------------------------------------------- */

.section {
  padding: 88px 0;
}

.section-alt {
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 26, 35, 0.55), rgba(16, 19, 26, 0.2));
}

.section-head {
  max-width: 660px;
  margin: 0 auto 46px;
  text-align: center;
}

.section h2,
.cta h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-head p {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 18px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step,
.feature {
  padding: 26px 24px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
}

.step::before {
  content: counter(step);
  counter-increment: step;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.step h3,
.feature h3 {
  margin: 18px 0 6px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.step p,
.feature p {
  color: var(--text-dim);
}

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

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: #b9b0ff;
}

.feature-icon .icon {
  width: 22px;
  height: 22px;
}

/* The builder, drawn: a chat on the left, the app's code on the right. */
.showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: 56px;
}

.showcase-copy > p {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 18px;
}

.ticks {
  display: grid;
  gap: 10px;
  margin: 22px 0 28px;
  padding: 0;
  list-style: none;
}

.ticks li {
  align-items: flex-start;
}

.ticks .icon {
  margin-top: 4px;
}

.mock {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--bg-1);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5);
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: 13px;
}

.mock-dots {
  display: inline-flex;
  gap: 6px;
}

.mock-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.mock-title {
  color: var(--text);
  font-weight: 600;
}

.mock-files {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
}

.mock-files span {
  padding: 4px 9px;
  border-radius: 7px;
}

.mock-files .is-active {
  background: var(--bg-3);
  color: var(--text);
}

.mock-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.mock-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  border-right: 1px solid var(--line);
}

.bubble {
  max-width: 94%;
  padding: 9px 12px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.45;
}

.bubble.me {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--accent);
  color: #fff;
}

.bubble.ai {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: var(--bg-3);
}

.mock-code {
  margin: 0;
  padding: 16px 18px;
  overflow: hidden;
  background: var(--bg-0);
  color: #c8d0e0;
  font: 12.5px/1.7 var(--mono);
  white-space: pre;
}

.tok-k { color: #c792ea; }
.tok-f { color: #7aa2f7; }
.tok-n { color: #ff9e64; }
.tok-c { color: #5f6a85; }

.ideas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 920px;
  margin: 0 auto;
}

.idea-chip {
  padding: 10px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-1);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.idea-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.idea-chip:active {
  transform: translateY(1px);
}

.cta {
  margin: 88px 0;
  padding: 60px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    radial-gradient(70% 130% at 50% 0%, rgba(124, 108, 255, 0.3), transparent 70%),
    var(--bg-1);
  text-align: center;
}

.cta p {
  margin: 14px 0 28px;
  color: var(--text-dim);
  font-size: 18px;
}

.footer {
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 60;
  padding: 12px 16px;
  border: 1px solid var(--warn);
  border-radius: 12px;
  background: var(--bg-2);
  text-align: center;
}

/* ---- log in / sign up dialog ------------------------------------------------- */

.auth-dialog {
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
}

.auth-dialog[open] {
  animation: rise 0.2s ease-out;
}

.auth-dialog::backdrop {
  background: rgba(4, 5, 8, 0.68);
  backdrop-filter: blur(4px);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.auth-body {
  padding: 30px 28px 26px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-logo {
  border-radius: 10px;
}

.auth-form h2 {
  margin-top: 4px;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.auth-lead {
  margin-top: -6px;
  color: var(--text-dim);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.auth-lead b {
  color: var(--text);
  font-weight: 600;
}

.auth-note {
  padding: 10px 13px;
  border: 1px solid rgba(124, 108, 255, 0.42);
  border-radius: 11px;
  background: var(--accent-soft);
  color: #d8d3ff;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
}

.auth-field small {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 400;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  background: var(--bg-0);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-code {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.32em;
  text-align: center;
}

.auth-code::placeholder {
  letter-spacing: 0.32em;
}

.auth-error {
  padding: 10px 13px;
  border: 1px solid rgba(251, 113, 133, 0.5);
  border-radius: 11px;
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
  font-size: 14px;
}

.auth-submit {
  height: 46px;
  margin-top: 4px;
  border-radius: 11px;
  font-size: 16px;
}

.auth-foot {
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: #b9b0ff;
  font-weight: 600;
  cursor: pointer;
}

.auth-link:hover:not(:disabled) {
  text-decoration: underline;
}

.auth-link:disabled {
  color: var(--text-faint);
  cursor: default;
}

/* ---- smaller screens --------------------------------------------------------- */

@media (max-width: 960px) {
  .hero {
    padding-top: 36px;
  }

  .hero-grid,
  .showcase {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-sub,
  .prompt {
    margin-inline: auto;
  }

  .prompt {
    text-align: left;
  }

  .hero-notes {
    justify-content: center;
  }

  .demo-phone {
    width: min(320px, 78vw);
  }

  .steps,
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .section {
    padding: 64px 0;
  }

  .cta {
    margin: 64px 0;
    padding: 44px 20px;
  }
}

@media (max-width: 600px) {
  .steps,
  .features,
  .mock-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .mock-chat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mock-files span:not(.is-active) {
    display: none;
  }

  .prompt-hint {
    display: none;
  }

  .prompt-actions {
    justify-content: flex-end;
  }

  .nav .btn {
    padding: 0 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
