/* =============================================================
   OJS Joinery & Building
   Brand: warm, premium, architectural. Charcoal + off-white,
   brass & oak accents. Cormorant Garamond / Montserrat.
   "Built Properly. Finished Beautifully."
   ============================================================= */

:root {
  /* Brand constants */
  --charcoal:  #1F1F1F;
  --offwhite:  #F5F3EF;
  --oak:       #A67C52;
  --brass:     #C9A76A;
  --slate:     #6B6F72;

  /* Semantic canvas tokens — light canvas (default, per brand mockups) */
  --bg:              #F5F3EF;
  --fg:              #1F1F1F;
  --fg-muted:        #6B6F72;
  --hairline:        #e2dccf;
  --surface:         #ffffff;         /* raised cards on the light canvas */
  --surface-invert:  #1F1F1F;         /* charcoal statement blocks */
  --on-invert:       #F5F3EF;
  --on-invert-muted: #a7a29a;
  --hairline-invert: #383735;
  color-scheme: light;

  --brass-hover: #d8b878;

  --f-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --f-body:    "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --pad: clamp(1.25rem, 5vw, 6rem);
  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark canvas */
[data-theme="dark"] {
  --bg:              #1F1F1F;
  --fg:              #F5F3EF;
  --fg-muted:        #a7a29a;
  --hairline:        #363532;
  --surface:         #262524;
  --surface-invert:  #171716;
  --on-invert:       #F5F3EF;
  --on-invert-muted: #a7a29a;
  --hairline-invert: #333230;
  color-scheme: dark;
}

/* Smooth cross-fade only while toggling */
html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color .5s var(--ease), color .5s var(--ease),
              border-color .5s var(--ease) !important;
}
@media (prefers-reduced-motion: reduce) {
  html.theming *, html.theming *::before, html.theming *::after { transition: none !important; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--charcoal); color: var(--offwhite);
  padding: .75rem 1.25rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.section { padding-block: clamp(4rem, 9vh, 8rem); }

/* Type devices ------------------------------------------------ */
.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: .72rem; font-weight: 500; letter-spacing: .28em; text-transform: uppercase;
  color: var(--oak); margin: 0 0 1.25rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--brass);
}
.eyebrow--center { justify-content: center; }

.display {
  font-family: var(--f-display); font-weight: 600;
  line-height: 1.04; letter-spacing: .005em; margin: 0;
}
.section-title {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; letter-spacing: .005em; margin: 0;
}
.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.lead { color: var(--fg-muted); font-size: 1.05rem; margin: 1.25rem 0 0; }

/* Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--f-body); font-weight: 500;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  padding: 1.05rem 2rem; border: 1px solid transparent; cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease),
              border-color .35s var(--ease), transform .35s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--brass { background: var(--brass); color: var(--charcoal); border-color: var(--brass); }
.btn--brass:hover { background: var(--brass-hover); border-color: var(--brass-hover); }
.btn--outline { background: transparent; color: currentColor; border-color: currentColor; }
.btn--outline:hover { background: var(--brass); color: var(--charcoal); border-color: var(--brass); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--hairline); }
.btn--ghost:hover { border-color: var(--brass); color: var(--oak); }

/* Navigation -------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: .7rem var(--pad);
  background: rgba(31,31,31,0.9);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid #2c2b29;
}
.nav__logo { height: 58px; width: auto; }
.nav__right { display: flex; align-items: center; gap: clamp(1.25rem, 2.4vw, 2.5rem); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.nav__links a {
  font-size: .78rem; font-weight: 400; letter-spacing: .12em; text-transform: uppercase;
  color: var(--offwhite); position: relative; padding: .3rem 0;
  transition: color .35s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav__links a:hover { color: var(--brass); }
.nav__links a:hover::after { transform: scaleX(1); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none; padding: 0;
  background: none; border: 1px solid #3a3937; border-radius: 50%;
  color: var(--offwhite); cursor: pointer; transition: border-color .35s var(--ease), color .35s var(--ease);
}
.theme-toggle:hover { border-color: var(--brass); color: var(--brass); }
.theme-toggle__dot {
  width: 14px; height: 14px; border-radius: 50%; border: 1px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
  transition: transform .6s var(--ease);
}
[data-theme="dark"] .theme-toggle__dot { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .theme-toggle__dot { transition: none; } }

.nav__cta { padding: .8rem 1.5rem; }

.nav__toggle {
  display: none; flex-direction: column; gap: 6px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav__toggle span { width: 24px; height: 1px; background: var(--offwhite); transition: transform .4s var(--ease), opacity .3s; }

.mobile-nav {
  position: fixed; inset: 0; z-index: 90; background: var(--charcoal);
  display: flex; flex-direction: column; justify-content: center; gap: 1.4rem; padding: var(--pad);
  transform: translateY(-100%); transition: transform .55s var(--ease);
}
.mobile-nav a { font-family: var(--f-display); font-size: 1.9rem; color: var(--offwhite); }
.mobile-nav a:hover { color: var(--brass); }
.mobile-nav .btn { margin-top: 1rem; align-self: flex-start; }
body.menu-open .mobile-nav { transform: translateY(0); }
body.menu-open { overflow: hidden; }
body.menu-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
body.menu-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Hero -------------------------------------------------------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: clamp(8rem, 16vh, 13rem) 0 clamp(3rem, 7vh, 5rem);
  color: var(--offwhite);
  background:
    linear-gradient(180deg, rgba(20,20,20,.62) 0%, rgba(20,20,20,.72) 55%, rgba(20,20,20,.92) 100%),
    url("assets/img/media-wall.jpg") center 40% / cover no-repeat;
}
.hero__inner { position: relative; max-width: 820px; }
.hero__title { font-size: clamp(2.9rem, 7.5vw, 6rem); }
.hero__title .amp { color: var(--brass); display: block; }
.hero__lede { max-width: 46ch; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: rgba(245,243,239,.82); margin: 1.75rem 0 2.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Trust bar --------------------------------------------------- */
.trust {
  background: var(--surface-invert); color: var(--on-invert);
  border-top: 1px solid var(--hairline-invert);
}
.trust__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  max-width: var(--maxw); margin: 0 auto;
}
.trust__item {
  padding: 1.9rem var(--pad); text-align: center;
  border-top: 1px solid var(--hairline-invert); border-right: 1px solid var(--hairline-invert);
}
.trust__value { font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; color: var(--brass); line-height: 1; margin-bottom: .5rem; }
.trust__label { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--on-invert-muted); }
@media (min-width: 760px) {
  .trust__grid { grid-template-columns: repeat(5, 1fr); }
  .trust__item { border-top: 0; }
  .trust__item:first-child { border-left: 1px solid var(--hairline-invert); }
}

/* Services ---------------------------------------------------- */
.services__grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
  border-top: 1px solid var(--hairline);
}
@media (min-width: 620px) { .services__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .services__grid { grid-template-columns: repeat(4, 1fr); } }

.service {
  padding: 2.5rem 2rem 2.75rem;
  border-bottom: 1px solid var(--hairline); border-right: 1px solid var(--hairline);
  transition: background .4s var(--ease);
}
.service:hover { background: var(--surface); }
.service__icon { width: 34px; height: 34px; color: var(--oak); margin-bottom: 1.5rem; }
.service__icon svg { width: 100%; height: 100%; display: block; }
.service__title { font-family: var(--f-display); font-weight: 600; font-size: 1.55rem; margin: 0 0 .6rem; }
.service__body { color: var(--fg-muted); font-size: .96rem; margin: 0; }

/* About / brand keywords -------------------------------------- */
.about { background: var(--surface); border-block: 1px solid var(--hairline); }
.about__grid { display: grid; grid-template-columns: 1fr; gap: clamp(2.5rem, 5vw, 5rem); align-items: center; }
@media (min-width: 900px) { .about__grid { grid-template-columns: 1.1fr .9fr; } }
.about__body p { color: var(--fg-muted); margin: 0 0 1.15rem; }
.about__body p:first-of-type { color: var(--fg); font-size: 1.15rem; font-family: var(--f-display); line-height: 1.5; }
.keywords { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.keyword { background: var(--bg); padding: 1.75rem 1.5rem; }
.keyword__icon { width: 28px; height: 28px; color: var(--brass); margin-bottom: .85rem; }
.keyword__icon svg { width: 100%; height: 100%; }
.keyword__title { font-weight: 600; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .35rem; }
.keyword__note { font-size: .85rem; color: var(--fg-muted); margin: 0; }

/* Projects ---------------------------------------------------- */
.projects { background: var(--surface-invert); color: var(--on-invert); }
.projects .section-title, .projects .eyebrow { color: var(--on-invert); }
.projects .eyebrow { color: var(--brass); }
.projects .lead { color: var(--on-invert-muted); }
.projects__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.projects__grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 2.5vw, 2rem); }
@media (min-width: 620px) { .projects__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .projects__grid { grid-template-columns: repeat(3, 1fr); } }

.project {
  display: flex; flex-direction: column; background: #262524;
  border: 1px solid var(--hairline-invert); overflow: hidden;
}
.project__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.project__img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.project:hover .project__img { transform: scale(1.05); }
.project__tag {
  position: absolute; top: 1rem; left: 1rem; z-index: 2;
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  background: rgba(31,31,31,.82); color: var(--brass); padding: .45rem .8rem; border: 1px solid var(--hairline-invert);
}
.project__body { padding: 1.5rem 1.5rem 1.75rem; display: flex; flex-direction: column; flex: 1; }
.project__title { font-family: var(--f-display); font-weight: 600; font-size: 1.4rem; margin: 0 0 .5rem; color: var(--on-invert); }
.project__desc { font-size: .9rem; color: var(--on-invert-muted); margin: 0 0 1.25rem; flex: 1; }
.project__link { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); display: inline-flex; align-items: center; gap: .5rem; }
.project__link span { transition: transform .35s var(--ease); }
.project:hover .project__link span { transform: translateX(5px); }

/* Process ----------------------------------------------------- */
.process__grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
  counter-reset: step;
}
@media (min-width: 620px) { .process__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .process__grid { grid-template-columns: repeat(4, 1fr); } }
.step { padding: 2.25rem 1.75rem 2.5rem 0; border-top: 2px solid var(--brass); margin-right: 1.5rem; }
.step__num { font-family: var(--f-display); font-weight: 600; font-size: 2.4rem; color: var(--brass); line-height: 1; display: block; margin: 1.25rem 0 1rem; }
.step__title { font-family: var(--f-display); font-weight: 600; font-size: 1.4rem; margin: 0 0 .6rem; }
.step__body { color: var(--fg-muted); font-size: .93rem; margin: 0; }

/* Testimonials ------------------------------------------------ */
.reviews { background: var(--surface); border-block: 1px solid var(--hairline); }
.reviews__grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.25rem, 2.5vw, 2rem); }
@media (min-width: 800px) { .reviews__grid { grid-template-columns: repeat(3, 1fr); } }
.review { background: var(--bg); border: 1px solid var(--hairline); padding: 2rem 1.9rem; display: flex; flex-direction: column; }
.review__stars { color: var(--brass); letter-spacing: .15em; font-size: .95rem; margin-bottom: 1.1rem; }
.review__quote { font-family: var(--f-display); font-size: 1.28rem; line-height: 1.45; margin: 0 0 1.5rem; flex: 1; }
.review__author { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); }
.review__author strong { color: var(--fg); font-weight: 600; }

/* Contact CTA ------------------------------------------------- */
.contact {
  position: relative; color: var(--offwhite); text-align: center;
  background:
    linear-gradient(rgba(20,20,20,.86), rgba(20,20,20,.9)),
    url("assets/img/oak-flooring.jpg") center / cover no-repeat;
  background-color: var(--charcoal);
}
.contact__title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.contact__lede { max-width: 46ch; margin: 1.25rem auto 2.25rem; color: rgba(245,243,239,.82); }
.contact__actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.contact__details { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; justify-content: center; font-size: .82rem; letter-spacing: .06em; color: rgba(245,243,239,.7); }
.contact__details a { color: var(--brass); }
.btn--whatsapp { background: transparent; color: var(--offwhite); border-color: rgba(245,243,239,.4); }
.btn--whatsapp:hover { background: #25D366; border-color: #25D366; color: #0b3d1e; }

/* Footer ------------------------------------------------------ */
.footer { background: var(--surface-invert); color: var(--on-invert); padding: clamp(3.5rem, 7vh, 5.5rem) 0 2.5rem; }
.footer__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
@media (min-width: 780px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer__logo { height: 128px; width: auto; margin-bottom: 1.25rem; margin-left: -6px; }
.footer__tagline { color: var(--on-invert-muted); font-family: var(--f-display); font-size: 1.05rem; max-width: 32ch; }
.footer__label { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); margin: 0 0 1.1rem; }
.footer__col { display: flex; flex-direction: column; gap: .7rem; }
.footer__col a, .footer__col span { font-size: .92rem; color: var(--on-invert-muted); transition: color .35s var(--ease); }
.footer__col a:hover { color: var(--brass); }
.footer__base {
  max-width: var(--maxw); margin: 3rem auto 0; padding-top: 1.75rem;
  border-top: 1px solid var(--hairline-invert);
  display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between;
  font-size: .72rem; letter-spacing: .06em; color: var(--on-invert-muted);
}

/* Reveal + focus ---------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

.js .hero__inner > * { opacity: 0; transform: translateY(22px); animation: rise .9s var(--ease) forwards; }
.js .hero__inner > *:nth-child(1) { animation-delay: .1s; }
.js .hero__inner > *:nth-child(2) { animation-delay: .24s; }
.js .hero__inner > *:nth-child(3) { animation-delay: .4s; }
.js .hero__inner > *:nth-child(4) { animation-delay: .54s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .hero__inner > * { opacity: 1; transform: none; animation: none; } }

a:focus-visible, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* Projects page ---------------------------------------------- */
.page-hero {
  position: relative; color: var(--offwhite); text-align: center;
  padding: clamp(9rem, 22vh, 14rem) 0 clamp(3.5rem, 8vh, 6rem);
  background:
    linear-gradient(rgba(18,18,18,.68) 0%, rgba(18,18,18,.86) 100%),
    url("assets/img/media-wall.jpg") center 42% / cover no-repeat;
  background-color: var(--charcoal);
}
.page-hero .eyebrow { color: var(--brass); justify-content: center; }
.page-hero__title { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.page-hero__lede { max-width: 54ch; margin: 1.25rem auto 0; color: rgba(245,243,239,.8); }

.filters {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.filter {
  font-family: var(--f-body); font-weight: 500;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .78rem 1.4rem; border: 1px solid var(--hairline);
  background: transparent; color: var(--fg); cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.filter:hover { border-color: var(--brass); color: var(--oak); }
.filter.is-active { background: var(--brass); border-color: var(--brass); color: var(--charcoal); }

.project.is-hidden { display: none; }
.projects-empty { text-align: center; color: var(--fg-muted); padding: 2rem 0; display: none; }

/* Before / After slider -------------------------------------- */
.ba {
  --pos: 50%;
  position: relative; max-width: 960px; margin: 0 auto;
  aspect-ratio: 3 / 2; overflow: hidden;
  border: 1px solid var(--hairline); user-select: none; touch-action: none;
}
.ba__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba__before-img { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba__divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 2px; background: var(--brass); transform: translateX(-1px); pointer-events: none;
}
.ba__knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--brass); border: 3px solid var(--offwhite);
  box-shadow: 0 3px 12px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.ba__knob svg { width: 22px; height: 12px; display: block; }
.ba__label {
  position: absolute; top: 1rem; z-index: 2;
  font-family: var(--f-body); font-size: .64rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  padding: .4rem .75rem; background: rgba(31,31,31,.72); color: var(--offwhite);
  pointer-events: none;
}
.ba__label--before { left: 1rem; }
.ba__label--after  { right: 1rem; }
.ba__range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; background: transparent;
}
.ba__range::-webkit-slider-thumb { -webkit-appearance: none; width: 46px; height: 100%; cursor: ew-resize; }
.ba__range::-moz-range-thumb { width: 46px; height: 100%; border: 0; background: transparent; cursor: ew-resize; }
.ba__range:focus-visible { outline: none; }
.ba__range:focus-visible ~ .ba__divider .ba__knob { outline: 2px solid var(--offwhite); outline-offset: 3px; }

/* Responsive nav --------------------------------------------- */
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
}
