/* =========================================================
   Студия ухода «Кактус» — design tokens & components
   ========================================================= */

:root {
  --bg:        #f3e9c4;
  --surface:   #ede1b1;
  --deep:      #e2d29a;
  --fg:        #1f3d2a;
  --fg-soft:   #2f5236;
  --muted:     #5a6b56;
  --line:      #c9b889;
  --pop:       #c54a3a;
  --radius:    4px;
  --space-section: 96px;
}

html { scroll-behavior: smooth; }

body {
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Force Tailwind to honor our hex tokens everywhere */
.bg-bg { background-color: var(--bg) !important; }
.bg-surface { background-color: var(--surface) !important; }
.bg-fg { background-color: var(--fg) !important; }
.text-fg { color: var(--fg) !important; }
.text-fg-soft { color: var(--fg-soft) !important; }
.text-muted { color: var(--muted) !important; }
.text-bg { color: var(--bg) !important; }
.text-pop { color: var(--pop) !important; }
.bg-pop { background-color: var(--pop) !important; }
.border-line { border-color: var(--line) !important; }

/* ====== Typography helpers ====== */
.font-display {
  font-family: "Marck Script", "Brush Script MT", cursive;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.tabular-nums { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ====== Buttons ====== */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.95rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
  min-height: 48px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-align: left;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn-primary:hover {
  background: var(--fg-soft);
  border-color: var(--fg-soft);
}
.btn-primary:focus-visible {
  outline: 3px solid var(--pop);
  outline-offset: 2px;
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg);
}
.btn-secondary:hover {
  background: var(--fg);
  color: var(--bg);
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--pop);
  outline-offset: 2px;
}
.btn-secondary:active { transform: translateY(1px); }

.btn-primary .dot,
.btn-secondary .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--pop);
  flex: none;
  display: inline-block;
}
.btn-secondary .dot { background: var(--fg); }
.btn-secondary:hover .dot { background: var(--bg); }

@media (hover: none) {
  .btn-primary:active, .btn-secondary:active { transform: scale(0.99); }
}

/* ====== Hero cacti band ====== */
.cacti-band {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  line-height: 0;
}
.cacti-band img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 220px;
  object-fit: cover;
  object-position: center bottom;
}
@media (min-width: 768px) {
  .cacti-band img { max-height: 280px; }
}

/* ====== Services chapters ====== */
.chapter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.chapter:first-child { border-top: 0; padding-top: 0; }

.chapter-num {
  font-family: "Golos Text", system-ui, sans-serif;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  line-height: 0.9;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.chapter-alt .chapter-num { color: var(--pop); }

.chapter-title {
  font-family: "Golos Text", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.chapter-lead {
  color: var(--fg-soft);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 60ch;
  margin-bottom: 1.25rem;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1.5rem;
}
.service-list li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--fg-soft);
  font-size: 0.98rem;
  line-height: 1.4;
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.7;
}

@media (min-width: 720px) {
  .chapter {
    grid-template-columns: 180px 1fr;
    gap: 2rem 3rem;
    padding: 3rem 0;
  }
}
@media (min-width: 1024px) {
  .chapter {
    grid-template-columns: 220px 1fr;
    gap: 2.5rem 4rem;
  }
}

/* ====== Portfolio tiles ====== */
.work-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
  overflow: hidden;
  isolation: isolate;
  margin: 0;
}
.work-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 40% at 70% 30%, rgba(31,61,42,0.08), transparent 60%),
    var(--surface);
}
.work-tile-2 { background: #e8dcae; }
.work-tile-2::before { background: radial-gradient(ellipse 60% 40% at 30% 70%, rgba(31,61,42,0.10), transparent 60%), #e8dcae; }
.work-tile-3 { background: #e6d9a4; }
.work-tile-3::before { background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(31,61,42,0.07), transparent 60%), #e6d9a4; }
.work-tile-4 { background: var(--bg); border-color: var(--deep); }
.work-tile-5 { background: #e6d9a4; }
.work-tile-5::before { background: radial-gradient(ellipse 60% 40% at 70% 30%, rgba(31,61,42,0.08), transparent 60%), #e6d9a4; }
.work-tile-6 { background: #dccc8e; }
.work-tile-6::before { background: radial-gradient(ellipse 60% 40% at 30% 70%, rgba(31,61,42,0.08), transparent 60%), #dccc8e; }

.work-tile-label {
  font-family: "Marck Script", cursive;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  line-height: 1;
  color: var(--fg);
  background: rgba(243, 233, 196, 0.75);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  backdrop-filter: blur(2px);
  z-index: 2;
  position: relative;
}

/* Real photo tiles */
.work-tile-img { background: #1f3d2a; }
.work-tile-img::before { content: none; }
.work-tile-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: block;
}
.work-tile-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31,61,42,0.05) 0%, rgba(31,61,42,0.30) 100%);
  z-index: 2;
  pointer-events: none;
}
.work-tile-img .work-tile-label {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  margin-top: 0;
  z-index: 3;
}
@media (hover: hover) {
  .work-tile-img:hover img { transform: scale(1.04); }
}

@media (hover: hover) {
  .work-tile { transition: transform 200ms ease, border-color 200ms ease; }
  .work-tile:hover { transform: translateY(-2px); border-color: var(--fg); }
}

/* ====== Price section ====== */
.price-col h3.price-title {
  font-family: "Golos Text", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  color: var(--bg);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(243, 233, 196, 0.25);
  letter-spacing: -0.01em;
}

.price-subtitle {
  font-family: "Golos Text", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 233, 196, 0.55);
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}
.price-subtitle-mt { margin-top: 2rem; }

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed rgba(243, 233, 196, 0.18);
}
.price-row:last-child { border-bottom: 0; }

.price-row dt,
.price-row dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--bg);
}
.price-row dd {
  font-variant-numeric: tabular-nums;
  color: rgba(243, 233, 196, 0.6);
  white-space: nowrap;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.price-note {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(243, 233, 196, 0.6);
  line-height: 1.4;
}

/* ====== Contact card ====== */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ====== Booking cards ====== */
.book-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.book-card-alt { background: var(--surface); }

.book-num {
  font-family: "Golos Text", system-ui, sans-serif;
  font-weight: 800;
  font-style: italic;
  font-size: 2.4rem;
  line-height: 0.9;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.book-card-alt .book-num { color: var(--pop); }

.book-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
  margin: 0;
}

.book-lead {
  color: var(--fg-soft);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0;
}

.book-or {
  text-align: center;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0;
}

.book-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.book-input {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 0.98rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 48px;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.book-card-alt .book-input { background: var(--bg); }
textarea.book-input { min-height: auto; resize: vertical; }

.book-input:focus-visible {
  outline: 3px solid var(--pop);
  outline-offset: 1px;
  border-color: var(--fg);
}
.book-input::placeholder { color: var(--muted); }

.consent-notice {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.4rem;
}
.consent-notice a { text-decoration: underline; text-underline-offset: 3px; }

.form-success,
.form-error {
  text-align: center;
  padding: 1.5rem 0;
}
.form-error {
  color: var(--pop);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ====== Section rhythm ====== */
section { padding-top: 4.5rem; padding-bottom: 4.5rem; }
@media (min-width: 768px) {
  section { padding-top: var(--space-section); padding-bottom: var(--space-section); }
}

/* ====== Reduced motion ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ====== Focus visibility (global) ====== */
:focus-visible {
  outline: 3px solid var(--pop);
  outline-offset: 2px;
  border-radius: 2px;
}
a:focus-visible, button:focus-visible { outline-offset: 3px; }

/* ====== Mobile type tweaks ====== */
@media (max-width: 600px) {
  .book-card { padding: 1.4rem; }
  .contact-card { padding: 1.4rem; }
  .work-tile { aspect-ratio: 1 / 1; }
  .work-tile-label { font-size: 1.5rem; }
}
