:root {
  --bg: #f5efe4;
  --bg-strong: #ead8bf;
  --surface: rgba(255, 249, 240, 0.8);
  --surface-strong: #fffaf2;
  --ink: #203239;
  --muted: #57676b;
  --line: rgba(32, 50, 57, 0.14);
  --accent: #bf5a36;
  --accent-strong: #964120;
  --accent-soft: rgba(191, 90, 54, 0.14);
  --teal: #2e6f6a;
  --shadow: 0 24px 80px rgba(56, 45, 23, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 28%),
    radial-gradient(circle at right 10% top 20%, rgba(46, 111, 106, 0.12), transparent 24%),
    linear-gradient(180deg, #f8f3eb 0%, #f2e6d3 48%, #efe3cf 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero,
.workflow,
.configurator,
.closing {
  position: relative;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.9), rgba(255, 248, 238, 0.7));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before,
.configurator::before {
  content: "";
  position: absolute;
  inset: auto -12% -28% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(191, 90, 54, 0.18), transparent 72%);
  pointer-events: none;
}

.topbar,
.hero-grid,
.workflow-grid,
.configurator-layout,
.closing {
  position: relative;
  z-index: 1;
}

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

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ink), #38545d);
  color: #fff7ef;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.brand p,
.brand span,
.eyebrow,
.lead,
.hero-points,
.metric-row span,
.ghost-link,
.workflow article span,
.workflow article p,
.field-grid small,
.summary-card span,
.summary-note,
.preview-empty,
.upload-card span,
.notes-field textarea,
.closing p {
  margin: 0;
}

.brand p {
  font-weight: 700;
}

.brand div span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.95rem;
}

.ghost-link,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.ghost-link,
.secondary-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(32, 50, 57, 0.08);
}

.primary-button {
  color: #fff9f2;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 32px rgba(150, 65, 32, 0.25);
}

.ghost-link:hover,
.secondary-button:hover,
.primary-button:hover,
.shape-card:hover,
.option-pill:hover,
.cover-card:hover {
  transform: translateY(-2px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.02;
}

h1 {
  margin-top: 14px;
  font-size: clamp(2.8rem, 4.8vw, 5.4rem);
  max-width: 10ch;
}

h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  max-width: 18ch;
}

h3 {
  font-size: 1.35rem;
}

.lead {
  max-width: 60ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

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

.hero-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin-top: 32px;
  list-style: none;
}

.hero-points li,
.workflow article,
.summary-card,
.panel-block,
.hero-card,
.preview-stage,
.closing-points article {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.hero-points li {
  padding: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.hero-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(32, 50, 57, 0.96), rgba(32, 50, 57, 0.88));
  color: #f7eee1;
}

.hero-card-header,
.hero-card-footer,
.metric-row,
.preview-stage-header,
.summary-card-header,
.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.hero-card-header,
.hero-card-footer,
.metric-row {
  align-items: center;
}

.hero-card-header span,
.hero-card-footer span,
.metric-row span {
  color: rgba(247, 238, 225, 0.7);
}

.hero-card-body {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.section-heading {
  margin-bottom: 24px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.workflow article,
.closing-points article {
  padding: 22px;
}

.workflow article span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.workflow article p,
.closing-points p {
  margin-top: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.configurator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.control-panel {
  display: grid;
  gap: 18px;
}

.panel-block {
  padding: 22px;
}

.block-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.block-heading span {
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.shape-grid,
.option-grid,
.field-grid,
.preview-strip,
.closing-points {
  display: grid;
  gap: 14px;
}

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

.shape-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.72);
  text-align: left;
  color: var(--ink);
}

.shape-card svg {
  width: 100%;
  height: 100px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(46, 111, 106, 0.12), rgba(191, 90, 54, 0.07));
}

.shape-card rect,
.shape-card path {
  fill: rgba(46, 111, 106, 0.16);
  stroke: var(--teal);
  stroke-width: 4;
  stroke-linejoin: round;
}

.shape-card span,
.shape-card strong,
.summary-card strong,
.summary-list strong,
.preview-stage-header strong {
  display: block;
}

.shape-card span {
  color: var(--muted);
}

.shape-card.is-active {
  border-color: rgba(191, 90, 54, 0.5);
  background: linear-gradient(180deg, rgba(255, 245, 239, 0.92), rgba(255, 252, 247, 0.8));
  box-shadow: inset 0 0 0 1px rgba(191, 90, 54, 0.16);
}

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

.field-hint {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.field-grid label,
.notes-field {
  display: grid;
  gap: 8px;
}

.dimension-field.is-hidden {
  display: none;
}

.field-grid input,
.notes-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(32, 50, 57, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.field-grid small {
  color: var(--muted);
}

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

.option-pill,
.cover-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 66px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.option-pill input,
.cover-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.option-pill:has(input:checked),
.cover-card:has(input:checked) {
  border-color: rgba(46, 111, 106, 0.34);
  background: linear-gradient(180deg, rgba(46, 111, 106, 0.18), rgba(255, 255, 255, 0.8));
}

.covers {
  margin-top: 14px;
}

.upload-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px dashed rgba(32, 50, 57, 0.25);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(46, 111, 106, 0.08), rgba(255, 255, 255, 0.56));
}

.upload-card input {
  display: none;
}

.preview-strip {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  min-height: 112px;
}

.preview-empty,
.preview-thumb {
  display: grid;
  place-items: center;
  min-height: 112px;
  border-radius: 18px;
  border: 1px dashed rgba(32, 50, 57, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.44);
  overflow: hidden;
}

.preview-thumb img {
  width: 100%;
  height: 112px;
  object-fit: cover;
}

.preview-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
}

.preview-stage,
.summary-card {
  padding: 22px;
}

.preview-stage-header,
.summary-card-header {
  align-items: center;
  margin-bottom: 18px;
}

.preview-stage-header span,
.summary-card-header span,
.summary-list span {
  color: var(--muted);
}

#shape-canvas {
  width: 100%;
  height: auto;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 235, 225, 0.88)),
    linear-gradient(90deg, rgba(32, 50, 57, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(32, 50, 57, 0.04) 1px, transparent 1px);
}

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

.summary-note {
  margin: 18px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(46, 111, 106, 0.08);
  line-height: 1.5;
  color: var(--muted);
}

.wide-button {
  width: 100%;
}

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

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

.brief-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: none;
  border-radius: 28px;
  background: transparent;
}

.brief-dialog::backdrop {
  background: rgba(22, 30, 34, 0.45);
  backdrop-filter: blur(4px);
}

.brief-dialog-card {
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffaf2, #f7ecdd);
  box-shadow: var(--shadow);
}

#dialog-copy {
  margin: 16px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .hero-grid,
  .configurator-layout,
  .closing,
  .workflow-grid,
  .closing-points {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 12px;
  }

  .hero,
  .workflow,
  .configurator,
  .closing {
    padding: 20px;
    border-radius: 26px;
  }

  .topbar,
  .hero-actions,
  .block-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-points,
  .shape-grid,
  .field-grid,
  .option-grid,
  .closing-points {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(2.4rem, 12vw, 3.6rem);
  }

  h2 {
    font-size: clamp(1.8rem, 9vw, 2.6rem);
  }
}
