/* ==========================================================================
   Craftify Box — stylesheet
   Plain CSS, no framework, no third-party requests.
   Every foreground/background pair below is checked against WCAG 2.1 AA
   (4.5:1 for text, 3:1 for large text and interface boundaries).
   ========================================================================== */

/* -------------------------------------------------------------- palette -- */
:root {
  --bg:          #FBF7F1;
  --bg-alt:      #F3EBDF;
  --surface:     #FFFFFF;
  --ink:         #1F1B16;
  --ink-muted:   #574E43;
  --accent:      #9A3412;
  --accent-deep: #7A2A0F;
  --on-accent:   #FFFFFF;
  --accent-wash: #F6E7DF;
  --sage:        #2C5545;
  --sage-wash:   #E4EDE7;
  --line:        #DED2BF;
  --line-strong: #8A7A63;
  --motif:       #B4835A;
  --focus:       #1B4D8F;
  --shadow:      0 1px 2px rgba(58, 42, 24, .06), 0 8px 24px -12px rgba(58, 42, 24, .18);

  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;

  --wrap: 68rem;
  --wrap-prose: 42rem;
  --radius: 10px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #16130F;
    --bg-alt:      #1E1A15;
    --surface:     #221D17;
    --ink:         #F2EBE1;
    --ink-muted:   #BFB2A2;
    --accent:      #E8815C;
    --accent-deep: #F0A184;
    --on-accent:   #16130F;
    --accent-wash: #33211A;
    --sage:        #8FC4AE;
    --sage-wash:   #1C2A24;
    --line:        #3B332A;
    --line-strong: #85786A;
    --motif:       #C08F63;
    --focus:       #9DC1F0;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.005em;
  margin: 0 0 .5em;
  color: var(--ink);
  overflow-wrap: break-word;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.35rem); }
h2 { font-size: clamp(1.55rem, 1.25rem + 1.1vw, 2.05rem); margin-top: 2.2em; }
h3 { font-size: clamp(1.2rem, 1.1rem + .5vw, 1.4rem); margin-top: 1.8em; }
h4 { font-size: 1.08rem; margin-top: 1.6em; font-family: var(--font-body); font-weight: 600; }

p, ul, ol, dl, table, blockquote, figure, pre { margin: 0 0 1.15em; }

a {
  color: var(--accent);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}
a:hover { color: var(--accent-deep); text-decoration-thickness: .14em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

strong { font-weight: 600; }

code {
  font-family: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .08em .35em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

/* --------------------------------------------------------------- layout -- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 40em) { .wrap { padding-inline: 2rem; } }

.prose { max-width: var(--wrap-prose); }

.section { padding-block: clamp(2.75rem, 1.5rem + 4vw, 4.75rem); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--focus);
  border-radius: var(--radius);
  padding: .7rem 1.1rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: .75rem;
  top: .75rem;
}

/* --------------------------------------------------------------- header -- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand:hover .brand-name { text-decoration: underline; text-underline-offset: .18em; }
.brand-mark {
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--accent);
}
.brand-name em {
  font-style: italic;
  color: var(--accent);
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .35rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: .45rem .7rem;
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: .97rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover {
  background: var(--bg-alt);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.site-nav a[aria-current='page'] {
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-weight: 600;
}

/* --------------------------------------------------------------- footer -- */
.site-footer {
  margin-top: auto;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 2rem;
  font-size: .95rem;
  color: var(--ink-muted);
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46em) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer h2 {
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 .8rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: .4rem; }
.site-footer ul + p { margin-top: .9rem; }
.site-footer p:last-of-type { margin-bottom: 0; }
.site-footer a { color: var(--accent); }
.footer-note {
  margin: 2.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: .88rem;
}

/* ----------------------------------------------------------------- hero -- */
.hero { padding-block: clamp(2.5rem, 1rem + 5vw, 5rem); }
.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 52em) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 3.5rem; }
}
.hero h1 { margin-bottom: .35em; }
.hero .lede { font-size: 1.18rem; color: var(--ink-muted); max-width: 34rem; }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: .35rem .8rem;
  margin-bottom: 1.1rem;
}

.hero-art {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(135deg, transparent 0 13px, color-mix(in srgb, var(--motif) 16%, transparent) 13px 14px),
    linear-gradient(160deg, var(--accent-wash), var(--sage-wash));
  position: relative;
  overflow: hidden;
}
.hero-art::after {
  content: '';
  position: absolute;
  inset: 12%;
  background-color: var(--motif);
  -webkit-mask: url('/assets/img/motif-hero.svg') center / contain no-repeat;
  mask: url('/assets/img/motif-hero.svg') center / contain no-repeat;
}

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: .78rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--on-accent);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--bg-alt); color: var(--ink); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.75rem;
}

/* ---------------------------------------------------------------- cards -- */
.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 34em) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60em) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 100%;
}
.card-art {
  height: 118px;
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in srgb, var(--motif) 15%, transparent) 11px 12px),
    var(--bg-alt);
}
.card-art::after {
  content: '';
  position: absolute;
  inset: 16px;
  background-color: var(--motif);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.card-body {
  padding: 1.25rem 1.35rem 1.45rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-body h3 { margin: 0 0 .4rem; font-size: 1.32rem; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: .16em; }
.card-body p { color: var(--ink-muted); font-size: .98rem; margin-bottom: 1rem; }
.card-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  font-size: .82rem;
}

.tag {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .15rem .6rem;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
}
.tag--level { background: var(--sage-wash); border-color: transparent; color: var(--ink); }
.tag--status { background: var(--accent-wash); border-color: transparent; color: var(--accent-deep); font-weight: 600; }

/* motif per box */
.m-embroidery::after { -webkit-mask-image: url('/assets/img/motif-embroidery.svg'); mask-image: url('/assets/img/motif-embroidery.svg'); }
.m-candle::after     { -webkit-mask-image: url('/assets/img/motif-candle.svg');     mask-image: url('/assets/img/motif-candle.svg'); }
.m-print::after      { -webkit-mask-image: url('/assets/img/motif-print.svg');      mask-image: url('/assets/img/motif-print.svg'); }
.m-book::after       { -webkit-mask-image: url('/assets/img/motif-book.svg');       mask-image: url('/assets/img/motif-book.svg'); }
.m-dye::after        { -webkit-mask-image: url('/assets/img/motif-dye.svg');        mask-image: url('/assets/img/motif-dye.svg'); }
.m-resin::after      { -webkit-mask-image: url('/assets/img/motif-resin.svg');      mask-image: url('/assets/img/motif-resin.svg'); }

/* ------------------------------------------------------------ post list -- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list > li { border-top: 1px solid var(--line); }
.post-list > li:last-child { border-bottom: 1px solid var(--line); }

.post-item {
  display: grid;
  gap: .3rem 2rem;
  padding-block: 1.6rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48em) {
  .post-item { grid-template-columns: 9.5rem 1fr; }
}
.post-item h3 { margin: 0 0 .3rem; font-size: 1.34rem; }
.post-item h3 a { color: var(--ink); text-decoration: none; }
.post-item h3 a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: .16em; }
.post-item p { margin: 0 0 .55rem; color: var(--ink-muted); }
.post-item .post-date {
  font-size: .86rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  padding-top: .35rem;
}

/* ---------------------------------------------------------- page header -- */
.page-head { padding-block: clamp(2.25rem, 1.2rem + 3.5vw, 3.75rem) 0; }
.page-head .lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: var(--wrap-prose);
}

.breadcrumb {
  font-size: .9rem;
  margin: 0 0 1.1rem;
  color: var(--ink-muted);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: '/'; margin-right: .35rem; color: var(--line-strong); }

/* --------------------------------------------------------------- article -- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  font-size: .9rem;
  color: var(--ink-muted);
  margin: 0 0 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.post-meta time { font-variant-numeric: tabular-nums; }

.prose h2 { margin-top: 2.1em; }
.prose p.lede {
  font-size: 1.17rem;
  line-height: 1.6;
  color: var(--ink);
}
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--motif); }
.prose dt { font-weight: 600; margin-top: .9em; }
.prose dd { margin: 0 0 .4em 1.1rem; color: var(--ink-muted); }

.prose blockquote {
  margin: 1.8em 0;
  padding: .2rem 0 .2rem 1.25rem;
  border-left: 4px solid var(--motif);
  font-style: italic;
  color: var(--ink-muted);
}

.callout {
  background: var(--sage-wash);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.9em 0;
}
.callout > :last-child { margin-bottom: 0; }
.callout h3 { margin-top: 0; font-size: 1.1rem; }

.table-wrap {
  overflow-x: auto;
  margin: 1.7em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-wrap table { margin: 0; min-width: 34rem; }

/* Comparison tables need more room than a 42rem measure. On wide screens let them run
   past the prose column into the page gutter rather than wrapping every cell to six lines. */
@media (min-width: 64em) {
  .prose .table-wrap { width: 58rem; max-width: calc(100vw - 4rem); }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
}
th, td {
  text-align: left;
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  hyphens: auto;
}
thead th {
  background: var(--bg-alt);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .02em;
}
tbody tr:last-child td { border-bottom: 0; }

/* ----------------------------------------------------------- box detail -- */
.box-hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  align-items: start;
}
/* Below the breakpoint the sidebar is pulled above the article body, so the reading order
   stays title -> what it looks like -> the detail, rather than burying the art at the bottom. */
.box-side { order: -1; }
@media (min-width: 54em) {
  .box-hero { grid-template-columns: minmax(0, 1fr) 19rem; gap: 3.5rem; }
  .box-side { order: 0; position: sticky; top: 1.75rem; }
}
.box-intro { max-width: 46rem; margin-bottom: 2.5rem; }
.box-intro .lede { font-size: 1.15rem; color: var(--ink-muted); }
.box-intro h1 { margin-bottom: .35em; }
.box-main .prose > h2:first-child { margin-top: 0; }
.box-art {
  aspect-ratio: 5 / 4;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, transparent 0 13px, color-mix(in srgb, var(--motif) 15%, transparent) 13px 14px),
    var(--bg-alt);
}
.box-art::after {
  content: '';
  position: absolute;
  inset: 18%;
  background-color: var(--motif);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.box-art + .spec-list { margin-top: 1.25rem; }
.spec-list {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.1rem 1.25rem;
}
.spec-list dt {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: .95rem;
}
.spec-list dt:first-child { margin-top: 0; }
.spec-list dd { margin: .15rem 0 0; color: var(--ink); }

.kit-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.15em;
}
.kit-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: .55em;
}
.kit-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .62em;
  width: .85rem;
  height: 0;
  border-top: 2px dashed var(--motif);
}

/* ---------------------------------------------------------------- forms -- */
.notify {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2.5rem 0 0;
  max-width: 34rem;
}
.notify h2 { margin-top: 0; font-size: 1.4rem; }
.notify p { color: var(--ink-muted); font-size: .96rem; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: .93rem;
  margin-bottom: .35rem;
}
.field input,
.field textarea {
  font: inherit;
  width: 100%;
  padding: .65rem .8rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-muted); opacity: 1; }
.field-hint {
  font-size: .87rem;
  color: var(--ink-muted);
  margin: .35rem 0 0;
}
.form-note {
  font-size: .88rem;
  color: var(--ink-muted);
  margin: 1rem 0 0;
}

/* --------------------------------------------------------------- pieces -- */
.status-banner {
  background: var(--accent-wash);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin: 0 0 2rem;
}
.status-banner p { margin: 0; color: var(--ink); }
.status-banner strong { color: var(--accent-deep); }

.step-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46em) { .step-list { grid-template-columns: repeat(3, 1fr); } }
.step-list li { counter-increment: step; }
.step-list li h3 {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
}
.step-list li h3::before {
  content: counter(step);
  flex: none;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-.1em);
}
.step-list li p { margin: 0; color: var(--ink-muted); font-size: .98rem; }

.pair {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 50em) { .pair { grid-template-columns: 1fr 1fr; gap: 3rem; } }

.postnav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .96rem;
}

.stitch-rule {
  height: 2px;
  border: 0;
  margin: 0;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 10px, transparent 10px 18px);
}

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

@media print {
  .site-nav, .skip-link, .notify, .hero-art, .card-art, .box-art { display: none; }
  body { background: #fff; color: #000; }
}
