:root {
  --white: #fbfaf8;
  --stone: #e6e2db;
  --stone-dark: #c9c2b6;
  --charcoal: #2b2a28;
  --charcoal-soft: #55524c;
  --parchment: #eadfc6;
  --parchment-deep: #dccdaa;
  --burgundy: #6b1e2b;
  --burgundy-dark: #521620;
  --gold: #9c7a3c;

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --text: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

html[lang="ar"] {
  --display: "Amiri", "Times New Roman", serif;
  --text: "IBM Plex Sans Arabic", Tahoma, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

html[lang="ar"] body { font-size: 1.125rem; line-height: 1.8; }

img { max-width: 100%; display: block; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--burgundy); }

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

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem;
  background: var(--charcoal); color: var(--white); padding: 0.5rem 1rem; z-index: 20;
}
.skip:focus { top: 1rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.35; font-weight: 700; }

h1 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.375rem; }

p { margin: 0 0 1em; max-width: var(--measure); }
.lead { font-size: 1.25rem; line-height: 1.55; color: var(--charcoal-soft); max-width: 38rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--stone);
  background: var(--white);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 4.5rem;
}
.brand {
  font-family: var(--display); font-size: 1.6rem; text-decoration: none;
  letter-spacing: 0.02em; color: var(--charcoal);
}
.brand:hover { color: var(--charcoal); }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { text-decoration: none; font-size: 0.97rem; padding-block: 0.4rem; border-bottom: 1px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--charcoal); }
.nav .lang {
  border: 1px solid var(--stone-dark); padding: 0.3rem 0.8rem; border-radius: 2rem;
}
.nav .lang:hover { border-color: var(--burgundy); }
.menu-toggle {
  display: none; background: none; border: 1px solid var(--stone-dark);
  border-radius: 2rem; padding: 0.45rem 1rem; font: inherit; color: inherit; cursor: pointer;
}

@media (max-width: 960px) {
  .menu-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--stone);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .nav.open { display: flex; }
  .nav a { padding-block: 0.7rem; width: 100%; }
  .nav .lang { margin-top: 0.75rem; width: auto; }
}

/* Home: the two houses */
.houses {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: calc(100svh - 4.5rem);
}
.house {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 3.5rem); text-decoration: none; overflow: hidden;
}
.house:hover { color: inherit; }
.house--heritage { background: var(--parchment); color: var(--burgundy-dark); }
.house--studio { background: var(--charcoal); color: var(--stone); }

.house .year {
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(5rem, 15vw, 13rem);
  line-height: 0.85; font-weight: 400; letter-spacing: -0.03em;
  margin: 0;
}
.house--heritage .year { color: var(--burgundy); }
.house--studio .year { color: transparent; -webkit-text-stroke: 1px var(--stone-dark); }

.house .place { font-size: 1rem; margin: 0.9rem 0 0; opacity: 0.85; }
.house h2 { font-size: clamp(1.9rem, 3.4vw, 3rem); margin-bottom: 0.4em; }
.house p { max-width: 26rem; }
.house .go {
  display: inline-block; margin-top: 0.5rem; padding-bottom: 0.15rem;
  border-bottom: 1px solid currentColor; font-weight: 500;
}
.house:hover .go { border-bottom-width: 2px; }

@media (max-width: 760px) {
  .houses { grid-template-columns: 1fr; min-height: 0; }
  .house { min-height: 70svh; gap: 3rem; }
}

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--stone { background: var(--stone); }
.section--parchment { background: var(--parchment); }
.section--charcoal { background: var(--charcoal); color: var(--stone); }
.section--charcoal a:hover { color: var(--white); }

.page-head { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem); }
.page-head--parchment { background: var(--parchment); color: var(--burgundy-dark); }
.page-head--charcoal { background: var(--charcoal); color: var(--stone); }
.page-head--charcoal .lead { color: var(--stone-dark); }
.page-head--parchment .lead { color: #6a4a3a; }
.page-head .house-name { font-size: 1rem; margin-bottom: 1rem; }

.split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .cols, .cols--2 { grid-template-columns: 1fr; } }

.col h3 { margin-bottom: 0.4em; }
.col { border-top: 1px solid var(--stone-dark); padding-top: 1.25rem; }
.section--charcoal .col { border-top-color: #4a4843; }

/* Facts list */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.facts div { padding: 1.5rem 0; border-top: 1px solid var(--stone-dark); }
.facts div:nth-child(odd) { padding-inline-end: 2rem; }
.facts dt { font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; margin-bottom: 0.5rem; }
.facts dd { margin: 0; color: var(--charcoal-soft); max-width: 22rem; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } .facts div:nth-child(odd) { padding-inline-end: 0; } }

/* Steps: a real sequence */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: 3.5rem 1fr;
  gap: 1rem; padding: 1.25rem 0; border-top: 1px solid var(--stone-dark);
}
.steps li::before {
  content: counter(step); font-family: var(--display); font-size: 1.75rem; line-height: 1.1; color: var(--burgundy);
}
.section--charcoal .steps li { border-top-color: #4a4843; }
.section--charcoal .steps li::before { color: var(--stone-dark); }
.steps strong { display: block; font-weight: 600; }
.steps span { color: var(--charcoal-soft); }
.section--charcoal .steps span { color: var(--stone-dark); }

/* Period guide */
.periods { margin: 0; padding: 0; list-style: none; }
.periods li {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem;
  padding: 1.1rem 0; border-top: 1px solid var(--parchment-deep);
}
.periods .dates { font-family: var(--display); font-size: 1.15rem; color: var(--burgundy); }
.periods strong { display: block; font-weight: 600; }
@media (max-width: 560px) { .periods li { grid-template-columns: 1fr; gap: 0.25rem; } }

/* Photo slots */
.photo {
  margin: 0; background: var(--stone); position: relative;
  aspect-ratio: 4 / 3; display: flex; align-items: flex-end;
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(43,42,40,0.045) 14px 15px);
}
.photo--tall { aspect-ratio: 3 / 4; }
.photo--wide { aspect-ratio: 16 / 9; }
.photo--parchment { background-color: var(--parchment-deep); }
.photo--dark { background-color: #3a3835; color: var(--stone-dark); }
.photo figcaption {
  font-size: 0.85rem; padding: 0.75rem 1rem; color: var(--charcoal-soft);
}
.photo--dark figcaption { color: var(--stone-dark); }

/* Piece grid */
.pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); }
@media (max-width: 860px) { .pieces { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pieces { grid-template-columns: 1fr; } }
.piece h3 { font-size: 1.2rem; margin: 0.9rem 0 0.2rem; }
.piece p { font-size: 0.95rem; color: var(--charcoal-soft); margin: 0; }
.piece .code { font-variant-numeric: tabular-nums; }

.counts { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.counts li { font-size: 1.05rem; }
.counts b { font-family: var(--display); font-size: 1.6rem; font-weight: 500; margin-inline-end: 0.35rem; }

/* Projects */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filters button {
  font: inherit; font-size: 0.95rem; background: none; color: inherit; cursor: pointer;
  border: 1px solid var(--stone-dark); border-radius: 2rem; padding: 0.4rem 1rem;
}
.filters button[aria-pressed="true"] { background: var(--charcoal); color: var(--white); border-color: var(--charcoal); }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 760px) { .projects { grid-template-columns: 1fr; } }
.project h3 { margin: 1rem 0 0.25rem; }
.project .meta { color: var(--charcoal-soft); font-size: 0.95rem; margin: 0; }
.project[hidden] { display: none; }

/* Buttons */
.button {
  display: inline-block; text-decoration: none; font: inherit; font-weight: 500; cursor: pointer;
  background: var(--burgundy); color: var(--white); border: 1px solid var(--burgundy);
  padding: 0.85rem 1.6rem; border-radius: 2rem;
}
.button:hover { background: var(--burgundy-dark); color: var(--white); }
.button--quiet { background: transparent; color: inherit; border-color: currentColor; }
.button--quiet:hover { background: transparent; color: inherit; border-width: 1px; box-shadow: inset 0 0 0 1px currentColor; }
.section--charcoal .button { background: var(--stone); color: var(--charcoal); border-color: var(--stone); }
.section--charcoal .button:hover { background: var(--white); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Call to action band */
.ask { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 2rem; }
.ask h2 { margin: 0; max-width: 30rem; }

/* Forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.5rem; max-width: 46rem; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
.form label { display: block; font-size: 0.95rem; font-weight: 500; margin-bottom: 0.35rem; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; color: inherit; background: var(--white);
  border: 1px solid var(--stone-dark); border-radius: 4px; padding: 0.7rem 0.85rem;
}
.form textarea { min-height: 9rem; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--burgundy); outline-offset: 0; border-color: var(--burgundy); }
.form .hint { font-size: 0.875rem; color: var(--charcoal-soft); margin: 0.35rem 0 0; }
.form-status { grid-column: 1 / -1; margin: 0; min-height: 1.5em; color: var(--burgundy); }

.contact-lines { list-style: none; margin: 0; padding: 0; }
.contact-lines li { padding: 0.9rem 0; border-top: 1px solid var(--stone-dark); }
.contact-lines span { display: block; font-size: 0.9rem; color: var(--charcoal-soft); }
.contact-lines a { font-size: 1.15rem; text-decoration: none; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* WhatsApp */
.whatsapp {
  position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 15;
  background: #1f6f4a; color: #fff; text-decoration: none; border-radius: 2rem;
  padding: 0.75rem 1.2rem; font-weight: 500; font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(20, 40, 30, 0.25);
}
.whatsapp:hover { color: #fff; background: #185a3c; }

/* Footer */
.site-footer { background: var(--charcoal); color: var(--stone-dark); padding-block: 3.5rem 2rem; font-size: 0.95rem; }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer .brand { color: var(--stone); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.site-footer .legal { max-width: none; grid-column: 1 / -1; border-top: 1px solid #4a4843; padding-top: 1.5rem; margin-top: 1rem; font-size: 0.875rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

.note { font-size: 0.9rem; color: var(--charcoal-soft); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
