/* Карикатури — Material 3 (Material You) theme, hand-rolled tokens */

:root {
  /* Color — light scheme, seed oklch(0.464 0.169 26.9) */
  --md-sys-color-primary: oklch(0.50 0.17 27);
  --md-sys-color-on-primary: oklch(1 0 0);
  --md-sys-color-primary-container: oklch(0.93 0.05 27);
  --md-sys-color-on-primary-container: oklch(0.27 0.11 27);
  --md-sys-color-secondary: oklch(0.52 0.05 27);
  --md-sys-color-on-secondary: oklch(1 0 0);
  --md-sys-color-secondary-container: oklch(0.94 0.03 27);
  --md-sys-color-on-secondary-container: oklch(0.30 0.04 27);
  --md-sys-color-tertiary: oklch(0.55 0.12 70);
  --md-sys-color-tertiary-container: oklch(0.93 0.07 80);
  --md-sys-color-on-tertiary-container: oklch(0.28 0.07 70);
  --md-sys-color-error: oklch(0.50 0.19 25);
  --md-sys-color-on-error: oklch(1 0 0);
  --md-sys-color-error-container: oklch(0.94 0.05 25);
  --md-sys-color-on-error-container: oklch(0.28 0.11 25);
  --md-sys-color-surface: oklch(0.985 0.004 27);
  --md-sys-color-surface-dim: oklch(0.90 0.008 27);
  --md-sys-color-surface-container-lowest: oklch(1 0 0);
  --md-sys-color-surface-container-low: oklch(0.965 0.006 27);
  --md-sys-color-surface-container: oklch(0.945 0.008 27);
  --md-sys-color-surface-container-high: oklch(0.925 0.010 27);
  --md-sys-color-surface-container-highest: oklch(0.905 0.012 27);
  --md-sys-color-on-surface: oklch(0.20 0.015 27);
  --md-sys-color-on-surface-variant: oklch(0.40 0.025 27);
  --md-sys-color-outline: oklch(0.55 0.03 27);
  --md-sys-color-outline-variant: oklch(0.85 0.02 27);
  --md-sys-color-inverse-surface: oklch(0.22 0.012 27);
  --md-sys-color-inverse-on-surface: oklch(0.95 0.008 27);
  --md-sys-color-shadow: oklch(0 0 0);

  /* Type */
  --font-display: "Google Sans Flex", "Roboto Flex", system-ui, sans-serif;
  --font-body: "Roboto Flex", "Google Sans Flex", system-ui, sans-serif;

  /* Shape */
  --radius-card: 16px;
  --radius-surface: 24px;
  --radius-field: 12px;
  --radius-full: 999px;

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1);
  --dur-short: 150ms;
  --dur-medium: 250ms;

  /* Elevation */
  --shadow-1: 0 1px 2px 0 color-mix(in oklch, var(--md-sys-color-shadow) 30%, transparent),
              0 1px 3px 1px color-mix(in oklch, var(--md-sys-color-shadow) 15%, transparent);
  --shadow-2: 0 1px 2px 0 color-mix(in oklch, var(--md-sys-color-shadow) 30%, transparent),
              0 2px 6px 2px color-mix(in oklch, var(--md-sys-color-shadow) 15%, transparent);
  --shadow-3: 0 4px 8px 3px color-mix(in oklch, var(--md-sys-color-shadow) 15%, transparent),
              0 1px 3px 0 color-mix(in oklch, var(--md-sys-color-shadow) 30%, transparent);

  color-scheme: light;
}

[data-theme="dark"] {
  --md-sys-color-primary: oklch(0.82 0.09 27);
  --md-sys-color-on-primary: oklch(0.32 0.13 27);
  --md-sys-color-primary-container: oklch(0.38 0.13 27);
  --md-sys-color-on-primary-container: oklch(0.93 0.05 27);
  --md-sys-color-secondary: oklch(0.82 0.035 27);
  --md-sys-color-on-secondary: oklch(0.30 0.04 27);
  --md-sys-color-secondary-container: oklch(0.33 0.035 27);
  --md-sys-color-on-secondary-container: oklch(0.92 0.025 27);
  --md-sys-color-tertiary: oklch(0.82 0.10 75);
  --md-sys-color-tertiary-container: oklch(0.38 0.08 70);
  --md-sys-color-on-tertiary-container: oklch(0.93 0.06 80);
  --md-sys-color-error: oklch(0.78 0.14 25);
  --md-sys-color-on-error: oklch(0.30 0.12 25);
  --md-sys-color-error-container: oklch(0.36 0.14 25);
  --md-sys-color-on-error-container: oklch(0.94 0.05 25);
  --md-sys-color-surface: oklch(0.17 0.008 27);
  --md-sys-color-surface-dim: oklch(0.14 0.006 27);
  --md-sys-color-surface-container-lowest: oklch(0.12 0.006 27);
  --md-sys-color-surface-container-low: oklch(0.19 0.010 27);
  --md-sys-color-surface-container: oklch(0.22 0.012 27);
  --md-sys-color-surface-container-high: oklch(0.26 0.014 27);
  --md-sys-color-surface-container-highest: oklch(0.30 0.016 27);
  --md-sys-color-on-surface: oklch(0.93 0.008 27);
  --md-sys-color-on-surface-variant: oklch(0.80 0.02 27);
  --md-sys-color-outline: oklch(0.65 0.025 27);
  --md-sys-color-outline-variant: oklch(0.40 0.02 27);
  --md-sys-color-inverse-surface: oklch(0.93 0.008 27);
  --md-sys-color-inverse-on-surface: oklch(0.24 0.012 27);

  color-scheme: dark;
}

/* Base */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  -webkit-font-smoothing: antialiased;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }

.display {
  font-size: clamp(2.75rem, 5.2vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 24px;
}

.headline {
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 16px;
}

.title-large {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; }

.section-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-sub {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
  max-width: 60ch;
}

/* Reveal on scroll — enhancement only, content visible without JS */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms var(--ease-emphasized), transform 500ms var(--ease-emphasized);
}

.js .reveal.is-inview {
  opacity: 1;
  transform: none;
}

/* App bar */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklch, var(--md-sys-color-surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
}

.app-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.app-nav a {
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  transition: background-color var(--dur-short) var(--ease-standard), color var(--dur-short) var(--ease-standard);
}

.app-nav a:hover {
  background: color-mix(in oklch, var(--md-sys-color-on-surface) 8%, transparent);
  color: var(--md-sys-color-on-surface);
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: background-color var(--dur-short) var(--ease-standard), box-shadow var(--dur-short) var(--ease-standard), transform var(--dur-short) var(--ease-standard);
}

.button .material-symbols-rounded { font-size: 20px; }

.button-filled {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.button-filled:hover { box-shadow: var(--shadow-1); }

.button-filled:active { transform: scale(0.98); }

.button-filled:disabled {
  background: color-mix(in oklch, var(--md-sys-color-on-surface) 12%, transparent);
  color: color-mix(in oklch, var(--md-sys-color-on-surface) 38%, transparent);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.button-tonal {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.button-tonal:hover { box-shadow: var(--shadow-1); }

.button-text {
  background: transparent;
  color: var(--md-sys-color-primary);
  padding: 10px 16px;
}

.button-text:hover {
  background: color-mix(in oklch, var(--md-sys-color-primary) 8%, transparent);
}

.button-xl {
  font-size: 1rem;
  padding: 16px 32px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-standard);
}

.icon-button:hover {
  background: color-mix(in oklch, var(--md-sys-color-on-surface-variant) 8%, transparent);
}

/* Hero */

.hero {
  overflow: clip;
}

.hero-grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 24px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.hero-sub {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0 0 32px;
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}

.hero-points .material-symbols-rounded {
  font-size: 20px;
  color: var(--md-sys-color-primary);
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
}

/* Hero visual — phone + floating cards */

.hero-visual {
  position: relative;
  min-height: 560px;
}

.hero-phone, .hero-card, .hero-bubble {
  position: absolute;
  will-change: transform;
}

.hero-phone {
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 2;
}

.phone-frame {
  width: 260px;
  border-radius: 40px;
  padding: 12px;
  background: var(--md-sys-color-inverse-surface);
  box-shadow: var(--shadow-3);
  rotate: -4deg;
}

.phone-notch {
  width: 88px;
  height: 20px;
  margin: 4px auto 10px;
  border-radius: var(--radius-full);
  background: color-mix(in oklch, var(--md-sys-color-inverse-on-surface) 14%, transparent);
}

.phone-screen {
  background: var(--md-sys-color-surface);
  border-radius: 30px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-app-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.phone-result {
  border-radius: 16px;
  aspect-ratio: 1;
  object-fit: cover;
}

.phone-prompt {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-high);
  border-radius: 10px;
  padding: 8px 10px;
}

.phone-button {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-full);
}

.hero-card {
  width: 132px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  background: var(--md-sys-color-surface-container-lowest);
  padding: 6px;
}

.hero-card img {
  border-radius: 14px;
  display: block;
}

.hero-card-a {
  top: 6%;
  right: 2%;
  rotate: 7deg;
}

.hero-card-b {
  bottom: 8%;
  left: 0;
  rotate: -8deg;
}

.hero-bubble {
  top: 14%;
  left: 4%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-1);
  rotate: -3deg;
}

.hero-bubble .material-symbols-rounded {
  font-size: 18px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 18;
}

/* Generator */

.generator-section { padding-bottom: 112px; }

.generator {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-surface);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.generator-heading {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.optional {
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
}

.text-field {
  background: var(--md-sys-color-surface-container-highest);
  border-radius: var(--radius-field) var(--radius-field) 0 0;
  border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
  transition: border-color var(--dur-short) var(--ease-standard);
}

.text-field:focus-within {
  border-bottom: 2px solid var(--md-sys-color-primary);
}

.text-field textarea {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  resize: vertical;
  min-height: 88px;
  padding: 20px 16px 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface);
}

.text-field textarea:focus { outline: none; }

.text-field textarea::placeholder {
  color: var(--md-sys-color-on-surface-variant);
}

.field-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.helper, .char-count {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Chips */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-standard), border-color var(--dur-short) var(--ease-standard);
}

.chip .material-symbols-rounded { font-size: 18px; }

.chip-assist {
  background: transparent;
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
}

.chip-assist:hover {
  background: color-mix(in oklch, var(--md-sys-color-on-surface-variant) 8%, transparent);
}

.chip-filter {
  background: transparent;
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
}

.chip-filter .material-symbols-rounded { display: none; }

.chip-filter:hover {
  background: color-mix(in oklch, var(--md-sys-color-on-surface-variant) 8%, transparent);
}

.chip-filter.is-selected {
  background: var(--md-sys-color-secondary-container);
  border-color: transparent;
  color: var(--md-sys-color-on-secondary-container);
}

.chip-filter.is-selected .material-symbols-rounded { display: inline-block; }

/* Dropzone */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 24px;
  border: 2px dashed var(--md-sys-color-outline-variant);
  border-radius: var(--radius-card);
  background: var(--md-sys-color-surface-container-lowest);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--dur-short) var(--ease-standard), background-color var(--dur-short) var(--ease-standard);
}

.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
}

.dropzone-icon {
  font-size: 40px;
  color: var(--md-sys-color-primary);
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 40;
}

.dropzone-text {
  font-size: 1rem;
  color: var(--md-sys-color-on-surface);
}

.dropzone-link {
  color: var(--md-sys-color-primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.previews:empty { display: none; }

.preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high);
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-full);
  background: color-mix(in oklch, var(--md-sys-color-surface-container-lowest) 90%, transparent);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-remove .material-symbols-rounded { font-size: 18px; }

/* Controls grid */

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
}

.controls-grid .field-block:first-child { grid-column: 1 / -1; }

/* Segmented buttons */

.segmented {
  display: inline-flex;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--radius-full);
  overflow: hidden;
  align-self: flex-start;
}

.segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 16px;
  border: none;
  border-right: 1px solid var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-standard);
}

.segment:last-child { border-right: none; }

.segment .material-symbols-rounded { font-size: 18px; }

.segment:hover {
  background: color-mix(in oklch, var(--md-sys-color-on-surface) 8%, transparent);
}

.segment.is-selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* Slider */

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.slider-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--md-sys-color-primary) 0%,
    var(--md-sys-color-primary) var(--fill, 50%),
    var(--md-sys-color-surface-container-highest) var(--fill, 50%),
    var(--md-sys-color-surface-container-highest) 100%
  );
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--md-sys-color-primary);
  box-shadow: var(--shadow-1);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--md-sys-color-surface-container-highest);
}

input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--md-sys-color-primary);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--md-sys-color-primary);
  box-shadow: var(--shadow-1);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Generate + progress */

.generate-button { align-self: flex-start; }

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.linear-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--md-sys-color-surface-container-highest);
  overflow: hidden;
  position: relative;
}

.linear-progress-bar {
  position: absolute;
  top: 0;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: var(--md-sys-color-primary);
  animation: progress-slide 1.4s var(--ease-standard) infinite;
}

@keyframes progress-slide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

.progress-status {
  margin: 0;
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Result */

.result {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.result-image-wrap {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high);
  max-width: 560px;
}

.result-image-wrap.is-loading {
  min-height: 320px;
  animation: shimmer 1.6s linear infinite;
  background: linear-gradient(
    100deg,
    var(--md-sys-color-surface-container-high) 40%,
    var(--md-sys-color-surface-container-highest) 50%,
    var(--md-sys-color-surface-container-high) 60%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  0%   { background-position: 180% 0; }
  100% { background-position: -20% 0; }
}

.result-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.result-image-wrap.is-loading img { display: none; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Styles section */

.styles-section { padding-bottom: 112px; }

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

.style-card {
  position: relative;
  border: none;
  padding: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-medium) var(--ease-emphasized), box-shadow var(--dur-medium) var(--ease-standard);
}

.style-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-3);
}

.style-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.style-card-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: color-mix(in oklch, var(--md-sys-color-surface-container-lowest) 88%, transparent);
  color: var(--md-sys-color-on-surface);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Gallery */

.gallery-section { padding-bottom: 112px; }

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

.gallery-item {
  margin: 0;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--shadow-1);
  transform-style: preserve-3d;
  transition: box-shadow var(--dur-medium) var(--ease-standard);
}

.gallery-wide { grid-column: span 2; }

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-item figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: color-mix(in oklch, var(--md-sys-color-inverse-surface) 82%, transparent);
  color: var(--md-sys-color-inverse-on-surface);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* How it works */

.how { padding-bottom: 112px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.step {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.step p {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
}

/* Use cases */

.usecases { padding-bottom: 112px; }

.usecases-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: start;
}

.usecases-copy {
  position: sticky;
  top: 120px;
}

.usecases-copy .button { margin-top: 28px; }

.usecases-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.usecase {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-card);
  padding: 24px;
}

.usecase:nth-child(2) { margin-left: 32px; }
.usecase:nth-child(3) { margin-left: 64px; }
.usecase:nth-child(4) { margin-left: 96px; }

.usecase-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.usecase p {
  margin: 6px 0 0;
  color: var(--md-sys-color-on-surface-variant);
}

/* FAQ */

.faq { padding-bottom: 112px; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
}

.faq-item {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-card);
  padding: 4px 24px;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  color: var(--md-sys-color-on-surface);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary .material-symbols-rounded {
  color: var(--md-sys-color-on-surface-variant);
  transition: transform var(--dur-medium) var(--ease-standard);
}

.faq-item[open] summary .material-symbols-rounded { transform: rotate(180deg); }

.faq-item p {
  margin: 0;
  padding: 0 0 20px;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 65ch;
}

/* CTA */

.cta { padding-bottom: 112px; }

.cta-inner {
  background: var(--md-sys-color-primary-container);
  border-radius: var(--radius-surface);
  padding: 72px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cta-inner .headline {
  color: var(--md-sys-color-on-primary-container);
  margin: 0;
}

.cta-inner .section-sub {
  color: var(--md-sys-color-on-primary-container);
  opacity: 0.85;
  margin-bottom: 12px;
}

/* Footer */

.footer {
  background: var(--md-sys-color-surface-container);
  padding: 56px 24px 32px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 48px;
  align-items: start;
}

.footer-tag {
  margin: 14px 0 0;
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 32ch;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.footer-col a {
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-col a:hover { color: var(--md-sys-color-on-surface); }

.footer-note {
  grid-column: 1 / -1;
  margin: 24px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Snackbar */

.snackbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  font-size: 0.875rem;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-medium) var(--ease-standard), transform var(--dur-medium) var(--ease-standard);
  z-index: 40;
  max-width: min(480px, calc(100vw - 48px));
}

.snackbar.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    padding: 56px 24px 72px;
  }

  .hero-visual {
    min-height: 480px;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
  }

  .styles-grid, .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  .gallery-wide { grid-column: span 2; }

  .usecases-grid { grid-template-columns: 1fr; gap: 40px; }

  .usecases-copy { position: static; }

  .usecase:nth-child(n) { margin-left: 0; }
}

@media (max-width: 720px) {
  .app-nav { display: none; }

  .app-bar-actions .button-filled { display: none; }

  .generator-section { padding-bottom: 72px; }

  .generator { padding: 24px 20px; }

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

  .generate-button { align-self: stretch; }

  .styles-section, .gallery-section, .how, .usecases, .faq, .cta { padding-bottom: 72px; }

  .styles-grid, .gallery-grid { grid-template-columns: 1fr; }

  .gallery-wide { grid-column: span 1; }

  .segmented { align-self: stretch; }

  .segment { flex: 1; justify-content: center; padding: 10px 8px; }

  .hero-visual { min-height: 420px; }

  .hero-card { width: 104px; }

  .cta-inner { padding: 48px 20px; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
