/* Jax Stone & Tile — "the grout line"
   Tokens, base, components. All colors derive from the declared palette. */

:root {
  --slate: #151719;
  --graphite: #1b1f21;
  --coal: #22272a;
  --ink: #ebe4d6;
  --sand: #b0a792;
  --clay: #c46a3e;
  --clay-deep: #a85430;
  --line: rgba(235, 228, 214, 0.14);
  --line-soft: rgba(235, 228, 214, 0.08);

  --font-display: "Bodoni Moda", "Times New Roman", serif;
  --font-body: "Archivo", "Helvetica Neue", sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --space-sec: clamp(72px, 10vw, 128px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--slate);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

::selection { background: var(--clay); color: #1a1410; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Hairline rule + grout grid ---------- */
.rule { height: 1px; background: var(--line); border: 0; }

.grout {
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 132px 132px;
}
.grout-dense {
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: 0.01em; text-wrap: pretty; }

.display-xl { font-size: clamp(3rem, 9vw, 5.75rem); font-weight: 500; letter-spacing: -0.005em; }
.display-lg { font-size: clamp(2.25rem, 5.5vw, 3.75rem); font-weight: 500; }
.display-md { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sand);
  display: flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--clay); }
.eyebrow--center { justify-content: center; }
.eyebrow--center::before { display: none; }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--sand); max-width: 60ch; }

.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); }

/* Diamond tile mark */
.diamond { display: inline-block; width: 7px; height: 7px; background: var(--clay); transform: rotate(45deg); flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 17px 26px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn .diamond { transition: background 0.25s var(--ease); }
.btn:hover .diamond { background: var(--ink); }

.btn--clay { background: var(--clay); color: #201409; }
.btn--clay:hover { background: var(--clay-deep); color: #f4ecdc; }

.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgba(21, 23, 25, 0.92); backdrop-filter: blur(10px); border-bottom-color: var(--line); }

.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand .diamond { width: 10px; height: 10px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: 0.02em; }
.brand-name em { font-style: normal; color: var(--clay); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sand);
  padding: 10px 12px;
  transition: color 0.2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: "◆"; color: var(--clay); font-size: 7px; display: block; text-align: center; margin-top: 3px; letter-spacing: 0; }

.nav-call { margin-left: 12px; }
.nav-call a { color: #201409; background: var(--clay); padding: 12px 18px 11px; }
.nav-call a:hover { background: var(--clay-deep); color: #f4ecdc; }

.nav-toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px 0; transition: transform 0.25s var(--ease), opacity 0.2s; }

/* ---------- Hero (editorial split) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 160px 0 clamp(48px, 7vw, 80px);
}
.hero-grid { position: absolute; inset: 0; opacity: 0.7; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(21,23,25,0.55), rgba(21,23,25,0) 30%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.hero-copy .eyebrow { margin-bottom: 28px; animation: rise 1s var(--ease) 0.08s both; }
.hero h1 { max-width: 11ch; animation: rise 1s var(--ease) 0.2s both; }
.hero .lead { margin-top: 28px; max-width: 46ch; animation: rise 1s var(--ease) 0.32s both; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; animation: rise 1s var(--ease) 0.44s both; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.hero-plate { position: relative; padding: 0 0 72px 56px; animation: rise 1.1s var(--ease) 0.3s both; }
.hero-plate .plate-frame { position: relative; border: 1px solid var(--line); background: var(--graphite); overflow: hidden; }
.hero-plate .plate-frame::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; opacity: 0.5;
}
.hero-plate .plate-main img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.hero-plate .plate-sub {
  position: absolute; left: 0; bottom: 0; width: 52%;
  border: 1px solid var(--line); overflow: hidden; background: var(--graphite);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.hero-plate .plate-sub img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-plate figcaption {
  padding: 14px 16px 13px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--sand); border-top: 1px solid var(--line);
}
.hero-plate .plate-sub figcaption { padding: 10px 12px 9px; }

.hero-tagline { position: absolute; left: 0; right: 0; bottom: 24px; width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(235,228,214,0.5); z-index: 2; }

/* ---------- Sections ---------- */
.section { padding-block: var(--space-sec); position: relative; }
.section-head { margin-bottom: clamp(44px, 6vw, 72px); display: grid; gap: 18px; }
.section-head .eyebrow { margin-bottom: 6px; }

/* ---------- Service cards ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.svc { border-right: 1px solid var(--line); padding: 34px 34px 40px 0; position: relative; transition: border-color 0.3s; }
.svc:last-child { border-right: 0; }
.svc .diamond { margin-bottom: 26px; transition: transform 0.4s var(--ease); }
.svc:hover .diamond { transform: rotate(45deg) scale(1.35); }
.svc h3 { font-size: 1.55rem; margin-bottom: 16px; }
.svc p { color: var(--sand); font-size: 15.5px; }
.svc .svc-link { margin-top: 22px; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
.svc .svc-link .diamond { width: 5px; height: 5px; margin: 0; transition: margin 0.25s var(--ease); }
.svc .svc-link:hover .diamond { margin-left: 6px; }

/* ---------- Steps (process) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.step { padding: 34px 30px 0 0; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step-num { font-family: var(--font-display); font-size: 2.4rem; font-weight: 500; color: var(--clay); line-height: 1; }
.step h3 { margin: 18px 0 12px; font-size: 1.25rem; }
.step p { color: var(--sand); font-size: 14.5px; }

/* ---------- Gallery tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--graphite); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.tile:hover img { transform: scale(1.06); }
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.tile:hover::after { opacity: 0.55; }
.tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 56px 20px 18px;
  background: linear-gradient(transparent, rgba(21,23,25,0.9));
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.tile:hover figcaption, .tile:focus-within figcaption { opacity: 1; transform: none; }

/* ---------- Contact band ---------- */
.cta-band { position: relative; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cta-band-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cta-band::after { content: ""; position: absolute; inset: 0; background: rgba(21, 23, 25, 0.82); }
.cta-band-inner { position: relative; z-index: 2; width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; padding-block: clamp(72px, 10vw, 120px); text-align: center; }
.cta-band-inner .eyebrow { margin-bottom: 22px; }
.cta-band-inner h2 { max-width: 18ch; margin-inline: auto; }
.cta-band-inner .lead { margin: 22px auto 0; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 38px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(56px, 7vw, 88px) 0 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
.footer-brand .brand-name { font-size: 26px; }
.footer-blurb { color: var(--sand); font-size: 14.5px; max-width: 38ch; margin-top: 16px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sand); margin-bottom: 18px; }
.footer-col a, .footer-col li { color: var(--ink); font-size: 15px; display: block; padding: 5px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--clay); }
.footer-bottom { margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand); }

/* ---------- Subpage hero ---------- */
.page-hero { padding: clamp(150px, 22vh, 200px) 0 clamp(60px, 8vw, 90px); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-hero .grout { position: absolute; inset: 0; opacity: 0.6; }
.page-hero-inner { position: relative; z-index: 2; }
.page-hero .eyebrow { margin-bottom: 24px; }
.page-hero h1 { max-width: 16ch; }
.page-hero .lead { margin-top: 24px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Detail sections (services page) ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.detail + .detail { margin-top: clamp(64px, 10vw, 120px); }
.detail-rev .detail-media { order: 2; }
.detail-media { border: 1px solid var(--line); overflow: hidden; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.detail-media:hover img { transform: scale(1.04); }
.detail-body .eyebrow { margin-bottom: 22px; }
.detail-body h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); margin-bottom: 20px; }
.detail-body p { color: var(--sand); }
.detail-list { margin-top: 26px; display: grid; gap: 14px; }
.detail-list li { display: flex; gap: 14px; align-items: baseline; color: var(--ink); font-size: 15.5px; }
.detail-list .diamond { width: 5px; height: 5px; flex: none; transform: translateY(-2px) rotate(45deg); }

/* ---------- Gallery page ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.gallery-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
.gal-item { position: relative; overflow: hidden; cursor: zoom-in; background: var(--graphite); aspect-ratio: 4 / 5; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.gal-item:hover img { transform: scale(1.05); }
.gal-item .tag {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); background: rgba(21,23,25,0.72); padding: 6px 10px; border: 1px solid var(--line);
}
.gal-item::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; opacity: 0; transition: opacity 0.4s var(--ease);
}
.gal-item:hover::after { opacity: 0.4; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 12, 13, 0.96); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 24px; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(1100px, 92vw); max-height: 78vh; object-fit: contain; border: 1px solid var(--line); }
.lightbox-cap { margin-top: 18px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sand); }
.lightbox-close { position: absolute; top: 22px; right: 26px; background: none; border: 0; color: var(--ink); font-size: 26px; cursor: pointer; padding: 8px; line-height: 1; }
.lightbox-close:hover { color: var(--clay); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink); font-size: 30px; cursor: pointer; padding: 16px; }
.lightbox-nav:hover { color: var(--clay); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

/* ---------- About page ---------- */
.about-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 7vw, 96px); align-items: start; }
.about-media { border: 1px solid var(--line); }
.about-media img { width: 100%; height: auto; }
.about-facts { margin-top: 30px; border-top: 1px solid var(--line); }
.about-facts li { display: flex; justify-content: space-between; gap: 24px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.about-facts .k { color: var(--sand); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.contact-card { border: 1px solid var(--line); padding: 30px; display: flex; gap: 22px; align-items: flex-start; }
.contact-card + .contact-card { margin-top: 18px; }
.contact-card .diamond { margin-top: 6px; }
.contact-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.contact-card p { color: var(--sand); font-size: 15px; }
.contact-card a { color: var(--ink); border-bottom: 1px solid var(--line); }
.contact-card a:hover { color: var(--clay); border-color: var(--clay); }
.contact-note { color: var(--sand); font-size: 14.5px; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .svc-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .svc { border-bottom: 1px solid var(--line); }
  .svc:nth-child(odd) { border-right: 1px solid var(--line); }
  .svc:nth-child(3) { border-bottom: 0; }
  .step { border-bottom: 1px solid var(--line); padding-bottom: 30px; }
  .step:nth-child(3), .step:nth-child(4) { border-bottom: 0; }
  .steps { border-bottom: 0; }
  .step:nth-child(even) { border-right: 0; }
  .tiles { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .detail-rev .detail-media { order: 0; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .about-split, .contact-grid { grid-template-columns: 1fr; }
  .hero-tagline { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero { padding-top: 130px; }
  .hero-plate { max-width: 460px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { background: rgba(21, 23, 25, 0.96); backdrop-filter: blur(10px); border-bottom-color: var(--line); }
  .nav { display: none; }
  .nav.is-open { display: flex; position: fixed; inset: 76px 0 0 0; flex-direction: column; align-items: stretch; background: rgba(21,23,25,0.98); padding: 24px var(--gutter); gap: 4px; border-top: 1px solid var(--line); }
  .nav.is-open a { font-size: 14px; padding: 14px 8px; border-bottom: 1px solid var(--line-soft); }
  .nav.is-open .nav-call { margin: 16px 0 0; }
  .nav-toggle { display: block; }
  .svc-grid, .steps { grid-template-columns: 1fr; }
  .svc, .svc:nth-child(odd), .svc:nth-child(3) { border-right: 0; border-bottom: 1px solid var(--line); }
  .svc:last-child { border-bottom: 0; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .gallery-grid, .gallery-grid:has(> :nth-child(3):last-child), .gallery-grid:has(> :nth-child(4):last-child) { grid-template-columns: 1fr; }
  .hero h1 { max-width: 10ch; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal, .js .reveal { opacity: 1; transform: none; }
}
