:root {
  --bg: #f7f2ea;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --ink: #211d1a;
  --muted: #5a524b; /* Darkened for better contrast/accessibility */
  --line: #ded3c4;
  --accent: #211d1a;
  --shadow: 0 24px 60px rgba(47, 37, 28, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(135deg, #f7f2ea 0%, #eee4d7 100%);

    
}



a {
  color: inherit;
}

.page {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 32px 0;
  
}

.hero {
  min-height: 72vh;
  display: grid;
  align-content: center;
  padding: 72px 0;

}

.hero-art {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(22px, 4vw, 46px);
}

.hero-logo {
  width: min(35vw, 400px);
  height: auto;
  object-fit: contain;
}




.bg-image {
  width: min(58vw, 620px);
  height: auto;
  margin: 0;
  pointer-events: none;
}





.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 850;
}

.eyebrow.small {
  margin-bottom: 6px;
  font-size: 0.68rem;
}

h1 {
  max-width: 1040px;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
}

.hero-text,
.helper-text,
.support-card p {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.actions,
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.button:active:not(:disabled) {
  transform: scale(0.98); /* Added pressed state */
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(47, 37, 28, 0.14);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.primary {
  background: var(--accent);
  color: #fffaf2;
}

.button.secondary {
  background: rgba(255, 250, 242, 0.5);
}

.button.full {
  width: 100%;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-bottom: 48px;
}

.info-card,
.input-panel,
.preview-panel,
.support-card {
  background: rgba(255, 250, 242, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.info-card {
  padding: 28px;
}

.info-card span {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 900;
}

.info-card p {
  color: var(--muted);
  line-height: 1.55;
}

.logo {
  display: block;
  width: min(28vw, 320px);
  height: auto;
  object-fit: contain;
}

.logo-link {
  display: inline-block;
  line-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.brand,
.nav-link,
.quiet-link {
  text-decoration: none;
  font-weight: 850;
}

.nav-link,
.quiet-link {
  color: var(--muted);
}

.generator-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 22px;
  align-items: start;
}

.input-panel,
.preview-panel {
  padding: clamp(22px, 4vw, 38px);
}

.input-panel h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

label {
  font-weight: 850;
}

textarea {
  width: 100%;
  min-height: 240px;
  padding: 16px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  outline: none;
}

textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(33, 29, 26, 0.08);
}

.form-meta {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-message {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-message.error {
  color: #9d2c1f;
}

.preview-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mood-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eee4d7;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: capitalize;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1.414; /* Standard paper proportion */
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(33, 29, 26, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 29, 26, 0.035) 1px, transparent 1px),
    #fffdfa;
  background-size: 44px 44px;
  display: grid;
  place-items: center;
}

/* Loading Shimmer Animation */
@keyframes pulse-shimmer {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.is-loading .empty-mark {
  animation: pulse-shimmer 1.5s infinite ease-in-out;
}

/* Fade-in for actions */
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.preview-actions.hidden-actions {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.preview-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 680px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fffdfa;
  box-shadow: 0 18px 45px rgba(47, 37, 28, 0.12);
  user-select: none;
  -webkit-user-drag: none;

}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.empty-mark {
  width: 72px;
  height: 72px;
  border: 2px solid var(--line);
  border-radius: 50%;
  position: relative;
}

.empty-mark::before,
.empty-mark::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 2px;
  background: var(--line);
  top: 50%;
  left: 50%;
  transform-origin: center;
}

.empty-mark::before {
  transform: translate(-50%, -50%) rotate(35deg);
}

.empty-mark::after {
  transform: translate(-50%, -50%) rotate(-35deg);
}

.hidden {
  display: none;
}

.thanks-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.support-card {
  width: min(100%, 760px);
  padding: clamp(30px, 7vw, 64px);
}

.support-card h1 {
  font-size: clamp(2.8rem, 8vw, 6rem);
}

.quiet-link {
  display: inline-flex;
  margin-top: 32px;
}

@media (max-width: 860px) {
  .page {
    width: min(100% - 24px, var(--max-width));
    padding: 22px 0;
  }

  .hero {
    min-height: auto;
    padding: 70px 0 48px;
  }

  .card-grid,
  .generator-layout {
    grid-template-columns: 1fr;
  }

  .actions,
  .preview-actions,
  .vertical-mobile {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

.canvas-wrap {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(33, 29, 26, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 29, 26, 0.035) 1px, transparent 1px),
    #fffdfa;
  background-size: 44px 44px;
  display: grid;
  place-items: center;
  padding: 18px;
}
.preview-image {
  max-height: 560px;
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(2.7rem, 18vw, 4.4rem);
  }

  .input-panel,
  .preview-panel,
  .support-card,
  .info-card {
    border-radius: 22px;
  }

  textarea {
    min-height: 220px;
  }
}
}
