/* ---------- tokens ---------- */
:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-right: #f5f3ee;
  --ink: #f5f3ee;
  --ink-dim: #a3a3a3;
  --ink-muted: #6b6b6b;
  --rule: #1f1f1f;
  --rule-right: #e5e1d8;
  --ink-right: #0a0a0a;
  --ink-right-dim: #5a5a5a;

  --accent: #d6ff3a;
  --accent-ink: #0a0a0a;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-sm: 10px;

  --t-fast: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-med: 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.left {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(20px, 3.2vw, 48px);
  gap: clamp(16px, 2.4vh, 32px);
  background:
    radial-gradient(
      1200px 600px at 12% 8%,
      rgba(214, 255, 58, 0.07),
      transparent 60%
    ),
    var(--bg);
  border-right: 1px solid var(--rule);
  overflow: hidden;
  min-height: 0;
}

.right {
  background: var(--bg-right);
  color: var(--ink-right);
  display: grid;
  place-items: center;
  padding: clamp(20px, 3.2vw, 48px);
  overflow: hidden;
  min-height: 0;
}

/* ---------- brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(214, 255, 58, 0.6);
}

.brand-mark {
  color: var(--ink);
  font-weight: 600;
}

.brand-meta {
  color: var(--ink-muted);
}

.brand-meta::before {
  content: "/ ";
  color: var(--ink-muted);
}

/* ---------- slide stage ---------- */
.stage {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 0;
}

.slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.8vh, 24px);
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  pointer-events: none;
}

.slide.is-active {
  pointer-events: auto;
}

/* ----- chat bubbles ----- */
.bubble {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 92%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.slide.is-active .bubble-user {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 60ms;
}

.slide.is-active .bubble-jappy {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 420ms;
}

.bubble-user {
  align-self: flex-end;
  align-items: flex-end;
  max-width: 78%;
}

.bubble-jappy {
  align-self: flex-start;
  align-items: flex-start;
}

.bubble-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 0 14px;
}

.bubble-body {
  border-radius: 22px;
  line-height: 1.25;
}

.bubble-user .bubble-body {
  padding: 12px 18px;
  background: #1a1a1a;
  border: 1px solid #262626;
  border-bottom-right-radius: 6px;
  color: #ececec;
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: 500;
  letter-spacing: -0.005em;
  max-width: 60ch;
}

.bubble-jappy .bubble-body {
  padding: clamp(20px, 2.2vw, 30px) clamp(22px, 2.4vw, 34px);
  background: linear-gradient(180deg, #131313, #0e0e0e);
  border: 1px solid rgba(214, 255, 58, 0.18);
  border-bottom-left-radius: 6px;
  box-shadow: 0 24px 60px -28px rgba(214, 255, 58, 0.18),
    0 0 0 1px rgba(214, 255, 58, 0.04) inset;
}

.reply {
  margin: 0;
  max-width: 36ch;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--ink);
}

.accent {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- controls ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dots {
  display: flex;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a2a2a;
  transition: background var(--t-fast), transform var(--t-fast);
}

.dot:hover {
  background: #3a3a3a;
}

.dot.is-active {
  background: var(--accent);
  transform: scale(1.2);
}

.next-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform var(--t-fast), background var(--t-fast);
}

.next-btn:hover {
  transform: translateX(3px);
  background: var(--accent);
  color: var(--accent-ink);
}

.next-arrow {
  display: inline-block;
  transition: transform var(--t-fast);
}

.next-btn:hover .next-arrow {
  transform: translateX(3px);
}

/* ---------- right / form ---------- */
.form-wrap {
  width: 100%;
  max-width: 480px;
  display: grid;
  gap: 28px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #0a0a0a;
  color: #f5f3ee;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  width: fit-content;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(214, 255, 58, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(214, 255, 58, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(214, 255, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(214, 255, 58, 0);
  }
}

.form-title {
  margin: 14px 0 10px;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.form-title .accent {
  color: #0a0a0a;
  background: var(--accent);
  padding: 0 8px;
  border-radius: 6px;
}

.form-sub {
  margin: 0;
  color: var(--ink-right-dim);
  font-size: 15px;
  line-height: 1.55;
}

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-right-dim);
  text-transform: lowercase;
}

.label em {
  font-style: normal;
  opacity: 0.65;
}

input[type="text"],
input[type="email"],
textarea {
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--rule-right);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--ink-right);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

input::placeholder,
textarea::placeholder {
  color: #b3b0a8;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink-right);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}

textarea {
  resize: vertical;
  min-height: 88px;
  font-family: inherit;
}

fieldset.field {
  border: 0;
  padding: 0;
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.chip span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--rule-right);
  font-size: 14px;
  transition: all var(--t-fast);
}

.chip:hover span {
  border-color: var(--ink-right);
}

.chip input:checked + span {
  background: var(--ink-right);
  color: var(--ink);
  border-color: var(--ink-right);
}

.chip input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.15);
}

.submit-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--ink-right);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  transition: transform var(--t-fast), background var(--t-fast),
    color var(--t-fast);
}

.submit-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.submit-btn:hover .next-arrow {
  transform: translateX(3px);
}

.micro {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-right-dim);
  text-align: center;
}

.micro a {
  color: var(--ink-right);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- success state ---------- */
.form-success {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 40px 0;
}

.form-success h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.form-success p {
  margin: 0;
  color: var(--ink-right-dim);
}

.check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  html,
  body {
    height: auto;
    overflow: auto;
    overscroll-behavior-y: none;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .left {
    min-height: 100dvh;
    padding: 24px 20px 28px;
    gap: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    overflow: visible;
  }

  .right {
    padding: 40px 20px 48px;
    overflow: visible;
    align-content: center;
  }

  .stage {
    padding: 4px 0;
  }

  .slide {
    gap: 14px;
  }

  .bubble {
    max-width: 100%;
  }

  .bubble-user {
    max-width: 92%;
  }

  .bubble-jappy .bubble-body {
    padding: 20px 22px;
  }

  .reply {
    max-width: none;
    font-size: clamp(20px, 4.8vw, 28px);
  }

  .bubble-user .bubble-body {
    font-size: clamp(15px, 3.8vw, 18px);
    max-width: none;
  }

  .form-wrap {
    gap: 22px;
    max-width: 520px;
  }
}

@media (max-width: 520px) {
  .left {
    padding: 20px 16px 24px;
    gap: 16px;
  }

  .right {
    padding: 32px 16px 40px;
  }

  .brand {
    font-size: 12px;
    gap: 8px;
  }

  .brand-meta {
    display: none;
  }

  .slide {
    gap: 12px;
  }

  .bubble-label {
    padding: 0 12px;
  }

  .bubble-user .bubble-body {
    padding: 11px 16px;
    font-size: 15px;
    border-radius: 18px;
    border-bottom-right-radius: 6px;
  }

  .bubble-jappy .bubble-body {
    padding: 18px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
  }

  .reply {
    font-size: 19px;
    line-height: 1.32;
  }

  .controls {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 14px;
  }

  .next-btn {
    justify-content: center;
    padding: 13px 20px;
    font-size: 15px;
  }

  .dots {
    justify-content: center;
  }

  .form-title {
    font-size: clamp(26px, 8vw, 34px);
    margin: 8px 0 6px;
  }

  .form-sub {
    font-size: 14px;
  }

  textarea {
    min-height: 110px;
    font-size: 16px; /* prevent iOS auto-zoom on focus */
  }

  .submit-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 15px;
  }
}

/* very small / cramped viewports — drop the per-slide viewport-lock so the
   slide content can breathe and the form is one short scroll away */
@media (max-width: 520px) and (max-height: 720px) {
  .left {
    min-height: auto;
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
