/* ------------------------------------------------------------------
   Berry Modest — design tokens, reset, typography, primitives
   ------------------------------------------------------------------ */
:root {
  --ivory: #F5F0E8;
  --ivory-2: #EDE6DA;
  --ivory-3: #E4DBCD;
  --paper: #FBF8F3;
  --ink: #1B1816;
  --ink-2: #46403B;
  --mute: #857A70;
  --mute-2: #A89D92;
  --line: #DCD2C4;
  --line-2: #EAE2D6;
  --berry: #5B1F3A;
  --berry-2: #7A2C4E;
  --berry-3: #A1476E;
  --berry-soft: #F0E4EA;
  --brass: #B08D5B;
  --brass-2: #D6B97F;
  --brass-3: #8C6E42;
  --oak: #8B6B4A;
  --oak-2: #6D5238;
  --walnut: #4A3628;

  --fit-tight: #B23A3A;
  --fit-close: #C98B3A;
  --fit-fitted: #C9A24B;
  --fit-comfortable: #5F8A62;
  --fit-relaxed: #4F7BA7;
  --fit-loose: #4A6A99;
  --fit-oversized: #6C6A9C;

  --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body: 'Jost', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --header-h: 76px;
  --rail-w: 220px;
  --radius: 2px;
  --radius-lg: 6px;
  --shadow-soft: 0 24px 60px -30px rgba(27, 24, 22, .35);
  --shadow-card: 0 12px 40px -24px rgba(27, 24, 22, .35);
  --ease-out: cubic-bezier(.16, .84, .3, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --dur: .6s;
  --max-w: 1380px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-home { background: #14100e; }
body.no-scroll { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.005em;
}
h1 { font-size: clamp(38px, 5vw, 64px); }
h2 { font-size: clamp(30px, 3.6vw, 44px); }
h3 { font-size: clamp(22px, 2.2vw, 28px); }
h4 { font-size: 20px; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mute);
}
.eyebrow.berry { color: var(--berry); }
.lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); font-weight: 300; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.serif { font-family: var(--font-display); }
.italic { font-style: italic; }

.skip-link {
  position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--ivory);
  padding: 8px 14px; z-index: 1000;
}
.skip-link:focus { left: 8px; }

/* Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 28px;
  font-family: var(--font-body); font-weight: 400; font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--ivory);
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform .3s var(--ease-out);
  white-space: nowrap;
}
.btn:hover { background: var(--berry); border-color: var(--berry); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.btn.light { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.btn.light:hover { background: var(--paper); border-color: var(--paper); }
.btn.outline-light { background: transparent; color: var(--ivory); border-color: rgba(245, 240, 232, .55); }
.btn.outline-light:hover { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.btn.berry { background: var(--berry); border-color: var(--berry); }
.btn.berry:hover { background: var(--berry-2); border-color: var(--berry-2); }
.btn.sm { min-height: 40px; padding: 0 18px; font-size: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 400;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
  transition: color .3s, border-color .3s;
}
.link:hover { color: var(--berry); }
.link .arrow { transition: transform .4s var(--ease-out); }
.link:hover .arrow { transform: translateX(4px); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  position: relative; transition: background .3s;
}
.icon-btn:hover { background: rgba(27, 24, 22, .06); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--berry);
}
.icon-btn .count {
  position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--berry); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 500;
}

/* Chips ----------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; min-width: 48px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 400;
  background: var(--paper); transition: border-color .3s, background .3s, color .3s;
  position: relative;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.chip.recommended::after {
  content: ''; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--berry); border: 2px solid var(--paper);
}
.chip[disabled] { opacity: .4; text-decoration: line-through; pointer-events: none; }

/* Swatches -------------------------------------------------------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .12); position: relative; transition: transform .3s var(--ease-out);
  box-shadow: inset 0 0 0 2px var(--paper);
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { box-shadow: inset 0 0 0 2px var(--paper), 0 0 0 1px var(--ink); }
.swatch.sm { width: 14px; height: 14px; box-shadow: none; }
.swatch.sm.active { box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--ink); }

/* Forms ----------------------------------------------------------- */
.field { display: grid; gap: 8px; }
.field label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); font-weight: 400; }
.field input, .field select, .field textarea {
  height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); font-weight: 300; font-size: 15px; width: 100%;
  transition: border-color .3s, box-shadow .3s;
  -moz-appearance: textfield;
}
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field textarea { height: auto; padding: 12px 14px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27, 24, 22, .06); }
.field.flag input { border-color: var(--fit-close); }
.field .hint { font-size: 12px; color: var(--mute); }
.field .flag-msg {
  font-size: 13px; color: #8A5A17; background: #FBF1E2; border: 1px solid #F0DDB8; padding: 10px 12px; border-radius: var(--radius);
  display: grid; gap: 8px;
}
.field .flag-msg label { display: flex; align-items: center; gap: 8px; letter-spacing: 0; text-transform: none; font-size: 13px; color: #8A5A17; }
.input-unit { position: relative; }
.input-unit input { padding-right: 46px; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--mute); letter-spacing: .1em; }

.check { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--berry); flex: none; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.segmented button { padding: 0 16px; height: 38px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 400; transition: background .3s, color .3s; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.active { background: var(--ink); color: var(--ivory); }

/* Range sliders */
.range { display: grid; gap: 6px; }
.range .row { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .08em; }
.range .row b { font-weight: 500; }
.range input[type=range] { width: 100%; accent-color: var(--berry); height: 24px; }

/* Fit badges ------------------------------------------------------ */
.fit-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 400; color: var(--ink-2);
}
.fit-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--mute)); flex: none; }
.fit-tight { --dot: var(--fit-tight); }
.fit-close { --dot: var(--fit-close); }
.fit-fitted { --dot: var(--fit-fitted); }
.fit-comfortable { --dot: var(--fit-comfortable); }
.fit-relaxed { --dot: var(--fit-relaxed); }
.fit-loose { --dot: var(--fit-loose); }
.fit-oversized { --dot: var(--fit-oversized); }
.fit-neutral { --dot: var(--mute-2); }

/* Layout helpers -------------------------------------------------- */
.container { width: min(var(--max-w), 100% - 48px); margin-inline: auto; }
.section { padding: 96px 0; }
.section.tight { padding: 56px 0; }
.grid { display: grid; gap: 24px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 16px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); border: 0; margin: 32px 0; }
.card { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 28px; }
.note {
  font-size: 13px; color: var(--mute); border-left: 2px solid var(--brass-2); padding: 6px 14px; line-height: 1.55;
}
.tag {
  display: inline-block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-2); font-weight: 400; background: var(--paper);
}
.tag.berry { background: var(--berry); color: var(--ivory); border-color: var(--berry); }
.tag.brass { color: var(--brass-3); border-color: var(--brass-2); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

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

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 64px 0; }
  .container { width: min(var(--max-w), 100% - 32px); }
  body { font-size: 15px; }
}

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