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

:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #111827;
  --muted: #667085;
  --border: #e4e7ec;
  --primary: #72bf78;
  --primary-dark: #5148e5;
  --soft: #f1f0ff;
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  width: min(1180px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.5px;
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

nav a:hover {
  color: var(--text);
}

.hero {
  width: min(1100px, calc(100% - 40px));
  margin: 80px auto 110px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary);
  background: var(--soft);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto;
  font-size: clamp(46px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.subtitle {
  max-width: 650px;
  margin: 24px auto 42px;
  color: var(--muted);
  font-size: 18px;
}

.tool-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, 0.08);
  text-align: left;
}

.upload-area {
  padding: 52px 24px;
  text-align: center;
  border: 2px dashed #d6d9e0;
  border-radius: 17px;
  cursor: pointer;
  transition: 0.2s ease;
}

.upload-area:hover {
  border-color: var(--primary);
  background: #fafaff;
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--soft);
  color: var(--primary);
  font-size: 25px;
  font-weight: 700;
}

.upload-area h2 {
  margin-bottom: 5px;
  font-size: 18px;
}

.upload-area p {
  color: var(--muted);
  font-size: 14px;
}

.upload-area span {
  display: block;
  margin-top: 9px;
  color: #98a2b3;
  font-size: 12px;
}

.output-section {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: center;
}

.output-section label {
  font-size: 14px;
  font-weight: 700;
}

select,
button {
  height: 48px;
  border-radius: 12px;
  font: inherit;
}

select {
  width: 100%;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
}

select:focus {
  border-color: var(--primary);
}

button {
  padding: 0 25px;
  border: 0;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

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

.tools {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto 100px;
}

.tools > h2 {
  margin-bottom: 32px;
  text-align: center;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.035em;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-grid article {
  min-height: 170px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.tool-grid h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

.tool-grid p {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  header {
    width: min(100% - 28px, 1180px);
  }

  nav {
    gap: 16px;
  }

  .hero {
    width: min(100% - 28px, 900px);
    margin-top: 50px;
  }

  .hero h1 {
    font-size: clamp(42px, 13vw, 62px);
  }

  .subtitle {
    font-size: 16px;
  }

  .tool-card {
    padding: 12px;
    border-radius: 19px;
  }

  .upload-area {
    padding: 42px 16px;
  }

  .output-section {
    grid-template-columns: 1fr;
  }

  .output-section button {
    width: 100%;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}

#image-preview {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
}


.upload-area {
  position: relative;
}

.upload-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.upload-area.has-image {
  min-height: 360px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.upload-area.has-image #image-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 12px;
}

.upload-area.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.upload-area.has-image .upload-content {
  color: #fff;
}

.upload-area.has-image .upload-content h2,
.upload-area.has-image .upload-content p,
.upload-area.has-image .upload-content span {
  color: #fff;
}

.upload-area.has-image #image-preview {
  opacity: 0.45;
}

.upload-area.has-image #remove-image {
  display: flex;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  backdrop-filter: blur(6px);
}

#image-preview[hidden] {
  display: none;
}

/* Smoother remove button */
.upload-area.has-image #remove-image {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-size: 20px;
  line-height: 0;
  padding-bottom: 2px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.upload-area.has-image #remove-image:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.06);
}

/* Smooth image hover effect */
.upload-area.has-image #image-preview {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.upload-area.has-image:hover #image-preview {
  opacity: 0.60;
  transform: scale(1.015);
}

.result-box {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #e4e5ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 24, 40, 0.06);
}

.result-box[hidden] {
  display: none;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.result-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

#copy-prompt {
  border: 1px solid #e1e2ea;
  border-radius: 9px;
  background: #f7f7fb;
  color: #4f46e5;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#copy-prompt:hover {
  background: #eeeeff;
  border-color: #c7c8f5;
  transform: translateY(-1px);
}

.result-content {
  padding: 14px;
  border-radius: 11px;
  background: #f8f9fc;
  color: #374151;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#generate-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Hero workspace */
.hero-workspace {
  display: grid;
  grid-template-columns: 760px 1fr;
  gap: 18px;
  align-items: stretch;
  width: 100%;
}

.hero-workspace .tool-card {
  width: 100%;
  max-width: 760px;
  margin: 0;
  box-sizing: border-box;
}

.demo-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(16, 24, 40, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  text-align: left;
}

.demo-visual {
  flex: 1;
  min-height: 220px;
  padding: 22px;
  border-radius: 17px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.demo-badge {
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.demo-icon {
  margin-bottom: 14px;
  font-size: 38px;
  color: var(--primary);
}

.demo-visual h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.demo-visual p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.demo-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 16px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.demo-flow b {
  color: var(--primary);
}


/* Demo animation */
.demo-icon,
.demo-visual h3,
.demo-visual p {
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.demo-visual.is-changing .demo-icon,
.demo-visual.is-changing h3,
.demo-visual.is-changing p {
  opacity: 0;
  transform: translateY(8px);
}

@media (prefers-reduced-motion: reduce) {
  .demo-icon,
  .demo-visual h3,
  .demo-visual p {
    transition: none;
  }
}

/* Demo visual background layer */
.demo-visual {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.demo-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.demo-badge,
.demo-icon,
.demo-visual h3,
.demo-visual p {
  position: relative;
  z-index: 2;
}

/* Image → Prompt background */
.demo-background {
  opacity: 0.22;
  background:
    linear-gradient(90deg, transparent 49%, rgba(114, 191, 120, 0.16) 50%, transparent 51%),
    radial-gradient(circle at 24% 50%, rgba(114, 191, 120, 0.34) 0 18px, transparent 19px),
    linear-gradient(rgba(114, 191, 120, 0.28), rgba(114, 191, 120, 0.28)) 72% 38% / 70px 5px no-repeat,
    linear-gradient(rgba(114, 191, 120, 0.22), rgba(114, 191, 120, 0.22)) 72% 50% / 88px 5px no-repeat,
    linear-gradient(rgba(114, 191, 120, 0.18), rgba(114, 191, 120, 0.18)) 72% 62% / 58px 5px no-repeat;
}

/* Image → Video background */
.demo-visual[data-demo="image-video"] .demo-background {
  opacity: 0.22;
  background:
    radial-gradient(circle at 50% 50%, rgba(114, 191, 120, 0.30) 0 28px, transparent 29px),
    linear-gradient(135deg, transparent 46%, rgba(114, 191, 120, 0.28) 47% 53%, transparent 54%) 50% 50% / 22px 28px no-repeat,
    linear-gradient(rgba(114, 191, 120, 0.18), rgba(114, 191, 120, 0.18)) 50% 50% / 150px 92px no-repeat,
    linear-gradient(90deg, rgba(114, 191, 120, 0.18), transparent 70%) 50% 78% / 190px 4px no-repeat;
}

/* Visual scene: Image → Prompt */
.demo-visual[data-demo="image-prompt"] .demo-background {
  opacity: 0.32;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 16px;
  background: linear-gradient(135deg, #eeeaff 0%, #fafaff 55%, #e9e7ff 100%);
}

.visual-image {
  position: relative;
  width: 92px;
  height: 112px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid rgba(114, 191, 120, 0.45);
  border-radius: 14px;
  background: linear-gradient(180deg, #dcd9ff 0%, #f1f0ff 55%, #cbc7ff 100%);
  box-shadow: 0 12px 30px rgba(114, 191, 120, 0.18);
  transform: rotate(-5deg);
}

.visual-sun {
  position: absolute;
  width: 20px;
  height: 20px;
  top: 17px;
  right: 16px;
  border-radius: 50%;
  background: rgba(114, 191, 120, 0.55);
}

.visual-mountain {
  position: absolute;
  bottom: -20px;
  width: 90px;
  height: 90px;
  border-radius: 18px;
  background: rgba(114, 191, 120, 0.28);
  transform: rotate(45deg);
}

.visual-mountain-one {
  left: -25px;
}

.visual-mountain-two {
  right: -42px;
  bottom: -32px;
  background: rgba(81, 72, 229, 0.35);
}

.visual-ai {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #72bf78;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 0 0 7px rgba(114, 191, 120, 0.10);
}

.visual-prompt {
  width: 105px;
  flex: 0 0 auto;
  padding: 14px 12px;
  border: 1px solid rgba(114, 191, 120, 0.32);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.10);
  transform: rotate(4deg);
}

.visual-prompt span {
  display: block;
  height: 6px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.42);
}

.visual-prompt span:nth-child(2) {
  width: 78%;
}

.visual-prompt span:nth-child(3) {
  width: 92%;
}

.visual-prompt span:nth-child(4) {
  width: 58%;
  margin-bottom: 0;
}

/* Balance Image → Prompt visual */
.demo-visual[data-demo="image-prompt"] .visual-image,
.demo-visual[data-demo="image-prompt"] .visual-prompt {
  width: 96px;
  height: 112px;
  flex: 0 0 96px;
  box-sizing: border-box;
}

.demo-visual[data-demo="image-prompt"] .visual-prompt {
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-visual[data-demo="image-prompt"] .visual-ai {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.demo-visual[data-demo="image-prompt"] .demo-background {
  gap: 10px;
}

/* Clear AI connector */
.demo-visual[data-demo="image-prompt"] .visual-ai {
  position: relative;
  width: 34px;
  height: 24px;
  flex: 0 0 34px;
  border-radius: 7px;
  background: #72bf78;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 5px 14px rgba(114, 191, 120, 0.22);
}

.demo-visual[data-demo="image-prompt"] .visual-ai::before {
  content: "→";
  position: absolute;
  right: 100%;
  margin-right: 2px;
  color: #72bf78;
  font-size: 15px;
  font-weight: 800;
}

.demo-visual[data-demo="image-prompt"] .visual-ai::after {
  content: "→";
  position: absolute;
  left: 100%;
  margin-left: 2px;
  color: #72bf78;
  font-size: 15px;
  font-weight: 800;
}

/* Show the correct visual for each demo */
.visual-video {
  display: none;
}

.demo-visual[data-demo="image-video"] .visual-image,
.demo-visual[data-demo="image-video"] .visual-prompt {
  display: none;
}

/* Visual scene: Image → Video */
.demo-visual[data-demo="image-video"] .demo-background {
  opacity: 0.32;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background: linear-gradient(135deg, #eeeaff 0%, #fafaff 55%, #e9e7ff 100%);
}

.demo-visual[data-demo="image-video"] .visual-video {
  display: block;
  width: 210px;
  padding: 9px;
  box-sizing: border-box;
  border: 1px solid rgba(114, 191, 120, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.10);
  transform: rotate(-2deg);
}

.video-frame {
  position: relative;
  height: 92px;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(180deg, #dcd9ff 0%, #f1f0ff 55%, #cbc7ff 100%);
}

.video-sun {
  position: absolute;
  width: 20px;
  height: 20px;
  top: 16px;
  right: 24px;
  border-radius: 50%;
  background: rgba(114, 191, 120, 0.55);
}

.video-hill {
  position: absolute;
  width: 150px;
  height: 90px;
  left: 20px;
  bottom: -62px;
  border-radius: 28px;
  background: rgba(114, 191, 120, 0.30);
  transform: rotate(-8deg);
}

.video-timeline {
  position: relative;
  height: 6px;
  margin: 10px 4px 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.15);
}

.video-timeline span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 55%;
  border-radius: inherit;
  background: rgba(114, 191, 120, 0.55);
  animation: demo-video-progress 2.2s ease-in-out infinite alternate;
}

.video-timeline i {
  position: absolute;
  top: 50%;
  left: 55%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #72bf78;
  transform: translate(-50%, -50%);
  animation: demo-video-playhead 2.2s ease-in-out infinite alternate;
}

@keyframes demo-video-progress {
  from { width: 18%; }
  to { width: 82%; }
}

@keyframes demo-video-playhead {
  from { left: 18%; }
  to { left: 82%; }
}

@media (prefers-reduced-motion: reduce) {
  .video-timeline span,
  .video-timeline i {
    animation: none;
  }
}

/* Screenshot scene visibility */
.visual-screenshot {
  display: none;
}

.demo-visual[data-demo="screenshot-prompt"] .visual-image,
.demo-visual[data-demo="screenshot-prompt"] .visual-prompt,
.demo-visual[data-demo="screenshot-prompt"] .visual-video {
  display: none;
}

/* Visual scene: Screenshot → Prompt */
.demo-visual[data-demo="screenshot-prompt"] .demo-background {
  opacity: 0.32;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background: linear-gradient(135deg, #eeeaff 0%, #fafaff 55%, #e9e7ff 100%);
}

.demo-visual[data-demo="screenshot-prompt"] .visual-screenshot {
  display: block;
  width: 210px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid rgba(114, 191, 120, 0.35);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.11);
  transform: rotate(2deg);
}

.browser-bar {
  height: 25px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  background: rgba(114, 191, 120, 0.10);
  border-bottom: 1px solid rgba(114, 191, 120, 0.16);
}

.browser-bar i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(114, 191, 120, 0.40);
}

.browser-bar > span {
  height: 7px;
  flex: 1;
  margin-left: 5px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.14);
}

.browser-body {
  height: 100px;
  display: grid;
  grid-template-columns: 42px 1fr;
}

.browser-sidebar {
  padding: 13px 8px;
  border-right: 1px solid rgba(114, 191, 120, 0.13);
  background: rgba(114, 191, 120, 0.06);
}

.browser-sidebar span {
  display: block;
  height: 6px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.25);
}

.browser-content {
  padding: 14px;
}

.browser-content b {
  display: block;
  width: 62%;
  height: 8px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.42);
}

.browser-content > span {
  display: block;
  width: 88%;
  height: 5px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.20);
}

.browser-content > span:nth-of-type(2) {
  width: 68%;
}

.browser-content div {
  width: 58px;
  height: 22px;
  margin-top: 11px;
  border-radius: 7px;
  background: rgba(114, 191, 120, 0.32);
  animation: demo-ui-pulse 1.8s ease-in-out infinite alternate;
}

@keyframes demo-ui-pulse {
  from {
    transform: translateY(0);
    opacity: 0.65;
  }
  to {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .browser-content div {
    animation: none;
  }
}

/* Product scene visibility */
.visual-product {
  display: none;
}

.demo-visual[data-demo="product-prompt"] .visual-image,
.demo-visual[data-demo="product-prompt"] .visual-prompt,
.demo-visual[data-demo="product-prompt"] .visual-video,
.demo-visual[data-demo="product-prompt"] .visual-screenshot {
  display: none;
}

/* Visual scene: Product Image → Prompt */
.demo-visual[data-demo="product-prompt"] .demo-background {
  opacity: 0.34;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background: linear-gradient(135deg, #eeeaff 0%, #fafaff 55%, #e9e7ff 100%);
}

.demo-visual[data-demo="product-prompt"] .visual-product {
  position: relative;
  display: block;
  width: 210px;
  height: 145px;
  overflow: hidden;
  border: 1px solid rgba(114, 191, 120, 0.30);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.10);
}

.product-light {
  position: absolute;
  top: -45px;
  left: 50%;
  width: 105px;
  height: 155px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    rgba(114, 191, 120, 0.24),
    rgba(114, 191, 120, 0)
  );
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
}

.product-item {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 39px;
  width: 52px;
  height: 72px;
  transform: translateX(-50%);
  border: 2px solid rgba(114, 191, 120, 0.46);
  border-radius: 10px 10px 14px 14px;
  background: linear-gradient(145deg, #ffffff, #dcd9ff);
  box-shadow: 0 9px 18px rgba(114, 191, 120, 0.18);
  animation: demo-product-float 2s ease-in-out infinite alternate;
}

.product-item span {
  position: absolute;
  top: -9px;
  left: 13px;
  width: 22px;
  height: 11px;
  border-radius: 4px 4px 2px 2px;
  background: #72bf78;
}

.product-item i {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 25px;
  height: 18px;
  border-radius: 5px;
  background: rgba(114, 191, 120, 0.25);
}

.product-platform {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 20px;
  width: 118px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #d9d6ff, #aaa4ff);
  box-shadow: 0 8px 18px rgba(114, 191, 120, 0.18);
}

.product-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 13px;
  width: 125px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(40, 35, 110, 0.13);
  filter: blur(5px);
}

@keyframes demo-product-float {
  from {
    transform: translateX(-50%) translateY(1px);
  }
  to {
    transform: translateX(-50%) translateY(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-item {
    animation: none;
  }
}

/* JSON scene visibility */
.visual-json {
  display: none;
}

.demo-visual[data-demo="image-json"] .visual-image,
.demo-visual[data-demo="image-json"] .visual-prompt,
.demo-visual[data-demo="image-json"] .visual-video,
.demo-visual[data-demo="image-json"] .visual-screenshot,
.demo-visual[data-demo="image-json"] .visual-product {
  display: none;
}

/* Visual scene: Image → JSON */
.demo-visual[data-demo="image-json"] .demo-background {
  opacity: 0.34;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 14px;
  background: linear-gradient(135deg, #eeeaff 0%, #fafaff 55%, #e9e7ff 100%);
}

.demo-visual[data-demo="image-json"] .visual-json {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.json-image,
.json-code {
  width: 96px;
  height: 112px;
  box-sizing: border-box;
  border: 1px solid rgba(114, 191, 120, 0.35);
  border-radius: 13px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.10);
}

.json-image {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #dcd9ff 0%, #f1f0ff 55%, #cbc7ff 100%);
  transform: rotate(-3deg);
}

.json-sun {
  position: absolute;
  top: 18px;
  right: 17px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(114, 191, 120, 0.52);
}

.json-mountain {
  position: absolute;
  left: 4px;
  bottom: -42px;
  width: 92px;
  height: 92px;
  border-radius: 18px;
  background: rgba(114, 191, 120, 0.30);
  transform: rotate(45deg);
}

.json-code {
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.90);
  transform: rotate(3deg);
}

.json-code b {
  display: block;
  color: #72bf78;
  font-size: 15px;
  line-height: 15px;
}

.json-code span {
  display: block;
  height: 5px;
  margin: 6px 0 6px 10px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.34);
  animation: demo-json-line 1.8s ease-in-out infinite alternate;
}

.json-code span:nth-of-type(2) {
  width: 72%;
  animation-delay: 0.15s;
}

.json-code span:nth-of-type(3) {
  width: 88%;
  animation-delay: 0.3s;
}

.json-code span:nth-of-type(4) {
  width: 62%;
  animation-delay: 0.45s;
}

@keyframes demo-json-line {
  from {
    opacity: 0.45;
    transform: scaleX(0.82);
    transform-origin: left;
  }
  to {
    opacity: 1;
    transform: scaleX(1);
    transform-origin: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .json-code span {
    animation: none;
  }
}

/* Ad Creative scene visibility */
.visual-ad {
  display: none;
}

.demo-visual[data-demo="ad-creative"] .visual-image,
.demo-visual[data-demo="ad-creative"] .visual-prompt,
.demo-visual[data-demo="ad-creative"] .visual-video,
.demo-visual[data-demo="ad-creative"] .visual-screenshot,
.demo-visual[data-demo="ad-creative"] .visual-product,
.demo-visual[data-demo="ad-creative"] .visual-json {
  display: none;
}

/* Visual scene: Ad Creative → Prompt */
.demo-visual[data-demo="ad-creative"] .demo-background {
  opacity: 0.34;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px 16px;
  background: linear-gradient(135deg, #eeeaff 0%, #fafaff 55%, #e9e7ff 100%);
}

.demo-visual[data-demo="ad-creative"] .visual-ad {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 215px;
  height: 130px;
  padding: 18px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(114, 191, 120, 0.34);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.10);
  transform: rotate(-2deg);
}

.ad-copy {
  position: relative;
  z-index: 3;
  width: 92px;
}

.ad-copy b {
  display: block;
  width: 76px;
  height: 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.60);
}

.ad-copy span {
  display: block;
  width: 68px;
  height: 5px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: rgba(114, 191, 120, 0.25);
}

.ad-copy span:nth-of-type(2) {
  width: 52px;
}

.ad-copy i {
  display: block;
  width: 48px;
  height: 17px;
  margin-top: 11px;
  border-radius: 6px;
  background: #72bf78;
  box-shadow: 0 5px 12px rgba(114, 191, 120, 0.22);
  animation: demo-ad-cta 1.8s ease-in-out infinite alternate;
}

.ad-product {
  position: relative;
  z-index: 3;
  width: 48px;
  height: 70px;
  margin-right: 5px;
  border: 2px solid rgba(114, 191, 120, 0.42);
  border-radius: 9px 9px 13px 13px;
  background: linear-gradient(145deg, #ffffff, #d8d5ff);
  box-shadow: 0 10px 20px rgba(114, 191, 120, 0.20);
  animation: demo-ad-product 2.1s ease-in-out infinite alternate;
}

.ad-product span {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 26px;
  height: 17px;
  border-radius: 5px;
  background: rgba(114, 191, 120, 0.30);
}

.ad-glow {
  position: absolute;
  z-index: 1;
  right: -18px;
  top: 8px;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  background: rgba(114, 191, 120, 0.15);
  filter: blur(3px);
}

@keyframes demo-ad-product {
  from {
    transform: translateY(2px) rotate(1deg);
  }
  to {
    transform: translateY(-4px) rotate(-2deg);
  }
}

@keyframes demo-ad-cta {
  from {
    transform: scale(0.94);
    opacity: 0.72;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-product,
  .ad-copy i {
    animation: none;
  }
}

/* Soft rounded Play icon */
.demo-icon.play-icon {
  position: relative;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
}

.demo-icon.play-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 27px;
  height: 31px;
  background: #72bf78;
  transform: translate(-44%, -50%);
  clip-path: path("M 4 3 Q 4 0 8 2 L 25 13 Q 29 15.5 25 18 L 8 29 Q 4 31 4 27 Z");
}

/* Dark mode color system */
html[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #13161d;
  --text: #f5f7fa;
  --muted: #98a2b3;
  --border: #272b35;
  --primary: #8178ff;
  --primary-dark: #7067f5;
  --soft: #1b1933;

  color-scheme: dark;
}

body {
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Theme toggle */
nav {
  align-items: center;
}

#theme-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

#theme-toggle:hover {
  background: var(--soft);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.theme-icon {
  display: block;
  font-size: 20px;
  line-height: 1;
}

/* Dark mode refinements */
html[data-theme="dark"] select {
  background: #181b23;
  color: #f5f7fa;
  border-color: #303541;
}

/* Metscore green identity */
:root {
  --primary: #72bf78;
  --primary-dark: #5eaa65;
  --soft: #edf8ee;
}

html[data-theme="dark"] {
  --primary: #72bf78;
  --primary-dark: #5eaa65;
  --soft: #18251a;
}

/* Reference-inspired Dark Demo */
html[data-theme="dark"] .demo-visual {
  background:
    linear-gradient(
      135deg,
      #182019 0%,
      #151b17 42%,
      #121613 72%,
      #151a17 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 18px 45px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .demo-visual .demo-background {
  background:
    linear-gradient(
      115deg,
      rgba(114, 191, 120, 0.22) 0%,
      rgba(114, 191, 120, 0.15) 24%,
      rgba(92, 160, 99, 0.10) 46%,
      rgba(63, 116, 70, 0.06) 68%,
      rgba(28, 40, 31, 0.02) 86%,
      transparent 100%
    );
}

/* Inner scene separation — Dark Demo */
html[data-theme="dark"] .visual-image,
html[data-theme="dark"] .visual-prompt,
html[data-theme="dark"] .visual-video,
html[data-theme="dark"] .visual-screenshot,
html[data-theme="dark"] .visual-product,
html[data-theme="dark"] .json-image,
html[data-theme="dark"] .json-code,
html[data-theme="dark"] .visual-ad {
  border-color: rgba(114, 191, 120, 0.30);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.24),
    0 0 18px rgba(114, 191, 120, 0.07);
}

html[data-theme="dark"] .visual-video,
html[data-theme="dark"] .visual-screenshot,
html[data-theme="dark"] .visual-product,
html[data-theme="dark"] .visual-ad {
  background: rgba(18, 27, 21, 0.82);
}


/* Dark mode upload hover */
html[data-theme="dark"] .upload-area:hover {
  background:
    linear-gradient(
      135deg,
      rgba(114, 191, 120, 0.10) 0%,
      rgba(114, 191, 120, 0.055) 45%,
      rgba(114, 191, 120, 0.025) 100%
    );
  border-color: rgba(114, 191, 120, 0.70);
  box-shadow:
    inset 0 0 28px rgba(114, 191, 120, 0.035),
    0 0 18px rgba(114, 191, 120, 0.07);
}

/* Dark mode — Demo matches upload hover */
html[data-theme="dark"] .demo-visual {
  background:
    linear-gradient(
      135deg,
      rgba(114, 191, 120, 0.10) 0%,
      rgba(114, 191, 120, 0.055) 45%,
      rgba(114, 191, 120, 0.025) 100%
    );
  border-color: rgba(114, 191, 120, 0.70);
  box-shadow:
    inset 0 0 28px rgba(114, 191, 120, 0.035),
    0 0 18px rgba(114, 191, 120, 0.07);
}


/* Select menu — Metscore green identity */
select option:checked {
  background: #72bf78;
  color: #ffffff;
}

html[data-theme="dark"] select option:checked {
  background: #72bf78;
  color: #ffffff;
}


/* Select option hover — Metscore green */
select option:hover {
  background: #72bf78;
  color: #ffffff;
}

html[data-theme="dark"] select option:hover {
  background: #72bf78;
  color: #ffffff;
}


/* Custom output dropdown */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--primary);
}

.custom-select-arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 100;
  display: none;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.14);
}

.custom-select.open .custom-select-menu {
  display: block;
}

.custom-select-menu button {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.custom-select-menu button:hover,
.custom-select-menu button.active {
  background: #72bf78;
  color: #ffffff;
}

/* Dark mode */
html[data-theme="dark"] .custom-select-trigger {
  background: #181b23;
  color: #f5f7fa;
  border-color: #303541;
}

html[data-theme="dark"] .custom-select-trigger:hover {
  border-color: #72bf78;
  background: #18251a;
}

html[data-theme="dark"] .custom-select-menu {
  background: #181b23;
  border-color: #303541;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(114, 191, 120, 0.06);
}

html[data-theme="dark"] .custom-select-menu button {
  color: #f5f7fa;
}

html[data-theme="dark"] .custom-select-menu button:hover,
html[data-theme="dark"] .custom-select-menu button.active {
  background: #72bf78;
  color: #ffffff;
}

/* Keep the real select functional but visually hidden */
#output-type {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dropdown hover follows the mouse only */
.custom-select-menu button.active {
  background: transparent;
  color: var(--text);
}

.custom-select-menu button:hover {
  background: #72bf78;
  color: #ffffff;
}

html[data-theme="dark"] .custom-select-menu button.active {
  background: transparent;
  color: #f5f7fa;
}

html[data-theme="dark"] .custom-select-menu button:hover {
  background: #72bf78;
  color: #ffffff;
}


/* Softer dropdown hover */
.custom-select-menu button:hover {
  background: rgba(114, 191, 120, 0.22);
  color: var(--text);
}

html[data-theme="dark"] .custom-select-menu button:hover {
  background: rgba(114, 191, 120, 0.18);
  color: #f5f7fa;
}


/* Restore custom dropdown trigger appearance */
.custom-select-trigger {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0 14px;
  box-shadow: none;
}

.custom-select-trigger:hover {
  background: #fff;
  color: var(--text);
  border-color: var(--primary);
  box-shadow: none;
  transform: none;
}

html[data-theme="dark"] .custom-select-trigger {
  background: #181b23;
  color: #f5f7fa;
  border-color: #303541;
}

html[data-theme="dark"] .custom-select-trigger:hover {
  background: #18251a;
  color: #f5f7fa;
  border-color: #72bf78;
  box-shadow: none;
  transform: none;
}


/* Final output controls layout */
.output-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.output-section > label {
  display: none !important;
}

.output-section > .custom-select {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
}

.output-section > #generate-button {
  grid-column: 2;
  grid-row: 1;
  width: auto;
}

.output-section > #output-type {
  position: absolute;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Clean final output row */
.output-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.output-section > .custom-select {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.output-section > #generate-button {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-width: 110px;
}

.output-section > #output-type {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Metscore typography */
@font-face {
  font-family: "Fedro";
  src: url("/fonts/fedro-black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Large display headings */
.hero h1 {
  font-family: "Fedro", Verdana, sans-serif;
  font-weight: 900;
}


/* Regular site text */
body {
  font-family: Verdana, Geneva, sans-serif;
}


/* Crisp SVG theme toggle */
#theme-toggle {
  border-radius: 999px;
  -webkit-font-smoothing: antialiased;
}

.theme-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.theme-icon .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon .icon-sun {
  display: block;
}


/* PROMPTLY brand logo */
.logo {
  font-family: "Fedro", Verdana, sans-serif;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.4px;
  color: var(--primary);
}

.logo-dot {
  display: inline-block;
  color: var(--primary);
  font-size: 1.12em;
  line-height: 1;
  margin-left: 1px;
}

html[data-theme="dark"] .logo {
  color: #ffffff;
}

html[data-theme="dark"] .logo-dot {
  color: #ffffff;
}


/* Align header exactly with main workspace */
header {
  width: min(1100px, calc(100% - 40px));
}

nav {
  align-items: center;
}


/* PROMPTLY subtle logo animation */
.logo-word {
  display: inline-block;
  color: var(--primary);
  background: linear-gradient(
    110deg,
    var(--primary) 0%,
    var(--primary) 38%,
    #b9e8bd 48%,
    #ffffff 52%,
    #b9e8bd 56%,
    var(--primary) 66%,
    var(--primary) 100%
  );
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: promptly-shine 5s ease-in-out infinite;
}

.logo-dot {
  font-size: 1.32em;
  margin-left: 1px;
  transform-origin: center bottom;
  animation: promptly-dot 5s ease-in-out infinite;
}

html[data-theme="dark"] .logo-word {
  background: linear-gradient(
    110deg,
    #ffffff 0%,
    #ffffff 38%,
    #b9e8bd 48%,
    var(--primary) 52%,
    #b9e8bd 56%,
    #ffffff 66%,
    #ffffff 100%
  );
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes promptly-shine {
  0%, 68% {
    background-position: 100% 0;
  }
  86%, 100% {
    background-position: -100% 0;
  }
}

@keyframes promptly-dot {
  0%, 76%, 92%, 100% {
    transform: scale(1);
  }
  84% {
    transform: scale(1.18);
  }
}

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


/* PROMPTLY bouncing dot */
.logo-dot {
  display: inline-block;
  font-size: 1.65em;
  line-height: 0.7;
  margin-left: 5px;
  transform-origin: center bottom;
  animation: promptly-dot-bounce 4.5s ease-in-out infinite;
}

@keyframes promptly-dot-bounce {
  0%, 68%, 100% {
    transform: translateY(0) scaleX(1) scaleY(1);
  }

  76% {
    transform: translateY(7px) scaleX(1.12) scaleY(0.86);
  }

  82% {
    transform: translateY(-7px) scaleX(0.94) scaleY(1.08);
  }

  88% {
    transform: translateY(2px) scaleX(1.05) scaleY(0.95);
  }

  93% {
    transform: translateY(-2px) scaleX(0.98) scaleY(1.02);
  }
}

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


/* PROMPTLY final bouncing dot */
.logo-dot {
  display: inline-block;
  font-size: 2.05em;
  line-height: 0.55;
  margin-left: 0;
  transform-origin: center bottom;
  animation: promptly-dot-drop 4.5s ease-in-out infinite;
}

@keyframes promptly-dot-drop {
  0%, 68%, 100% {
    transform: translateY(0) scaleX(1) scaleY(1);
  }

  /* Launch upward */
  76% {
    transform: translateY(-11px) scaleX(0.94) scaleY(1.08);
  }

  /* Hit the resting point */
  83% {
    transform: translateY(0) scaleX(1.22) scaleY(0.78);
  }

  /* Small rebound */
  88% {
    transform: translateY(-4px) scaleX(0.97) scaleY(1.04);
  }

  /* Settle */
  93% {
    transform: translateY(0) scaleX(1.05) scaleY(0.95);
  }
}


/* Permanently disable PROMPTLY text shine */
.logo .logo-word {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: var(--primary) !important;
  color: var(--primary) !important;
  animation: none !important;
}

html[data-theme="dark"] .logo .logo-word {
  background: none !important;
  background-image: none !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
  animation: none !important;
}


/* =========================================
   PROMPTLY — FINAL MOBILE RESPONSIVE LAYOUT
   ========================================= */

@media (max-width: 760px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  header {
    width: calc(100% - 28px);
    height: 68px;
    margin: 0 auto;
  }

  nav {
    gap: 14px;
    flex-shrink: 0;
  }

  nav a {
    font-size: 13px;
  }

  #theme-toggle {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .logo {
    font-size: 20px;
    white-space: nowrap;
  }

  .hero {
    width: calc(100% - 28px);
    max-width: 100%;
    margin: 48px auto 80px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 54px);
    line-height: 0.98;
  }

  .subtitle {
    max-width: 100%;
    font-size: 15px;
    line-height: 1.55;
  }

  .hero-workspace {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .hero-workspace .tool-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
  }

  .demo-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .upload-area {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 38px 14px;
  }

  .output-section {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .output-section > .custom-select,
  .output-section > #generate-button {
    grid-column: 1;
    width: 100%;
  }

  .output-section > .custom-select {
    grid-row: 1;
  }

  .output-section > #generate-button {
    grid-row: 2;
  }

  .custom-select,
  .custom-select-trigger,
  .custom-select-menu {
    max-width: 100%;
  }

  img,
  svg {
    max-width: 100%;
  }
}

@media (max-width: 430px) {

  header {
    width: calc(100% - 20px);
  }

  nav {
    gap: 10px;
  }

  nav a {
    font-size: 12px;
  }

  .logo {
    font-size: 18px;
  }

  #theme-toggle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .hero {
    width: calc(100% - 20px);
    margin-top: 42px;
  }

  .hero h1 {
    font-size: clamp(36px, 11.5vw, 48px);
  }

  .tool-card,
  .demo-card {
    border-radius: 18px;
  }
}


/* =========================================
   SITE FOOTER
   ========================================= */

.site-footer {
  width: 100%;
  margin-top: 80px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  width: min(1100px, calc(100% - 40px));
  min-height: 110px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-email {
  min-width: 190px;
  height: 48px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.footer-email svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

.footer-email:hover {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary);
}

@media (max-width: 760px) {
  .site-footer {
    margin-top: 60px;
  }

  .footer-inner {
    width: calc(100% - 28px);
    min-height: 0;
    padding: 30px 0 36px;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .footer-links {
    justify-content: center;
    gap: 22px;
  }

  .footer-email {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
}

@media (max-width: 430px) {
  .footer-inner {
    width: calc(100% - 20px);
  }

  .footer-links {
    gap: 18px;
  }

  .footer-links a {
    font-size: 12px;
  }
}


/* =========================================
   INNER PAGES — ABOUT / PRIVACY / TERMS
   ========================================= */

.inner-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.inner-page .page-main {
  flex: 1;
  width: min(760px, calc(100% - 40px));
  margin: 70px auto 90px;
}

.page-content {
  width: 100%;
}

.page-content > .eyebrow {
  margin-bottom: 16px;
}

.page-content > h1 {
  max-width: 720px;
  margin-bottom: 24px;
  font-family: "Fedro", Verdana, sans-serif;
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -1.5px;
}

.page-lead {
  max-width: 680px;
  margin-bottom: 58px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.page-content section {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.page-content section h2 {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.3;
}

.page-content section p {
  max-width: 680px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.inner-page .site-footer {
  margin-top: 0;
}

@media (max-width: 760px) {
  .inner-page .page-main {
    width: calc(100% - 28px);
    margin: 48px auto 65px;
  }

  .page-content > h1 {
    font-size: clamp(38px, 11vw, 52px);
    letter-spacing: -1px;
  }

  .page-lead {
    margin-bottom: 42px;
    font-size: 15px;
  }

  .page-content section {
    padding: 26px 0;
  }
}

@media (max-width: 430px) {
  .inner-page .page-main {
    width: calc(100% - 20px);
  }
}


/* =========================================
   LANGUAGE SWITCHER
   ========================================= */

.language-switcher {
  position: relative;
  display: flex;
  align-items: center;
}

#language-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

#language-toggle:hover,
#language-toggle[aria-expanded="true"] {
  background: var(--soft);
  color: var(--primary);
}

#language-toggle svg {
  width: 20px;
  height: 20px;
}

.language-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 10px);
  right: 0;
  width: 165px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(17, 24, 39, .12);
}

.language-menu[hidden] {
  display: none;
}

.language-option {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.language-option:hover {
  background: var(--soft);
}

.language-check {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

html[data-theme="dark"] .language-menu {
  box-shadow: 0 16px 42px rgba(0, 0, 0, .28);
}

@media (max-width: 430px) {
  #language-toggle {
    width: 34px;
    height: 34px;
  }

  .language-menu {
    width: 155px;
    right: -4px;
  }
}


/* Keep header layout fixed in every language */
header {
  direction: ltr;
}

header nav {
  direction: ltr;
}

/* Arabic typography — use Verdana instead of Fedro */
html[lang="ar"] .hero h1,
html[lang="ar"] .page-content > h1 {
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
}

/* Arabic eyebrow typography */
html[lang="ar"] .eyebrow {
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
}

/* Arabic demo flow typography */
html[lang="ar"] .demo-flow span {
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
}

/* =========================================
   CAPABILITIES STRIP
   ========================================= */
.capabilities-strip {
  width: min(1100px, calc(100% - 40px));
  margin: 72px auto 88px;
}

.capabilities-track {
  position: relative;
  min-height: 150px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1.25fr 1fr auto;
  align-items: center;
  gap: 32px;
  overflow: hidden;

  border: 1px solid rgba(114, 191, 120, .32);
  border-radius: 24px;

  background:
    radial-gradient(circle at 12% 20%, rgba(114,191,120,.16), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(114,191,120,.10), transparent 28%),
    var(--surface);

  box-shadow: 0 18px 50px rgba(17,24,39,.055);
}

.capabilities-visual {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cap-chip,
.cap-core,
.cap-outputs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  white-space: nowrap;
}

.cap-chip {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.cap-core {
  min-width: 48px;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: 0 8px 22px rgba(114,191,120,.24);
}

.cap-arrow {
  color: var(--primary);
  font-size: 17px;
}

.cap-outputs {
  position: relative;
  width: 88px;
  height: 38px;
}

.cap-outputs span {
  position: absolute;
  inset: 0;
  color: var(--primary-dark);
  background: var(--soft);
  border: 1px solid rgba(114,191,120,.22);
}

.cap-outputs span:not(:first-child) {
  opacity: 0;
}

.capabilities-copy {
  min-width: 0;
}

.capabilities-kicker {
  margin-bottom: 7px;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
}

.capabilities-copy h3 {
  max-width: 390px;
  font-size: 18px;
  line-height: 1.35;
}

.capabilities-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

html[data-theme="dark"] .capabilities-track {
  box-shadow: 0 18px 50px rgba(0,0,0,.16);
}

@media (max-width: 760px) {
  .capabilities-strip {
    width: calc(100% - 28px);
    margin: 54px auto 68px;
  }

  .capabilities-track {
    min-height: 0;
    padding: 24px 20px;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .capabilities-visual {
    flex-wrap: wrap;
  }

  .capabilities-action {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .capabilities-strip {
    width: calc(100% - 20px);
  }
}

/* =========================================
   CAPABILITIES — CALM MOTION
   ========================================= */

/* Image gently travels toward AI */
.cap-image {
  position: relative;
  animation: cap-image-breathe 4.8s ease-in-out infinite;
}

/* AI softly processes the input */
.cap-core {
  position: relative;
  isolation: isolate;
  animation: cap-ai-pulse 4.8s ease-in-out infinite;
}

.cap-core::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border: 1px solid rgba(114,191,120,.28);
  border-radius: 15px;
  opacity: 0;
  transform: scale(.82);
  animation: cap-ai-ring 4.8s ease-out infinite;
}

/* Arrows breathe instead of flashing */
.cap-arrow {
  animation: cap-arrow-flow 4.8s ease-in-out infinite;
}

/* Cycle through the possible outputs */
.cap-outputs span {
  opacity: 0;
  transform: translateY(6px) scale(.96);
  animation: cap-output-cycle 12s ease-in-out infinite;
}

.cap-outputs span:nth-child(1) { animation-delay: 0s; }
.cap-outputs span:nth-child(2) { animation-delay: 3s; }
.cap-outputs span:nth-child(3) { animation-delay: 6s; }
.cap-outputs span:nth-child(4) { animation-delay: 9s; }

/* Very subtle ambient glow */
.capabilities-track::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  left: -110px;
  top: -120px;
  border-radius: 50%;
  background: rgba(114,191,120,.10);
  filter: blur(28px);
  pointer-events: none;
  animation: cap-ambient 9s ease-in-out infinite alternate;
}

@keyframes cap-image-breathe {
  0%, 18%, 100% {
    transform: translateX(0);
  }
  38%, 52% {
    transform: translateX(4px);
  }
}

@keyframes cap-ai-pulse {
  0%, 25%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(114,191,120,.20);
  }
  40%, 55% {
    transform: scale(1.045);
    box-shadow: 0 10px 28px rgba(114,191,120,.34);
  }
}

@keyframes cap-ai-ring {
  0%, 25% {
    opacity: 0;
    transform: scale(.82);
  }
  38% {
    opacity: .75;
  }
  62%, 100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes cap-arrow-flow {
  0%, 20%, 100% {
    opacity: .42;
    transform: translateX(0);
  }
  38%, 58% {
    opacity: 1;
    transform: translateX(2px);
  }
}

@keyframes cap-output-cycle {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(.96);
  }
  5%, 20% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  25%, 100% {
    opacity: 0;
    transform: translateY(-5px) scale(.98);
  }
}

@keyframes cap-ambient {
  from {
    transform: translate3d(0,0,0) scale(1);
    opacity: .55;
  }
  to {
    transform: translate3d(90px,35px,0) scale(1.18);
    opacity: .9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cap-image,
  .cap-core,
  .cap-core::before,
  .cap-arrow,
  .cap-outputs span,
  .capabilities-track::before {
    animation: none !important;
  }

  .cap-outputs span:first-child {
    opacity: 1;
    transform: none;
  }
}

/* Capability messages — synchronized with output cycle */
.capabilities-messages {
  position: relative;
  height: 50px;
  max-width: 390px;
}

.capabilities-messages h3 {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(7px);
  animation: cap-message-cycle 12s ease-in-out infinite;
}

.capabilities-messages h3:nth-child(1) { animation-delay: 0s; }
.capabilities-messages h3:nth-child(2) { animation-delay: 3s; }
.capabilities-messages h3:nth-child(3) { animation-delay: 6s; }
.capabilities-messages h3:nth-child(4) { animation-delay: 9s; }

@keyframes cap-message-cycle {
  0% {
    opacity: 0;
    transform: translateY(7px);
  }

  5%, 20% {
    opacity: 1;
    transform: translateY(0);
  }

  25%, 100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .capabilities-messages h3 {
    animation: none !important;
    opacity: 0;
    transform: none;
  }

  .capabilities-messages h3:first-child {
    opacity: 1;
  }
}

/* =========================================
   CAPABILITIES — FINAL MOBILE LAYOUT
   ========================================= */
@media (max-width: 760px) {
  .capabilities-strip {
    width: calc(100% - 28px);
    max-width: 100%;
    margin: 54px auto 68px;
  }

  .capabilities-track {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 26px 20px;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    overflow: hidden;
  }

  .capabilities-visual {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 7px;
  }

  .cap-chip,
  .cap-core,
  .cap-outputs span {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 9px;
    letter-spacing: .35px;
  }

  .cap-core {
    min-width: 42px;
  }

  .cap-arrow {
    flex: 0 0 auto;
    font-size: 14px;
  }

  .cap-outputs {
    flex: 0 0 76px;
    width: 76px;
    height: 34px;
  }

  .capabilities-copy {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .capabilities-kicker {
    margin-bottom: 9px;
    font-size: 9px;
    letter-spacing: .9px;
  }

  .capabilities-messages {
    width: 100%;
    max-width: 100%;
    height: 52px;
    margin: 0 auto;
  }

  .capabilities-messages h3 {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
  }

  .capabilities-action {
    width: min(220px, 100%);
    min-height: 42px;
    margin: 0 auto;
  }
}

@media (max-width: 430px) {
  .capabilities-strip {
    width: calc(100% - 20px);
    margin: 48px auto 62px;
  }

  .capabilities-track {
    padding: 24px 14px;
    border-radius: 20px;
    gap: 22px;
  }

  .capabilities-visual {
    gap: 5px;
  }

  .cap-chip,
  .cap-core,
  .cap-outputs span {
    padding: 6px 7px;
    font-size: 8px;
  }

  .cap-core {
    min-width: 38px;
  }

  .cap-outputs {
    flex-basis: 70px;
    width: 70px;
  }

  .capabilities-messages {
    height: 58px;
  }

  .capabilities-messages h3 {
    font-size: 15px;
  }
}

/* Mobile only — show the visual demo before the upload tool */
@media (max-width: 760px) {
  .hero-workspace .demo-card {
    order: 1;
  }

  .hero-workspace .tool-card {
    order: 2;
  }
}

/* Mobile only — unified vertical rhythm */
@media (max-width: 760px) {
  .hero-workspace {
    gap: 32px;
  }

  .hero {
    margin-bottom: 32px;
  }

  .capabilities-strip {
    margin-top: 0;
    margin-bottom: 32px;
  }
}

/* Mobile only — refined hero H1 */
@media (max-width: 760px) {
  .hero h1 {
    font-size: clamp(34px, 9.5vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.7px;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: clamp(32px, 9.5vw, 40px);
    line-height: 1.06;
    letter-spacing: -0.5px;
  }
}

/* Desktop / laptop — refined hero H1 */
@media (min-width: 761px) {
  .hero h1 {
    font-size: clamp(46px, 5vw, 58px);
    line-height: 1.04;
    letter-spacing: -0.9px;
  }
}
