/* packman-website — get-started funnel layout.
 * Structure mirrors nas.com's step=prompt and step=branding screens.
 */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 16px 120px;
  box-sizing: border-box;
}

.step {
  width: min(1200px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 32px;
  animation: stepFadeIn 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.step > .step-heading,
.step > .step-sub {
  align-self: center;
}

.step .card {
  width: 100%;
  max-width: none;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.step-heading {
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-align: center;
}

.step-sub {
  margin: -12px 0 0;
  font-size: 15px;
  color: var(--ink-muted);
  text-align: center;
}

/* Prompt input card — "I want to sell..." */
.prompt-card {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(20px, 3vw, 36px);
  width: 100%;
}

.prompt-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: clamp(20px, 2vw, 28px) clamp(22px, 2.4vw, 32px);
  width: 100%;
  box-sizing: border-box;
  border-radius: 22px;
  border: 2px solid transparent;
  background-image:
    linear-gradient(#fff, #fff),
    linear-gradient(
      90deg,
      var(--brand) 0%,
      var(--brand-deep) 22%,
      var(--brand-secondary) 48%,
      var(--brand-deep) 74%,
      var(--brand) 100%
    );
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 100% 100%, 300% 100%;
  animation: promptBorderFlow 7s linear infinite;
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    background-position 220ms ease;
  box-shadow:
    0 18px 40px -26px rgba(210, 248, 1, 0.8),
    0 10px 26px -20px rgba(44, 42, 89, 0.16);
}

.prompt-field:focus-within {
  box-shadow:
    0 0 0 4px rgba(210, 248, 1, 0.16),
    0 20px 48px -24px rgba(210, 248, 1, 0.95),
    0 14px 32px -22px rgba(44, 42, 89, 0.18);
  animation-duration: 3.5s;
}

@keyframes promptBorderFlow {
  0%   { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 300% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-field {
    animation: none;
    background-position: 0 0, 50% 50%;
  }
}

.prompt-field .sparkle {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--brand-secondary);
  animation: sparklePulse 2.8s ease-in-out infinite;
  transform-origin: center;
}

@keyframes sparklePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.15); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-field .sparkle {
    animation: none;
  }
}

.prompt-field input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 22px;
  line-height: 1.3;
  padding: 10px 0;
  color: var(--ink);
  text-overflow: ellipsis;
}

.prompt-field input::placeholder {
  color: var(--ink-placeholder);
}

.prompt-card .cta-row {
  display: flex;
  justify-content: flex-end;
}

/* Image upload tile (branding step) */
.upload-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin-top: 8px;
}

.upload-tile {
  width: 128px;
  height: 128px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(210, 248, 1, 0.18) 0%, rgba(210, 248, 1, 0.08) 100%);
  border: 2px dashed rgba(210, 248, 1, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.upload-tile:hover,
.upload-tile.is-dragover {
  transform: translateY(-2px);
  border-color: var(--brand-deep);
  background: linear-gradient(180deg, rgba(210, 248, 1, 0.3) 0%, rgba(210, 248, 1, 0.15) 100%);
}

.upload-tile input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-tile .icon {
  color: var(--brand-secondary);
  opacity: 0.6;
  width: 32px;
  height: 32px;
}

.upload-tile .preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-tile.has-image {
  border-style: solid;
  border-color: var(--brand-deep);
}

.upload-tile .remove-btn {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  border: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.upload-tile.has-image .remove-btn {
  display: inline-flex;
}

.upload-progress {
  font-size: 13px;
  color: var(--ink-muted);
  min-height: 20px;
}

.upload-progress.is-error {
  color: #b91c1c;
}

.field-group {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group--compact {
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.field-optional {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(44, 42, 89, 0.06);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.text-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1.5px solid rgba(44, 42, 89, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  padding: 14px 16px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.text-input::placeholder {
  color: var(--ink-placeholder);
}

.text-input:focus {
  outline: none;
  border-color: var(--brand-deep);
  box-shadow: 0 0 0 4px var(--ring);
}

.text-input.has-error {
  border-color: rgba(185, 28, 28, 0.55);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.08);
}

.field-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #b91c1c;
}

.upload-wrap .btn-primary {
  min-width: 220px;
}

.upload-wrap .btn-primary .btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: currentColor;
  display: none;
  flex: 0 0 auto;
  animation: buttonSpin 700ms linear infinite;
}

.upload-wrap .btn-primary.is-loading .btn-spinner {
  display: inline-flex;
}

.upload-wrap .btn-primary.is-loading .arrow {
  display: none;
}

.upload-wrap .btn-primary.is-loading {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(44, 42, 89, 0.18);
}

@keyframes buttonSpin {
  to { transform: rotate(360deg); }
}

/* Transition overlay */
.thinking {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 42px 24px;
  animation: stepFadeIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.thinking .orb {
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
}

.thinking .orb .ring,
.thinking .orb .core {
  position: absolute;
  border-radius: 999px;
}

.thinking .orb .core {
  width: 54px;
  height: 54px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 14px 30px rgba(210, 248, 1, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  animation: coreFloat 1.6s ease-in-out infinite;
}

.thinking .orb .bot-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.thinking .orb .ring-one {
  inset: 12px;
  border: 1.5px solid rgba(210, 248, 1, 0.4);
  animation: orbitPulse 1.8s ease-in-out infinite;
}

.thinking .orb .ring-two {
  inset: 0;
  border: 1px solid rgba(44, 42, 89, 0.12);
  animation: orbitPulse 1.8s ease-in-out infinite 180ms;
}

@keyframes orbitPulse {
  0%, 100% { transform: scale(0.96); opacity: 0.45; }
  50%      { transform: scale(1.04); opacity: 1; }
}

@keyframes coreFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-2px) scale(1.04); }
}

.thinking .label {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-secondary);
  letter-spacing: 0;
  text-transform: none;
}

.thinking .hint {
  max-width: 420px;
  margin-top: -4px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
}

.thinking .echo {
  font-size: 18px;
  color: var(--ink);
  max-width: 480px;
  text-align: center;
  font-weight: 500;
}

.thinking-progress {
  width: min(320px, 100%);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(44, 42, 89, 0.08);
  box-shadow: inset 0 1px 2px rgba(44, 42, 89, 0.08);
}

.thinking-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(210, 248, 1, 0.25) 0%, var(--brand) 38%, var(--brand-deep) 100%);
  animation: thinkingBar 1.2s ease-in-out infinite;
}

@keyframes thinkingBar {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

.thinking .echo::before { content: "\201C"; }
.thinking .echo::after  { content: "\201D"; }

[dir="rtl"] .thinking .echo::before { content: "\00BB"; }
[dir="rtl"] .thinking .echo::after  { content: "\00AB"; }

@media (prefers-reduced-motion: reduce) {
  .thinking .orb .ring-one,
  .thinking .orb .ring-two,
  .thinking .orb .core,
  .thinking-progress span,
  .upload-wrap .btn-primary .btn-spinner {
    animation: none;
  }
}

/* Hero (index.html) */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 120px;
  text-align: center;
  gap: 28px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 780px;
  font-weight: 700;
}

.hero h1 .accent {
  background: linear-gradient(120deg, var(--brand-secondary) 0%, var(--brand-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  margin: 0;
  max-width: 560px;
  font-size: 17px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.hero .cta-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero .pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(210, 248, 1, 0.2);
  border: 1px solid rgba(210, 248, 1, 0.5);
  color: var(--brand-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .pill-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand-deep);
  box-shadow: 0 0 8px var(--brand-deep);
}
