:root {
  --bg: #efe8dc;
  --surface: rgba(254, 249, 241, 0.92);
  --surface-strong: #fffaf2;
  --surface-muted: #f4ebde;
  --hero-bg: #161211;
  --hero-panel: rgba(255, 247, 236, 0.08);
  --ink: #201814;
  --muted: #706257;
  --line: rgba(32, 24, 20, 0.12);
  --line-strong: rgba(255, 247, 236, 0.14);
  --accent: #de6c42;
  --accent-deep: #a84825;
  --accent-soft: rgba(222, 108, 66, 0.14);
  --teal: #0f8a83;
  --teal-soft: rgba(15, 138, 131, 0.14);
  --shadow-xl: 0 38px 80px rgba(40, 25, 15, 0.16);
  --shadow-lg: 0 20px 48px rgba(40, 25, 15, 0.1);
  --radius-2xl: 36px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(222, 108, 66, 0.12), transparent 30%),
    linear-gradient(180deg, #f6f1e8 0%, var(--bg) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(32, 24, 20, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 24, 20, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 88%);
}

img,
canvas {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px 0 76px;
  color: #fff8f0;
  background:
    radial-gradient(circle at 18% 18%, rgba(222, 108, 66, 0.2), transparent 28%),
    radial-gradient(circle at 86% 22%, rgba(15, 138, 131, 0.14), transparent 24%),
    linear-gradient(135deg, #181311 0%, #211712 52%, #141111 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
}

.hero::before {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 158, 113, 0.22) 0%, rgba(255, 158, 113, 0) 72%);
}

.hero::after {
  width: 360px;
  height: 360px;
  bottom: -180px;
  left: -80px;
  background: radial-gradient(circle, rgba(15, 138, 131, 0.18) 0%, rgba(15, 138, 131, 0) 72%);
}

.hero-inner,
.content-shell {
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.controls-column,
.preview-column,
.inspector-column,
.summary-item,
.palette-item,
.hero-stat,
.status-pill,
.canvas-panel,
.controls-block,
.inspector-block {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(145deg, #f0a567 0%, #db5c3f 48%, #0f8a83 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.18);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong,
.brand-copy small,
h1,
h2,
h3,
.hero-stat strong,
.summary-item strong,
.material-card strong,
.palette-meta strong,
.palette-count strong,
.guide-step span {
  font-family: "Outfit", sans-serif;
}

.brand-copy strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-copy small {
  color: rgba(255, 248, 240, 0.68);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toplink {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 248, 240, 0.06);
  color: rgba(255, 248, 240, 0.92);
  transition: background-color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.toplink:hover {
  transform: translateY(-1px);
  background: rgba(255, 248, 240, 0.12);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  gap: 40px;
  align-items: end;
  min-height: calc(100svh - 164px);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  background: rgba(255, 248, 240, 0.08);
  color: rgba(255, 248, 240, 0.84);
  border: 1px solid rgba(255, 248, 240, 0.12);
}

.section-kicker {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 8ch;
  font-size: clamp(3.1rem, 6vw, 6.2rem);
  line-height: 0.92;
}

.hero-text,
.workspace-copy p,
.microcopy,
.canvas-head p,
.guide-step p,
.value-item p,
.empty-state,
.upload-meta {
  color: var(--muted);
}

.hero-text {
  max-width: 58ch;
  margin: 20px 0 0;
  color: rgba(255, 248, 240, 0.72);
  font-size: 1.03rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.primary-btn,
.ghost-btn,
.secondary-btn,
.preset-chip,
.mode-chip,
.fit-chip {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.primary-btn,
.ghost-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #f39a66 100%);
  color: #fffaf3;
  box-shadow: 0 16px 32px rgba(173, 76, 37, 0.24);
}

.ghost-btn {
  border: 1px solid rgba(255, 248, 240, 0.14);
  background: rgba(255, 248, 240, 0.08);
  color: #fff8f0;
}

.secondary-btn {
  width: 100%;
  margin-top: 14px;
  background: #1d1714;
  color: #fff8f0;
}

.muted-btn {
  background: #f2e8da;
  color: var(--ink);
}

.primary-btn:hover,
.ghost-btn:hover,
.secondary-btn:hover,
.preset-chip:hover,
.mode-chip:hover,
.fit-chip:hover {
  transform: translateY(-1px);
}

.ghost-btn:disabled,
.secondary-btn:disabled,
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-points span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 240, 0.12);
  background: rgba(255, 248, 240, 0.06);
  color: rgba(255, 248, 240, 0.8);
  backdrop-filter: blur(12px);
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
}

.hero-stage {
  position: relative;
  width: min(620px, 100%);
  aspect-ratio: 1.08;
  padding: 24px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 240, 0.12);
  background:
    linear-gradient(160deg, rgba(255, 248, 240, 0.14), rgba(255, 248, 240, 0.02)),
    rgba(255, 248, 240, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.04);
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: -30px;
  background-image:
    radial-gradient(circle at center, rgba(255, 248, 240, 0.12) 0 3px, transparent 4px),
    radial-gradient(circle at center, rgba(15, 138, 131, 0.14) 0 3px, transparent 4px),
    radial-gradient(circle at center, rgba(222, 108, 66, 0.14) 0 3px, transparent 4px);
  background-size: 42px 42px, 54px 54px, 68px 68px;
  background-position: 0 0, 20px 18px, 10px 28px;
  opacity: 0.35;
  transform: rotate(-7deg) scale(1.1);
}

.hero-photo,
.hero-pattern {
  position: absolute;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 240, 0.14);
}

.hero-photo span,
.hero-pattern span {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 16, 14, 0.5);
  color: rgba(255, 248, 240, 0.88);
  font-size: 0.82rem;
  backdrop-filter: blur(10px);
}

.hero-photo {
  top: 52px;
  left: 24px;
  width: 46%;
  height: 56%;
  background:
    radial-gradient(circle at 28% 34%, #f6d89c 0 12%, transparent 13%),
    radial-gradient(circle at 63% 32%, #f08b6d 0 18%, transparent 19%),
    radial-gradient(circle at 54% 72%, #3c9ac9 0 13%, transparent 14%),
    linear-gradient(145deg, #f8e7ca 0%, #d86d53 50%, #326987 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  transform: rotate(-5deg);
}

.hero-pattern {
  right: 24px;
  bottom: 88px;
  width: 56%;
  height: 64%;
  background:
    linear-gradient(145deg, rgba(255, 249, 242, 0.92), rgba(245, 236, 227, 0.84)),
    rgba(255, 248, 240, 0.84);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.24);
  transform: rotate(5deg);
}

.hero-pattern::after {
  content: "";
  position: absolute;
  inset: 56px 26px 26px;
  border-radius: 20px;
  background-image:
    radial-gradient(circle at center, rgba(222, 108, 66, 0.82) 0 44%, rgba(180, 75, 36, 0.88) 45% 53%, transparent 54%),
    radial-gradient(circle at center, rgba(15, 138, 131, 0.78) 0 44%, rgba(8, 95, 90, 0.84) 45% 53%, transparent 54%),
    radial-gradient(circle at center, rgba(252, 216, 121, 0.92) 0 44%, rgba(227, 182, 74, 0.94) 45% 53%, transparent 54%),
    radial-gradient(circle at center, rgba(79, 144, 207, 0.84) 0 44%, rgba(47, 95, 148, 0.88) 45% 53%, transparent 54%);
  background-size: 30px 30px;
  background-position: 0 0, 15px 0, 0 15px, 15px 15px;
  box-shadow: inset 0 0 0 1px rgba(32, 24, 20, 0.08);
}

.hero-stats {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-stat {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 248, 240, 0.12);
  background: rgba(17, 14, 13, 0.48);
  backdrop-filter: blur(14px);
}

.hero-stat span,
.summary-item span,
.material-card span,
.mini-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.hero-stat span {
  color: rgba(255, 248, 240, 0.62);
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  color: #fff9f2;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.05em;
}

.content-shell {
  margin-top: -30px;
  padding-bottom: 64px;
}

.value-strip,
.workspace,
.guide,
.cta-band {
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-xl);
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding: 24px 28px;
  border-radius: 28px;
}

.value-item h2 {
  margin-top: 8px;
  font-size: 1.42rem;
  line-height: 1.18;
}

.value-item p {
  margin: 0;
}

.workspace,
.guide {
  margin-top: 24px;
}

.workspace {
  padding: 36px;
  border-radius: var(--radius-2xl);
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.workspace-copy h2,
.guide-head h2,
.cta-band h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.workspace-copy p {
  max-width: 60ch;
  margin: 10px 0 0;
  line-height: 1.8;
}

.workspace-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  white-space: normal;
}

.status-pill[data-tone="idle"] {
  background: rgba(32, 24, 20, 0.08);
  color: var(--ink);
}

.status-pill[data-tone="loading"] {
  background: var(--teal-soft);
  color: #0b6a65;
}

.status-pill[data-tone="success"] {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.status-pill[data-tone="error"] {
  background: rgba(156, 43, 43, 0.12);
  color: #8f2d2d;
}

.status-pill.muted {
  background: rgba(32, 24, 20, 0.06);
  color: var(--muted);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 24px;
}

.controls-column,
.preview-column,
.inspector-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.upload-dropzone,
.controls-block,
.inspector-block,
.canvas-panel {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.upload-dropzone {
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(222, 108, 66, 0.12), transparent 40%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(247, 240, 231, 0.88));
  border-style: dashed;
  cursor: pointer;
}

.upload-dropzone strong {
  font-size: 1.15rem;
  line-height: 1.35;
}

.upload-label {
  color: var(--accent-deep);
  font-weight: 700;
}

.upload-dropzone.is-dragover,
.upload-dropzone.has-file {
  border-style: solid;
  box-shadow: 0 18px 42px rgba(172, 78, 42, 0.12);
  transform: translateY(-1px);
}

.controls-stack {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 24px;
}

.controls-block,
.inspector-block,
.canvas-panel {
  padding: 22px;
}

.controls-block h3,
.inspector-block h3,
.canvas-head h3 {
  font-size: 1.28rem;
}

.microcopy,
.canvas-head p,
.guide-step p,
.empty-state,
.upload-meta {
  line-height: 1.75;
}

.microcopy {
  margin: 10px 0 0;
}

.preset-grid,
.toggle-row {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.preset-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fit-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preset-chip,
.mode-chip,
.fit-chip {
  min-height: 48px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 700;
}

.preset-chip.active,
.mode-chip.active,
.fit-chip.active {
  border-color: transparent;
  background: #1d1714;
  color: #fff8f0;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.04);
}

.size-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.size-inputs label {
  display: grid;
  gap: 8px;
}

.size-inputs span {
  color: var(--muted);
}

input[type="number"] {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  color: var(--ink);
}

.checkbox span {
  line-height: 1.6;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.checkbox.is-disabled {
  opacity: 0.45;
}

.tip-block p + p {
  margin-top: 10px;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(15, 138, 131, 0.08), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(243, 235, 225, 0.92));
  border: 1px solid rgba(32, 24, 20, 0.08);
}

.summary-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(32, 24, 20, 0.08);
}

.summary-item strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
  line-height: 1.1;
}

.canvas-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.canvas-panel {
  background: rgba(255, 255, 255, 0.74);
}

.canvas-panel.featured {
  background:
    radial-gradient(circle at top right, rgba(222, 108, 66, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.84);
}

.canvas-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.canvas-head p {
  margin: 8px 0 0;
}

.canvas-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  min-height: 320px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 240, 232, 0.9)),
    repeating-linear-gradient(45deg, rgba(32, 24, 20, 0.03) 0 10px, transparent 10px 20px);
}

.canvas-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(32, 24, 20, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 24, 20, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
}

.canvas-frame.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.58) 46%, transparent 100%);
  animation: sweep 1.1s linear infinite;
}

canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  position: relative;
  z-index: 1;
}

.materials-summary {
  display: grid;
  gap: 14px;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.material-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(32, 24, 20, 0.08);
}

.material-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.42rem;
}

.material-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.mini-label {
  font-weight: 700;
}

.color-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.color-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(32, 24, 20, 0.08);
}

.color-dot,
.swatch {
  border: 1px solid rgba(32, 24, 20, 0.12);
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

.palette-list {
  display: grid;
  gap: 2px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.palette-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(32, 24, 20, 0.08);
}

.palette-item:last-child {
  border-bottom: 0;
}

.swatch {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.palette-meta strong,
.palette-count strong {
  display: block;
  font-size: 1rem;
}

.palette-meta span,
.palette-count span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.palette-count {
  text-align: right;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(32, 24, 20, 0.14);
  background: rgba(255, 255, 255, 0.58);
}

.guide,
.cta-band {
  padding: 36px;
  border-radius: var(--radius-2xl);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.guide-step {
  padding-top: 22px;
  border-top: 1px solid rgba(32, 24, 20, 0.12);
}

.guide-step span {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 800;
}

.guide-step h3 {
  margin-top: 14px;
  font-size: 1.32rem;
  line-height: 1.16;
}

.guide-step p {
  margin: 12px 0 0;
}

.cta-band {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(15, 138, 131, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(255, 250, 242, 0.95), rgba(246, 236, 224, 0.92));
}

.cta-band::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -10px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background-image: radial-gradient(circle, rgba(222, 108, 66, 0.12) 0 4px, transparent 5px);
  background-size: 24px 24px;
  opacity: 0.8;
}

.cta-band > * {
  position: relative;
  z-index: 1;
}

.mobile-dock {
  display: none;
}

.mobile-dock-btn {
  flex: 1 1 0;
  min-width: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

@keyframes sweep {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@media (max-width: 1260px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .controls-stack {
    position: static;
  }
}

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .hero-copy {
    max-width: none;
  }

  h1 {
    max-width: 10ch;
  }

  .summary-bar,
  .canvas-stage,
  .guide-grid,
  .value-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .hero-inner,
  .content-shell {
    width: min(100% - 20px, 100%);
  }

  .hero {
    padding-top: 14px;
    padding-bottom: 34px;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 26px;
  }

  .workspace-head,
  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stage {
    width: 100%;
    padding: 18px;
    min-height: 320px;
    aspect-ratio: 1.15;
  }

  .hero-photo {
    width: 48%;
    height: 48%;
    left: 18px;
    top: 30px;
  }

  .hero-pattern {
    width: 60%;
    height: 54%;
    right: 18px;
    bottom: 84px;
  }

  .hero-stats,
  .canvas-stage,
  .guide-grid,
  .value-strip {
    grid-template-columns: 1fr;
  }

  .workspace,
  .guide,
  .cta-band {
    padding: 20px;
    border-radius: 26px;
  }

  .controls-block,
  .inspector-block,
  .canvas-panel,
  .upload-dropzone {
    padding: 16px;
    border-radius: 22px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.35rem, 10vw, 3.15rem);
  }

  .hero-grid {
    gap: 24px;
  }

  .hero-text {
    font-size: 0.95rem;
    line-height: 1.72;
  }

  .hero-actions {
    width: 100%;
    gap: 10px;
  }

  .hero-actions .primary-btn,
  .hero-actions .ghost-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .hero-points {
    gap: 8px;
  }

  .hero-points span {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .hero-stat {
    padding: 14px 16px;
  }

  .hero-stat strong {
    font-size: 1.35rem;
  }

  .workspace-head {
    gap: 12px;
    margin-bottom: 18px;
  }

  .workspace-status {
    width: 100%;
  }

  .status-pill {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
    border-radius: 16px;
  }

  .upload-dropzone {
    min-height: 124px;
  }

  .controls-stack,
  .controls-column,
  .preview-column,
  .inspector-column {
    gap: 14px;
  }

  .summary-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .summary-item {
    padding: 14px;
  }

  .summary-item strong {
    font-size: 1.12rem;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toggle-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toggle-row:not(.fit-row) > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .fit-row,
  .size-inputs,
  .materials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .canvas-frame {
    min-height: 240px;
    border-radius: 18px;
  }

  .palette-item {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px 0;
  }

  .swatch {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .palette-count {
    grid-column: 2;
    text-align: left;
    margin-top: 2px;
  }

  .guide-step h3 {
    font-size: 1.14rem;
  }

  .cta-band .primary-btn {
    width: 100%;
  }

  .mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(246, 239, 230, 0.92);
    border-top: 1px solid rgba(32, 24, 20, 0.08);
    backdrop-filter: blur(16px);
  }

  .mobile-dock .primary-btn,
  .mobile-dock .ghost-btn {
    min-height: 48px;
    width: auto;
  }
}

@media (max-width: 460px) {
  .brand-copy small {
    font-size: 0.64rem;
  }

  .toplink {
    min-height: 38px;
    padding: 0 12px;
  }

  .hero-stage {
    min-height: 280px;
    padding: 14px;
  }

  .hero-photo {
    left: 14px;
    top: 24px;
    width: 50%;
    height: 46%;
  }

  .hero-pattern {
    right: 14px;
    bottom: 72px;
    width: 64%;
    height: 52%;
  }

  .hero-pattern::after {
    inset: 48px 18px 18px;
    background-size: 22px 22px;
    background-position: 0 0, 11px 0, 0 11px, 11px 11px;
  }

  .hero-stats {
    left: 14px;
    right: 14px;
    bottom: 14px;
    gap: 8px;
  }

  .hero-stat {
    padding: 10px 12px;
  }

  .hero-stat strong {
    font-size: 1.12rem;
  }

  .hero-actions .primary-btn,
  .hero-actions .ghost-btn {
    flex-basis: 100%;
  }

  .summary-bar {
    grid-template-columns: 1fr;
  }

  .materials-grid,
  .size-inputs {
    grid-template-columns: 1fr;
  }

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

  .toggle-row,
  .fit-row {
    grid-template-columns: 1fr;
  }

  .toggle-row:not(.fit-row) > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .mobile-dock {
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

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