/* CrestMill — Savile Row Heritage Factory Bespoke Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --bg: #F8F5EE;
  --surface: #FFFFFF;
  --surface-alt: #F1ECE1;
  --ink: #13271F;
  --ink-soft: #2C3E36;
  --muted: #5C6962;
  --line: #DCD4C4;
  --line-strong: #C2B59E;
  --accent: #7C4A2D;
  --accent-hover: #61371F;
  --forest: #13271F;
  --forest-deep: #0D1C16;
  --brass: #9B7B4B;
  --danger: #9B2C2C;
  --success: #1F5B3D;
  --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --radius: 2px;
  --container: 1200px;
  --shadow-soft: 0 10px 30px rgba(19, 39, 31, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: flex; flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.012em;
  line-height: 1.22;
}
h1 { font-size: clamp(2rem, 3.8vw, 3.25rem); }
h2 { font-size: clamp(1.55rem, 2.5vw, 2.25rem); }
h3 { font-size: clamp(1.12rem, 1.45vw, 1.35rem); }
p { margin: 0 0 1rem; color: var(--ink-soft); }
p:last-child { margin-bottom: 0; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.85em; }

.eyebrow, .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ''; width: 1.5rem; height: 1px; background: var(--accent); }

.section { padding: clamp(3.75rem, 6.5vw, 6rem) 0; border-bottom: 1px solid var(--line); }
.section--alt { background: var(--surface-alt); }
.section--forest { background: var(--forest); color: var(--bg); border-bottom-color: rgba(248, 245, 238, 0.14); }
.section--forest h2, .section--forest h3, .section--forest p { color: var(--bg); }
.section--forest .muted { color: rgba(248, 245, 238, 0.74); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.75rem; }
.section-head__copy { max-width: 44rem; display: grid; gap: 0.75rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.82rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.btn--primary { background: var(--forest); color: var(--bg); border-color: var(--forest); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.btn--accent { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--outline:hover { border-color: var(--ink); background: rgba(19, 39, 31, 0.04); }
.btn--ghost-light { background: transparent; color: var(--bg); border-color: rgba(248, 245, 238, 0.35); }
.btn--ghost-light:hover { border-color: var(--bg); background: rgba(248, 245, 238, 0.08); }
.btn--sm { padding: 0.56rem 1rem; font-size: 0.84rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(248, 245, 238, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar {
  background: var(--forest);
  color: rgba(248, 245, 238, 0.86);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.45rem 0;
}
.topbar__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; align-items: center; }
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand__mark { width: 38px; height: 38px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.brand__name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }
.brand__sub { display: block; font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 0.92rem; font-weight: 500; color: var(--ink-soft); padding: 0.35rem 0; border-bottom: 1px solid transparent; transition: color 160ms ease, border-color 160ms ease; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 42px; height: 42px; background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--forest);
  color: var(--bg);
  padding: 5rem 2rem 2.5rem;
  flex-direction: column;
  gap: 1.25rem;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a { font-family: var(--font-display); font-size: 1.45rem; padding: 0.65rem 0; border-bottom: 1px solid rgba(248, 245, 238, 0.14); color: var(--bg); }
.mobile-nav__close { position: absolute; top: 1.25rem; right: 1.25rem; width: 42px; height: 42px; background: transparent; color: var(--bg); border: 1px solid rgba(248, 245, 238, 0.3); cursor: pointer; }

/* Editorial Asymmetric Hero & Archival Image Framing */
.hero { padding: clamp(3rem, 5.5vw, 5.25rem) 0 clamp(3rem, 5vw, 4.5rem); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr); gap: clamp(2rem, 4.5vw, 4rem); align-items: start; }
.hero-copy { display: grid; gap: 1.35rem; align-self: start; }
.hero-lead { font-size: 1.1rem; line-height: 1.7; color: var(--ink-soft); max-width: 38rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; padding-top: 0.25rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 1.15rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }

.archival-frame { align-self: start; background: var(--surface); border: 1px solid var(--line-strong); padding: 0.65rem; box-shadow: var(--shadow-soft); }
.archival-frame__media { position: relative; display: flex; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-alt); }
.archival-frame__media--4x3 { aspect-ratio: 4 / 3; }
.archival-frame__media img { width: 100%; height: 100%; object-fit: cover; }
.archival-frame__caption { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.65rem; margin-top: 0.65rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

/* Fact Ledger Strip */
.fact-ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface); }
.fact-ledger__item { padding: 1.45rem 1.5rem; border-right: 1px solid var(--line); display: grid; gap: 0.3rem; }
.fact-ledger__item:last-child { border-right: 0; }
.fact-ledger__val { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); }
.fact-ledger__lbl { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Lookbook Collection Cards */
.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.collection-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lookbook-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); transition: border-color 180ms ease; }
.lookbook-card:hover { border-color: var(--accent); }
.lookbook-card__media { display: flex; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-alt); align-self: start; width: 100%; }
.lookbook-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 420ms ease; }
.lookbook-card:hover .lookbook-card__media img { transform: scale(1.025); }
.lookbook-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; }
.lookbook-card__specs { list-style: none; margin: 0.25rem 0 0; padding: 0.85rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 0.38rem; font-size: 0.88rem; color: var(--ink-soft); }
.lookbook-card__foot { margin-top: auto; padding-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* Interactive Spec & Lead-Time Configurator */
.configurator { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr); gap: 2rem; background: var(--surface); border: 1px solid var(--line-strong); padding: clamp(1.5rem, 3vw, 2.5rem); }
.cfg-controls { display: grid; gap: 1.5rem; }
.cfg-group { display: grid; gap: 0.65rem; }
.cfg-group__label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cfg-options { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.cfg-btn { padding: 0.55rem 0.95rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 0.88rem; font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: all 150ms ease; }
.cfg-btn:hover { border-color: var(--ink); color: var(--ink); }
.cfg-btn.is-active { background: var(--forest); border-color: var(--forest); color: var(--bg); }
.cfg-readout { align-self: start; background: var(--forest); color: var(--bg); padding: 1.75rem; display: grid; gap: 1.15rem; }
.cfg-readout h3 { color: var(--bg); font-size: 1.18rem; }
.cfg-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; padding: 1rem 0; border-top: 1px solid rgba(248, 245, 238, 0.18); border-bottom: 1px solid rgba(248, 245, 238, 0.18); }
.cfg-metric__lbl { display: block; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(248, 245, 238, 0.68); }
.cfg-metric__val { font-family: var(--font-display); font-size: 1.1rem; color: var(--bg); }
.cfg-note { font-size: 0.9rem; color: rgba(248, 245, 238, 0.86); line-height: 1.55; }
.cfg-quote-tag { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #E2C69E; }

/* Finely Ruled Specification Tables & Article Tables */
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.spec-table, .b2b-article-body table, article table { width: 100%; border-collapse: collapse; font-size: 0.94rem; text-align: left; background: var(--surface); }
.spec-table th, .spec-table td, .b2b-article-body table th, .b2b-article-body table td, article table th, article table td { padding: 0.88rem 1.15rem; border: 1px solid var(--line); vertical-align: top; }
.spec-table thead th, .b2b-article-body table thead th, article table thead th { background: var(--surface-alt); color: var(--ink); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.b2b-article-body table, article table { margin: 1.75rem 0; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Factory Transparency & Heritage Craft Timeline */
.factory-spread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.75rem); align-items: start; }
.cert-row { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.25rem; }
.cert-chip { font-family: var(--font-mono); font-size: 0.74rem; padding: 0.42rem 0.8rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); }
.timeline__step { padding: 1.65rem; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 0.65rem; align-content: start; }
.timeline__num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.12em; }

/* FAQ Accordion */
.faq-list { max-width: 56rem; border-top: 1px solid var(--line-strong); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.25rem 0; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--font-mono); font-size: 1.25rem; color: var(--accent); flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-item__body { padding: 0 0 1.35rem; color: var(--ink-soft); max-width: 48rem; }

/* Blog Article Prose */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; align-items: start; }
.b2b-article-body { max-width: 48rem; font-size: 1.04rem; line-height: 1.78; }
.b2b-article-body h2 { margin: 2.35rem 0 0.9rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.b2b-article-body h3 { margin: 1.75rem 0 0.65rem; }
.b2b-article-body ul, .b2b-article-body ol { margin: 0 0 1.25rem; padding-left: 1.35rem; color: var(--ink-soft); }
.b2b-article-body li { margin-bottom: 0.45rem; }
.b2b-article-body blockquote { margin: 1.6rem 0; padding: 1rem 1.35rem; border-left: 3px solid var(--accent); background: var(--surface-alt); font-family: var(--font-display); font-style: italic; color: var(--ink); }
.sidebar-card { position: sticky; top: 6.25rem; background: var(--surface); border: 1px solid var(--line-strong); padding: 1.5rem; display: grid; gap: 1rem; }

/* Sticky Inquiry / Trade Desk Section */
.rfq-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.rfq-aside { position: sticky; top: 6.25rem; display: grid; gap: 1.25rem; }
.rfq-card { background: var(--surface); border: 1px solid var(--line-strong); padding: clamp(1.5rem, 3vw, 2.25rem); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-field { display: grid; gap: 0.38rem; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 0.72rem 0.85rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 0.95rem; transition: border-color 160ms ease, background-color 160ms ease; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--forest); background: var(--surface); }
.form-field input.is-invalid, .form-field textarea.is-invalid { border-color: var(--danger); }
.form-error { font-size: 0.85rem; color: var(--danger); font-weight: 500; min-height: 1.2em; }
.form-success { display: none; padding: 1.1rem 1.25rem; background: #EDF5F0; border: 1px solid var(--success); color: var(--forest); font-weight: 500; margin-top: 1rem; }
.form-success.is-visible { display: block; }
.hp-trap { position: absolute !important; left: -9999px !important; top: auto !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: 0 !important; pointer-events: none !important; }

/* Executive Trade-Desk Footer */
.site-footer { background: var(--forest-deep); color: rgba(248, 245, 238, 0.84); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 2.5rem; padding-bottom: 2.75rem; border-bottom: 1px solid rgba(248, 245, 238, 0.14); }
.site-footer h3, .site-footer h4 { color: var(--bg); font-size: 0.98rem; margin-bottom: 0.9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.9rem; }
.site-footer a:hover { color: #E2C69E; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; font-family: var(--font-mono); font-size: 0.74rem; color: rgba(248, 245, 238, 0.6); }

/* WhatsApp Modal, Floating CTA & GDPR Cookie Notice */
#waModal { display: none; position: fixed; inset: 0; z-index: 95; background: rgba(13, 28, 22, 0.68); align-items: center; justify-content: center; padding: 1.25rem; }
#waModal.is-open { display: flex; }
.modal-panel { width: min(100%, 460px); background: var(--surface); border: 1px solid var(--line-strong); padding: 2rem; position: relative; display: grid; gap: 1.15rem; box-shadow: 0 24px 56px rgba(13, 28, 22, 0.28); }
.modal-close { position: absolute; top: 1rem; right: 1rem; width: 34px; height: 34px; background: transparent; border: 1px solid var(--line); cursor: pointer; font-size: 1.1rem; }

.wa-float {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.78rem 1.2rem;
  background: var(--forest);
  color: var(--bg);
  border: 1px solid rgba(248, 245, 238, 0.24);
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(13, 28, 22, 0.24);
}
.wa-float:hover { background: var(--accent); }

#cookieBanner {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 65;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 1rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  font-size: 0.84rem;
  box-shadow: var(--shadow-soft);
}
#cookieBanner.is-hidden { display: none; }

@media (max-width: 1024px) {
  .hero-grid, .configurator, .factory-spread, .rfq-grid, .article-layout { grid-template-columns: 1fr; }
  .fact-ledger, .timeline, .footer-grid, .collection-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rfq-aside, .sidebar-card { position: static; }
}
@media (max-width: 768px) {
  .nav-links, .nav-actions .btn--outline { display: none; }
  .nav-toggle { display: inline-flex; }
  .collection-grid, .collection-grid--3, .fact-ledger, .timeline, .form-grid, .footer-grid { grid-template-columns: 1fr; }
  .fact-ledger__item { border-right: 0; border-bottom: 1px solid var(--line); }
  .fact-ledger__item:last-child { border-bottom: 0; }
  #cookieBanner { left: 1rem; right: 1rem; bottom: 5rem; max-width: none; }
  .wa-float { right: 1rem; bottom: 1rem; }
}
