/* ===========================================================
   Paint & paper shop — stylesheet
   Palette: single hue 28 (burnt clay) + 5 HSB variations
   Spacing scale: 4 8 12 16 24 32 40 48 64
   Type scale: base 16, ratio 1.25 (13 / 16 / 20 / 25 / 31 / 39)
   =========================================================== */

:root {
  /* --- colour (role names, not looks) --- */
  --brand:        #6B4320; /* hsb 28,70,42  — 8.1:1 on white  */
  --brand-deep:   #422D1B; /* hsb 28,60,26  — hover / active   */
  --brand-mid:    #B88C65; /* hsb 28,45,72  — meaningful lines */
  --brand-soft:   #EDD4BE; /* hsb 28,20,93  — fills            */
  --brand-wash:   #FAF0E8; /* hsb 28, 7,98  — section fills    */

  --text-strong:  #1A1815; /* 16.4:1 on page                   */
  --text-weak:    #5C574E; /* 6.7:1  on page                   */
  --text-invert:  #FFFFFF;

  --fill-page:    #FAF7F2;
  --fill-card:    #FFFFFF;

  --stroke:       #8A8175; /* 3.8:1 — borders, inputs, icons   */

  --state-error:  #8C2A16;
  --state-ok:     #1F5A38;

  /* --- spacing --- */
  --s4: 4px;  --s8: 8px;   --s12: 12px; --s16: 16px;
  --s24: 24px; --s32: 32px; --s40: 40px; --s48: 48px; --s64: 64px;

  /* --- type --- */
  --body: ui-sans-serif, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --t-13: 13px; --t-16: 16px; --t-20: 20px;
  --t-25: 25px; --t-31: 31px; --t-39: 39px;

  --rail: 240px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fill-page);
  color: var(--text-strong);
  font: 400 var(--t-16)/24px var(--body);
}
img { display: block; max-width: 100%; }
figure, h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
h1 { font-size: var(--t-31); line-height: 36px; letter-spacing: -0.02em; }
h2 { font-size: var(--t-25); line-height: 32px; letter-spacing: -0.01em; }
h3 { font-size: var(--t-20); line-height: 28px; }
.lede { font-size: var(--t-20); line-height: 32px; color: var(--text-weak); }
.small { font-size: var(--t-13); line-height: 20px; }
.measure { max-width: 64ch; }
strong, b { font-weight: 700; }

a { color: var(--brand); }
a:hover { color: var(--brand-deep); }
:focus-visible {
  outline: 3px solid var(--brand-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (min-width: 1000px) {
  h1 { font-size: var(--t-39); line-height: 44px; }
  h2 { font-size: var(--t-31); line-height: 36px; }
  h3 { font-size: var(--t-25); line-height: 32px; }
}

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: var(--text-invert);
  padding: var(--s12) var(--s16); z-index: 20;
}
.skip:focus { left: var(--s8); top: var(--s8); color: var(--text-invert); }

/* ---------- rail (navigation) ---------- */
.rail {
  position: sticky; top: 0; z-index: 10;
  background: var(--fill-page);
  border-bottom: 2px solid var(--stroke);
  padding: var(--s12) var(--s16);
  display: flex; align-items: center; gap: var(--s16);
}
.rail__mark {
  font-family: var(--display);
  font-size: var(--t-20); line-height: 28px;
  color: var(--text-strong); text-decoration: none;
  white-space: nowrap;
}
.rail__mark:hover { color: var(--brand-deep); }
.rail__sub { display: block; font: 400 var(--t-13)/20px var(--body); color: var(--text-weak); }
.rail__scroll { flex: 1; overflow-x: auto; }
.rail__list { display: flex; gap: var(--s8); }
.rail__link {
  display: flex; align-items: center; gap: var(--s8);
  min-height: 48px; padding: var(--s8) var(--s12);
  color: var(--text-strong); text-decoration: none;
  border: 2px solid transparent; border-radius: 2px;
  white-space: nowrap;
}
.rail__link:hover { background: var(--brand-wash); color: var(--brand-deep); }
.rail__link[aria-current="true"] { border-color: var(--brand); color: var(--brand); }
.rail__num { font-size: var(--t-13); color: var(--text-weak); }
.rail__link[aria-current="true"] .rail__num { color: var(--brand); }
.rail__foot { display: none; }

/* currency switch */
.switch { display: flex; border: 2px solid var(--stroke); border-radius: 2px; overflow: hidden; }
.switch__btn {
  min-width: 48px; min-height: 48px; padding: var(--s8) var(--s12);
  border: 0; background: var(--fill-card); color: var(--text-strong);
  font: 700 var(--t-16)/24px var(--body); cursor: pointer;
}
.switch__btn + .switch__btn { border-left: 2px solid var(--stroke); }
.switch__btn:hover { background: var(--brand-wash); }
.switch__btn[aria-pressed="true"] { background: var(--brand); color: var(--text-invert); }

/* ---------- page shell ---------- */
.wrap { padding: 0 var(--s16); max-width: 1280px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s24); }
.section { padding: var(--s40) 0; }
.section--tight { padding: var(--s32) 0; }

/* ---------- masthead ---------- */
.masthead { padding: var(--s40) 0 var(--s32); }
.masthead__text { grid-column: span 12; }
.masthead__text p { margin-top: var(--s16); }
.masthead__index {
  grid-column: span 12;
  margin-top: var(--s32);
  background: var(--fill-card);
  border: 2px solid var(--stroke);
  border-radius: 2px;
  padding: var(--s24);
}
.idx { margin-top: var(--s16); }
.idx__row { border-top: 1px solid var(--stroke); }
.idx__row:first-child { border-top: 0; }
.idx__link {
  display: flex; align-items: baseline; gap: var(--s12);
  min-height: 48px; padding: var(--s12) 0;
  text-decoration: none; color: var(--text-strong);
}
.idx__link:hover { color: var(--brand-deep); }
.idx__link:hover .idx__name { text-decoration: underline; }
.idx__num { font-size: var(--t-13); color: var(--brand); font-weight: 700; width: 24px; }
.idx__name { flex: 1; }
.idx__count { font-size: var(--t-13); color: var(--text-weak); }

/* ---------- band + cards ---------- */
.band { padding-top: var(--s40); scroll-margin-top: 96px; }
.band__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s12);
  padding-bottom: var(--s16);
  border-bottom: 2px solid var(--brand);
  margin-bottom: var(--s32);
}
.band__num { font-size: var(--t-13); font-weight: 700; color: var(--brand); }
.band__note { flex: 1 1 240px; color: var(--text-weak); font-size: var(--t-13); line-height: 20px; }

.card {
  grid-column: span 12;
  background: var(--fill-card);
  border: 1px solid var(--stroke);
  border-radius: 2px;
  padding: var(--s16);
  display: flex; flex-direction: column; gap: var(--s12);
}
.card__media {
  background: var(--brand-wash);
  border-radius: 2px; overflow: hidden;
  aspect-ratio: 4 / 5;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { flex: 1; display: flex; flex-direction: column; gap: var(--s12); }
.card__name { font-family: var(--display); font-size: var(--t-20); line-height: 28px; }
.card__desc { color: var(--text-weak); }
.card__foot {
  margin-top: auto; padding-top: var(--s12);
  border-top: 1px solid var(--stroke);
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s12);
}
.card__price { font-weight: 700; font-size: var(--t-20); line-height: 28px; }
.card__unit { font-size: var(--t-13); line-height: 20px; color: var(--text-weak); }

/* wide variant for the wallpaper band */
.band--wide .card__media { aspect-ratio: 3 / 2; }

/* ---------- note strip ---------- */
.strip {
  grid-column: span 12;
  background: var(--brand-wash);
  border-left: 4px solid var(--brand);
  border-radius: 2px;
  padding: var(--s24);
}
.strip p { margin-top: var(--s12); color: var(--text-weak); }
.strip dl { margin-top: var(--s16); display: grid; gap: var(--s12); }
.strip dt { font-weight: 700; font-size: var(--t-13); line-height: 20px; }
.strip dd { color: var(--text-weak); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; min-width: 48px; padding: var(--s12) var(--s24);
  font: 700 var(--t-16)/24px var(--body);
  border-radius: 2px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none;
}
.btn--primary { background: var(--brand); color: var(--text-invert); }
.btn--primary:hover { background: var(--brand-deep); color: var(--text-invert); }
.btn--primary:active { background: #2E1F12; }
.btn--secondary { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn--secondary:hover { background: var(--brand-wash); color: var(--brand-deep); border-color: var(--brand-deep); }
.btn--tertiary { background: transparent; color: var(--brand); padding-left: 0; padding-right: 0; }
.btn--tertiary:hover { color: var(--brand-deep); text-decoration: underline; }

/* ---------- form ---------- */
.form { grid-column: span 12; max-width: 480px; }
.field { margin-top: var(--s24); }
.field label, .fieldset__legend { display: block; font-weight: 700; }
.field .hint { display: block; font-size: var(--t-13); line-height: 20px; color: var(--text-weak); margin-top: var(--s4); }
.field input[type="text"], .field input[type="email"] {
  width: 100%; min-height: 48px; margin-top: var(--s8);
  padding: var(--s12); border: 2px solid var(--stroke); border-radius: 2px;
  background: var(--fill-card); color: var(--text-strong);
  font: 400 var(--t-16)/24px var(--body);
}
.field input:hover { border-color: var(--brand); }
.field--narrow input { max-width: 160px; }
.field--group { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-inline-size: auto; }
.switch--foot { margin-top: var(--s16); }
.choice { display: flex; align-items: center; gap: var(--s12); min-height: 48px; }
.choice input { width: 24px; height: 24px; accent-color: var(--brand); }
.form__actions { margin-top: var(--s24); display: flex; justify-content: flex-start; }
.msg { margin-top: var(--s16); font-size: var(--t-13); line-height: 20px; }
.msg--error { color: var(--state-error); font-weight: 700; }
.msg--ok { color: var(--state-ok); font-weight: 700; }

/* ---------- policy pages ---------- */
.doc { grid-column: span 12; }
.doc h2 { margin-top: var(--s40); }
.doc h3 { margin-top: var(--s24); }
.doc p, .doc ul, .doc ol, .doc table { margin-top: var(--s16); }
.doc li { padding-left: var(--s16); position: relative; margin-top: var(--s8); }
.doc li::before {
  content: ""; position: absolute; left: 0; top: 12px;
  width: 8px; height: 2px; background: var(--stroke);
}
.doc ol { counter-reset: n; }
.doc ol li { counter-increment: n; }
.doc ol li::before { content: counter(n) "."; width: auto; height: auto; background: none; top: 0; color: var(--brand); font-weight: 700; }
.doc table { border-collapse: collapse; width: 100%; }
.doc th, .doc td { text-align: left; padding: var(--s12); border-bottom: 1px solid var(--stroke); vertical-align: top; }
.doc th { font-size: var(--t-13); line-height: 20px; }
.doc__meta { color: var(--text-weak); font-size: var(--t-13); line-height: 20px; margin-top: var(--s8); }
.doc__toc { grid-column: span 12; margin-top: var(--s24); }
.doc__toc ul { border-top: 1px solid var(--stroke); }
.doc__toc a { display: block; padding: var(--s12) 0; border-bottom: 1px solid var(--stroke); text-decoration: none; }
.doc__toc a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.foot {
  margin-top: var(--s64);
  background: var(--brand-deep);
  color: var(--text-invert);
  padding: var(--s48) 0 var(--s32);
}
.foot a { color: var(--brand-soft); }
.foot a:hover { color: var(--text-invert); }
.foot__col { grid-column: span 12; }
.foot__col + .foot__col { margin-top: var(--s32); }
.foot h2 { font-size: var(--t-20); line-height: 28px; }
.foot__list { margin-top: var(--s16); display: grid; gap: var(--s8); }
.foot__list a { display: inline-flex; align-items: center; min-height: 48px; }
.foot dl { margin-top: var(--s16); display: grid; gap: var(--s8); }
.foot dt { font-size: var(--t-13); line-height: 20px; color: var(--brand-soft); }
.foot__legal {
  grid-column: span 12; margin-top: var(--s32); padding-top: var(--s16);
  border-top: 1px solid var(--brand-mid);
  font-size: var(--t-13); line-height: 20px; color: var(--brand-soft);
}

/* ---------- responsive: 12-column composition ---------- */
@media (min-width: 640px) {
  .wrap { padding: 0 var(--s24); }
  .card { grid-column: span 6; }
  .masthead__text { grid-column: span 7; }
  .masthead__index { grid-column: span 5; margin-top: 0; }
  .foot__col { grid-column: span 4; }
  .foot__col + .foot__col { margin-top: 0; }
  .band--wide .card { grid-column: span 6; flex-direction: row; align-items: flex-start; gap: var(--s16); }
  .band--wide .card__media { flex: 0 0 160px; aspect-ratio: 3 / 4; }
  .band--wide .card__body { flex: 1; display: flex; flex-direction: column; gap: var(--s12); min-height: 100%; }
  .strip { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s24); align-items: start; }
  .strip dl { margin-top: 0; }
}

@media (min-width: 1000px) {
  body { padding-left: var(--rail); }
  .rail {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail);
    flex-direction: column; align-items: stretch; gap: var(--s24);
    padding: var(--s32) var(--s24);
    border-bottom: 0; border-right: 2px solid var(--stroke);
    overflow-y: auto;
  }
  .rail__scroll { flex: 0 0 auto; overflow: visible; }
  .rail__list { flex-direction: column; gap: var(--s4); }
  .rail__link { padding: var(--s8); }
  .rail__foot { display: block; margin-top: auto; }
  .rail__foot .foot__list { margin-top: var(--s12); }
  .rail__foot a { display: block; padding: var(--s12) var(--s8); text-decoration: none; }
  .rail__foot a:hover { text-decoration: underline; }
  .wrap { padding: 0 var(--s48); }
  .section { padding: var(--s48) 0; }
  .masthead { padding: var(--s64) 0 var(--s40); }
  .card { grid-column: span 4; }
  .band--wide .card { grid-column: span 6; }
  .doc { grid-column: span 8; }
  .doc__toc { grid-column: span 4; margin-top: 0; }
  .form { grid-column: span 6; }
  .strip { grid-column: span 10; }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .btn, .rail__link { transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear; }
}
