/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #f5f4fc;
  color: #2f2f4a;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.nav-logo { height: 60px; width: auto; }

.nav-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

/* ── Hero Section ────────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(145deg, #0f0620 0%, #1e0d45 25%, #331b69 55%, #6a2ea8 80%, #c43ca0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 5rem;
  overflow: hidden;
}

/* Decorative blobs */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(244,83,196,0.35) 0%, transparent 70%);
  top: -150px; right: -150px;
}
.hero-blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(93,61,184,0.4) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}
.hero-blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(244,83,196,0.2) 0%, transparent 70%);
  top: 40%; left: 10%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  text-align: center;
}

.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0 auto 2.5rem;
  max-width: 560px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255,255,255,0.72);
  line-height: 1.6;
}

/* ── Upload Card ─────────────────────────────────────────────────────────── */
.upload-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(12,6,35,0.45), 0 0 0 1px rgba(255,255,255,0.08);
  padding: 1.5rem;
  text-align: left;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #d0c8f8;
  border-radius: 14px;
  background: #f9f8ff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: #7c5dd8;
  background: #f3efff;
}

.drop-zone.has-image {
  border-style: solid;
  border-color: #a88df0;
  background: #f9f8ff;
}

.drop-state { width: 100%; padding: 2rem 1rem; text-align: center; }

.drop-icon {
  width: 40px; height: 40px;
  color: #9381d8;
  margin: 0 auto 0.75rem;
  display: block;
}

.drop-primary {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2f2f4a;
}

.drop-or {
  margin: 0 0 0.75rem;
  color: #9395b0;
  font-size: 0.9rem;
}

.browse-btn {
  display: inline-block;
  background: linear-gradient(135deg, #331b69 0%, #5d3db8 60%, #f453c4 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.browse-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(87,55,163,0.3); }

.drop-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #9395b0;
}

.file-input-hidden {
  position: absolute;
  opacity: 0; width: 1px; height: 1px;
  pointer-events: none;
}

/* Preview state */
.drop-preview { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }

.preview-img {
  max-height: 160px;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.preview-name {
  font-size: 0.85rem;
  color: #4a4f75;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.change-image-btn {
  font: inherit;
  font-size: 0.82rem;
  color: #7c5dd8;
  background: none;
  border: 1px solid #c8baf8;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}

.change-image-btn:hover { background: #f3efff; }

/* Settings row */
.settings-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.settings-field {
  flex: 1;
  min-width: 160px;
}

.settings-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3c3661;
  margin-bottom: 0.35rem;
}

.settings-input {
  width: 100%;
  border: 1px solid #d4d8ef;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: #fcfcff;
  color: #2f2f4a;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-input:focus {
  outline: none;
  border-color: #6b56c8;
  box-shadow: 0 0 0 3px rgba(107,86,200,0.16);
}

.generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #331b69 0%, #5d3db8 60%, #f453c4 100%);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.15s;
  flex-shrink: 0;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(87,55,163,0.3);
}

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

.generate-btn-block {
  width: 100%;
  justify-content: center;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  font-size: 1rem;
}

.settings-row-cta { align-items: stretch; }

/* ── Model selector ──────────────────────────────────────────────────────── */
.model-selector-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.model-tabs {
  display: flex;
  background: #f0eeff;
  border: 1.5px solid #ddd8f8;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.model-tab { position: relative; }

.model-tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}

.model-tab-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #7a7fa0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
  white-space: nowrap;
}

.model-tab input[type="radio"]:checked + .model-tab-label {
  background: linear-gradient(135deg, #331b69 0%, #5d3db8 60%, #f453c4 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(87,55,163,0.25);
}

.model-tab-label:hover { color: #3c3661; }
.model-tab input[type="radio"]:checked + .model-tab-label:hover { color: #fff; }

/* Advanced options */
.advanced-details {
  margin-top: 0.85rem;
  border-top: 1px solid #ebebf5;
  padding-top: 0.75rem;
}

.advanced-summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: #7a7fa0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.advanced-summary::before { content: "▸"; font-size: 0.7rem; transition: transform 0.2s; }
.advanced-details[open] .advanced-summary::before { transform: rotate(90deg); }
.advanced-summary::-webkit-details-marker { display: none; }

.advanced-body {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.advanced-body label { font-size: 0.82rem; font-weight: 600; color: #3c3661; }

.advanced-body textarea, .advanced-body input[type="text"] {
  width: 100%;
  border: 1px solid #d4d8ef;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  background: #fcfcff;
  color: #2f2f4a;
  resize: vertical;
}

.checkbox-label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
  font-weight: 400 !important;
  color: #4a4f75 !important;
}
.checkbox-label input[type="checkbox"] { margin-top: 0.15rem; width: auto; }

.hero-drag-hint {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
}

/* ── How it Works ────────────────────────────────────────────────────────── */
.how-section {
  background: #ffffff;
  padding: 4rem 1.5rem;
}

.how-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.how-title {
  margin: 0 0 2.5rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #1e1040;
}

.how-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.how-card {
  flex: 1;
  min-width: 200px;
  max-width: 260px;
  padding: 1.5rem 1rem;
  text-align: center;
}

.how-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #331b69, #f453c4);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.how-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1e1040;
}

.how-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #5a5f80;
  line-height: 1.55;
}

.how-arrow {
  font-size: 1.4rem;
  color: #c8baf8;
  align-self: center;
  padding: 0 0.5rem;
  flex-shrink: 0;
}

/* ── Results Section ─────────────────────────────────────────────────────── */
.results-section {
  background: #f5f4fc;
  padding: 2.5rem 1.5rem 4rem;
}

.results-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 1px solid #e7e8f4;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(35,20,79,0.06);
  padding: 1.5rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e1040;
}

.details-card { padding: 1.25rem 1.5rem; }
.details-card[open] { padding-bottom: 1.5rem; }

.details-summary {
  font-size: 1rem;
  font-weight: 700;
  color: #1e1040;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  margin: 0;
}
.details-summary::before { content: "▸"; font-size: 0.75rem; transition: transform 0.2s; }
.details-card[open] .details-summary::before { transform: rotate(90deg); }
.details-summary::-webkit-details-marker { display: none; }

.muted { color: #7a7f9f; margin-top: 0.5rem; font-size: 0.9rem; }

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #3c3661;
}

input, textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d4d8ef;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: #fcfcff;
  color: #2f2f4a;
  font: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #6b56c8;
  box-shadow: 0 0 0 3px rgba(107,86,200,0.16);
}

/* ── Pipeline Steps ──────────────────────────────────────────────────────── */
.pipeline-card { }

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.step-card {
  border: 1px solid #dfe3f6;
  border-radius: 10px;
  padding: 0.7rem;
  background: #fafbff;
}

.step-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #331b69;
}

.step-card p {
  margin: 0;
  color: #5f6487;
  font-size: 0.8rem;
  line-height: 1.35;
}

.step-card.step-active { border-color: #a88df0; background: #faf7ff; }
.step-card.step-done { border-color: #7dd3a8; background: #f4fff8; }
.step-card.step-error { border-color: #f2a3a3; background: #fff6f6; }

/* ── Result Panel ────────────────────────────────────────────────────────── */
.result-panel { display: flex; flex-direction: column; gap: 1rem; }
.result-panel.hidden { display: none; }

.result-summary {
  color: #3b3d5f;
  font-weight: 600;
  font-size: 0.9rem;
  background: #f8f3ff;
  border: 1px solid #eadcfd;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #331b69 0%, #5d3db8 60%, #f453c4 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.8rem 1.25rem;
  font-size: 1rem;
  width: fit-content;
  transition: transform 0.15s, box-shadow 0.2s;
}
.download-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(87,55,163,0.3); }

.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.install-card {
  border: 1px solid #dfe3f6;
  border-radius: 10px;
  padding: 0.85rem;
  background: #fafbff;
}

.install-card h3 { margin: 0 0 0.35rem; font-size: 0.9rem; color: #331b69; }
.install-card p { margin: 0; color: #4a4f75; font-size: 0.85rem; line-height: 1.45; }

/* ── Font Preview ────────────────────────────────────────────────────────── */
.font-preview {
  margin-top: 0.75rem;
  border: 1px solid #dfe3f6;
  border-radius: 10px;
  background: #fafbff;
  padding: 1.25rem;
  min-height: 100px;
  font-size: 30px;
  line-height: 1.45;
  color: #1e2345;
}

/* ── SVG Type Tester ─────────────────────────────────────────────────────── */
.svg-tester { display: flex; flex-direction: column; gap: 1rem; }

.svg-tester-input {
  width: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #d4d8ef;
  border-radius: 8px;
  background: #ffffff;
  resize: vertical;
}

.svg-tester-controls {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center;
  padding: 0.5rem 0;
  border-top: 1px solid #e5e7f5;
  border-bottom: 1px solid #e5e7f5;
}

.svg-tester-controls .control-group {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.84rem;
}

.svg-tester-controls .control-group span:first-child {
  color: #7a7fa0;
  min-width: 5.5rem;
}

.svg-tester-controls input[type="range"] { width: 130px; }

.svg-tester-controls input[type="color"] {
  width: 36px; height: 28px; padding: 0;
  border: 1px solid #d4d8ef;
  border-radius: 6px; background: none; cursor: pointer;
}

.svg-tester-controls .size-display {
  font-size: 0.78rem;
  color: #7a7fa0;
  font-variant-numeric: tabular-nums;
  min-width: 3.5ch;
}

.svg-tester-output {
  background: #fafaf7;
  border: 1px solid #e5e7f5;
  border-radius: 10px;
  padding: 1.2rem;
  min-height: 100px;
  overflow-x: auto;
  line-height: 1.4;
}

.svg-tester-output .svg-line { display: flex; align-items: flex-end; flex-wrap: nowrap; }
.svg-tester-output .svg-glyph { display: inline-block; vertical-align: bottom; flex-shrink: 0; }
.svg-tester-output .svg-glyph svg { display: block; }

.svg-tester-metrics {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.2rem;
}

/* ── Style Examples ──────────────────────────────────────────────────────── */
.style-examples { margin-top: 0.85rem; display: flex; flex-direction: column; gap: 0.65rem; }

.style-stats {
  border: 1px dashed #d7dbf0;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  color: #4a4f75;
  background: #fbfcff;
  font-size: 0.88rem;
}

.style-card {
  border: 1px solid #dfe3f6;
  border-radius: 10px;
  padding: 0.85rem;
  background: #fafbff;
}

.style-card h3 { margin: 0 0 0.3rem; font-size: 0.95rem; color: #331b69; }
.style-desc { margin: 0 0 0.4rem; color: #4a4f75; font-size: 0.88rem; }
.style-samples { margin: 0; padding-left: 1rem; color: #2f2f4a; font-size: 0.88rem; }
.style-samples li { margin: 0.2rem 0; }

/* ── AI / Gemini Output ──────────────────────────────────────────────────── */
.gemini-output { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }

.gemini-output-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid #dfe3f6;
  border-radius: 8px;
  background: #fff;
}

.gemini-output textarea[readonly] { background: #f7f8ff; font-size: 0.82rem; }

.ocr-label { margin-top: 0.4rem; }

.ocr-grid {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.ocr-item {
  border: 1px solid #dfe3f6;
  border-radius: 8px;
  padding: 0.4rem;
  background: #fff;
  text-align: center;
}

.ocr-item img {
  width: 100%;
  height: 60px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}

.ocr-item .char { margin-top: 0.3rem; font-size: 0.78rem; font-weight: 700; color: #331b69; }

/* ── Technical status ────────────────────────────────────────────────────── */
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f8ff;
  border: 1px solid #dfe3f6;
  border-radius: 8px;
  padding: 0.75rem;
  color: #3b3d5f;
  font-size: 0.82rem;
  margin: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #e7e8f4;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: #6a6f8f;
}

.site-footer a {
  color: #5c3ec0;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

/* ── Loading Overlay + Mini Game ─────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 3, 22, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(6px);
  padding: 1rem;
}

.loading-overlay.hidden { display: none; }

/* Game wrapper */
.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 540px;
}

/* Status pill */
.game-status-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.88rem;
  font-weight: 600;
}

.spinner-small {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #f453c4;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

.loading-message { color: inherit; font-weight: inherit; }

/* Game canvas */
.game-canvas {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  display: block;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

/* HUD */
.game-hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
  padding: 0 0.25rem;
}

.game-score-block, .game-lives-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.game-lives-block { align-items: flex-end; }

.game-hud-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.38);
  font-weight: 700;
}

.game-score-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f453c4;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.game-lives {
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  line-height: 1;
  color: #f472b6;
}

.game-hint {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.28);
  text-align: center;
}

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

.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════════ */
/*  RESULT PAGE                                                               */
/* ══════════════════════════════════════════════════════════════════════════ */

/* Page transitions */
#pageHome { animation: pageFadeIn 0.35s ease; }
.page-result { background: #f7f6fd; min-height: 100vh; animation: pageFadeIn 0.4s ease; }

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

/* ── Result nav ─────────────────────────────────────────────────────────── */
.result-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e8e7f5;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo-dark { height: 64px; width: auto; }

.restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #5c3ec0;
  background: none;
  border: 1.5px solid #cdc5f5;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.restart-btn:hover { background: #f3efff; border-color: #9b87e8; }

/* ── Result hero ────────────────────────────────────────────────────────── */
.result-hero-section {
  background: linear-gradient(145deg, #0f0620 0%, #1e0d45 30%, #331b69 65%, #7b3bb0 90%, #c43ca0 100%);
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
}

.result-hero-inner { max-width: 600px; margin: 0 auto; }

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.result-font-name {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.result-font-name-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
}

.result-font-name-input {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 0.65rem;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.result-font-name-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.result-font-name-input:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.result-font-name-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(244, 83, 196, 0.7);
  box-shadow: 0 0 0 3px rgba(244, 83, 196, 0.25);
}

.result-meta {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

/* ── Specimen section ───────────────────────────────────────────────────── */
.specimen-section {
  background: #ffffff;
  border-bottom: 1px solid #e7e8f4;
  padding: 2rem 1.5rem;
}

.specimen-inner { max-width: 900px; margin: 0 auto; }

.specimen-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eeedf8;
}

.specimen-text-input {
  flex: 1;
  min-width: 200px;
  border: 1.5px solid #d4d8ef;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.92rem;
  background: #fafaff;
  color: #2f2f4a;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.specimen-text-input:focus {
  outline: none;
  border-color: #6b56c8;
  box-shadow: 0 0 0 3px rgba(107,86,200,0.14);
}

.specimen-size-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.specimen-size-wrap input[type="range"] { width: 110px; }
.specimen-size-label {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: #7a7fa0;
  min-width: 3.5ch;
}

.specimen-output {
  font-size: 72px;
  line-height: 1.25;
  color: #1a1040;
  min-height: 90px;
  word-break: break-word;
  overflow-wrap: break-word;
  padding: 0.25rem 0;
  transition: font-size 0.15s;
}

.specimen-secondary {
  font-size: 48px;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e5e4f5;
  color: #3a325a;
}

.specimen-small {
  font-size: 36px;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e5e4f5;
  color: #5a5278;
  letter-spacing: 0.05em;
}

/* ── Download section ───────────────────────────────────────────────────── */
.download-section {
  background: #f7f6fd;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid #e7e8f4;
}

.download-inner { max-width: 500px; margin: 0 auto; }

.big-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, #331b69 0%, #5d3db8 55%, #f453c4 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 14px;
  padding: 0.95rem 2rem;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 24px rgba(87,55,163,0.28);
}
.big-download-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(87,55,163,0.35); }

.download-hint {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: #7a7fa0;
}

/* ── Install section ────────────────────────────────────────────────────── */
.install-section {
  background: #ffffff;
  padding: 2.5rem 1.5rem;
  border-bottom: 1px solid #e7e8f4;
}

.install-inner { max-width: 860px; margin: 0 auto; }

.install-title {
  margin: 0 0 1.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e1040;
  text-align: center;
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.install-card {
  border: 1.5px solid #e4e1f7;
  border-radius: 14px;
  padding: 1.25rem;
  background: #fafaff;
}

.install-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3efff, #ede5ff);
  display: flex; align-items: center; justify-content: center;
  color: #5d3db8;
  margin-bottom: 0.75rem;
}

.install-card h3 { margin: 0 0 0.65rem; font-size: 1rem; color: #1e1040; }

.install-card ol {
  margin: 0;
  padding-left: 1.25rem;
  color: #4a4f75;
  font-size: 0.88rem;
  line-height: 1.7;
}

.install-card ol li + li { margin-top: 0.1rem; }

.result-footer { background: #fff; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .hero-title { font-size: 2.2rem; }

  .settings-row { flex-direction: column; align-items: stretch; }
  .generate-btn { width: 100%; justify-content: center; }

  .how-steps { flex-direction: column; align-items: center; }
  .how-arrow { transform: rotate(90deg); padding: 0; }
  .how-card { max-width: 320px; }

  .pipeline-steps { grid-template-columns: 1fr; }
  .install-grid { grid-template-columns: 1fr; }

  .site-footer { flex-direction: column; gap: 0.4rem; text-align: center; }

  .specimen-output { font-size: 48px; }
  .specimen-secondary { font-size: 32px; }
  .specimen-small { font-size: 24px; }
  .specimen-toolbar { flex-direction: column; align-items: stretch; }
  .specimen-size-wrap { justify-content: space-between; }
  .specimen-size-wrap input[type="range"] { flex: 1; }
}

@media (max-width: 480px) {
  .hero-section { padding: 6rem 1rem 4rem; }
  .upload-card { padding: 1rem; }
  .install-grid { grid-template-columns: 1fr; }
  .big-download-btn { font-size: 1rem; padding: 0.85rem 1.25rem; width: 100%; }
}
