/* ============================================================
   AvatarForge — static design system (pure CSS3, no frameworks)
   Mobile-first · light/dark · reduced-motion aware
   ============================================================ */

/* ————— Fonts (self-hosted, swap) ————— */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/assets/fonts/sora-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-600.woff2") format("woff2");
}

/* ————— Design tokens ————— */
:root {
  /* Spacing scale — use these instead of ad-hoc values */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 2.5rem;
  --space-9: 3rem;
  --space-10: 4rem;
  /* Layout */
  --container: 76rem;
  --radius: 0.75rem;
  --background: #fbf9fe;
  --foreground: #201a2c;
  --card: #ffffff;
  --card-foreground: #201a2c;
  --muted: #f3eff8;
  --muted-foreground: #6f6584;
  --accent: #f0eafc;
  --accent-foreground: #4c1d95;
  --primary: #7c3aed;
  --primary-foreground: #fafafa;
  --secondary: #f3eff8;
  --secondary-foreground: #4c1d95;
  --destructive: #dc2626;
  --destructive-soft: rgba(220, 38, 38, 0.08);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.1);
  --border: rgba(124, 58, 237, 0.14);
  --input: rgba(124, 58, 237, 0.2);
  --ring: #8b5cf6;
  --shadow-sm: 0 1px 2px rgba(32, 26, 44, 0.05), 0 1px 3px rgba(32, 26, 44, 0.04);
  --shadow-md: 0 2px 4px rgba(32, 26, 44, 0.05), 0 8px 20px -6px rgba(32, 26, 44, 0.1);
  --shadow-lg: 0 4px 8px rgba(32, 26, 44, 0.05), 0 18px 40px -12px rgba(76, 29, 149, 0.18);
  --shadow-btn: 0 1px 2px rgba(76, 29, 149, 0.24), 0 6px 16px -4px rgba(124, 58, 237, 0.4);
  --shadow-btn-lg: 0 2px 4px rgba(76, 29, 149, 0.28), 0 10px 24px -6px rgba(124, 58, 237, 0.48);
  --gradient-brand: linear-gradient(100deg, #7c3aed, #c026d3 55%, #f43f5e);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --header-h: 4rem;
}
[data-theme="dark"] {
  --background: #16121f;
  --foreground: #f5f2fa;
  --card: #201a2c;
  --card-foreground: #f5f2fa;
  --muted: #262035;
  --muted-foreground: #a89fbc;
  --accent: #2c2440;
  --accent-foreground: #ddd1f7;
  --primary: #8b5cf6;
  --primary-foreground: #fafafa;
  --secondary: #262035;
  --secondary-foreground: #ddd1f7;
  --destructive: #f87171;
  --destructive-soft: rgba(248, 113, 113, 0.1);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --input: rgba(255, 255, 255, 0.16);
  --ring: #8b5cf6;
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px -4px rgba(124, 58, 237, 0.45);
  --shadow-btn-lg: 0 2px 4px rgba(0, 0, 0, 0.45), 0 10px 24px -6px rgba(124, 58, 237, 0.5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.35), 0 8px 20px -6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.35), 0 18px 40px -12px rgba(0, 0, 0, 0.55);
}

/* ————— Reset / base ————— */
*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img,
canvas,
svg,
video {
  max-width: 100%;
  display: block;
}
/* Global hidden state (filter items, JS-toggled panels) */
[hidden] {
  display: none !important;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
}
input, select, textarea {
  font: inherit;
  color: inherit;
}
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
::selection {
  background: rgba(124, 58, 237, 0.25);
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.35) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.35); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.55); }

/* ————— Accessibility helpers ————— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
}
:focus:not(:focus-visible) { outline: none; }

/* ————— Icons ————— */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: -0.25em;
}
.icon-sm { width: 1em; height: 1em; }

/* ————— Layout ————— */
.site-main {
  flex: 1;
  width: 100%;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) {
  .container { padding-inline: 1.5rem; }
}
.section {
  padding-block: 3.5rem;
}
@media (min-width: 640px) {
  .section { padding-block: 5rem; }
}
.section-alt {
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.section-heading {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-desc {
  margin-top: 0.75rem;
  color: var(--muted-foreground);
  font-size: 1rem;
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-6 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-6 { grid-template-columns: repeat(6, 1fr); }
}

/* ————— Buttons ————— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease,
    background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-btn);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-btn-lg);
  transform: translateY(-1px);
  filter: saturate(1.08);
}
.btn-primary:hover:not(:disabled) .icon { transform: translateX(2px); }
.btn-primary .icon { transition: transform 0.2s ease; }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-outline {
  background: color-mix(in srgb, var(--background) 70%, transparent);
  border-color: var(--input);
  color: var(--foreground);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}
.btn-ghost {
  color: var(--muted-foreground);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--accent);
  color: var(--foreground);
}
.btn-sm { min-height: 38px; padding: 0.35rem 0.85rem; font-size: 0.875rem; }
.btn-lg { min-height: 48px; padding: 0.7rem 1.75rem; font-size: 1.05rem; font-weight: 700; }
.btn-block { width: 100%; }

/* ————— Badges / chips / pills ————— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-soft {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}
.badge-outline {
  border: 1px solid var(--input);
  color: var(--muted-foreground);
  background: var(--card);
}
.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
  min-height: 40px;
}
.chip:hover { border-color: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--foreground); }
.chip[aria-selected="true"],
.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
}

/* ————— Cards ————— */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}
@media (min-width: 640px) {
  .card { padding: 1.5rem; }
}
.card-hover {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
  box-shadow: var(--shadow-lg);
}
.card-hover:hover .link-arrow .icon,
.card-hover:hover .preset-link .icon { transform: translateX(3px); }
a.card { display: block; }

.feature-card .feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(217, 70, 239, 0.1));
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.15);
  color: var(--primary);
  margin-bottom: 0.85rem;
}
.feature-title { font-size: 1.02rem; font-weight: 700; }
.feature-desc { margin-top: 0.35rem; font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.55; }

.step-card { position: relative; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.step-title { font-size: 1.05rem; font-weight: 700; }
.step-desc { margin-top: 0.35rem; font-size: 0.9rem; color: var(--muted-foreground); }

.tool-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-card-body { min-width: 0; }
.tool-card-title { font-size: 1rem; font-weight: 700; }
.tool-card-desc { margin-top: 0.15rem; font-size: 0.875rem; color: var(--muted-foreground); }
.tool-card-arrow {
  margin-left: auto;
  color: var(--muted-foreground);
  transition: transform 0.2s, color 0.2s;
}
a.tool-card:hover .tool-card-arrow { transform: translateX(3px); color: var(--primary); }

/* ————— Alerts ————— */
.alert {
  border-radius: calc(var(--radius) - 2px);
  padding: 0.85rem 1rem;
  font-size: 0.925rem;
  line-height: 1.5;
}
.alert-error {
  background: var(--destructive-soft);
  color: var(--destructive);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.alert-success {
  background: var(--success-soft);
  color: var(--success);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}
.alert-success strong { color: var(--success); }
[data-theme="dark"] .alert-success { color: #bbf7d0; }
[data-theme="dark"] .alert-success strong { color: #bbf7d0; }

/* ————— Forms ————— */
.field { margin-bottom: 1.1rem; }
.field label,
.field > span.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.field .req { color: var(--destructive); }
input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--input);
  background: var(--background);
  border-radius: calc(var(--radius) - 3px);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}
.field-error { color: var(--destructive); font-size: 0.85rem; margin-top: 0.35rem; }
.field-hint { color: var(--muted-foreground); font-size: 0.8rem; margin-top: 0.35rem; }
.field.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #d946ef);
  opacity: 0.35;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 999px;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #d946ef);
  opacity: 0.35;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--primary);
  border: 2px solid #fff;
}
.field label output { font-weight: 500; color: var(--muted-foreground); font-size: 0.82rem; }

/* ————— Header ————— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: var(--header-h);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, #7c3aed, #d946ef 60%, #fb7185);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: var(--shadow-sm);
}
.logo-accent {
  background: linear-gradient(100deg, #7c3aed, #d946ef, #f43f5e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-desktop { display: none; }
.nav-list { display: flex; align-items: center; gap: 0.15rem; }
.nav-link {
  position: relative;
  display: inline-block;
  border-radius: 0.5rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-brand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.nav-link:hover { background: var(--accent); color: var(--foreground); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--primary); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 0.4rem; }
.theme-toggle,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}
.theme-toggle:hover, .menu-toggle:hover { background: var(--accent); color: var(--foreground); }
.theme-toggle .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-light { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-dark { display: inline-flex; }
.header-cta { display: none; }
.menu-toggle .menu-close-icon { display: none; }
.menu-toggle[aria-expanded="true"] .menu-open-icon { display: none; }
.menu-toggle[aria-expanded="true"] .menu-close-icon { display: block; }
@media (min-width: 640px) {
  .header-cta { display: inline-flex; }
}
@media (min-width: 1024px) {
  .nav-desktop { display: block; }
  .menu-toggle { display: none; }
}

/* Mobile menu */
.mobile-menu {
  border-top: 1px solid var(--border);
  background: var(--background);
  padding: 0.75rem 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
}
.mobile-menu[hidden] { display: none; }
.nav-list-m li + li { margin-top: 0.15rem; }
.nav-link-m {
  display: block;
  border-radius: 0.6rem;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--foreground) 80%, transparent);
}
.nav-link-m:hover { background: var(--accent); }
.nav-link-m.is-active { background: var(--accent); color: var(--primary); }
.mobile-menu .btn-block { margin-top: 1rem; }
body.menu-open { overflow: hidden; }

/* ————— Footer ————— */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 45%, transparent);
  padding-bottom: env(safe-area-inset-bottom);
}
.footer-grid {
  display: grid;
  gap: var(--space-7);
  padding-block: var(--space-9) var(--space-8);
}
@media (min-width: 480px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr 1fr; gap: var(--space-6); }
}
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 480px) {
  .footer-brand { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .footer-brand { grid-column: auto; padding-right: var(--space-4); }
}
.footer-tagline {
  margin-top: 1rem;
  max-width: 20rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.footer-badges li {
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  padding: 0.2rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.footer-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.footer-links { margin-top: 1rem; display: grid; gap: 0.6rem; }
.footer-links a {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 4px;
}
/* Compact footer on mobile: 2-up link columns, tighter rhythm */
@media (max-width: 479px) {
  .footer-links a { padding-block: 0.15rem; }
  .footer-heading { margin-top: 0; }
  .footer-col + .footer-col { margin-top: 0.25rem; }
}
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.footer-bottom a { text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom a:hover { color: var(--foreground); }

/* ————— Breadcrumbs ————— */
.breadcrumbs { padding-block: 0.5rem; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
.breadcrumbs a {
  color: var(--muted-foreground);
  transition: color 0.15s;
  border-radius: 4px;
}
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--foreground); font-weight: 500; }
.crumb-sep { width: 0.9em; height: 0.9em; opacity: 0.6; }

/* ————— Page hero ————— */
.page-hero { padding-block: 2.5rem 3.5rem; text-align: center; }
@media (min-width: 640px) {
  .page-hero { padding-block: 4rem 5rem; }
}
.page-hero .breadcrumbs { text-align: left; }
@media (min-width: 640px) {
  .page-hero .breadcrumbs { text-align: center; }
  .page-hero .breadcrumbs ol { justify-content: center; }
}
.page-hero-badge { margin-bottom: 1rem; }
.page-hero-inner { max-width: 46rem; margin-inline: auto; }
.page-hero-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-hero-subtitle {
  margin-top: 1rem;
  color: var(--muted-foreground);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
}
.hero-cta-row {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}
@media (min-width: 640px) {
  .hero-cta-row {
    flex-direction: row;
    justify-content: center;
  }
  .hero-cta-row .btn { min-width: 220px; }
}

/* Decorative helpers */
.text-gradient {
  background-image: linear-gradient(100deg, #7c3aed, #d946ef 55%, #f43f5e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-glow {
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(124, 58, 237, 0.12), transparent),
    radial-gradient(ellipse 50% 45% at 85% 10%, rgba(217, 70, 239, 0.1), transparent);
}
.bg-dotted {
  background-image: radial-gradient(rgba(124, 58, 237, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ————— Home hero ————— */
.home-hero { overflow: hidden; }
.home-hero-grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
  padding-block: 2rem 3rem;
}
/* Mobile-first hero order (PRD §3): H1+copy → CTAs → compact visual → trust row.
   DOM: .home-hero-copy → .hero3d-wrap → .hero-trust (fallback: checklist inside copy). */
@media (min-width: 1024px) {
  .home-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas: "copy visual" "trust visual";
    align-items: start;
    padding-block: 3.5rem 4.5rem;
    gap: var(--space-6) var(--space-9);
  }
  .home-hero-copy { grid-area: copy; align-self: center; }
  .hero3d-wrap { grid-area: visual; align-self: center; }
  .hero-trust { grid-area: trust; align-self: end; }
}
.home-hero-copy { text-align: center; }
@media (min-width: 1024px) {
  .home-hero-copy { text-align: left; }
}
.home-hero-title {
  font-size: clamp(2.2rem, 7vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.home-hero-sub {
  margin-top: 1.25rem;
  max-width: 36rem;
  margin-inline: auto;
  color: var(--muted-foreground);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
}
@media (min-width: 1024px) {
  .home-hero-sub { margin-inline: 0; }
}
.hero-checklist {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}
@media (min-width: 1024px) { .hero-checklist { justify-content: flex-start; } }
.hero-checklist li { display: flex; align-items: center; gap: 0.4rem; }
.hero-checklist .icon { color: var(--primary); }

/* ————— 3D hero scene (lightweight CSS-3D, JS-enhanced) ————— */
.hero3d-wrap { position: relative; }
.hero3d-wrap::before {
  content: "";
  position: absolute;
  inset: -1.5rem;
  border-radius: 2.5rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(217, 70, 239, 0.1) 50%, rgba(244, 63, 94, 0.14));
  filter: blur(2.5rem);
  pointer-events: none;
}
.hero3d {
  position: relative;
  perspective: 1100px;
  aspect-ratio: 1 / 1;
  max-width: 30rem;
  margin-inline: auto;
  touch-action: pan-y;
}
.hero3d-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.25s ease-out;
}
.hero3d.is-auto .hero3d-stage {
  animation: hero3d-float 9s ease-in-out infinite;
}
@keyframes hero3d-float {
  0%, 100% { transform: rotateX(6deg) rotateY(-11deg) translateY(0); }
  50% { transform: rotateX(3deg) rotateY(9deg) translateY(-10px); }
}
.hero3d-avatar {
  position: absolute;
  inset: 12%;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  box-shadow: 0 30px 60px -18px rgba(76, 29, 149, 0.45);
  transform: translateZ(60px);
  background: var(--card);
}
.hero3d-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero3d-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.16), transparent 40%, rgba(244, 63, 94, 0.12));
  pointer-events: none;
}
.hero3d-ring {
  position: absolute;
  border-radius: 999px;
  border: 1.5px solid rgba(124, 58, 237, 0.3);
  transform: rotateX(72deg);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.15);
}
.hero3d-ring.r1 {
  inset: -4%;
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  animation: ring-spin 14s linear infinite;
}
.hero3d-ring.r2 {
  inset: 6%;
  border-style: dashed;
  border-color: color-mix(in srgb, #d946ef 30%, transparent);
  animation: ring-spin 22s linear infinite reverse;
}
@keyframes ring-spin {
  from { transform: rotateX(72deg) rotateZ(0deg); }
  to { transform: rotateX(72deg) rotateZ(360deg); }
}
.hero3d-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  animation: chip-bob 6s ease-in-out infinite;
}
.hero3d-chip .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #f43f5e);
}
.hero3d-chip.c1 { top: 6%; left: -2%; transform: translateZ(110px); }
.hero3d-chip.c2 { bottom: 14%; right: -3%; transform: translateZ(95px); animation-delay: 1.4s; }
.hero3d-chip.c3 { bottom: -2%; left: 12%; transform: translateZ(80px); animation-delay: 2.6s; }
@keyframes chip-bob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -8px; }
}
/* Simplified presentation on small screens / no-hover: flatter, cheaper */
@media (max-width: 639px), (hover: none) {
  .hero3d { perspective: none; aspect-ratio: 1/1; max-width: 17rem; margin-inline: auto; }
  .hero3d-stage { transform: none !important; animation: none !important; position: relative; inset: auto; width: 100%; height: 100%; }
  .hero3d-ring { display: none; }
  .hero3d-avatar { inset: 6%; transform: none; border-radius: 1.1rem; box-shadow: 0 18px 36px -14px rgba(76, 29, 149, 0.4); }
  .hero3d-chip { transform: none; font-size: 0.7rem; padding: 0.3rem 0.65rem; animation: none; }
  .hero3d-chip.c1 { top: 4%; left: 2%; }
  .hero3d-chip.c2 { bottom: 10%; right: 2%; }
  .hero3d-chip.c3 { display: none; }
}

/* ————— Home style category cards ————— */
.stylecat-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(217, 70, 239, 0.1));
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.15);
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.stylecat-title { font-size: 0.95rem; font-weight: 700; }
.stylecat-desc { margin-top: 0.25rem; font-size: 0.78rem; color: var(--muted-foreground); line-height: 1.5; }
@media (min-width: 640px) {
  .stylecat-desc { font-size: 0.85rem; }
}

/* ————— Gallery ————— */
.filter-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}
.gallery-item { display: block; }
/* Deliberate image container: owns the aspect ratio, never stretches (PRD §7) */
.gallery-frame {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: var(--muted);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.gallery-item:hover .gallery-frame { box-shadow: var(--shadow-md); }
.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.03); }
.gallery-caption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.gallery-caption .badge { margin-left: 0.35rem; }
.gallery-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* ————— FAQ ————— */
.faq-accordion { display: grid; gap: 0.65rem; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::marker { content: ""; }
.faq-chevron { color: var(--muted-foreground); transition: transform 0.2s; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted-foreground);
  font-size: 0.92rem;
  line-height: 1.65;
}
.faq-cat-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.5rem 0 0.5rem;
}
.faq-cat-count { color: var(--muted-foreground); font-size: 0.85rem; margin-bottom: 1rem; }
.faq-nav { justify-content: flex-start; }
@media (min-width: 640px) { .faq-nav { justify-content: center; } }

/* ————— CTA band ————— */
.cta-band {
  margin-block: 1rem;
  padding-block: 3.5rem;
}
.cta-band-inner {
  text-align: center;
  max-width: 42rem;
  margin-inline: auto;
  border-radius: 1.5rem;
  padding: 2.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(217, 70, 239, 0.08) 50%, rgba(244, 63, 94, 0.1));
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}
@media (min-width: 640px) {
  .cta-band-inner { padding: 3.5rem 2.5rem; }
}
.cta-title { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; }
.cta-subtitle { margin: 0.75rem auto 1.75rem; color: var(--muted-foreground); max-width: 34rem; }

/* ————— Generator ————— */
/* Prevent grid blowout from native select min-content width (mobile fix) */
.gen-layout > *,
.customize-grid > *,
.grid > * {
  min-width: 0;
}
select {
  min-width: 0;
}
.gen-wrap { max-width: 72rem; margin-inline: auto; padding: 2rem 1rem 4rem; }
@media (min-width: 640px) { .gen-wrap { padding-inline: 1.5rem; } }
.gen-head { max-width: 42rem; margin-inline: auto; text-align: center; }
.gen-head .page-hero-title { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.gen-head p { margin-top: 0.85rem; color: var(--muted-foreground); font-size: 1rem; line-height: 1.65; }

/* Step indicator */
.step-indicator {
  display: flex;
  gap: 0.25rem;
  margin: 1.75rem auto 0;
  max-width: 46rem;
  overflow-x: auto;
  padding: 0.25rem;
  scrollbar-width: none;
}
.step-indicator::-webkit-scrollbar { display: none; }
.step-dot {
  flex: 1;
  min-width: 3.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.35rem;
  border-radius: 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
  white-space: nowrap;
}
.step-dot .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 1.5px solid var(--input);
  background: var(--card);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.2s;
}
.step-dot.is-active { color: var(--primary); }
.step-dot.is-active .n {
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
}
.step-dot.is-done .n {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-color: transparent;
  color: var(--primary);
}
@media (max-width: 639px) {
  .step-dot span.lbl { display: none; }
  .step-dot { min-width: 2.4rem; }
  .generate-btn { width: 100%; }
}

.gen-layout {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
/* Mobile: panel steps first, preview/result LAST (PRD §15 step order 1→5) */
@media (max-width: 1023px) {
  .gen-layout > .gen-preview { order: 2; position: static; }
  .gen-layout > div { order: 1; }
}
/* Desktop: upload/input LEFT, preview/result RIGHT (PRD §15) */
@media (min-width: 1024px) {
  .gen-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .gen-layout > .gen-preview { order: 2; }
}
.gen-preview { align-self: start; position: sticky; top: calc(var(--header-h) + 1rem); }
.gen-preview-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 0.9rem;
}
.preview-empty {
  display: flex;
  min-height: 10rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px dashed var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}
.preview-empty .icon { width: 2rem; height: 2rem; opacity: 0.5; }
.preview-img-wrap {
  position: relative;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: 0.8rem;
}
.preview-img-wrap.is-circle { border-radius: 999px; }
.preview-img-wrap.is-rounded { border-radius: 1.5rem; }
.preview-img-wrap.is-portrait { aspect-ratio: 4/5; width: 100%; max-width: 15rem; }
.preview-img-wrap.is-square { aspect-ratio: 1/1; width: 100%; max-width: 16rem; }
.preview-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.preview-ratio-tag {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.preview-photo-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}
.gen-error { margin-top: 1rem; }
.gen-privacy-note {
  margin-top: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: calc(var(--radius) - 3px);
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.step-section + .step-section { margin-top: 1.25rem; }
.step-section.is-cta {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 5%, var(--card)), color-mix(in srgb, #d946ef 5%, var(--card)));
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.step-section-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.step-section-head .step-num { margin-bottom: 0; width: 1.75rem; height: 1.75rem; font-size: 0.8rem; }
.step-section-head .opt-note {
  margin-left: auto;
  display: none;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted-foreground);
}
@media (min-width: 640px) { .step-section-head .opt-note { display: block; } }
.step-section-sub { margin: -0.5rem 0 1rem 2.4rem; font-size: 0.85rem; color: var(--muted-foreground); }

/* Upload zone */
.upload-zone {
  display: flex;
  min-height: 14rem;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 2px dashed var(--input);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s;
}
.upload-zone:hover, .upload-zone:focus-visible { border-color: color-mix(in srgb, var(--primary) 50%, transparent); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.upload-zone.is-dragover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.upload-zone-icon {
  display: flex;
  width: 3.5rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(217, 70, 239, 0.1));
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.2);
  color: var(--primary);
}
.upload-zone-icon .icon { width: 1.5rem; height: 1.5rem; }
.upload-zone-title { font-weight: 700; }
.upload-zone-sub { font-size: 0.85rem; color: var(--muted-foreground); }
.upload-zone-note { font-size: 0.72rem; color: color-mix(in srgb, var(--muted-foreground) 80%, transparent); }
.upload-privacy {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  border-radius: calc(var(--radius) - 3px);
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.upload-privacy .icon { color: var(--primary); margin-top: 0.1rem; }
.photo-ready-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: color-mix(in srgb, var(--primary) 90%, transparent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.uploaded-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* Style picker */
.style-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}
.style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
@media (min-width: 640px) { .style-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .style-grid { grid-template-columns: repeat(4, 1fr); } }
.style-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  padding: 0;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.style-card:hover { border-color: color-mix(in srgb, var(--primary) 50%, transparent); box-shadow: var(--shadow-sm); }
.style-card[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent), var(--shadow-md);
}
.style-card-art {
  display: flex;
  height: 5rem;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
}
@media (min-width: 640px) { .style-card-art { height: 6rem; } }
.style-card-art .icon { width: 2rem; height: 2rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); transition: transform 0.2s; }
.style-card:hover .style-card-art .icon { transform: scale(1.1); }
.style-card-body { padding: 0.65rem; }
.style-card-name { font-size: 0.85rem; font-weight: 700; line-height: 1.25; }
.style-card-desc {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.style-card-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.style-card[aria-pressed="true"] .style-card-check { display: inline-flex; }
.style-card-check .icon { width: 0.85rem; height: 0.85rem; }

/* Customize */
.customize-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .customize-grid { grid-template-columns: 1fr 1fr; } }
.framing-group { display: flex; gap: 0.5rem; }
.framing-btn {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 3px);
  background: var(--background);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.15s;
}
.framing-btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--foreground); }
.framing-btn[aria-checked="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-weight: 600;
}

/* Generate */
.generate-btn {
  width: 100%;
  min-height: 3.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.generate-note { margin-top: 0.75rem; text-align: center; font-size: 0.75rem; color: var(--muted-foreground); line-height: 1.5; }

/* Generating overlay */
.gen-overlay {
  display: flex;
  min-height: 16rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  padding: 2rem;
  text-align: center;
}
.gen-overlay-orb { position: relative; width: 4rem; height: 4rem; }
.gen-overlay-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  animation: orb-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.gen-overlay-orb-core {
  position: relative;
  display: flex;
  width: 4rem;
  height: 4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.gen-overlay-orb-core .icon { width: 1.75rem; height: 1.75rem; animation: icon-pulse 1.8s ease-in-out infinite; }
@keyframes orb-ping {
  0% { transform: scale(1); opacity: 0.5; }
  75%, 100% { transform: scale(1.8); opacity: 0; }
}
@keyframes icon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.gen-overlay-title { font-weight: 700; }
.gen-overlay-status { margin-top: 0.25rem; font-size: 0.9rem; color: var(--muted-foreground); min-height: 1.4em; }
.gen-overlay-hint { margin-top: 0.5rem; font-size: 0.72rem; color: color-mix(in srgb, var(--muted-foreground) 80%, transparent); }

/* Result panel */
.result-panel { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.result-img-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: 0.8rem;
}
.result-img-wrap.is-circle { border-radius: 999px; }
.result-img-wrap.is-rounded { border-radius: 1.5rem; }
.result-img-wrap.is-portrait { aspect-ratio: 4/5; width: 100%; max-width: 16rem; }
.result-img-wrap.is-square { aspect-ratio: 1/1; width: 100%; max-width: 18rem; }
.result-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.result-ready {
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}
.result-actions { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
@media (min-width: 640px) {
  .result-actions { flex-direction: row; justify-content: center; }
  .result-actions .btn { flex: none; min-width: 9.5rem; }
}
.result-demo-chip {
  font-size: 0.72rem;
  text-align: center;
  color: var(--muted-foreground);
  max-width: 24rem;
}

/* ————— Photo editor ————— */
.editor-card { margin-top: 2rem; }
.editor-grid { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) { .editor-grid { grid-template-columns: 3fr 2fr; } }
.editor-stage {
  position: relative;
  display: flex;
  min-height: 16rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    repeating-conic-gradient(color-mix(in srgb, var(--muted) 60%, transparent) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  overflow: hidden;
  padding: 0.75rem;
}
.editor-stage canvas { max-width: 100%; max-height: 26rem; border-radius: 0.5rem; box-shadow: var(--shadow-md); }
.editor-empty { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; color: var(--muted-foreground); font-size: 0.9rem; padding: 1rem; }
.editor-empty-icon { width: 2.5rem; height: 2.5rem; opacity: 0.45; }
.editor-file-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.editor-controls { align-self: start; }
.resize-row { display: flex; gap: 0.5rem; }
.resize-row input { flex: 1; }
.privacy-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.9rem;
  border-radius: calc(var(--radius) - 3px);
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.privacy-note .icon { color: var(--primary); margin-top: 0.1rem; }

/* ————— Contact ————— */
.contact-grid { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 3fr 2fr; align-items: start; } }
.contact-form .btn { margin-top: 0.25rem; }
.topic-list { display: grid; gap: 0.75rem; }
.topic-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.topic-item .icon { color: var(--primary); margin-top: 0.2rem; }
.topic-item-title { font-weight: 600; font-size: 0.95rem; }
.topic-item-desc { font-size: 0.85rem; color: var(--muted-foreground); }
.contact-aside-card + .contact-aside-card { margin-top: 1rem; }

/* ————— Blog ————— */
.blog-filter { margin-top: 1.75rem; }
.post-card { display: flex; flex-direction: column; gap: 0.5rem; }
.post-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.post-card-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
a.post-card:hover .post-card-title { color: var(--primary); }
.post-card-desc { font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.55; }
.featured-post { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 768px) {
  .featured-post { grid-template-columns: 1fr 1fr; align-items: center; }
}
.featured-panel {
  border-radius: var(--radius);
  min-height: 12rem;
  background: linear-gradient(135deg, #7c3aed, #d946ef 55%, #fb7185);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
}
.featured-panel .icon { width: 3rem; height: 3rem; opacity: 0.9; }
.article-header { max-width: 48rem; margin-inline: auto; text-align: center; padding-block: 2.5rem 1.5rem; }
.article-title { font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 0.9rem; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}
.article-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.article-body { max-width: 48rem; margin-inline: auto; padding-block: 1.5rem 2rem; }
.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  max-width: 48rem;
  margin: 2rem auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.25rem;
}
.author-initials {
  display: flex;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
}
.author-box p { font-size: 0.85rem; color: var(--muted-foreground); line-height: 1.6; }
.author-box .author-name { font-weight: 700; color: var(--foreground); font-size: 0.95rem; }

/* ————— Rich text (blog articles, legal) ————— */
.rich-text {
  max-width: 48rem;
  margin-inline: auto;
  color: color-mix(in srgb, var(--foreground) 90%, transparent);
  font-size: 1rem;
  line-height: 1.75;
}
.rich-text > * + * { margin-top: 1rem; }
.rich-text h2 { margin-top: 2.5rem; margin-bottom: 0.75rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.rich-text h3 { margin-top: 2rem; margin-bottom: 0.5rem; font-size: 1.25rem; font-weight: 700; }
.rich-text h4 { margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.1rem; font-weight: 600; }
.rich-text ul { list-style: disc; padding-left: 1.5rem; display: grid; gap: 0.5rem; }
.rich-text ol { list-style: decimal; padding-left: 1.5rem; display: grid; gap: 0.5rem; }
.rich-text li::marker { color: var(--primary); }
.rich-text strong { font-weight: 600; color: var(--foreground); }
.rich-text a {
  font-weight: 500;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
  text-underline-offset: 4px;
}
.rich-text a:hover { text-decoration-color: var(--primary); }
.rich-text blockquote {
  border-left: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
  padding-left: 1rem;
  font-style: italic;
  color: var(--muted-foreground);
}
.rich-text code {
  border-radius: 0.3rem;
  background: var(--muted);
  padding: 0.1rem 0.4rem;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.rich-text pre { overflow-x: auto; border-radius: 0.5rem; background: var(--muted); padding: 1rem; }

/* ————— Legal / prose pages ————— */
.prose-page { max-width: 48rem; margin-inline: auto; padding-block: 0.5rem 3rem; }
.prose-page .legal-updated { font-size: 0.85rem; color: var(--muted-foreground); margin-bottom: 1.5rem; }

/* ————— 404 ————— */
.notfound { text-align: center; padding-block: 4rem 5rem; }
.notfound-code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.notfound-title { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; margin-top: 0.75rem; }
.notfound-sub { margin: 0.85rem auto 2rem; max-width: 34rem; color: var(--muted-foreground); }
.notfound-actions { display: flex; flex-direction: column; gap: 0.75rem; justify-content: center; align-items: stretch; }
@media (min-width: 640px) { .notfound-actions { flex-direction: row; } }
.notfound-links {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* ————— Tool landing sections ————— */
.landing-section { margin-top: 3rem; }
.landing-section > .container > h2,
.landing-h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 800; letter-spacing: -0.02em; }
.landing-lede { margin-top: 1rem; color: var(--muted-foreground); line-height: 1.7; max-width: 46rem; }
.bullet-list { display: grid; gap: 0.6rem; margin-top: 1rem; }
.bullet-list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; line-height: 1.6; }
.bullet-list .icon { color: var(--primary); margin-top: 0.25rem; }
.preset-card-title { font-size: 0.98rem; font-weight: 700; }
.preset-card-desc { margin-top: 0.3rem; font-size: 0.85rem; color: var(--muted-foreground); }
.preset-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}
.preset-link .icon { transition: transform 0.2s; }
a:hover .preset-link .icon { transform: translateX(2px); }
.tips-list { counter-reset: tips; display: grid; gap: 0.75rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .tips-list { grid-template-columns: 1fr 1fr; } }
.tips-list li {
  counter-increment: tips;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--card);
  padding: 1rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.55;
}
.tips-list li::before {
  content: counter(tips);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
}
.info-callout {
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 5%, var(--card));
  padding: 1.25rem 1.4rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted-foreground);
}
.info-callout strong { color: var(--foreground); }

/* ————— Toasts ————— */
.toast-wrap {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 26rem);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  animation: toast-in 0.25s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--destructive); }
.toast-info { border-left: 3px solid var(--primary); }
.toast .icon { margin-top: 0.1rem; }
.toast-success .icon { color: var(--success); }
.toast-error .icon { color: var(--destructive); }
.toast-info .icon { color: var(--primary); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ————— Reveal on scroll (JS-enhanced only) ————— */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ————— Utility ————— */
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mx-auto { margin-inline: auto; }
.hidden { display: none; }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--primary);
}
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }
.max-w-3xl { max-width: 48rem; margin-inline: auto; }

/* ————— Reduced motion (PRD #19) ————— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero3d.is-auto .hero3d-stage { animation: none; }
  .hero3d-ring { animation: none !important; }
  .hero3d-chip { animation: none !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
}

/* ============================================================
   REDESIGN ADDITIONS (R-1) — announcement strip · moving strip ·
   style cards · generator peek · use cases · blog thumbs ·
   article figures · sticky mobile generate bar · touch UX
   ============================================================ */

/* ————— Icons ————— */
.icon-xs { width: 0.95rem; height: 0.95rem; }

/* ————— Announcement / trust strip (homepage, PRD §8.1) ————— */
.top-strip {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 4%, var(--background));
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.top-strip .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.4rem;
  padding-block: 0.45rem;
}
.top-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.top-strip .icon { color: var(--primary); }
.top-strip strong { color: var(--foreground); font-weight: 600; }
/* Keep it to one calm line on small phones */
@media (max-width: 560px) {
  .top-strip span:nth-child(n+3) { display: none; }
}

/* ————— Moving feature strip (PRD §9-10) ————— */
.forge-strip {
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 55%, var(--background));
  padding-block: 0.85rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.forge-track {
  display: flex;
  width: max-content;
  animation: forge-scroll 36s linear infinite;
}
.forge-strip:hover .forge-track,
.forge-strip:focus-within .forge-track { animation-play-state: paused; }
@keyframes forge-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.forge-group {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  padding-inline: 1.2rem;
}
.forge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--foreground) 70%, transparent);
  white-space: nowrap;
}
.forge-item .icon { color: var(--primary); }
.forge-sep {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #f43f5e);
  opacity: 0.55;
  flex-shrink: 0;
}

/* ————— Avatar style showcase cards with description (PRD §17) ————— */
.stylecard { display: flex; flex-direction: column; }
.stylecard .gallery-caption {
  margin-top: 0.65rem;
  text-align: left;
  font-size: 0.92rem;
  color: var(--foreground);
}
.stylecard .gallery-caption strong { font-weight: 700; }
.stylecard-desc {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}
.stylecard:hover .gallery-caption strong { color: var(--primary); }

/* ————— Generator preview composition (homepage, PRD §8.7) ————— */
.genpeek-card {
  position: relative;
  border-radius: calc(var(--radius) + 0.25rem);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 50%),
    var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.genpeek-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.25rem;
}
@media (min-width: 768px) {
  .genpeek-grid { gap: 1.5rem; padding: 1.75rem; }
}
.genpeek-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  aspect-ratio: 1 / 1;
  border: 1.5px dashed var(--input);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  color: var(--muted-foreground);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.75rem;
}
.genpeek-box .icon { color: var(--primary); }
.genpeek-result {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--muted);
}
.genpeek-result img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.genpeek-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--primary);
}
@media (min-width: 768px) {
  .genpeek-arrow { display: inline-flex; }
}
.genpeek-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--foreground);
}
.genpeek-chip .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #f43f5e);
}

/* ————— Use case cards (homepage, PRD §8.9) ————— */
.usecase-card { display: flex; flex-direction: column; }
.usecase-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(217, 70, 239, 0.1));
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.15);
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.usecase-title { font-size: 0.98rem; font-weight: 700; }
.usecase-desc { margin-top: 0.3rem; font-size: 0.85rem; color: var(--muted-foreground); line-height: 1.55; }
.usecase-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}
.usecase-link .icon { transition: transform 0.2s ease; }
a:hover .usecase-link .icon { transform: translateX(3px); }

/* ————— Blog thumbnails (homepage blog row + blog index) ————— */
.post-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--muted);
}
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}
a.post-card:hover .post-thumb img { transform: scale(1.04); }

/* ————— Blog article figure (PRD §33) ————— */
.article-figure {
  max-width: 48rem;
  margin: 0 auto 1.75rem;
  padding-inline: 0;
}
.article-figure .article-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: calc(var(--radius) + 0.15rem);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.article-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* ————— Sticky mobile generate bar (PRD §16) ————— */
.gen-stickybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--background) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(32, 26, 44, 0.08);
}
.gen-stickybar .btn { width: 100%; }
@media (min-width: 640px) {
  .gen-stickybar { display: none !important; }
}

/* ————— Touch UX (PRD §47): 44px minimum targets ————— */
@media (pointer: coarse) {
  .chip { min-height: 44px; }
  .footer-links a { padding-block: 0.35rem; }
}

/* ————— Hero trust row (desktop grid area) ————— */
.hero-trust { margin-top: 0; }
@media (max-width: 1023px) {
  .hero-trust { margin-top: 1.25rem; }
}

/* ============================================================
   R-3 generator refinements (Task R-3, frontend-styling-expert)
   Sticky mobile generate bar state · step indicator safety ·
   section scroll offsets · opt-note mobile wrap · touch targets
   Existing rules above are untouched — append-only block.
   ============================================================ */

/* ————— Sticky mobile generate bar: show/hide state (JS toggles .is-visible + body class) ————— */
.gen-stickybar {
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.gen-stickybar:not(.is-visible) {
  transform: translateY(112%);
  opacity: 0;
}
@media (max-width: 639px) {
  /* Reserve space so the bar never covers the footer content */
  body.sticky-gen-visible {
    padding-bottom: calc(4.6rem + env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .gen-stickybar { transition: none; }
  .gen-stickybar:not(.is-visible) { transform: none; }
}

/* ————— Step indicator: can never push page width (safety net ≤639px) ————— */
@media (max-width: 639px) {
  .step-indicator {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .step-indicator::-webkit-scrollbar { display: none; }
}
/* Very narrow phones: tighter dots so all 5 fit without scrolling */
@media (max-width: 359px) {
  .step-indicator { gap: 0.1rem; padding: 0.15rem; }
  .step-dot { min-width: 2.05rem; padding: 0.4rem 0.2rem; }
  .step-dot .n { width: 1.45rem; height: 1.45rem; font-size: 0.7rem; }
}

/* ————— Section anchors clear the sticky header when scrolled to ————— */
.step-section { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* ————— opt-note wraps nicely on phones (describe counter/help, labels) ————— */
@media (max-width: 639px) {
  .opt-note {
    font-size: 0.72rem;
    line-height: 1.45;
    overflow-wrap: break-word;
  }
}

/* ————— Touch targets on the generator page: everything ≥44px on touch ————— */
@media (pointer: coarse) {
  .style-card { min-height: 44px; }
  /* .btn-sm controls on this page (Replace/Remove photo, Cancel) */
  .gen-wrap .btn-sm { min-height: 44px; }
}

/* ============================================================
   R-2 homepage refinements (Task R-2, frontend-styling-expert)
   Generator-preview chip positions · stylecard desc layout
   Existing rules above are untouched — append-only block.
   ============================================================ */

/* ————— Genpeek chip positions (homepage generator preview) ————— */
/* .genpeek-chip is absolutely positioned by the base rule; these
   variants anchor the floating pills to the card corners. */
.genpeek-chip.gp-tl { top: 0.8rem; left: 0.8rem; }
.genpeek-chip.gp-tr { top: 0.8rem; right: 0.8rem; }
.genpeek-chip.gp-br { bottom: 0.8rem; right: 0.8rem; }

/* ————— Stylecard description sits on its own line under the title ————— */
/* .stylecard-desc is a <span> inside the blockified .gallery-caption;
   this makes the margin-top + line-height of the base rule apply. */
.stylecard .stylecard-desc { display: block; }

/* ————— Genpeek grid children: kill the automatic min-content floor so the
   two columns stay perfectly equal even on 320px phones (the upload mock's
   aspect-ratio otherwise inflates the first column) ————— */
.genpeek-grid > * { min-width: 0; }

/* ————— 3D-style showcase (Task 2-a) —————
   Homepage "3D style" section. Premium static treatment of the
   existing avatar artwork: rounded frame with a gentle CSS-3D
   float, soft gradient glow and floating glass chips. NO WebGL,
   NO canvas, NO spinning. Mobile-first; adapts to light/dark via
   existing tokens. Decorative bleed is capped at 0.875rem so the
   section can never cause horizontal overflow at 320px (container
   pads 1rem on phones). Reduced-motion: all animation disabled.
   ============================================================ */

/* ————— Stage: wraps glow + frame + chips and provides perspective depth ————— */
.x3d-showcase {
  position: relative;
  max-width: 30rem;
  margin-inline: auto;
  perspective: 1100px;
}

/* ————— Soft violet/fuchsia gradient glow peeking out behind the frame ————— */
.x3d-glow {
  position: absolute;
  inset: -1.25rem -0.875rem; /* vertical bleed is free; horizontal stays inside the 1rem container padding */
  z-index: 0;
  border-radius: 2rem;
  background:
    radial-gradient(ellipse 62% 55% at 28% 22%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 70%),
    radial-gradient(ellipse 55% 50% at 78% 82%, color-mix(in srgb, #d946ef 24%, transparent), transparent 72%);
  filter: blur(2.25rem);
  pointer-events: none;
}

/* ————— Rounded image frame with the very gentle float (≈6s, alternate) ————— */
.x3d-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 1 / 1;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lg), 0 30px 60px -24px rgba(76, 29, 149, 0.35);
  transform-style: preserve-3d;
  animation: x3d-float 6s ease-in-out infinite alternate;
  will-change: transform;
}
.x3d-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes x3d-float {
  from { transform: rotateX(2.5deg) rotateY(-3deg) translateY(0); }
  to   { transform: rotateX(-1.5deg) rotateY(2.5deg) translateY(-10px); }
}

/* ————— Floating glass chips (same DNA as .genpeek-chip) ————— */
.x3d-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}
.x3d-chip .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #d946ef);
}
.x3d-chip-a {
  top: 7%;
  left: -0.5rem;
  animation: x3d-chip-bob 5.5s ease-in-out infinite alternate;
}
.x3d-chip-b {
  bottom: 9%;
  right: -0.5rem;
  animation: x3d-chip-bob 7s ease-in-out infinite alternate;
  animation-delay: 1.3s;
}
@keyframes x3d-chip-bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-7px); }
}

/* ————— Responsive: chip + type scale down on very narrow phones ————— */
@media (max-width: 359px) {
  .x3d-chip { font-size: 0.66rem; padding: 0.26rem 0.55rem; }
}

/* ————— Desktop: center the copy card next to the tall visual ————— */
@media (min-width: 640px) {
  .x3d-grid { align-items: center; }
}

/* ————— Dark-mode variants (tokens do most of the work) ————— */
[data-theme="dark"] .x3d-frame {
  box-shadow: var(--shadow-lg), 0 30px 60px -24px rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .x3d-glow { opacity: 0.75; }

/* ————— Reduced motion: freeze the float and chip bob entirely ————— */
@media (prefers-reduced-motion: reduce) {
  .x3d-frame { animation: none; }
  .x3d-chip-a,
  .x3d-chip-b { animation: none; }
}
