:root {
  --page: #f5eadb;
  --paper: #fff9ef;
  --paper-strong: #fff3df;
  --sand: #ead4b7;
  --sand-soft: #f7e8d2;
  --gold: #c99843;
  --gold-soft: #efd19a;
  --brown: #6f4a2f;
  --brown-2: #8c6544;
  --cocoa: #4f3829;
  --text: #765b46;
  --muted: #9d846c;
  --line: #dec6a7;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(94, 62, 35, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(111, 74, 47, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #f5eadb 0%, #fff9ef 45%, #f1ddc4 100%);
  background-size: 42px 42px, auto;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

body.menu-open,
body.modal-open {
  overflow: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.wrap {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 249, 239, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--brown);
  border: 1px solid #5f3e28;
  border-radius: 6px;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--cocoa);
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.top-nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--brown);
  border-radius: 6px;
  font-weight: 800;
}

.lang-select {
  min-height: 42px;
  padding: 0 10px;
  color: var(--brown);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 900;
}

.top-nav a:hover {
  background: var(--sand-soft);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px auto;
  background: var(--brown);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.hero {
  position: relative;
  min-height: calc(100vh - 74px);
  overflow: hidden;
  padding: 58px 0 46px;
  background-image: url("../assets/toy-background.jpg");
  background-position: center;
  background-size: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(64, 42, 27, 0.72) 0%, rgba(79, 56, 41, 0.52) 44%, rgba(245, 234, 219, 0.22) 100%),
    linear-gradient(180deg, rgba(64, 42, 27, 0.15), rgba(64, 42, 27, 0.64));
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: end;
  min-height: calc(100vh - 178px);
}

.hero-copy {
  max-width: 760px;
  padding: 28px 0;
}

.section-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--cocoa);
  line-height: 1.16;
}

.hero h1,
.hero .hero-text {
  color: var(--paper);
  text-shadow: 0 2px 18px rgba(43, 28, 18, 0.32);
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(32px, 5vw, 64px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(25px, 3vw, 38px);
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
}

.hero-text {
  max-width: 690px;
  margin-bottom: 24px;
  font-size: 18px;
}

.discount-note {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 18px;
  padding: 8px 12px;
  color: var(--brown);
  background: rgba(255, 249, 239, 0.9);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 900;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.light-btn,
.text-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-btn {
  color: var(--paper);
  background: var(--brown);
  border: 1px solid var(--brown);
  box-shadow: 0 12px 24px rgba(79, 56, 41, 0.24);
}

.light-btn {
  color: var(--brown);
  background: var(--paper);
  border: 1px solid rgba(255, 249, 239, 0.72);
}

.form-light {
  border-color: var(--line);
}

.text-btn {
  min-height: auto;
  padding: 0;
  color: var(--brown);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.primary-btn:hover,
.light-btn:hover,
.category-tabs button:hover,
.template-card:hover {
  transform: translateY(-1px);
}

.hero-panel {
  padding: 22px;
  color: var(--paper);
  background: rgba(255, 249, 239, 0.16);
  border: 1px solid rgba(255, 249, 239, 0.42);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.panel-label {
  display: block;
  margin-bottom: 10px;
  color: var(--gold-soft);
  font-weight: 900;
}

.hero-panel h2,
.hero-panel p {
  color: var(--paper);
}

.hero-category-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.hero-category-list button {
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  color: #4f3829;
  background: rgba(255, 249, 239, 0.9);
  border: 1px solid rgba(255, 249, 239, 0.8);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.hero-category-list button:hover,
.hero-category-list button:focus-visible {
  background: #fffaf0;
  box-shadow: 0 10px 22px rgba(46, 34, 24, 0.18);
  transform: translateY(-1px);
}

.hero-category-list button:focus-visible {
  outline: 2px solid rgba(255, 221, 154, 0.95);
  outline-offset: 2px;
}

.section {
  padding: 52px 0;
}

.section-head {
  max-width: 780px;
  margin-bottom: 22px;
}

.section-head p:not(.section-label) {
  color: var(--text);
  font-size: 17px;
}

.templates-section {
  background: rgba(255, 249, 239, 0.55);
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  color: var(--brown);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 900;
}

.category-tabs button.active {
  color: var(--paper);
  background: var(--brown);
  border-color: var(--brown);
  box-shadow: 0 10px 20px rgba(79, 56, 41, 0.18);
}

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

.template-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.template-card button {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: inherit;
}

.preview-art {
  position: relative;
  display: grid;
  min-height: 168px;
  place-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.preview-art::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 249, 239, 0.8);
  border-radius: 6px;
}

.preview-art strong {
  position: relative;
  display: block;
  max-width: 100%;
  padding: 10px 13px;
  color: var(--cocoa);
  background: rgba(255, 249, 239, 0.86);
  border: 1px solid rgba(255, 249, 239, 0.95);
  border-radius: 6px;
  text-align: center;
  overflow-wrap: anywhere;
}

.vip-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff9ef;
  background: #4f3829;
  border: 2px solid #efd19a;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(48, 32, 21, 0.28);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.palette-rose {
  background: linear-gradient(135deg, #edd0be, #fff3df 52%, #c59a6a);
}

.palette-mint {
  background: linear-gradient(135deg, #dbc0a2, #fff9ef 50%, #b98357);
}

.palette-sky {
  background: linear-gradient(135deg, #e0c095, #fff7ea 48%, #d7a474);
}

.palette-lavender {
  background: linear-gradient(135deg, #cda985, #fff2dd 50%, #8c6544);
}

.palette-coral {
  background: linear-gradient(135deg, #efd19a, #fff9ef 50%, #d89b75);
}

.palette-green {
  background: linear-gradient(135deg, #d7c2a1, #fff8eb 50%, #a8794f);
}

.template-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.template-body h3 {
  min-height: 44px;
  margin: 0;
}

.template-body p {
  min-height: 70px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-meta span {
  padding: 5px 8px;
  color: var(--brown);
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.template-price {
  display: grid;
  gap: 7px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.price-card {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 7px 9px;
  color: var(--cocoa);
  background: #fff7ea;
  border: 1px solid #e1bf91;
  border-radius: 6px;
}

.price-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.price-card strong {
  color: #7a4828;
  font-size: 17px;
  font-weight: 950;
  white-space: nowrap;
}

.price-card del {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration-thickness: 2px;
}

.vip-price-card {
  background: #fff3df;
  border-color: #c99843;
}

.vip-price-card span,
.vip-price-card strong {
  color: #4f3829;
}

.price-note {
  margin: 8px 0 0;
  color: var(--brown);
  font-size: 14px;
  font-weight: 900;
}

.process-section {
  background: linear-gradient(180deg, #f1ddc4, #fff9ef);
  border-top: 1px solid var(--line);
}

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

.process-grid article {
  padding: 18px;
  background: rgba(255, 249, 239, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.process-grid span {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--gold);
  font-weight: 900;
}

.process-grid p {
  margin-bottom: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 18px;
}

.modal.open {
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(55, 37, 25, 0.58);
}

.modal-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(48, 32, 21, 0.32);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-height: 38px;
  padding: 0 12px;
  color: var(--brown);
  background: rgba(255, 249, 239, 0.88);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 900;
}

.modal-step {
  display: none;
}

.modal-step.active {
  display: grid;
}

.modal-step-preview {
  grid-template-columns: 1fr 0.86fr;
  min-height: 560px;
}

.modal-preview {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 42px 28px;
  text-align: center;
  background-position: center;
  background-size: cover;
}

.modal-preview h2 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  overflow-wrap: anywhere;
}

.modal-preview p {
  margin: 0;
  color: var(--brown);
  font-size: 20px;
  font-weight: 900;
}

.preview-kicker {
  color: var(--brown);
  font-weight: 900;
  text-transform: uppercase;
}

.preview-lines {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.preview-lines span {
  padding: 8px 12px;
  color: var(--cocoa);
  background: rgba(255, 249, 239, 0.74);
  border: 1px solid rgba(255, 249, 239, 0.9);
  border-radius: 6px;
  font-weight: 800;
}

.modal-info {
  display: grid;
  align-content: center;
  padding: 42px 28px;
}

.modal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 22px;
}

.modal-meta div {
  padding: 12px;
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.modal-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-meta dd {
  margin: 0;
  color: var(--cocoa);
  font-weight: 900;
}

.wide-btn {
  width: 100%;
}

.modal-actions-stack {
  display: grid;
  gap: 10px;
}

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

.order-form {
  gap: 16px;
  padding: 28px;
}

.form-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-right: 92px;
}

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

.form-row {
  display: grid;
  gap: 7px;
}

.form-row label {
  color: var(--cocoa);
  font-weight: 900;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--cocoa);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.file-row input {
  padding: 9px 12px;
}

.form-row textarea {
  resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 152, 67, 0.22);
}

.order-status {
  display: none;
  padding: 14px;
  color: var(--cocoa);
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
}

.order-status.show {
  display: block;
}

.order-status span {
  display: block;
  margin-top: 6px;
  font-weight: 700;
}

.order-status a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  padding: 24px 0;
  background: #e9d5bb;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-grid p {
  margin: 0;
  color: var(--cocoa);
  font-weight: 900;
}

.footer-grid a {
  color: var(--brown);
  font-weight: 900;
}

@media (max-width: 1020px) {
  .hero-grid,
  .modal-step-preview {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    align-items: end;
  }

  .hero-panel {
    max-width: 520px;
  }

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

  .modal-step-preview {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: min(100% - 24px, 1160px);
  }

  .header-grid {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .menu-toggle {
    display: grid;
  }

  .top-nav {
    position: fixed;
    top: 73px;
    left: 12px;
    right: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: var(--shadow);
  }

  .top-nav.open {
    display: flex;
  }

  .top-nav a {
    justify-content: flex-start;
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding: 36px 0;
  }

  .hero-grid {
    min-height: auto;
  }

  .hero-panel {
    padding: 18px;
  }

  .section {
    padding: 38px 0;
  }

  .templates-grid,
  .process-grid,
  .form-grid,
  .modal-meta,
  .example-actions {
    grid-template-columns: 1fr;
  }

  .template-body h3,
  .template-body p {
    min-height: auto;
  }

  .category-tabs {
    margin-right: -12px;
    padding-right: 12px;
  }

  .modal {
    padding: 10px;
  }

  .modal-dialog {
    max-height: calc(100vh - 20px);
  }

  .modal-preview,
  .modal-info,
  .order-form {
    padding: 22px 16px;
  }

  .form-head {
    display: grid;
    padding-right: 86px;
  }
}

@media (max-width: 440px) {
  .brand small {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 24px;
  }

  .primary-btn,
  .light-btn {
    width: 100%;
  }

  .hero-actions {
    width: 100%;
  }
}
