/* ============================================================
   Maison Zellij — Quiet Luxe Stone
   Modern Moroccan tile, marble & natural-stone atelier
   Design system: warm alabaster canvas · Fraunces + Manrope
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Palette */
  --canvas:        #F4EFE7;
  --surface:       #FCF9F3;
  --greige:        #E9E2D5;
  --hairline:      #E0D8C9;
  --ink:           #262220;
  --muted:         #655C50;   /* darkened to clear AA on the greige band */
  --terracotta:    #B0593A;
  --terracotta-dp: #98492E;
  --bronze:        #8A7350;   /* ornament / linework only */
  --bronze-text:   #6A5533;   /* bronze used as small text on light bgs (AA) */
  --gold:          #CDB184;   /* bronze role on dark cobalt / obsidian (AA) */
  --cobalt:        #143C82;
  --cobalt-dp:     #0E2A5E;
  --obsidian:      #1F1B18;
  --chalk:         #EDE7DA;

  /* Fonts */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Rhythm */
  --pad-x: clamp(1.25rem, 5vw, 6rem);
  --section-y: clamp(5rem, 12vh, 10rem);
  --maxw: 1440px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --nav-h: 76px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-feature-settings: "onum" 1, "kern" 1;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
::selection { background: var(--terracotta); color: var(--chalk); }

/* ---------- Typographic roles ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 340;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
  font-optical-sizing: auto;
}
.display {
  font-size: clamp(2.75rem, 1.6rem + 5.6vw, 6rem);
  font-weight: 320;
  line-height: 1.03;
  letter-spacing: -.022em;
}
h2 {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem);
  font-weight: 340;
  letter-spacing: -.015em;
  line-height: 1.08;
}
h3 {
  font-size: clamp(1.4rem, 1.15rem + 1.1vw, 2.1rem);
  font-weight: 370;
  line-height: 1.15;
}
p { margin-bottom: 1.4em; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.15rem, 1rem + .6vw, 1.35rem);
  line-height: 1.6;
  color: var(--ink);
  font-weight: 380;
}

/* Eyebrow / kicker micro-caps */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--bronze-text);
}
.eyebrow::before {
  content: "";
  width: 12px; height: 12px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--star-mask) center / contain no-repeat;
          mask: var(--star-mask) center / contain no-repeat;
}
.eyebrow.no-star::before { display: none; }
.eyebrow--light { color: var(--bronze); }

/* Eight-point star as a mask so it inherits currentColor */
:root {
  --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23000' stroke-width='2.4'%3E%3Crect x='7' y='7' width='18' height='18'/%3E%3Crect x='7' y='7' width='18' height='18' transform='rotate(45 16 16)'/%3E%3C/g%3E%3C/svg%3E");
}

/* Zellige tessellation, strokes only — used as faint section atmosphere */
:root {
  --zellige-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23262220' stroke-width='1'%3E%3Crect x='24' y='24' width='32' height='32'/%3E%3Crect x='24' y='24' width='32' height='32' transform='rotate(45 40 40)'/%3E%3Cpath d='M40 0v16M40 64v16M0 40h16M64 40h16'/%3E%3C/g%3E%3C/svg%3E");
  --zellige-bronze: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%238A7350' stroke-width='1'%3E%3Crect x='24' y='24' width='32' height='32'/%3E%3Crect x='24' y='24' width='32' height='32' transform='rotate(45 40 40)'/%3E%3Cpath d='M40 0v16M40 64v16M0 40h16M64 40h16'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(3.5rem, 8vh, 6rem); }
.band { background: var(--greige); }
.section-head { max-width: 62ch; }
.section-head .eyebrow { margin-bottom: 1.1rem; }
.section-head p { color: var(--muted); margin-top: 1rem; max-width: 54ch; }

/* Star divider */
.divider {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--hairline);
  margin-block: clamp(3rem, 6vh, 5rem);
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  background: currentColor;
  flex: 1;
}
.divider i {
  width: 20px; height: 20px;
  flex: none;
  background: var(--bronze);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
          mask: var(--star-mask) center / contain no-repeat;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-fg: var(--chalk);
  --btn-bg: var(--terracotta-dp);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .95em 1.6em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border-radius: 2px;
  overflow: hidden;
  isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn > span { position: relative; z-index: 1; }
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--obsidian);
  transform: translateX(-101%);
  transition: transform .5s var(--ease);
  z-index: 0;
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { transform: translateX(0); }
.btn--ghost {
  --btn-fg: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline);
}
.btn--ghost::after { background: var(--ink); }
.btn--ghost:hover { --btn-fg: var(--canvas); border-color: var(--ink); }
.btn--light { --btn-fg: var(--ink); --btn-bg: var(--chalk); }
.btn--light::after { background: var(--terracotta-dp); }
.btn--light:hover { --btn-fg: var(--chalk); }

/* Text link with drawing underline */
.tlink {
  position: relative;
  color: var(--terracotta-dp);
  font-weight: 600;
  background-image: linear-gradient(var(--terracotta), var(--terracotta));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size .3s var(--ease);
  padding-bottom: 2px;
}
.tlink:hover { background-size: 100% 2px; }
.tlink .arw { transition: transform .3s var(--ease); display: inline-block; }
.tlink:hover .arw { transform: translateX(4px); }

/* ---------- Focus states ---------- */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  background: transparent;
  transition: transform .35s var(--ease), background .35s var(--ease),
              border-color .35s var(--ease), backdrop-filter .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav__inner {
  width: 100%; max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem;
}
.brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -.01em;
  color: var(--chalk);
  transition: color .35s var(--ease), font-size .35s var(--ease);
  white-space: nowrap;
}
.brand b { font-style: normal; font-weight: 400; }
.nav__links {
  display: flex; align-items: center; gap: clamp(1rem, 2vw, 2.2rem);
  list-style: none;
}
.nav__links a {
  font-weight: 600; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .16em;
  color: var(--chalk);
  opacity: .82;
  position: relative;
  padding-block: .4rem;
  transition: opacity .25s var(--ease), color .25s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--terracotta);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__cta { margin-left: .5rem; }
.nav__pill {
  display: inline-flex; align-items: center;
  padding: .6em 1.2em;
  font-weight: 600; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--chalk);
  background: var(--terracotta-dp);
  border-radius: 2px;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.nav__pill:hover { background: var(--obsidian); transform: translateY(-1px); }

/* Scrolled / condensed */
.nav.is-solid {
  background: rgba(252, 249, 243, .9);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--hairline);
}
.nav.is-solid .brand { color: var(--ink); font-size: 1.35rem; }
.nav.is-solid .nav__links a { color: var(--ink); opacity: .7; }
.nav.is-solid .nav__links a:hover,
.nav.is-solid .nav__links a.is-active { opacity: 1; }
.nav.is-hidden { transform: translateY(-100%); }

/* Hamburger */
.nav__burger {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  margin-right: -8px;
}
.nav__burger span {
  position: absolute; left: 11px; right: 11px; height: 1.5px;
  background: var(--chalk);
  transition: transform .3s var(--ease), opacity .2s var(--ease), background .35s var(--ease);
}
.nav.is-solid .nav__burger span { background: var(--ink); }
.nav__burger span:nth-child(1) { top: 16px; }
.nav__burger span:nth-child(2) { top: 22px; }
.nav__burger span:nth-child(3) { top: 28px; }
body.menu-open .nav__burger span { background: var(--chalk); }
body.menu-open .nav__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .nav__burger span:nth-child(2) { opacity: 0; }
body.menu-open .nav__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--obsidian);
  padding: calc(var(--nav-h) + 2rem) var(--pad-x) 3rem;
  display: flex; flex-direction: column; justify-content: center; gap: .4rem;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform .5s var(--ease), visibility .5s var(--ease);
  background-image: var(--zellige-bronze);
  background-size: 120px;
}
body.menu-open .mobile-menu { visibility: visible; }
.mobile-menu::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 40%, transparent, var(--obsidian) 75%);
}
body.menu-open .mobile-menu { transform: translateY(0); }
.mobile-menu a {
  position: relative;
  font-family: var(--serif); font-weight: 340;
  font-size: clamp(2rem, 8vw, 3rem);
  color: var(--chalk);
  padding-block: .3rem;
  opacity: 0; transform: translateY(12px);
}
body.menu-open .mobile-menu a {
  animation: menuIn .5s var(--ease) forwards;
}
.mobile-menu a:nth-child(1) { animation-delay: .12s; }
.mobile-menu a:nth-child(2) { animation-delay: .18s; }
.mobile-menu a:nth-child(3) { animation-delay: .24s; }
.mobile-menu a:nth-child(4) { animation-delay: .30s; }
.mobile-menu a:nth-child(5) { animation-delay: .36s; }
.mobile-menu a:nth-child(6) { animation-delay: .42s; }
@keyframes menuIn { to { opacity: 1; transform: translateY(0); } }
.mobile-menu .m-contact {
  font-family: var(--sans); font-size: 1rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--terracotta); margin-top: 1.5rem;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  color: var(--chalk);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
  animation: heroSettle 1.4s var(--ease) .1s forwards;
}
@keyframes heroSettle { to { transform: scale(1); } }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(24,20,17,.5) 0%, transparent 20%),
    linear-gradient(to top, rgba(24,20,17,.78) 0%, rgba(24,20,17,.28) 42%, rgba(24,20,17,.2) 100%),
    linear-gradient(to right, rgba(24,20,17,.35), transparent 55%);
}
.hero__inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--pad-x) clamp(3.5rem, 10vh, 7rem);
}
.hero .eyebrow { color: var(--chalk); opacity: .9; margin-bottom: 1.5rem; }
.hero h1 { color: var(--chalk); max-width: 16ch; }
.hero h1 .ln { display: block; overflow: hidden; padding-block: .16em; margin-block: -.16em; }
.hero h1 .ln > span {
  display: block;
  transform: translateY(105%);
  animation: lineUp .9s var(--ease) forwards;
}
.hero h1 .ln:nth-child(1) > span { animation-delay: .35s; }
.hero h1 .ln:nth-child(2) > span { animation-delay: .45s; }
.hero h1 .ln:nth-child(3) > span { animation-delay: .55s; }
@keyframes lineUp { to { transform: translateY(0); } }
.hero__sub {
  max-width: 46ch;
  margin-top: 1.75rem;
  color: var(--chalk); opacity: .9;
  font-size: clamp(1.05rem, .95rem + .5vw, 1.25rem);
  line-height: 1.6;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.hero__meta {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: flex; flex-wrap: wrap; gap: 2rem 3rem;
  border-top: 1px solid rgba(237,231,218,.22);
  padding-top: 1.75rem;
}
.hero__meta div { display: flex; flex-direction: column; }
.hero__meta b {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 1.9rem; line-height: 1; letter-spacing: -.01em;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.hero__meta small {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .18em;
  opacity: .72; margin-top: .5rem;
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  color: var(--chalk); opacity: .8;
}
.scroll-cue i {
  width: 22px; height: 22px;
  background: var(--terracotta);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
          mask: var(--star-mask) center / contain no-repeat;
  animation: cuePulse 2.4s var(--ease) infinite;
}
.scroll-cue small { font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; }
@keyframes cuePulse { 0%,100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(5px); opacity: 1; } }

/* ============================================================
   Manifesto
   ============================================================ */
.manifesto { text-align: center; }
.manifesto .inner { max-width: 24ch; margin-inline: auto; }
.manifesto .star {
  width: 26px; height: 26px; margin: 0 auto 2rem;
  background: var(--bronze);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
          mask: var(--star-mask) center / contain no-repeat;
}
.manifesto p {
  font-family: var(--serif); font-weight: 330;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.6rem);
  line-height: 1.28; letter-spacing: -.01em;
  max-width: 22ch; margin-inline: auto;
}
.manifesto .tag {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  color: var(--muted); font-size: 1.15rem; margin-top: 1.75rem;
}

/* ============================================================
   Categories
   ============================================================ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(.6rem, 1.4vw, 1rem);
  margin-top: 3.5rem;
}
.cat {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--greige);
  border: 1px solid var(--hairline);
}
.cat img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s var(--ease), filter .6s var(--ease);
  filter: saturate(.96);
}
.cat::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24,20,17,.82) 4%, rgba(24,20,17,.15) 55%, rgba(24,20,17,.05) 100%);
  transition: opacity .5s var(--ease);
}
.cat:hover img { transform: scale(1.06); }
.cat__body {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  color: var(--chalk);
}
.cat__num {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: .9rem; opacity: .7; display: block; margin-bottom: .5rem;
}
.cat__body h3 { color: var(--chalk); font-weight: 380; }
.cat__body p {
  font-size: .86rem; line-height: 1.5; color: var(--chalk); opacity: 0;
  max-height: 0; overflow: hidden; margin: 0;
  transform: translateY(6px);
  transition: opacity .45s var(--ease), max-height .45s var(--ease), transform .45s var(--ease), margin .45s var(--ease);
}
.cat:hover .cat__body p, .cat:focus-visible .cat__body p {
  opacity: .88; max-height: 6em; margin-top: .5rem; transform: translateY(0);
}
.cat__arrow {
  position: absolute; top: clamp(1.1rem, 2vw, 1.5rem); right: clamp(1.1rem, 2vw, 1.5rem);
  z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(237,231,218,.4);
  display: grid; place-items: center; color: var(--chalk);
  transition: background .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
}
.cat:hover .cat__arrow { background: var(--terracotta); border-color: var(--terracotta); }

/* ============================================================
   Signature materials
   ============================================================ */
.mat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.6rem, 1.4vw, 1rem);
  margin-top: 3.5rem;
}
.mat {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4; background: var(--greige);
}
.mat img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.12) saturate(.95);
  transition: transform 1.1s var(--ease), filter .6s var(--ease);
}
.mat:hover img { transform: scale(1.05); filter: grayscale(0) saturate(1); }
.mat::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24,20,17,.6), transparent 60%);
}
.mat figcaption {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 1.1rem; color: var(--chalk);
}
.mat figcaption b {
  display: block; font-weight: 600; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .16em;
}
.mat figcaption span {
  display: block; font-size: .76rem; color: var(--chalk); opacity: .72;
  margin-top: .3rem; font-family: var(--serif); font-style: italic;
}

/* ============================================================
   Selected work — gallery + filter
   ============================================================ */
.work__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1.5rem;
}
.work__count {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  color: var(--muted); font-size: 1rem;
}
.work__count b { color: var(--terracotta-dp); font-style: normal; }
.filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 2.25rem 0 2.75rem;
}
.filter {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .6em 1.1em;
  font-weight: 600; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  transition: color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.filter::before {
  content: ""; width: 11px; height: 11px; flex: none;
  background: currentColor;
  -webkit-mask: var(--star-mask) center / contain no-repeat;
          mask: var(--star-mask) center / contain no-repeat;
  opacity: 0; transform: scale(.5);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  margin-left: -.4em;
}
.filter:hover { color: var(--ink); border-color: var(--bronze); }
.filter.is-active {
  color: var(--chalk); background: var(--terracotta-dp); border-color: var(--terracotta-dp);
}
.filter.is-active::before { opacity: 1; transform: scale(1); margin-left: 0; color: var(--chalk); }

.gallery {
  columns: 3;
  column-gap: clamp(.6rem, 1.4vw, 1rem);
}
.card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  break-inside: avoid;
  margin-bottom: clamp(.6rem, 1.4vw, 1rem);
  overflow: hidden;
  background: var(--greige);
  border: 1px solid var(--hairline);
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: border-color .35s var(--ease);
}
.card.is-hidden { display: none; }
@keyframes cardPop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.card:hover { border-color: var(--bronze); }
.card img {
  width: 100%; height: 100%; display: block;
  object-fit: cover;
  transition: transform .9s var(--ease);
}
.card:hover img { transform: scale(1.045); }
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24,20,17,.72), transparent 48%);
  opacity: 0; transition: opacity .45s var(--ease);
}
.card:hover::after { opacity: 1; }
.card__cap {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 1.2rem;
  color: var(--chalk);
  opacity: 0; transform: translateY(12px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.card:hover .card__cap,
.card:focus-visible .card__cap { opacity: 1; transform: translateY(0); }
.card:focus-visible::after { opacity: 1; }
.card__cap b { display: block; font-family: var(--serif); font-weight: 360; font-size: 1.2rem; }
.card__cap span {
  display: block; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .14em; opacity: .8; margin-top: .4rem;
}
.card__view {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(252, 249, 243, .92);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--ink);
  display: grid; place-items: center;
  opacity: 0; transform: scale(.8);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.card:hover .card__view,
.card:focus-visible .card__view { opacity: 1; transform: scale(1); }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(31, 27, 24, .96);
  background: color-mix(in srgb, var(--obsidian) 96%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  position: relative; max-width: 1100px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.lightbox__img {
  max-width: 100%; max-height: 78vh; width: auto; object-fit: contain;
  border: 1px solid rgba(237,231,218,.15);
  background: var(--obsidian);
  opacity: 0; transition: opacity .35s var(--ease);
}
.lightbox__img.is-ready { opacity: 1; }
.lightbox__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; width: 100%;
  background: var(--surface);
  padding: .9rem 1.2rem;
  border-radius: 2px;
}
.lightbox__bar b { font-family: var(--serif); font-weight: 360; font-size: 1.1rem; color: var(--ink); }
.lightbox__bar span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-top: .25rem; }
.lightbox__counter { font-size: .72rem; letter-spacing: .18em; color: var(--muted); white-space: nowrap; font-feature-settings: "tnum" 1; }
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(237, 231, 218, .14);
  background: color-mix(in srgb, var(--surface) 14%, transparent);
  border: 1px solid rgba(237,231,218,.3);
  color: var(--chalk);
  display: grid; place-items: center;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.lb-btn:hover { background: var(--terracotta); border-color: var(--terracotta); }
.lb-prev { left: -8px; }
.lb-next { right: -8px; }
.lb-close {
  position: absolute; top: -14px; right: -6px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--terracotta); color: var(--chalk);
  display: grid; place-items: center; z-index: 3;
  transition: transform .3s var(--ease);
}
.lb-close:hover { transform: rotate(90deg); }
@media (max-width: 760px) {
  .lb-prev { left: 2px; } .lb-next { right: 2px; }
  .lb-btn { width: 44px; height: 44px; }
  .lb-close { top: -8px; right: 2px; }
}

/* ============================================================
   Featured project — Obsidian interlude
   ============================================================ */
.featured { background: var(--obsidian); color: var(--chalk); position: relative; overflow: hidden; }
.featured::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--zellige-bronze);
  background-size: 130px; opacity: .05;
  -webkit-mask: radial-gradient(120% 90% at 80% 20%, #000, transparent 70%);
          mask: radial-gradient(120% 90% at 80% 20%, #000, transparent 70%);
}
.featured__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.featured__media {
  position: relative; overflow: hidden; aspect-ratio: 4 / 3;
  border: 1px solid rgba(237,231,218,.14);
}
.featured__media img { width: 100%; height: 100%; object-fit: cover; }
.featured__media .girih {
  position: absolute; top: 14px; left: 14px; width: 46px; height: 46px;
  border-left: 1px solid var(--bronze); border-top: 1px solid var(--bronze);
}
.featured__media .girih::after {
  content: ""; position: absolute; top: 8px; left: 8px; width: 14px; height: 14px;
  background: var(--bronze);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
          mask: var(--star-mask) center / contain no-repeat;
}
.featured h2 { color: var(--chalk); }
.featured .eyebrow { color: var(--gold); margin-bottom: 1.2rem; }
.featured p { color: var(--chalk); opacity: .82; margin-top: 1.25rem; max-width: 46ch; }
.featured__specs {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem; margin-top: 2.25rem;
  border-top: 1px solid rgba(237,231,218,.16); padding-top: 1.75rem;
}
.featured__specs div small {
  display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--gold); opacity: .95;
}
.featured__specs div b {
  font-family: var(--serif); font-weight: 340; font-size: 1.35rem; color: var(--chalk);
  display: block; margin-top: .35rem;
}

/* ============================================================
   Craft & process
   ============================================================ */
.process-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: 3.5rem;
}
.step { position: relative; padding-top: 2rem; border-top: 1px solid var(--hairline); }
.step__num {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 2.6rem; color: var(--bronze); line-height: 1;
  font-feature-settings: "lnum" 1;
}
.step h3 { margin-top: 1rem; font-size: 1.3rem; }
.step p { color: var(--muted); font-size: .92rem; margin-top: .75rem; }

/* ============================================================
   Stats
   ============================================================ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}
.stat { text-align: left; }
.stat b {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(2.8rem, 2rem + 3vw, 4.5rem); line-height: 1;
  color: var(--ink); letter-spacing: -.02em;
  font-feature-settings: "lnum" 1, "tnum" 1;
  display: inline-block;
}
.stat .rule {
  height: 1px; background: var(--bronze); width: 0;
  margin: 1.1rem 0; transition: width 1.4s var(--ease);
}
.stat.is-seen .rule { width: 72px; }
.stat small { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }

/* ============================================================
   Testimonials
   ============================================================ */
.quotes { position: relative; overflow: hidden; }
.quotes::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--zellige-ink); background-size: 90px; opacity: .04;
  -webkit-mask: radial-gradient(90% 80% at 50% 50%, #000, transparent 72%);
          mask: radial-gradient(90% 80% at 50% 50%, #000, transparent 72%);
}
.quotes__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: 3rem;
}
.quote { position: relative; padding-top: 2.5rem; }
.quote .girih {
  position: absolute; top: 0; left: 0; width: 30px; height: 30px;
  border-left: 1px solid var(--bronze); border-top: 1px solid var(--bronze);
}
.quote p {
  font-family: var(--serif); font-style: italic; font-weight: 330;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); line-height: 1.5;
  color: var(--ink);
}
.quote cite {
  display: block; margin-top: 1.5rem; font-style: normal;
  font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--ink);
}
.quote cite span { display: block; color: var(--muted); margin-top: .3rem; letter-spacing: .1em; }

/* ============================================================
   About
   ============================================================ */
.about__grid {
  display: grid; grid-template-columns: .85fr 1.15fr;
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.about__portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 4px 4px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 0 1px rgba(176,89,58,.0);
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__portrait::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 999px 999px 4px 4px;
  box-shadow: inset 0 0 0 1px rgba(176,89,58,.35);
  pointer-events: none;
}
.about__body h2 { max-width: 16ch; }
.about__body p { color: var(--muted); margin-top: 1.3rem; }
.about__body p:first-of-type { color: var(--ink); }
.about__sign {
  margin-top: 2rem; font-family: var(--serif); font-style: italic;
  font-size: 1.4rem; color: var(--ink);
}

/* ============================================================
   Contact — Cobalt jewel block
   ============================================================ */
.contact { position: relative; }
.contact__block {
  position: relative;
  background: linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt-dp) 100%);
  color: var(--chalk);
  border-radius: 3px;
  overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr;
}
.contact__block::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--zellige-bronze); background-size: 120px; opacity: .07;
  -webkit-mask: radial-gradient(120% 100% at 100% 0%, #000, transparent 72%);
          mask: radial-gradient(120% 100% at 100% 0%, #000, transparent 72%);
}
.contact__reg {
  position: absolute; top: 20px; right: 20px; width: 26px; height: 26px;
  border-top: 1px solid var(--bronze); border-right: 1px solid var(--bronze);
  z-index: 2;
}
.contact__info {
  position: relative; z-index: 1;
  padding: clamp(2.25rem, 4vw, 3.75rem);
}
.contact__info .eyebrow { color: var(--gold); }
.contact__info h2 { color: var(--chalk); margin-top: 1rem; }
.contact__info > p { color: var(--chalk); opacity: .82; margin-top: 1rem; max-width: 34ch; }
.contact__list { list-style: none; margin-top: 2.25rem; display: grid; gap: 1.4rem; }
.contact__list li { display: flex; gap: 1rem; align-items: flex-start; }
.contact__list .ic {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  border: 1px solid rgba(237,231,218,.28);
  display: grid; place-items: center; color: var(--gold);
  margin-top: 2px;
}
.contact__list .ic svg { width: 16px; height: 16px; }
.contact__list small { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .18em; color: var(--gold); }
.contact__list span { display: block; color: var(--chalk); opacity: .95; margin-top: .25rem; line-height: 1.5; }
.contact__list a span:hover { text-decoration: underline; }

.contact__form {
  position: relative; z-index: 1;
  background: var(--surface); color: var(--ink);
  padding: clamp(2.25rem, 4vw, 3.75rem);
}
.field { margin-bottom: 1.4rem; }
.field:last-of-type { margin-bottom: 1.75rem; }
.field label {
  display: block; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted); margin-bottom: .55rem; font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; font-size: .95rem;
  color: var(--ink);
  background: transparent;
  border: none; border-bottom: 1px solid var(--hairline);
  padding: .55rem 0;
  transition: border-color .3s var(--ease);
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-bottom-color: var(--terracotta);
}
.field input::placeholder, .field textarea::placeholder { color: #9a9184; color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.form-note { font-size: .74rem; color: var(--muted); margin-top: 1.1rem; }
.form-ok {
  margin-top: 1rem; font-size: .85rem; color: var(--terracotta-dp); font-weight: 600;
  display: none;
}
.form-ok.show { display: block; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  position: relative; overflow: hidden;
  background: var(--obsidian); color: var(--chalk);
  padding-block: clamp(3.5rem, 8vh, 6rem) 2.5rem;
}
.footer::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--zellige-bronze); background-size: 110px; opacity: .06;
}
.footer__inner { position: relative; z-index: 1; }
.footer__top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(237,231,218,.14);
}
.footer .brand { color: var(--chalk); font-size: 1.9rem; }
.footer__col h3 {
  font-family: var(--sans); font-weight: 600; font-size: .66rem;
  text-transform: uppercase; letter-spacing: .18em; color: var(--gold); margin-bottom: 1.2rem;
}
.footer__col ul { list-style: none; display: grid; gap: .7rem; }
.footer__col a, .footer__col p { color: var(--chalk); opacity: .78; font-size: .92rem; transition: opacity .25s var(--ease); }
.footer__col a:hover { opacity: 1; color: var(--terracotta); }
.footer__blurb { color: var(--chalk); opacity: .78; font-size: .92rem; margin-top: 1.1rem; max-width: 30ch; line-height: 1.6; }
.footer__seal {
  text-align: center; padding-top: 2.5rem;
}
.footer__seal i {
  width: 24px; height: 24px; margin: 0 auto 1.25rem;
  background: var(--bronze);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
          mask: var(--star-mask) center / contain no-repeat;
}
.footer__seal p { font-size: .78rem; color: var(--chalk); opacity: .6; letter-spacing: .04em; max-width: 60ch; margin-inline: auto; }
.footer__socials { display: flex; gap: 1.25rem; margin-top: 1.4rem; }
.footer__socials a { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; }

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
[data-stagger] > * { transition-delay: calc(var(--i, 0) * 70ms); }

/* ============================================================
   Touch devices — reveal hover-only content by default
   ============================================================ */
@media (hover: none) {
  .card__cap, .card__view { opacity: 1; transform: none; }
  .card::after { opacity: 1; }
  .cat__body p { opacity: .9; max-height: 8em; margin-top: .5rem; transform: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .mat-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { columns: 2; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 2rem; }
  .quotes__grid { grid-template-columns: 1fr; gap: 2.5rem; max-width: 60ch; }
  .featured__grid { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 380px; }
  .contact__block { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
}
@media (max-width: 720px) {
  .cat-grid { grid-template-columns: 1fr; }
  .mat-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { columns: 1; }
  .process-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .featured__specs { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .hero__meta b { font-size: 1.6rem; }
  .filter { min-height: 44px; }
  .field input, .field select, .field textarea { font-size: 16px; }
}
@media (max-width: 440px) {
  .mat-grid { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__media img { transform: none; animation: none; }
  .hero h1 .ln > span { transform: none; animation: none; }
}
