/* ── Nemerc design system ─────────────────────────────────────
   Palette: graphite #2D2D2D · warm sand #C4A882 · cold white #FAFAF8
   · warm linen #F4F1EC. No gradients, no shadows, hairlines only. */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #2D2D2D;
  --sand: #C4A882;
  --bg: #FAFAF8;
  --linen: #F4F1EC;
  --ink-60: rgba(45, 45, 45, 0.62);
  --line: rgba(45, 45, 45, 0.14);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: 0.005em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ── Type ── */

h1, h2, h3 { font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; }

h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.0625rem; }

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 1rem;
}

.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-60); max-width: 38em; }

.muted { color: var(--ink-60); }

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.8rem 1.6rem;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover { background: #1a1a1a; }

.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }

.btn--sand { background: var(--sand); border-color: var(--sand); color: var(--ink); }
.btn--sand:hover { background: #b3956d; border-color: #b3956d; }

.btn--small { padding: 0.55rem 1.1rem; font-size: 0.875rem; }

.btn[disabled] { opacity: 0.5; cursor: default; }

.text-link {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--sand);
  padding-bottom: 1px;
}
.text-link:hover { color: var(--sand); }

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.wordmark { display: flex; align-items: center; }
.wordmark img { height: 24px; width: auto; display: block; }

.site-nav { display: flex; gap: 2rem; }

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-60);
  padding: 0.25rem 0;
}

.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--sand); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.75rem 0; font-size: 1rem; }
  .site-nav a[aria-current="page"] { border-bottom: 0; color: var(--sand); }
}

/* ── Hero ── */

.hero {
  position: relative;
  min-height: min(78vh, 720px);
  display: flex;
  align-items: flex-end;
  color: #fff;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__scrim { position: absolute; inset: 0; background: rgba(45, 45, 45, 0.5); }

.hero__content {
  position: relative;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5rem) var(--gutter);
}

.hero__content h1 { max-width: 15em; }

.hero__content .lead { color: rgba(255, 255, 255, 0.85); margin-top: 1.25rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero .btn--outline { color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.hero .btn--outline:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ── Sections ── */

.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.section--linen { background: var(--linen); }
.section--ink { background: var(--ink); color: var(--bg); }
.section-head { max-width: 44em; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head .lead { margin-top: 0.75rem; }

/* Fact strip */

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.fact { border-top: 2px solid var(--sand); padding-top: 1rem; }
.fact strong { display: block; font-size: 1.05rem; font-weight: 600; margin-bottom: 0.25rem; }
.fact p { font-size: 0.9375rem; color: var(--ink-60); }
.section--ink .fact p { color: rgba(250, 250, 248, 0.7); }

@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* Split layout (about / story) */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.split img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
  .split img { aspect-ratio: 16 / 10; }
}

/* Steps */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); counter-reset: step; }

.step { counter-increment: step; border-top: 1px solid var(--line); padding-top: 1rem; }

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--sand);
  margin-bottom: 0.5rem;
}

.step h3 { margin-bottom: 0.35rem; }
.step p { font-size: 0.9375rem; color: var(--ink-60); }

@media (max-width: 800px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ── Catalog ── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.filter-group { display: flex; flex-direction: column; gap: 0.6rem; }

.filter-group__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.pill {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-60);
  cursor: pointer;
  transition: all 0.12s ease;
}

.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.catalog-count { font-size: 0.875rem; color: var(--ink-60); margin-bottom: 1.25rem; }

.fabric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) var(--gutter);
}

@media (max-width: 600px) {
  .fabric-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.fabric-card { display: flex; flex-direction: column; }

.fabric-card__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--linen);
  margin-bottom: 0.9rem;
}

.fabric-card h3 { font-size: 1rem; margin-bottom: 0.2rem; }

.fabric-card__meta { font-size: 0.85rem; color: var(--ink-60); line-height: 1.5; }

.fabric-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-60);
  margin-top: 0.45rem;
}

.fabric-card__tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sand);
}

.fabric-card__tag--mto::before { background: transparent; border: 1px solid var(--sand); }

.fabric-card .btn { margin-top: 0.9rem; align-self: flex-start; }

.fabric-card .btn.added { background: transparent; color: var(--ink); border-color: var(--sand); }

/* ── RFQ bar + drawer ── */

.rfq-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.rfq-bar.visible { transform: translateY(0); }

.rfq-bar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rfq-bar__count { font-size: 0.9375rem; }
.rfq-bar__count strong { color: var(--sand); }

.rfq-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(45, 45, 45, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.rfq-overlay.visible { opacity: 1; pointer-events: auto; }

.rfq-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(440px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}

.rfq-drawer.open { transform: translateX(0); }

.rfq-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.rfq-drawer__head h2 { font-size: 1.1rem; }

.rfq-drawer__close { background: none; border: 0; cursor: pointer; padding: 0.4rem; color: var(--ink); }

.rfq-drawer__body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem 2rem; }

/* ── RFQ form (drawer + inline) ── */

.rfq-items { list-style: none; margin-bottom: 1.5rem; }

.rfq-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.rfq-item img { width: 56px; height: 56px; object-fit: cover; }

.rfq-item__name { font-size: 0.9rem; font-weight: 600; }
.rfq-item__sub { font-size: 0.8rem; color: var(--ink-60); }

.rfq-item__qty { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--ink-60); }

.rfq-item__qty input {
  width: 5.2rem;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
}

.rfq-item__remove {
  grid-column: 3;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--ink-60);
  text-decoration: underline;
  justify-self: end;
}

.rfq-empty {
  font-size: 0.9375rem;
  color: var(--ink-60);
  padding: 1rem 0 1.5rem;
}

.form-grid { display: grid; gap: 1rem; }

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 0.35rem;
}

.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.field input:focus, .field textarea:focus { outline: 2px solid var(--sand); outline-offset: -1px; border-color: var(--sand); }

.field textarea { resize: vertical; min-height: 90px; }

.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

@media (max-width: 480px) { .field--row { grid-template-columns: 1fr; } }

.form-status { font-size: 0.9rem; margin-top: 0.75rem; display: none; }
.form-status.success { display: block; color: #3e6b4f; }
.form-status.error { display: block; color: #8c3b2e; }

/* Inline RFQ (contact page) */

.rfq-inline { background: #fff; border: 1px solid var(--line); padding: clamp(1.25rem, 4vw, 2rem); }

/* ── Contact ── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-list { list-style: none; display: grid; gap: 1.5rem; }

.contact-list strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 0.2rem;
}

.contact-list a { text-decoration: none; border-bottom: 1px solid var(--sand); }

/* ── CTA band ── */

.cta-band { text-align: left; }
.cta-band .btn { margin-top: 1.75rem; }
.section--ink .lead { color: rgba(250, 250, 248, 0.75); }

/* ── Footer ── */

.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0; margin-top: clamp(3rem, 8vw, 5rem); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p { font-size: 0.85rem; color: var(--ink-60); }

.site-footer nav { display: flex; gap: 1.5rem; }

.site-footer nav a { font-size: 0.85rem; color: var(--ink-60); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }

/* ── Utilities ── */

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