:root {
  --bg-primary: #fcfcfc;
  --bg-surface: #ffffff;
  --text-primary: #0a0a0c;
  --text-secondary: #575763;
  --text-light: #ffffff;
  --border-light: rgba(0, 0, 0, 0.08);
  --color-dark: #0f1013;
  --color-dark-hover: #26272b;
  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-pill: 9999px;
  --radius-card: 20px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* HEADER */
.app-header {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 28px;
  width: auto;
}

.header-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* MAIN CONTENT */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 4vh;
}

.view-section {
  display: none;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

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

/* TYPOGRAPHY */
.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 500;
}

/* FORMS */
.create-form, .respond-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 440px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.input-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.input-group input, .input-group select, .textarea-wrapper textarea {
  width: 100%;
  padding: 16px;
  font-family: inherit;
  font-size: 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-subtle, #f5f5f7);
  transition: background 0.2s, box-shadow 0.2s;
  outline: none;
  color: var(--text-primary);
  appearance: none;
}

.input-group select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%230a0a0c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.input-group input:focus, .input-group select:focus, .textarea-wrapper textarea:focus {
  background: var(--bg-surface);
  border-color: var(--color-dark);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

/* BUTTONS */
.btn-primary {
  background: var(--color-dark);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s, background 0.2s;
  font-family: inherit;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--color-dark-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: rgba(0,0,0,0.02);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-outline:hover {
  background: var(--bg-surface);
}

/* RESPOND PAGE */
.respond-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.respond-city {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 24px;
}

.respond-prompt {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.textarea-wrapper {
  position: relative;
}

.textarea-wrapper textarea {
  resize: none;
  padding-bottom: 32px;
}

.char-count {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.growth-cta {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.growth-cta p {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.respond-paused {
  padding: 24px 0;
  color: var(--text-secondary);
  font-weight: 500;
}

/* INBOX PAGE */
.inbox-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.inbox-city {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.inbox-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-weight: 500;
}

.inbox-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
}

.inbox-empty {
  padding: 24px 0;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
}

/* Response Card */
.response-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.response-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-subtle, #f5f5f7);
  padding: 4px 8px;
  border-radius: 4px;
}

.response-date {
  font-size: 13px;
  color: var(--text-muted, #8e8e93);
  font-weight: 500;
}

.response-message {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-primary);
  font-weight: 500;
  white-space: pre-wrap;
  margin: 8px 0;
}

.response-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.btn-resp-share {
  border-color: var(--text-primary);
  color: var(--text-primary);
  font-weight: 700;
}

.btn-resp-share:hover {
  background: var(--text-primary);
  color: white;
}

.response-actions-subtle {
  display: flex;
  gap: 12px;
}

.response-actions-subtle button {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.response-actions-subtle button:hover {
  background: var(--bg-subtle, #f5f5f7);
}

.btn-resp-block {
  color: #dc2626 !important;
}

.btn-resp-block:hover {
  background: #fef2f2 !important;
}

/* FOOTER */
.app-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo img {
  height: 20px;
}

.footer-logo span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

/* INFO MODAL */
.info-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.info-modal.hidden {
  display: none !important;
}

.info-modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.info-modal h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
}

.info-body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* HOW IT WORKS / STEPS */
.how-it-works-home {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.how-it-works-home h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hiw-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hiw-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hiw-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hiw-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

.hiw-text strong {
  font-weight: 600;
}

.hiw-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 24px;
  font-weight: 500;
}

/* BOTTOM SHEET TUTORIAL */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s;
}

.bottom-sheet-overlay.hidden {
  display: none !important;
}

.bottom-sheet {
  background: var(--bg-surface);
  width: 100%;
  max-width: 500px;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 24px;
  animation: slideUp 0.3s ease-out forwards;
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sheet-header h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.btn-close-sheet {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.sheet-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.ig-schematic {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-subtle, #f5f5f7);
  border-radius: 16px;
}

.ig-story-mock {
  width: 45px;
  height: 80px;
  background: #111;
  border-radius: 6px;
  border: 2px solid var(--border-light);
}

.ig-arrow {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.ig-link-sticker {
  background: white;
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #0095f6;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 4px;
}

.ig-link-icon {
  font-size: 12px;
}

.ig-schematic-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sheet-steps {
  margin-bottom: 20px;
  gap: 12px;
}

.sheet-what-next {
  background: var(--bg-subtle, #f5f5f7);
  padding: 12px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.sheet-what-next strong {
  color: var(--text-primary);
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* DASHBOARD */
.creator-dashboard {
  margin-bottom: 32px;
}

.dashboard-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
}

.dashboard-item:hover {
  background: var(--bg-subtle, #f5f5f7);
}

.text-danger {
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

.text-danger:hover {
  background: #fef2f2 !important;
}

/* ABOUT PAGE */
.about-hero {
  padding: 32px 0 48px;
}

.about-headline {
  font-size: clamp(32px, 8vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.about-subhead {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 16px;
  max-width: 90%;
}

.about-journey {
  margin: 48px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.journey-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 20px;
  border-left: 3px solid var(--color-dark);
}

.journey-step {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.journey-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.about-section {
  margin-bottom: 56px;
}

.about-section h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.about-section p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-section p em {
  font-weight: 600;
  font-style: normal;
  color: var(--text-primary);
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-list dt {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.about-list dd {
  font-size: 15px;
  color: var(--text-secondary);
  margin-left: 0;
  margin-top: 4px;
}

.about-cta {
  padding-top: 40px;
  border-top: 1px solid var(--border-light);
  margin-bottom: 32px;
}

.about-cta p {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.about-cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .about-cta-buttons {
    flex-direction: row;
  }
}

.footer-legal {
  font-size: 12px;
  color: var(--text-muted);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-dark);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* LOADER */
.fullscreen-loader {
  position: fixed;
  inset: 0;
  background: rgba(252, 252, 252, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.fullscreen-loader.hidden {
  display: none;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: var(--color-dark);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* DESKTOP LAYOUT for CREATE */
.create-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.preview-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: none; /* Hide on mobile */
}

.create-preview-side {
  display: none; /* Hide on mobile by default */
}

@media (min-width: 900px) {
  .create-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
  
  .create-form-side {
    flex: 1;
    max-width: 480px;
  }
  
  .create-preview-side {
    display: block;
    width: 320px;
    flex-shrink: 0;
  }
  
  .preview-label {
    display: block;
  }
  
  .preview-scaler {
    width: 100%;
    aspect-ratio: 1080 / 1920;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 32px rgba(0,0,0,0.08);
    border: 1px solid var(--border-light);
  }
  
  .preview-scaler .story-canvas {
    transform-origin: top left;
    /* Will be scaled via JS based on container width */
  }
}

/* ==========================================================================
   STORY RENDER ENGINE (HTML-TO-IMAGE TARGETS)
   These must be EXACTLY 1080x1920.
   ========================================================================== */
.story-render-container {
  position: fixed;
  top: -9999px;
  left: -9999px;
  pointer-events: none;
}

.story-canvas {
  width: 1080px;
  height: 1920px;
  position: relative;
  background: #fbfbfb;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.story-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 240, 235, 0.6) 0%, rgba(251, 251, 251, 0) 70%);
  z-index: 1;
}

.story-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 80px 60px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.story-logo-wrapper {
  margin-top: 40px;
}

.story-logo-wrapper img {
  height: 90px;
  width: auto;
}

.story-card {
  width: 900px;
  background: #111111;
  border-radius: 80px;
  padding: 100px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  height: 1000px;
  justify-content: space-between;
}

.story-tag {
  font-size: 40px;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 50px;
  letter-spacing: -0.01em;
}

.story-heading {
  font-size: 92px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.story-input-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 120px;
  padding: 40px 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-pill-text {
  font-size: 40px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.story-pill-arrow {
  font-size: 45px;
  color: #ffffff;
}

.story-footer {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.story-url {
  font-size: 32px;
  color: #1a1a1f;
  letter-spacing: -0.01em;
}

.story-dots {
  display: flex;
  gap: 12px;
}

.s-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.bg-orange { background: #f97316; }
.bg-grey { background: #cbd5e1; }
.bg-green { background: #15803d; }

/* Specifics for Response Card */
.response-card {
  background: #ffffff;
  border: 4px solid #0a0a0a;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.12);
}

.response-card .story-tag {
  color: #575763;
}

.response-card .story-response-text {
  font-size: 56px;
  font-weight: 600;
  line-height: 1.35;
  color: #0a0a0a;
  letter-spacing: -0.02em;
}
