/* ==========================================================================
   The Raw House — Theme C · Contemporary Bold
   Shared stylesheet for Home, Collection, and Product mockups
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; color: inherit; cursor: pointer; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
picture { display: block; }

/* ---------- Design tokens ---------- */
:root {
  /* Color */
  --bg: #FFFFFF;
  --bg-dark: #0A0A0A;
  --bg-surface: #F7F7F7;
  --bg-surface-2: #EEECE8;

  --ink: #0A0A0A;
  --ink-2: #333333;
  --ink-3: #666666;
  --ink-inv: #FFFFFF;
  --ink-inv-2: rgba(255,255,255,0.72);
  --ink-inv-3: rgba(255,255,255,0.48);

  --rule: #E5E5E5;
  --rule-dark: rgba(255,255,255,0.14);

  /* Typography */
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;
  --s-7: 64px;
  --s-8: 96px;
  --s-9: 144px;
  --s-10: 192px;
}

/* ---------- Base ---------- */
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */
.container { max-width: 1440px; margin: 0 auto; padding: 0 var(--s-6); }
.container--narrow { max-width: 960px; }
.container--wide { max-width: 1680px; }
.section { padding: var(--s-9) 0; }
.section--sm { padding: var(--s-7) 0; }
.section--dark { background: var(--bg-dark); color: var(--ink-inv); }
.section--surface { background: var(--bg-surface); }

/* ---------- Typography ---------- */
.serif { font-family: var(--serif); font-weight: 400; }
.sans  { font-family: var(--sans); }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.section--dark .eyebrow { color: var(--ink-inv-3); }

.display-xl {
  font-family: var(--serif);
  font-size: clamp(64px, 11vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0;
}
.display-lg {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.display-md {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.display-sm {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.headline {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.18;
  margin: 0;
  font-weight: 400;
}
.lead {
  font-size: 20px;
  line-height: 1.48;
  color: var(--ink-2);
  max-width: 60ch;
}
.section--dark .lead { color: var(--ink-inv-2); }
p { margin: 0 0 1em 0; color: var(--ink-2); max-width: 68ch; }
.section--dark p { color: var(--ink-inv-2); }
em { font-style: italic; }

/* ---------- Links / buttons ---------- */
.link-underline { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 16px 24px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: all 160ms ease;
}
.btn:hover { background: var(--ink); color: var(--ink-inv); }
.btn--inv { border-color: var(--ink-inv); color: var(--ink-inv); }
.btn--inv:hover { background: var(--ink-inv); color: var(--ink); }
.btn--solid { background: var(--ink); color: var(--ink-inv); }
.btn--solid:hover { background: transparent; color: var(--ink); }
.btn__arrow { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ---------- Announcement bar ---------- */
.announce {
  background: var(--bg-dark);
  color: var(--ink-inv);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 24px;
  text-align: center;
}
.announce a { color: var(--ink-inv); border-bottom: 1px solid rgba(255,255,255,0.3); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding: 22px var(--s-6);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.nav--dark { background: var(--bg-dark); border-bottom: 1px solid var(--rule-dark); color: var(--ink-inv); }
.nav--overlay {
  position: absolute; top: 0; left: 0; right: 0;
  background: transparent; color: var(--ink-inv);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.nav__logo { height: 31px; display: block; }
.nav__logo--large { height: 39px; }
.nav__links {
  display: flex; gap: 36px;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
}
.nav__links a { padding: 4px 0; border-bottom: 1px solid transparent; transition: border-color 120ms; }
.nav__links a:hover,
.nav__links a.active { border-bottom-color: currentColor; }

/* ---------- Placeholder (image) ---------- */
.ph {
  position: relative; background: #1B1B1B; color: rgba(255,255,255,0.82);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ph--light { background: #E8E6E0; color: #4A4742; }
.ph::before {
  content: "";
  position: absolute; inset: 14px;
  border: 1px dashed rgba(255,255,255,0.14);
  pointer-events: none;
}
.ph--light::before { border-color: rgba(0,0,0,0.12); }
.ph__label {
  position: relative; z-index: 2;
  padding: 20px 28px; max-width: 82%;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px; line-height: 1.55;
  letter-spacing: 0.02em;
}
.ph__kind {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); margin-bottom: 10px;
  font-weight: 600;
}
.ph--light .ph__kind { color: rgba(0,0,0,0.48); }
.ph__path { color: rgba(255,255,255,0.95); margin-bottom: 8px; word-break: break-word; }
.ph--light .ph__path { color: rgba(0,0,0,0.82); }
.ph__spec { color: rgba(255,255,255,0.52); font-size: 10.5px; }
.ph--light .ph__spec { color: rgba(0,0,0,0.46); }

/* Aspect-ratio variants applied inline: style="aspect-ratio: 16/9;" etc. */

/* ---------- Grids ---------- */
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); gap: var(--s-3); }

/* ---------- Cards (collection tiles) ---------- */
.tile { display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.tile .ph { aspect-ratio: 4 / 5; }
.tile__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tile__title { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.tile__sub { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.tile:hover .tile__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.tile--product .ph { aspect-ratio: 3 / 4; }
.tile--product .tile__title { font-size: 20px; }

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-dark); color: var(--ink-inv);
  padding: var(--s-9) var(--s-6) var(--s-6);
}
.footer__top { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: var(--s-6); margin-bottom: var(--s-8); }
.footer__logo { height: 28px; margin-bottom: var(--s-4); }
.footer__col h5 { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-inv-3); margin: 0 0 var(--s-4) 0; font-weight: 500; }
.footer__col ul { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-inv-2); }
.footer__col ul a:hover { color: var(--ink-inv); }
.footer__newsletter input[type="email"] {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding: 10px 0; color: var(--ink-inv); font: inherit; font-size: 14px;
}
.footer__newsletter input::placeholder { color: rgba(255,255,255,0.45); }
.footer__newsletter button {
  margin-top: var(--s-3); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-inv); border-bottom: 1px solid var(--ink-inv); padding: 4px 0;
}
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--s-5); border-top: 1px solid var(--rule-dark);
  font-size: 12px; color: var(--ink-inv-3);
}

/* ---------- Hero (Home) ---------- */
.hero {
  position: relative; background: var(--bg-dark); color: var(--ink-inv);
  min-height: 100vh; display: flex; flex-direction: column;
}
.hero__media { position: absolute; inset: 0; }
.hero__media .ph { width: 100%; height: 100%; background: #151515; }
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.25) 0%, rgba(10,10,10,0.05) 30%, rgba(10,10,10,0.85) 100%);
  pointer-events: none;
}
.hero__content {
  position: relative; z-index: 1;
  margin-top: auto;
  padding: var(--s-9) var(--s-6) var(--s-8);
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-6); align-items: end;
}
.hero__title { max-width: 14ch; }
.hero__meta { text-align: right; display: flex; flex-direction: column; gap: var(--s-3); align-items: flex-end; }
.hero__meta .eyebrow { color: var(--ink-inv-3); }

/* ---------- Collection / Product specific ---------- */
.page-hero {
  position: relative; background: var(--bg-dark); color: var(--ink-inv);
  padding-top: 0;
}
.page-hero__media .ph { aspect-ratio: 21 / 9; }
.page-hero__meta {
  padding: var(--s-7) var(--s-6) var(--s-5);
  display: grid; grid-template-columns: 2fr 1fr; gap: var(--s-6); align-items: end;
}

.meta-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5);
  padding: var(--s-6) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.meta-row dt { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.meta-row dd { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 22px; line-height: 1.1; }

/* Installation-view mosaic */
.mosaic { display: grid; gap: var(--s-4); grid-template-columns: repeat(6, 1fr); }
.mosaic > .ph { aspect-ratio: 4 / 5; }
.mosaic > .span-6 { grid-column: span 6; aspect-ratio: 21 / 9; }
.mosaic > .span-3 { grid-column: span 3; aspect-ratio: 4 / 5; }
.mosaic > .span-2 { grid-column: span 2; aspect-ratio: 4 / 5; }
.mosaic > .span-4 { grid-column: span 4; aspect-ratio: 3 / 2; }

/* Product page split */
.product {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-7);
  padding: var(--s-6) var(--s-6) var(--s-9);
  max-width: 1680px; margin: 0 auto;
}
.product__gallery { display: flex; flex-direction: column; gap: var(--s-3); }
.product__primary { aspect-ratio: 4 / 5; }
.product__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
.product__thumbs .ph { aspect-ratio: 1 / 1; }
.product__thumbs .ph__label { padding: 10px; }
.product__thumbs .ph__path { font-size: 10px; }
.product__thumbs .ph__spec { display: none; }
.product__thumbs .ph__kind { font-size: 9px; margin-bottom: 4px; }

.product__info {
  position: sticky; top: 100px;
  align-self: start;
  padding-top: var(--s-3);
}
.product__breadcrumb { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-5); }
.product__breadcrumb a { color: var(--ink-3); }
.product__breadcrumb a:hover { color: var(--ink); }
.product__title { font-family: var(--serif); font-size: 56px; line-height: 1; letter-spacing: -0.01em; margin: 0 0 var(--s-3); }
.product__maker { font-size: 17px; color: var(--ink-2); margin-bottom: var(--s-5); font-style: italic; font-family: var(--serif); }

.spec { border-top: 1px solid var(--rule); padding: var(--s-4) 0; display: grid; grid-template-columns: 120px 1fr; gap: var(--s-3); font-size: 14px; align-items: baseline; }
.spec:last-of-type { border-bottom: 1px solid var(--rule); }
.spec dt { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.spec dd { margin: 0; color: var(--ink-2); }

.product__price { margin: var(--s-5) 0; font-family: var(--serif); font-size: 24px; color: var(--ink); }
.product__actions { display: flex; flex-direction: column; gap: 12px; margin-top: var(--s-5); }
.product__actions .btn { width: 100%; justify-content: center; }
.product__note { margin-top: var(--s-4); font-size: 13px; color: var(--ink-3); }

/* Related */
.related { padding: var(--s-8) var(--s-6); background: var(--bg-surface); }

/* ---------- Product page — stacked (below-fold) layout ---------- */
.product-page { max-width: 1680px; margin: 0 auto; }

.product-page__header {
  padding: var(--s-5) var(--s-6) 0;
}
.product-page__breadcrumb {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: var(--s-4);
}
.product-page__breadcrumb a { color: var(--ink-3); }
.product-page__breadcrumb a:hover { color: var(--ink); }
.product-page__title-row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-5); align-items: end;
  padding-bottom: var(--s-5); border-bottom: 1px solid var(--rule);
}
.product-page__title {
  font-family: var(--serif); font-size: clamp(48px, 7vw, 96px);
  line-height: 1; letter-spacing: -0.01em; margin: 0;
}
.product-page__maker {
  font-family: var(--serif); font-style: italic;
  font-size: 20px; color: var(--ink-2); margin: 0;
  padding-bottom: 10px;
}
.product-page__gallery {
  padding: var(--s-7) var(--s-6);
  display: flex; flex-direction: column; gap: var(--s-3);
  max-width: 900px; margin: 0 auto;
}
.product-page__primary { aspect-ratio: 4 / 5; }
.product-page__thumbs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3);
}
.product-page__thumbs .ph { aspect-ratio: 1 / 1; }
.product-page__thumbs .ph__label { padding: 10px; }
.product-page__thumbs .ph__path { font-size: 10px; }
.product-page__thumbs .ph__spec { display: none; }
.product-page__thumbs .ph__kind { font-size: 9px; margin-bottom: 4px; }

.product-page__body {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s-8);
  padding: var(--s-7) var(--s-6) var(--s-9);
  border-top: 1px solid var(--rule);
  max-width: 1440px; margin: 0 auto;
}
.product-page__description {
  font-size: 17px; line-height: 1.7; color: var(--ink-2);
  margin: 0 0 var(--s-5) 0; max-width: 58ch;
}
.product-page__price {
  font-family: var(--serif); font-size: 28px; color: var(--ink);
  margin: var(--s-5) 0 var(--s-4);
}
.product-page__actions { display: flex; flex-direction: column; gap: 12px; }
.product-page__actions .btn { justify-content: center; }
.product-page__note { margin-top: var(--s-4); font-size: 13px; color: var(--ink-3); }

@media (max-width: 960px) {
  .product-page__body { grid-template-columns: 1fr; }
  .product-page__title-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .product-page__thumbs { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- CMS copy key overlay ---------- */
[data-copy-key] { position: relative; }
.cms-overlay-active [data-copy-key]::after {
  content: attr(data-copy-key);
  position: absolute; top: 0; left: 0;
  background: rgba(230, 100, 20, 0.93);
  color: #fff; font-family: var(--mono);
  font-size: 10px; line-height: 1.3;
  padding: 3px 7px; z-index: 200;
  pointer-events: none; white-space: nowrap;
  border-radius: 2px; max-width: 320px;
  overflow: hidden; text-overflow: ellipsis;
}
.cms-toggle {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: #E66414; color: #fff;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; padding: 11px 18px; border: none; cursor: pointer;
  font-family: var(--sans); border-radius: 3px;
  box-shadow: 0 3px 16px rgba(0,0,0,0.25);
  transition: background 120ms;
}
.cms-toggle:hover { background: #C4540E; }
.cms-toggle.active { background: var(--bg-dark); }

/* ---------- Utility ---------- */
.stack-sm > * + * { margin-top: var(--s-3); }
.stack-md > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }
.mt-lg { margin-top: var(--s-6); }
.mt-xl { margin-top: var(--s-8); }
.center-text { text-align: center; }
.rule { height: 1px; background: var(--rule); border: none; margin: var(--s-6) 0; }
.rule--dark { background: var(--rule-dark); }

/* ---------- Inquiry strip (bottom) ---------- */
.cta-strip {
  background: var(--bg-dark); color: var(--ink-inv);
  padding: var(--s-8) var(--s-6);
  display: grid; grid-template-columns: 2fr 1fr; gap: var(--s-6); align-items: end;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .product { grid-template-columns: 1fr; gap: var(--s-6); }
  .product__info { position: static; }
  .hero__content { grid-template-columns: 1fr; }
  .hero__meta { text-align: left; align-items: flex-start; }
  .page-hero__meta { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: repeat(2, 1fr); }
  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .mosaic > .span-6 { grid-column: span 2; aspect-ratio: 16 / 9; }
  .mosaic > .span-3, .mosaic > .span-2 { grid-column: span 1; }
  .mosaic > .span-4 { grid-column: span 2; }
  .nav__links { gap: 20px; }
  .section { padding: var(--s-7) 0; }
  .container { padding: 0 var(--s-4); }
  .cta-strip { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-4, .footer__top { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .nav__links.mobile-visible { display: flex; }
  .product__thumbs { grid-template-columns: repeat(3, 1fr); }
}
