/* Ювелирная Мастерская — общая дизайн-система
   --------------------------------------------
   Палитра, типографика, базовые компоненты, утилиты.
   Импортируется на каждой странице сайта.
*/

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
img { background-color: var(--c-bg-2, #3a0e12); opacity: 0; transition: opacity 250ms ease-out; }
img.is-loaded { opacity: 1; }
button { font: inherit; cursor: pointer; background: none; border: none; padding: 0; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* === DESIGN TOKENS === */
:root {
  /* Palette — Бордо (default) */
  --c-bg: #2a0a0e;
  --c-bg-2: #3a0e12;
  --c-bg-3: #4a151a;
  --c-bg-card: rgba(255,255,255,0.025);
  --c-ink: #ede1cc;
  --c-ink-dim: #c5b89e;
  --c-ink-muted: rgba(237,225,204,0.55);
  --c-accent: #c9a87a;        /* brass */
  --c-accent-2: #b07e3e;
  --c-divider: rgba(201,168,122,0.25);
  --c-divider-strong: rgba(201,168,122,0.5);

  /* Typography */
  --f-serif: 'Fraunces', 'Cormorant Garamond', 'Times New Roman', serif;
  --f-sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Container */
  --container: 1280px;
  --pad-x: clamp(20px, 4vw, 64px);
}

/* Palette: Малахит (alternative) */
[data-palette="malachite"] {
  --c-bg: #0e1f17;
  --c-bg-2: #15291f;
  --c-bg-3: #1d4030;
  --c-bg-card: rgba(255,255,255,0.025);
}

/* === BASE === */
body {
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: 18px;
  font-weight: 450;
  line-height: 1.6;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* === SHARED LAYOUT BACKGROUND ===
   Guilloché-style concentric arcs on top of soft radial gradient.
   Used on every page section that sits on the dark base. */
.page-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
.page-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, var(--c-bg-3) 0%, var(--c-bg-2) 50%, var(--c-bg) 100%);
}
.page-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    repeating-radial-gradient(circle at 20% 40%, transparent 0 38px, rgba(201,168,122,0.05) 38px 39.5px),
    repeating-radial-gradient(circle at 80% 60%, transparent 0 42px, rgba(201,168,122,0.045) 42px 43.5px),
    repeating-radial-gradient(circle at 50% 110%, transparent 0 60px, rgba(201,168,122,0.04) 60px 61.5px);
}

/* === CONTAINER === */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* === TYPOGRAPHY HELPERS === */
.eyebrow {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--c-accent);
}
.eyebrow-uc {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow-uc::before { content: ''; width: 36px; height: 1px; background: var(--c-accent); }

.h-display {
  font-family: var(--f-serif);
  font-weight: 500;
  font-variation-settings: "SOFT" 50, "opsz" 120;
  font-size: clamp(54px, 7.5vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--c-ink);
  margin: 0;
}
.h-display i { font-style: italic; color: var(--c-accent); font-variation-settings: "SOFT" 80, "opsz" 120; font-weight: 500; }

.h-section {
  font-family: var(--f-serif);
  font-weight: 500;
  font-variation-settings: "SOFT" 50, "opsz" 96;
  font-size: clamp(40px, 5.4vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  margin: 0;
}
.h-section i { font-style: italic; color: var(--c-accent); font-variation-settings: "SOFT" 80, "opsz" 96; font-weight: 500; }

.h-card {
  font-family: var(--f-serif);
  font-weight: 500;
  font-variation-settings: "SOFT" 50, "opsz" 36;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--c-ink);
  margin: 0;
}

.lede {
  font-family: var(--f-serif);
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 500;
  line-height: 1.65;
  color: var(--c-ink);
  margin: 0;
}

.text-letter {
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--c-ink-dim);
}

.text-meta {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
}

/* === DIVIDERS === */
.rule { height: 1px; background: var(--c-divider); width: 100%; }
.rule-strong { height: 1px; background: var(--c-divider-strong); width: 100%; }

/* Decorative rule with ornament in middle */
.rule-orn {
  display: flex; align-items: center; gap: 16px;
  color: var(--c-accent);
}
.rule-orn::before, .rule-orn::after {
  content: ''; flex: 1; height: 1px; background: var(--c-accent); opacity: 0.5;
}
.rule-orn-mark { font-family: var(--f-serif); font-style: italic; font-size: 18px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 17px 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid transparent;
  transition: opacity 0.2s, transform 0.1s, background 0.2s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--c-accent);
  color: var(--c-bg);
}
.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-divider-strong);
}
.btn-underline {
  padding: 16px 0;
  border-bottom: 1px solid var(--c-accent);
  color: var(--c-ink);
}

/* === CARDS === */
.card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-divider);
  padding: 24px;
  transition: border-color 0.2s, background 0.2s;
}
.card-link:hover { border-color: var(--c-divider-strong); background: rgba(255,255,255,0.04); }

/* === IMAGE === */
.img-frame {
  position: relative; overflow: hidden;
  background: var(--c-bg-2);
}
.img-frame img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.05) saturate(0.92); }
.img-frame .caption {
  position: absolute; left: 14px; bottom: 14px;
  background: var(--c-accent); color: var(--c-bg);
  padding: 6px 12px;
  font-family: var(--f-serif); font-style: italic; font-size: 13px;
}

/* === MONOGRAM === */
.monogram {
  width: 60px; height: 68px; display: block;
}

/* === MAIN GUTTERS === */
.section { padding-top: clamp(64px, 9vw, 112px); padding-bottom: clamp(64px, 9vw, 112px); }
.section-tight { padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); }

/* === FORMS === */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--c-accent);
}
.field-input, .field-textarea, .field-select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--c-divider-strong);
  padding: 14px 0;
  font-family: var(--f-serif);
  font-size: 18px;
  color: var(--c-ink);
  outline: none;
  transition: border-color 0.2s;
}
.field-textarea { resize: vertical; min-height: 100px; }
.field-input:focus, .field-textarea:focus, .field-select:focus { border-color: var(--c-accent); }
.field-input::placeholder, .field-textarea::placeholder { color: rgba(237,225,204,0.4); }

/* === FOCUS RING === */
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 4px; }

/* === HONEYPOT (anti-spam) ===
   Скрытое поле для отлова ботов. Не используем display:none — некоторые
   умные боты его пропускают. Прячем визуально, но оставляем доступным DOM'у. */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* === MOBILE / RESPONSIVE TWEAKS === */
@media (max-width: 720px) {
  :root {
    --pad-x: 20px;
    --s-7: 32px;
    --s-8: 44px;
    --s-9: 56px;
    --s-10: 72px;
  }
  body { font-size: 17px; line-height: 1.55; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .section-tight { padding-top: 40px; padding-bottom: 40px; }
  .h-display { font-size: clamp(40px, 9vw, 60px); }
  .h-section { font-size: clamp(30px, 7vw, 44px); }
  .lede { font-size: clamp(17px, 4.2vw, 20px); }
}
@media (max-width: 460px) {
  :root { --pad-x: 16px; }
  .btn { padding: 15px 22px; font-size: 12px; letter-spacing: 0.2em; }
}
