:root {
  --bg: #f5f5f3;
  --bg-2: #f2f2ef;
  --panel: rgba(250, 250, 248, 0.97);
  --panel-strong: rgba(255, 255, 253, 0.99);
  --text: #111111;
  --muted: #5f5f5b;
  --line: rgba(17, 17, 17, 0.1);
  --accent: #111111;
  --accent-2: #3a3a3a;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: #f4f4f1;
  position: relative;
  overflow-x: hidden;
}

.background-orb { display: none; }

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.single-surface {
  background: var(--panel);
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 28px;
}

.idea-card,
.cards-stage {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.flat-hero {
  padding-bottom: 10px;
}

.eyebrow,
.section-kicker,
.summary-label,
.card-category,
.card-prompt-label {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

h1, h2, h3, p, ul { margin-top: 0; }
h1, h2, h3 {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.02;
  font-weight: 400;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  margin: 10px 0 16px;
  letter-spacing: -0.01em;
}

.lead,
.sublead {
  font-size: 1rem;
  line-height: 1.68;
  max-width: 780px;
  color: var(--muted);
}

.sublead {
  margin-top: -2px;
  margin-bottom: 0;
}

.hero-actions,
.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions { margin: 24px 0 14px; }

.download-row {
  margin-bottom: 14px;
}

.download-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 194, 170, 0.28);
  padding-bottom: 2px;
  font-weight: 600;
}

.download-link:hover {
  border-bottom-color: var(--accent);
}

.summary-text {
  margin: 16px 0 18px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  max-width: 900px;
}

.inline-actions {
  margin-bottom: 4px;
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-redraw {
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover { transform: translateY(-1px); }

.primary-button {
  background: #111111;
  color: #ffffff;
  font-weight: 700;
}

.secondary-button {
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-weight: 600;
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.cards-stage {
  margin-top: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.flat-stage {
  border-top: 1px solid rgba(28, 23, 20, 0.08);
  padding-top: 20px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.idea-card {
  background: #ffffff;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  perspective: 1200px;
  overflow: hidden;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.mini-redraw {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(17, 17, 17, 0.04);
  color: var(--accent);
}

.card-title {
  font-size: 1.45rem;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.card-description,
.card-prompt {
  color: var(--muted);
  line-height: 1.58;
  font-size: 0.92rem;
}

.card-visual {
  margin: 16px 0;
}

.card-image-placeholder {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.1);
  background: linear-gradient(135deg, #ededeb, #ffffff 72%);
}

.card-back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.16) 0 2px, transparent 2px 100%),
    radial-gradient(circle at 50% 50%, transparent 0 34%, rgba(255,255,255,0.10) 34% 35%, transparent 35% 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 18px),
    linear-gradient(135deg, #0b0b0c, #1e1e20 72%);
  background-size: 120px 120px, 180px 180px, 100% 100%, 100% 100%, 100% 100%;
}

.idea-card.card-is-back {
  background: #111111;
  border-color: rgba(255,255,255,0.08);
}

.idea-card.card-is-back .card-title,
.idea-card.card-is-back .card-description,
.idea-card.card-is-back .card-category {
  visibility: hidden;
}

.card-flipping {
  animation: cardFlipIn 0.6s ease;
  transform-origin: center;
}

.card-back-label {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  z-index: 2;
}

.card-back-label::before,
.card-back-label::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
}

.card-back-label::after {
  inset: auto;
  width: 54px;
  height: 54px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}

.image-chip {
  display: none;
}

.visual-texture,
.visual-line {
  position: absolute;
  border-radius: 999px;
}

.visual-texture-a {
  width: 150px;
  height: 150px;
  background: rgba(0, 0, 0, 0.08);
  right: -20px;
  top: -12px;
}

.card-back .visual-texture-a {
  background: rgba(255,255,255,0.06);
}

.visual-texture-b {
  width: 190px;
  height: 190px;
  background: rgba(0, 0, 0, 0.05);
  left: -50px;
  bottom: -60px;
}

.card-back .visual-texture-b {
  background: rgba(255,255,255,0.04);
}

.visual-line {
  width: 160%;
  height: 1px;
  background: rgba(0, 0, 0, 0.18);
  top: 55%;
  left: -20%;
  transform: rotate(-15deg);
  border-radius: 0;
}

.card-back .visual-line {
  background: rgba(255,255,255,0.14);
}

.card-footer {
  margin-top: auto;
  padding-top: 6px;
}

@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .page-shell { width: min(100% - 16px, 100%); padding-top: 16px; }
  .single-surface { border-radius: 24px; padding: 18px; }
  .cards-grid { grid-template-columns: 1fr; }
  .hero-actions,
  .summary-actions { flex-direction: column; }
  .primary-button,
  .secondary-button,
  .ghost-button { width: 100%; }
  .card-title { font-size: 1.42rem; }
  .card-description { font-size: 0.9rem; }
  .card-visual { margin: 14px 0; }
}

@keyframes cardFlipIn {
  0% {
    transform: rotateY(180deg) scale(0.98);
    opacity: 0.35;
  }
  100% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
}
