:root {
  --ink: #191a1b;
  --muted: #5c5f62;
  --line: #dcdddf;
  --grey: #f2f2f2;
  --soft-grey: #f7f7f7;
  --red: #b3261e;
  --display: "Century Gothic", "Avenir Next", Avenir, Futura, "Segoe UI", system-ui, sans-serif;
  --text: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --radius: 6px;
  --max: 1200px;

  /* Fabric textures drawn in CSS: placeholders until real product photos arrive. */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --knit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='18'%3E%3Cpath d='M0 0l7 9 7-9M0 9l7 9 7-9' fill='none' stroke='%23000' stroke-opacity='.1' stroke-width='1.6'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font: 16px/1.55 var(--text); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Announcement bar */
.announce { background: var(--ink); color: #fff; text-align: center; padding: .6rem 1rem; font-size: .95rem; }
.announce a { font-weight: 700; margin-left: .25rem; text-underline-offset: 3px; }

/* Header */
.site-header { max-width: var(--max); margin: 0 auto; padding: 1.25rem 1.5rem 0; }
.header-inner { display: flex; align-items: center; gap: 1rem 2.5rem; flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 1.85rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; white-space: nowrap; line-height: 1; }
.brand span { color: inherit; font-style: normal; }
.search { flex: 1 1 320px; display: flex; align-items: center; gap: .6rem; background: var(--grey); border-radius: 4px; padding: 0 1rem; min-height: 48px; }
.search svg { flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: .75rem 0; }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 2px var(--ink); }
.main-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem 1.75rem; border-top: 1px solid var(--line); margin-top: 1.25rem; padding: .9rem 0; }
.main-nav a { text-decoration: none; }
.main-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.main-nav .accent { color: var(--red); }

/* Layout & type */
main { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.block { padding: 3.5rem 0 1rem; scroll-margin-top: .5rem; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
.sub { color: var(--muted); margin: 0 0 1.75rem; }

/* Buttons & tags */
.btn { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; font-weight: 700; padding: .8rem 1.3rem; border-radius: 4px; }
.btn:hover { background: #3a3b3d; }
.text-link { font-weight: 700; text-underline-offset: 4px; }
.tag { display: inline-block; background: var(--ink); color: #fff; font-size: .8rem; font-weight: 700; padding: .2rem .5rem; border-radius: 3px; }
.actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

/* Hero */
.hero { padding-top: 1rem; }
.hero-media { position: relative; border-radius: var(--radius); aspect-ratio: 16 / 7; }
.hero-media .tag { position: absolute; left: 1rem; top: 1rem; }
.hero-text { padding-top: 1.5rem; max-width: 780px; }
.hero-text p { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.5rem; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.tile-media { aspect-ratio: 4 / 3; border-radius: var(--radius); margin-bottom: 1rem; }
.tile p { margin: 0; color: var(--muted); }

/* Preview listing */
.crumbs { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }
.item-count { margin: 0 0 1.25rem; }
.tabs { display: flex; align-items: center; gap: 1.75rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs-label { color: var(--muted); white-space: nowrap; }
#tabs { display: flex; gap: 1.75rem; }
.tab { font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem 0; cursor: pointer; white-space: nowrap; }
.tab[aria-pressed="true"] { font-weight: 700; border-bottom-color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1.75rem; }
.filters-label { font-weight: 700; margin-right: .25rem; }
.pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.pill { font: inherit; color: var(--ink); background: #fff; border: 1px solid #b9bbbe; border-radius: 6px; padding: .45rem .9rem; cursor: pointer; }
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill[aria-pressed="true"]::before { content: "✓ "; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2rem 1.25rem; }
.card-media { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); margin-bottom: .8rem; transition: opacity .25s; }
.card-media .tag { position: absolute; left: .6rem; bottom: .6rem; }
.card.miss .card-media { opacity: .45; }
.card.miss .tag { display: none; }
.card-group { font-weight: 700; margin: 0; }
.card-name { font-family: var(--text); font-weight: 400; font-size: 1rem; margin: 0 0 .5rem; }
.bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line); margin-bottom: .4rem; }
.bar span { display: block; height: 100%; }
.f-soft { background: #6d7f8c; }
.f-plant { background: #c8b48f; }
.f-animal { background: #9c7a5b; }
.f-synth { background: #a7abb0; }
.f-stretch { background: var(--ink); }
.card-comp { margin: 0; font-size: .9rem; color: var(--muted); }
.card-share { margin: .25rem 0 0; font-weight: 700; font-size: .95rem; }
.card.miss .card-share { color: var(--red); }
.empty { grid-column: 1 / -1; color: var(--muted); }
.note { color: var(--muted); font-size: .9rem; margin: 1.5rem 0 0; }

/* Guide */
.category-row { display: flex; gap: 1.25rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 2.25rem; }
.category { flex: 0 0 auto; width: 112px; text-decoration: none; }
.category .swatch { display: block; width: 112px; height: 112px; border-radius: var(--radius); margin-bottom: .5rem; }
.category .label { text-decoration: underline; text-underline-offset: 3px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.75rem 1.5rem; }
.guide-card { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: start; scroll-margin-top: 1rem; }
.guide-card .swatch { width: 96px; height: 96px; border-radius: var(--radius); }
.guide-card p { margin: 0; color: var(--muted); }
.guide-card p.fibres { color: var(--ink); font-weight: 700; margin: 0 0 .35rem; }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; margin-top: 3.5rem; background: var(--soft-grey); border-radius: var(--radius); padding: 2rem; scroll-margin-top: 1rem; }
.feature-media { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.feature-media figure { margin: 0; }
.feature-media .swatch { aspect-ratio: 1; border-radius: var(--radius); }
.feature-media figcaption { font-weight: 700; margin-top: .4rem; }
.feature p { color: var(--muted); margin: 0; }

/* Steps */
.steps { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 1px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--display); font-weight: 700; font-size: 2rem; margin-bottom: .4rem; }
.steps h3 { margin-bottom: .35rem; }
.steps p { margin: 0; color: var(--muted); }

/* Footer */
.site-footer { background: var(--soft-grey); margin-top: 4rem; }
.site-footer > p { max-width: var(--max); margin: 0 auto; padding: 1.5rem; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.5rem; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
.footer-inner h2 { font-size: 1rem; margin: 0 0 .6rem; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-brand .brand { font-size: 1.3rem; }
.footer-brand p { color: var(--muted); margin: .75rem 0 0; max-width: 340px; }
.footer-bottom { max-width: var(--max); margin: 0 auto; padding: 1rem 1.5rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.footer-bottom p { margin: 0; }

/* Legal page */
.legal { max-width: 780px; padding: 2rem 0; }
.legal h2 { font-size: 1.25rem; margin-top: 2rem; }
.todo { background: #fdecea; color: var(--red); padding: 0 .3rem; border-radius: 3px; }

/* Fabric swatches */
.swatch-hero {
  background:
    var(--noise),
    radial-gradient(120% 90% at 18% 25%, rgba(255, 255, 255, .5), transparent 60%),
    linear-gradient(105deg, #c9b9aa 0%, #eee4da 20%, #cdbdaf 36%, #f3ebe3 52%, #c7b6a7 70%, #e9dfd5 86%, #c3b2a3 100%);
}
.swatch-satin { background: var(--noise), linear-gradient(115deg, #cbbcae 0%, #efe6dc 28%, #cdbfb2 47%, #f5eee7 63%, #c6b7a9 100%); }
.swatch-jersey { background: var(--knit), linear-gradient(160deg, #e6dbd0, #d3c3b3); background-size: 14px 18px, auto; }
.swatch-rib { background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .08) 0 4px, rgba(255, 255, 255, .14) 4px 10px), linear-gradient(160deg, #d9d2cb, #bfb5ab); }
.swatch-cotton { background: var(--knit), linear-gradient(160deg, #f1f1ee, #dedcd6); background-size: 14px 18px, auto; }
.swatch-crepe { background: var(--noise), linear-gradient(160deg, #6f7d86, #4f5c65); }
.swatch-linen {
  background:
    repeating-linear-gradient(0deg, rgba(90, 70, 40, .08) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(90, 70, 40, .07) 0 1px, transparent 1px 5px),
    var(--noise),
    linear-gradient(160deg, #ebe3d3, #d8ccb6);
}
.swatch-wool { background: var(--knit), var(--noise), linear-gradient(160deg, #c9ab8c, #a88767); background-size: 18px 22px, auto, auto; }
.swatch-poly { background: linear-gradient(115deg, #aeb4bb 0%, #e9edf1 30%, #b7bdc4 50%, #f2f5f8 66%, #a9afb6 100%); }

@media (max-width: 760px) {
  .brand { font-size: 1.45rem; }
  .hero-media { aspect-ratio: 1; }
  .main-nav { justify-content: flex-start; gap: .25rem 1.25rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem .9rem; }
  .feature { grid-template-columns: 1fr; padding: 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; }
}
