@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@700;800&family=Inter:wght@400;600;700&family=Space+Mono:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
  --background: #fafaf5;
  --surface: #fafaf5;
  --surface-low: #f4f4ef;
  --surface-container: #eeeee9;
  --surface-high: #e8e8e3;
  --surface-highest: #e3e3de;
  --stark-white: #ffffff;
  --obsidian: #1a1a1a;
  --ink: #1a1c19;
  --muted: #5d3f3c;
  --maple-red: #e62128;
  --maple-red-dark: #be0016;
  --arctic-blue: #0077c0;
  --blue-dark: #00426e;
  --shadow: 4px 4px 0 0 var(--obsidian);
  --shadow-pressed: 2px 2px 0 0 var(--obsidian);
  --headline: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Space Mono', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--ink);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 132px;
  background: var(--background);
  color: var(--ink);
  opacity: 0;
  transition: opacity 360ms ease;
}

body.ready {
  opacity: 1;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

img {
  display: block;
  max-width: 100%;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 2px solid var(--obsidian);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-lockup,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  color: var(--maple-red);
  font-family: var(--headline);
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.topbar .material-symbols-outlined {
  color: var(--maple-red-dark);
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--maple-red-dark);
}

.icon-button:hover,
.icon-button:focus-visible {
  background: var(--surface-highest);
  outline: 2px solid var(--obsidian);
  outline-offset: 2px;
}

.nav {
  display: none;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.nav a:hover {
  color: var(--maple-red);
}

.shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 48px 16px 0;
}

.hero {
  padding-top: 14px;
}

.hero-inner {
  max-width: 760px;
}

.hero h1,
.page-title,
.section h2,
.deal-header h1 {
  margin: 0;
  font-family: var(--headline);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero h1 {
  margin-bottom: 20px;
  font-size: clamp(48px, 12vw, 82px);
  line-height: 1.1;
}

.hero p {
  max-width: 640px;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.deal-loop {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: center;
  width: min(100%, 332px);
  margin: 0 auto 28px;
  padding: 14px;
  border: 2px solid var(--obsidian);
  background: var(--surface-low);
  box-shadow: var(--shadow);
}

.flow-step {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 222px);
  align-items: center;
  justify-items: start;
  justify-content: center;
  column-gap: 10px;
  color: var(--obsidian);
  text-align: left;
}

.flow-copy {
  display: grid;
  gap: 4px;
}

.flow-kicker {
  color: var(--maple-red-dark);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flow-step strong {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow-dot {
  width: 34px;
  height: 34px;
  border: 2px solid var(--obsidian);
  border-radius: 999px;
  background: var(--stark-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  flex: 0 0 auto;
  color: var(--obsidian);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  animation: dotPulse 3.6s ease-in-out infinite;
}

.flow-step:nth-of-type(2) .flow-dot {
  background: var(--arctic-blue);
  color: var(--stark-white);
  animation-delay: 0.65s;
}

.flow-step:nth-of-type(3) .flow-dot {
  background: var(--maple-red);
  color: var(--stark-white);
  animation-delay: 1.3s;
}

.flow-arrow {
  --arrow-rotate: 90deg;
  justify-self: center;
  margin-left: 0;
  color: var(--maple-red);
  font-size: 25px;
  transform: rotate(var(--arrow-rotate));
  animation: arrowNudge 1.4s ease-in-out infinite;
}

.flow-arrow:nth-of-type(2) {
  animation-delay: 0.7s;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.button,
button {
  min-height: 58px;
  border: 2px solid var(--obsidian);
  border-radius: 0;
  padding: 16px 20px;
  background: var(--stark-white);
  color: var(--obsidian);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  transition: transform 100ms ease, background 160ms ease, color 160ms ease, box-shadow 100ms ease;
}

.button:hover,
button:hover {
  background: var(--surface-highest);
}

.button:active,
button:active {
  transform: translateY(2px);
}

.button:focus-visible,
button:focus-visible,
.nav a:focus-visible,
.bottom-nav a:focus-visible {
  outline: 3px solid var(--maple-red);
  outline-offset: 3px;
}

.button.primary,
button.primary {
  background: var(--obsidian);
  color: var(--stark-white);
}

.button.primary:hover,
button.primary:hover {
  background: var(--maple-red);
}

.button.ghost,
button.ghost {
  background: var(--background);
  color: var(--obsidian);
}

.button.full,
button.full {
  width: 100%;
}

.button[disabled],
button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.microcopy {
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.bento-card,
.step-card,
.deal-card,
.form-panel,
.mock-panel,
.how-block,
.empty-state,
.modal,
.form-note,
.pickup,
.congrats {
  border: 2px solid var(--obsidian);
  box-shadow: var(--shadow);
  background: var(--stark-white);
}

.section {
  padding: 54px 0 0;
}

.section h2 {
  margin-bottom: 28px;
  font-size: 28px;
  line-height: 1.2;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.step-card {
  min-height: 190px;
  padding: 24px;
}

.step-card:nth-child(2) {
  background: var(--arctic-blue);
  color: var(--stark-white);
}

.step-card span,
.deal-kicker,
.field label,
.field-label,
.side-label,
.back-link,
.working,
.how-icon {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.step-card span {
  display: block;
  margin-bottom: 24px;
  color: var(--muted);
}

.step-card:nth-child(2) span {
  color: rgba(255,255,255,0.7);
}

.step-card strong {
  display: block;
  font-family: var(--headline);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.mock-grid {
  display: grid;
  gap: 28px;
}

.mock-panel {
  overflow: hidden;
}

.mock-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-container);
  object-fit: cover;
}

.mock-flag {
  display: inline-flex;
  margin: -44px 0 0 16px;
  position: relative;
  z-index: 1;
  background: var(--maple-red);
  color: var(--stark-white);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mock-meta {
  padding: 24px;
}

.mock-meta h3 {
  margin: 0 0 8px;
  font-family: var(--headline);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.mock-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.chat {
  display: grid;
  gap: 24px;
  padding: 8px 2px 0;
}

.bubble {
  max-width: 85%;
  padding: 16px;
  border: 2px solid var(--obsidian);
  border-radius: 12px;
  line-height: 1.5;
  font-size: 16px;
  background: var(--surface-low);
}

.bubble.buyer {
  justify-self: start;
  border-top-left-radius: 0;
}

.bubble.seller {
  justify-self: end;
  border-top-right-radius: 0;
  background: var(--obsidian);
  color: var(--stark-white);
}

.bubble.system {
  justify-self: center;
  max-width: 100%;
  color: var(--muted);
  background: var(--surface-container);
  font-family: var(--mono);
  font-size: 12px;
}

.side-label {
  display: block;
  margin-bottom: 9px;
  color: inherit;
  opacity: 0.72;
}

.form-page,
.deals-shell {
  width: min(100%, 840px);
}

.back-link {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 20px;
}

.page-title {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.form-panel {
  padding: 24px;
}

.field {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.field label,
.field-label {
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  min-height: 56px;
  border: 2px solid var(--obsidian);
  border-radius: 4px;
  background: var(--surface-container);
  color: var(--obsidian);
  outline: 0;
  padding: 14px 15px;
  font-size: 16px;
  font-weight: 600;
}

textarea {
  min-height: 144px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: var(--maple-red);
  box-shadow: 0 0 0 3px rgba(230,33,40,0.14);
}

.price-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--obsidian);
  border-radius: 4px;
  background: var(--surface-container);
  padding: 0 14px;
}

.price-row span {
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 700;
}

.price-row input {
  border: 0;
  box-shadow: none;
  padding-left: 0;
  background: transparent;
}

.secret {
  margin-top: -3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

.form-note {
  margin: 18px 0 0;
  padding: 16px;
  background: var(--obsidian);
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  line-height: 1.5;
}

.upload-target {
  min-height: 190px;
  border: 2px dashed var(--obsidian);
  border-radius: 4px;
  background: var(--surface-container);
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  cursor: pointer;
}

.upload-target strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--headline);
  font-size: 22px;
}

.upload-target span span {
  color: var(--muted);
  font-size: 13px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--obsidian);
  box-shadow: var(--shadow-pressed);
}

.success-panel {
  display: none;
  min-height: 430px;
  place-items: center;
  text-align: center;
  padding: 48px 24px;
}

.success-panel.show {
  display: grid;
}

.success-panel h2,
.empty-state h2,
.congrats h3 {
  margin: 24px 0 8px;
  font-family: var(--headline);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.success-panel p,
.empty-state p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.5;
}

.working-mark {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  border: 4px solid var(--maple-red);
  animation: breathe 1.3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1); }
}

.deal-header {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
}

.deal-header h1 {
  font-size: 32px;
  line-height: 1.2;
}

.working {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--muted);
  white-space: nowrap;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--maple-red);
  animation: pulse 1.3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.deal-list {
  display: grid;
  gap: 20px;
}

.deal-card {
  overflow: hidden;
  background: var(--obsidian);
  color: var(--stark-white);
  animation: settle 360ms ease both;
}

.deal-card.new {
  animation: newDeal 620ms ease both;
}

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

@keyframes newDeal {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.deal-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-container);
}

.deal-body {
  padding: 24px;
}

.deal-kicker {
  margin-bottom: 8px;
  color: rgba(255,255,255,0.62);
}

.deal-body h2 {
  margin: 0;
  font-family: var(--headline);
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.deal-description {
  margin: 7px 0 20px;
  color: rgba(255,255,255,0.72);
  line-height: 1.45;
}

.price {
  margin: 0;
  font-family: var(--headline);
  font-size: 50px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.comparison {
  margin: 8px 0 20px;
  color: #17c964;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.pickup {
  margin: 18px 0;
  padding: 14px;
  background: #0b0b0b;
  color: rgba(255,255,255,0.72);
  box-shadow: none;
  line-height: 1.45;
}

.transcript-toggle {
  width: 100%;
  justify-content: space-between;
  background: #0b0b0b;
  color: var(--stark-white);
  border-color: rgba(255,255,255,0.2);
}

.transcript-toggle:hover {
  background: var(--maple-red);
}

.transcript {
  display: none;
  margin-top: 12px;
  overflow: hidden;
  background: #0b0b0b;
}

.transcript.show {
  display: block;
}

.transcript .chat {
  padding: 16px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.deal-card .actions .ghost {
  color: var(--stark-white);
  border-color: rgba(255,255,255,0.34);
  background: transparent;
}

.deal-card .actions .primary {
  background: var(--stark-white);
  color: var(--obsidian);
}

.status-note {
  margin-top: 14px;
  color: rgba(255,255,255,0.72);
  line-height: 1.45;
}

.congrats {
  margin-top: 18px;
  padding: 18px;
  background: #0b0b0b;
  color: var(--stark-white);
  box-shadow: none;
}

.congrats h3 {
  margin-top: 0;
}

.congrats p {
  margin: 6px 0;
  color: rgba(255,255,255,0.72);
}

.empty-state {
  min-height: 430px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 36px 24px;
}

.how-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.how-block {
  padding: 24px;
}

.how-block:nth-child(2) {
  background: var(--arctic-blue);
  color: var(--stark-white);
}

.how-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  margin-bottom: 20px;
  color: var(--muted);
}

.how-block:nth-child(2) .how-icon {
  color: rgba(255,255,255,0.78);
}

.how-block h2 {
  margin: 0 0 10px;
  font-family: var(--headline);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.how-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.how-block:nth-child(2) p {
  color: rgba(255,255,255,0.78);
}

.bottom-nav {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 70;
  display: flex !important;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.bottom-nav-inner {
  width: min(100%, 430px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 8px;
  border: 2px solid var(--obsidian);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.bottom-nav a {
  min-width: 66px;
  min-height: 58px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bottom-nav a:hover,
.bottom-nav a.active {
  background: var(--maple-red);
  color: var(--stark-white);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(26,26,26,0.35);
}

.modal {
  width: min(100%, 430px);
  padding: 24px;
}

.modal h2 {
  margin: 0 0 8px;
  font-family: var(--headline);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.modal p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.account-card {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  padding: 16px;
  border: 2px solid var(--obsidian);
  background: var(--surface-container);
}

.account-card strong {
  font-family: var(--headline);
  font-size: 22px;
  line-height: 1.1;
}

.account-card span {
  color: var(--muted);
  line-height: 1.35;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.error {
  color: var(--maple-red-dark);
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@keyframes dotPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(230, 33, 40, 0);
  }

  18% {
    box-shadow: 0 0 0 6px rgba(230, 33, 40, 0.18);
  }

  36% {
    box-shadow: 0 0 0 0 rgba(230, 33, 40, 0);
  }
}

@keyframes arrowNudge {
  0%,
  100% {
    transform: rotate(var(--arrow-rotate)) translateX(0);
  }

  45% {
    transform: rotate(var(--arrow-rotate)) translateX(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-dot,
  .flow-arrow {
    animation: none;
  }
}

@media (min-width: 900px) {
  body {
    padding-bottom: 132px;
  }

  .topbar {
    padding: 14px 40px;
  }

  .nav {
    display: flex;
  }

  .shell {
    padding: 64px 40px 0;
  }

  .hero {
    padding-top: 16px;
  }

  .deal-loop {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    width: 100%;
    max-width: 720px;
    margin: 0 0 28px;
    padding: 18px;
    gap: 8px;
  }

  .flow-step {
    grid-template-columns: 38px minmax(0, auto);
    justify-content: center;
  }

  .flow-arrow {
    --arrow-rotate: 0deg;
    justify-self: center;
    margin-left: 0;
  }

  .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps,
  .how-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mock-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: start;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deal-header {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}
