/* ============================================================
   Let Me Claude That For You — styles
   Warm, minimalist Claude-inspired aesthetic. Vanilla CSS.
   ============================================================ */

:root {
  --bg: #FBF9F6;
  --bg-elevated: #FFFFFF;
  --text: #191919;
  --text-muted: #6B6862;
  --text-faint: #98948C;
  --accent: #C96442;          /* Claude clay / terracotta */
  --accent-hover: #B5573A;
  --accent-soft: #F1E4DD;
  --border: #E7E1D8;
  --border-strong: #D8D1C5;
  --user-bubble: #F2ECE1;
  --shadow-sm: 0 1px 2px rgba(25, 25, 25, 0.04);
  --shadow-md: 0 4px 20px rgba(25, 25, 25, 0.06);
  --radius-lg: 26px;
  --radius-md: 16px;
  --maxw: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----------------------------- Header ----------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-glyph {
  color: var(--accent);
  font-size: 1.15rem;
  transform: translateY(1px);
}

.brand-name { font-size: 1.15rem; }

.brand-model {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 999px;
}

.header-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.header-link:hover { background: var(--bg-elevated); color: var(--text); }

/* ------------------------------ Stage ----------------------------- */
.stage {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px 48px;
  display: flex;
  flex-direction: column;
}

.view { display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* ------------------------------ Hero ------------------------------ */
.hero {
  text-align: center;
  margin: clamp(24px, 8vh, 80px) 0 28px;
}

.hero-title {
  font-size: clamp(1.9rem, 6vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  line-height: 1.15;
}
.accent { color: var(--accent); }

.hero-sub {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* ---------------------------- Composer ---------------------------- */
.composer-wrap { margin: 8px 0 4px; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 22px rgba(201, 100, 66, 0.12);
}
.composer.is-readonly { box-shadow: var(--shadow-sm); }

.icon-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--bg); color: var(--text-muted); }
.paperclip { cursor: default; }

.composer-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--text);
  padding: 8px 2px;
  max-height: 220px;
  overflow-y: auto;
}
.composer-input::placeholder { color: var(--text-faint); }

/* Simulated (non-editable) input behaves like a div but matches the textarea */
.sim-input {
  min-height: 24px;
  white-space: pre-wrap;
  word-break: break-word;
}
.sim-input.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 1px;
  transform: translateY(2px);
  animation: blink 1s steps(1) infinite;
}

.submit-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.submit-btn:hover { background: var(--accent-hover); }
.submit-btn:active { transform: scale(0.92); }
.submit-btn.clicked { animation: press 0.32s ease; }

.composer-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 10px 0 0;
}
kbd {
  font-family: var(--font);
  font-size: 0.78rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text-muted);
}

/* ------------------------- Creator actions ------------------------ */
.creator-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.primary-btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.12s ease;
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:active { transform: translateY(1px); }

.ghost-btn {
  appearance: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ghost-btn:hover { background: var(--bg-elevated); color: var(--text); border-color: var(--text-faint); }
.ghost-btn.small { padding: 6px 14px; font-size: 0.85rem; }

/* --------------------------- Link output -------------------------- */
.link-output {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px auto 0;
  max-width: 100%;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 10px 12px;
  animation: fade-in 0.3s ease;
}
.link-text {
  flex: 1 1 auto;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  line-height: 1.4;
}

/* ------------------------- Simulation view ------------------------ */
.response-area {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: clamp(16px, 6vh, 48px) 0 24px;
  min-height: 40vh;
}

.msg { animation: fade-in 0.35s ease; }

.msg-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--user-bubble);
  border: 1px solid var(--border);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-claude {
  align-self: flex-start;
  max-width: 100%;
  display: flex;
  gap: 14px;
}
.claude-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  margin-top: 2px;
}
.claude-body {
  flex: 1 1 auto;
  padding-top: 2px;
}
.claude-body p { margin: 0 0 0.85em; }
.claude-body p:last-child { margin-bottom: 0; }
.claude-body strong { font-weight: 600; }
.claude-body em { font-style: italic; }
.claude-body code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.claude-body ul { margin: 0 0 0.85em; padding-left: 1.3em; }
.claude-body li { margin-bottom: 0.25em; }

/* Streaming caret on Claude's message while it writes */
.streaming::after {
  content: "▋";
  color: var(--accent);
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}

/* Thinking indicator */
.thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.thinking .dots { display: inline-flex; gap: 4px; }
.thinking .dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: pulse 1.2s ease-in-out infinite;
}
.thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking .dots span:nth-child(3) { animation-delay: 0.4s; }

.sim-composer-wrap { margin-top: auto; }
.sim-disclaimer { color: var(--text-faint); }

.sim-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  animation: fade-in 0.4s ease;
}

/* ------------------------------ Toast ----------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------- Footer ----------------------------- */
.site-footer {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px 32px;
  text-align: center;
}
.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* --------------------------- Animations --------------------------- */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

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

@keyframes press {
  0% { transform: scale(1); background: var(--accent); }
  40% { transform: scale(0.82); background: var(--accent-hover); }
  100% { transform: scale(1); background: var(--accent); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------- Responsive -------------------------- */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .stage { padding: 12px 16px 36px; }
  .site-header { padding: 14px 16px; }
  .hero { margin-top: 28px; }
  .creator-actions { flex-direction: column; }
  .creator-actions .primary-btn,
  .creator-actions .ghost-btn { width: 100%; justify-content: center; }
  .msg-user { max-width: 92%; }
  .header-link { display: none; }
}
