/* ============================================================
   QANTARA ENGINEERING — Main Stylesheet
   Design system: stone/amber palette, Segoe UI + Space Mono
   ============================================================ */

/* ── Custom Properties ───────────────────────────────────── */
:root {
  /* Palette */
  --clr-bg:          #F5F0E8;      /* warm parchment */
  --clr-bg-dark:     #141210;      /* near-black with warm tone */
  --clr-bg-dark-2:   #1E1A17;      /* dark section alt */
  --clr-stone:       #C8A96E;      /* golden amber (logo match) */
  --clr-stone-light: #DEC898;      /* lighter amber */
  --clr-stone-dark:  #8B7048;      /* darker amber */
  --clr-text:        #2A2318;      /* rich dark brown */
  --clr-text-light:  #6B5D4F;      /* muted brown */
  --clr-text-inv:    #F5F0E8;      /* off-white for dark sections */
  --clr-text-muted:  rgba(245,240,232,0.6);
  --clr-border:      rgba(42,35,24,0.12);
  --clr-border-inv:  rgba(245,240,232,0.15);

  /* Typography */
  --font-serif:  'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-sans:   'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:   'Space Mono', monospace;

  /* Spacing (8-pt grid) */
  --sp-1:  0.5rem;
  --sp-2:  1rem;
  --sp-3:  1.5rem;
  --sp-4:  2rem;
  --sp-6:  3rem;
  --sp-8:  4rem;
  --sp-12: 6rem;
  --sp-16: 8rem;
  --sp-20: 10rem;

  /* Layout */
  --max-w:       1200px;
  --max-w-wide:  1440px;
  --nav-h:       80px;

  /* Effects */
  --radius:    4px;
  --radius-lg: 8px;
  --shadow:    0 4px 24px rgba(42,35,24,0.12);
  --shadow-lg: 0 16px 64px rgba(42,35,24,0.2);
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.2s ease;
}

body.theme-light {
  --clr-bg:          #FAF7F0;
  --clr-bg-dark:     #EFE8DA;
  --clr-bg-dark-2:   #FFFDF8;
  --clr-text:        #2A2318;
  --clr-text-light:  #665746;
  --clr-text-inv:    #2A2318;
  --clr-text-muted:  rgba(42,35,24,0.64);
  --clr-border:      rgba(42,35,24,0.14);
  --clr-border-inv:  rgba(42,35,24,0.16);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.65;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Layout Containers ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.container-wide {
  width: 100%;
  max-width: var(--max-w-wide);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

/* ── Section Base ────────────────────────────────────────── */
.section { padding-block: var(--sp-16); }
.section--dark {
  background-color: var(--clr-bg-dark);
  color: var(--clr-text-inv);
}

.section__header {
  margin-bottom: var(--sp-8);
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-stone);
  margin-bottom: var(--sp-1);
}
.section__label--light { color: var(--clr-stone-light); }

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--clr-text);
  letter-spacing: -0.035em;
}
.section__title--light { color: var(--clr-text-inv); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.875rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: var(--transition-fast);
}

.btn--primary {
  background-color: var(--clr-stone);
  color: var(--clr-bg-dark);
  font-weight: 700;
}
.btn--primary:hover {
  background-color: var(--clr-stone-light);
  transform: translateY(-1px);
}

.btn--ghost {
  border: 1px solid rgba(245,240,232,0.5);
  color: var(--clr-text-inv);
}
.btn--ghost:hover {
  border-color: var(--clr-stone);
  color: var(--clr-stone-light);
}
body.theme-light .btn--ghost {
  border-color: rgba(42,35,24,0.32);
  color: var(--clr-text);
}
body.theme-light .btn--ghost:hover {
  border-color: var(--clr-stone-dark);
  color: var(--clr-stone-dark);
}

/* ── Reveal Animations ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 0.12s; }
.reveal--delay-2 { transition-delay: 0.24s; }
.reveal--delay-3 { transition-delay: 0.36s; }

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--sp-4);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}
.nav.scrolled {
  background-color: rgba(20,18,16,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--clr-border-inv);
}
body.theme-light .nav.scrolled {
  background-color: rgba(245,240,232,0.94);
  box-shadow: 0 1px 0 var(--clr-border);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.4rem 0.7rem 0.4rem 0.4rem;
  border: 1px solid rgba(245,240,232,0.18);
  border-radius: var(--radius-lg);
  background: rgba(245,240,232,0.92);
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.nav__logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
}
.nav__logo:hover {
  background: var(--clr-bg);
  border-color: rgba(200,169,110,0.55);
  box-shadow: 0 10px 34px rgba(0,0,0,0.28), 0 0 0 1px rgba(200,169,110,0.18);
}
.nav__logo-text {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 300;
  color: var(--clr-text);
  letter-spacing: -0.03em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.nav__link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.75);
  transition: color var(--transition-fast);
}
.nav__link:hover,
.nav__link.active { color: var(--clr-stone-light); }
body.theme-light .nav.scrolled .nav__link {
  color: rgba(42,35,24,0.72);
}
body.theme-light .nav.scrolled .nav__link:hover,
body.theme-light .nav.scrolled .nav__link.active {
  color: var(--clr-stone-dark);
}

.nav__link--cta {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--clr-stone);
  border-radius: var(--radius);
  color: var(--clr-stone-light);
}
.nav__link--cta:hover {
  background-color: var(--clr-stone);
  color: var(--clr-bg-dark);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(245,240,232,0.35);
  border-radius: var(--radius);
  color: rgba(245,240,232,0.78);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}
.theme-toggle:hover {
  border-color: var(--clr-stone);
  color: var(--clr-stone-light);
}
.theme-toggle__icon {
  position: relative;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.theme-toggle__icon::after {
  content: '';
  position: absolute;
  inset: 2px 0 2px 6px;
  background: currentColor;
  border-radius: 0 10px 10px 0;
}
body.theme-light .nav.scrolled .theme-toggle {
  border-color: rgba(42,35,24,0.2);
  color: rgba(42,35,24,0.72);
}
body.theme-light .nav.scrolled .theme-toggle:hover {
  border-color: var(--clr-stone-dark);
  color: var(--clr-stone-dark);
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
}
.nav__burger span {
  display: block;
  height: 1.5px;
  background: var(--clr-text-inv);
  border-radius: 2px;
  transition: var(--transition-fast);
}
body.theme-light .nav.scrolled .nav__burger span { background: var(--clr-text); }
.nav__burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
}
.hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  will-change: transform;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(14,12,10,0.78) 0%,
    rgba(14,12,10,0.5) 50%,
    rgba(14,12,10,0.3) 100%
  );
}
body.theme-light .hero__overlay {
  background: linear-gradient(
    135deg,
    rgba(245,240,232,0.82) 0%,
    rgba(245,240,232,0.62) 48%,
    rgba(245,240,232,0.3) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  text-align: center;
}

.hero__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-stone);
  margin-bottom: var(--sp-3);
}
body.theme-light .hero__label { color: var(--clr-stone-dark); }

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6.5vw, 5.9rem);
  font-weight: 500;
  line-height: 1.04;
  color: var(--clr-text-inv);
  letter-spacing: -0.045em;
  margin-bottom: var(--sp-4);
}
body.theme-light .hero__title { color: var(--clr-text); }

.hero__sub {
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  font-weight: 300;
  color: rgba(245,240,232,0.75);
  line-height: 1.65;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: var(--sp-6);
}
body.theme-light .hero__sub { color: rgba(42,35,24,0.76); }

.hero__actions {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  z-index: 1;
  color: rgba(245,240,232,0.5);
}
body.theme-light .hero__scroll { color: rgba(42,35,24,0.52); }
.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--clr-stone));
  animation: scrollLine 2s ease-in-out infinite;
}
.hero__scroll-text {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
@keyframes scrollLine {
  0%, 100% { opacity: 0.4; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ── About ───────────────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: center;
}

.about__image-wrap {
  position: relative;
}
.about__portrait {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-lg);
  filter: grayscale(15%);
}
.about__image-accent {
  position: absolute;
  inset: -16px -16px auto auto;
  width: 60%;
  height: 60%;
  border: 1px solid var(--clr-stone);
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0.4;
}

.about__role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-stone-dark);
  line-height: 1.8;
  margin-bottom: var(--sp-4);
}

.about__bio {
  font-size: 1.05rem;
  color: var(--clr-text-light);
  line-height: 1.8;
  margin-bottom: var(--sp-3);
}

.about__stats {
  display: flex;
  gap: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--clr-border);
  margin-top: var(--sp-4);
}
.about__stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.about__stat-num {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--clr-stone-dark);
  line-height: 1;
}
.about__stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-text-light);
}

/* ── Services ────────────────────────────────────────────── */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--clr-border-inv);
  border: 1px solid var(--clr-border-inv);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: var(--sp-8);
}

.service-card {
  background-color: var(--clr-bg-dark-2);
  padding: var(--sp-8) var(--sp-6);
  transition: background-color var(--transition-fast);
}
.service-card:hover {
  background-color: #241F1A;
}
body.theme-light .service-card:hover {
  background-color: #F5F0E8;
}

.service-card__icon {
  width: 48px;
  height: 48px;
  color: var(--clr-stone);
  margin-bottom: var(--sp-4);
}
.service-card__icon svg { width: 100%; height: 100%; }

.service-card__title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--clr-text-inv);
  margin-bottom: var(--sp-3);
  line-height: 1.2;
}

.service-card__desc {
  font-size: 0.925rem;
  color: var(--clr-text-muted);
  line-height: 1.75;
}

/* ── Projects ────────────────────────────────────────────── */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-8);
}

/* Featured spans full width */
.project-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 3fr 2fr;
}
.project-card--featured .project-card__img-wrap {
  aspect-ratio: 16/9;
}

/* Drawing card spans full width */
.project-card--drawing {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 2fr 3fr;
}
.project-card__img-wrap--drawing {
  background-color: #F8F5F0;
}
.project-card__img--drawing {
  object-fit: contain !important;
  padding: var(--sp-4);
}

.project-card {
  background-color: var(--clr-bg-dark-2);
  overflow: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.project-card__img-wrap {
  overflow: hidden;
  aspect-ratio: 4/3;
  flex-shrink: 0;
}
.project-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.project-card:hover .project-card__img { transform: scale(1.04); }

.project-card__body {
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
}

.project-card__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-stone);
}

.project-card__title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--clr-text-inv);
  line-height: 1.2;
  margin-top: 4px;
}

.project-card__location {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(245,240,232,0.4);
  margin-bottom: var(--sp-1);
}
body.theme-light .project-card__location { color: rgba(42,35,24,0.48); }

.project-card__desc {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  line-height: 1.7;
}

/* ── Experience / Timeline ───────────────────────────────── */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: var(--sp-8);
  margin-top: var(--sp-8);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--clr-border-inv);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--sp-8);
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute;
  left: calc(-1 * var(--sp-8) - 5px);
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: var(--clr-stone);
  border: 2px solid var(--clr-bg-dark);
  box-shadow: 0 0 0 4px rgba(200,169,110,0.15);
}

.timeline__period {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-stone);
  display: block;
  margin-bottom: var(--sp-1);
}

.timeline__role {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--clr-text-inv);
  line-height: 1.2;
  margin-bottom: 4px;
}

.timeline__org {
  font-size: 0.9rem;
  color: rgba(245,240,232,0.65);
}
body.theme-light .timeline__org { color: rgba(42,35,24,0.66); }

.timeline__place {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(245,240,232,0.35);
  margin-top: 4px;
}
body.theme-light .timeline__place { color: rgba(42,35,24,0.46); }

/* ── Contact ─────────────────────────────────────────────── */
.contact {
  position: relative;
  padding-block: var(--sp-20);
  overflow: hidden;
}

.contact__bg {
  position: absolute;
  inset: 0;
}
.contact__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.35);
}
body.theme-light .contact__bg-img { filter: brightness(0.9) saturate(0.9); }
.contact__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,12,10,0.85) 0%, rgba(14,12,10,0.6) 100%);
}
body.theme-light .contact__overlay {
  background: linear-gradient(135deg, rgba(245,240,232,0.88) 0%, rgba(245,240,232,0.68) 100%);
}

.contact__container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  align-items: start;
}

.contact__text {
  font-size: 1.05rem;
  color: rgba(245,240,232,0.75);
  line-height: 1.75;
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-6);
}
body.theme-light .contact__text { color: rgba(42,35,24,0.72); }

.contact__details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.contact__detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact__detail-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-stone);
}
.contact__detail-value {
  font-size: 0.975rem;
  color: var(--clr-text-inv);
  transition: color var(--transition-fast);
}
body.theme-light .contact__detail-value { color: var(--clr-text); }
a.contact__detail-value:hover { color: var(--clr-stone-light); }

/* ── Contact Form ────────────────────────────────────────── */
.contact-form {
  background: rgba(245,240,232,0.06);
  border: 1px solid var(--clr-border-inv);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
body.theme-light .contact-form {
  background: rgba(255,253,248,0.72);
  border-color: rgba(42,35,24,0.16);
}

.contact-form__honeypot { display: none !important; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.6);
}
body.theme-light .form-label { color: rgba(42,35,24,0.62); }
.required { color: var(--clr-stone); }

.form-input {
  background: rgba(245,240,232,0.06);
  border: 1px solid var(--clr-border-inv);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--clr-text-inv);
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  width: 100%;
}
body.theme-light .form-input {
  background: rgba(255,255,255,0.65);
  border-color: rgba(42,35,24,0.16);
  color: var(--clr-text);
}
body.theme-light .form-input::placeholder { color: rgba(42,35,24,0.36); }
.form-input::placeholder { color: rgba(245,240,232,0.25); }
.form-input:focus {
  border-color: var(--clr-stone);
  background: rgba(245,240,232,0.09);
}
.form-input.invalid { border-color: #C06060; }

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 8 7-8' stroke='%23C8A96E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  cursor: pointer;
}
.form-select option {
  background-color: var(--clr-bg-dark-2);
  color: var(--clr-text-inv);
}

.form-textarea { resize: vertical; min-height: 140px; }

.form-error {
  font-size: 0.75rem;
  color: #C06060;
  min-height: 1em;
}

.btn--submit {
  align-self: flex-start;
  position: relative;
  overflow: hidden;
}
.btn__loading { display: none; }
.btn--submit.loading .btn__text { display: none; }
.btn--submit.loading .btn__loading { display: inline; }
.btn--submit:disabled { opacity: 0.6; cursor: not-allowed; }

.form-success {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid rgba(100,180,100,0.4);
  border-radius: var(--radius);
  background: rgba(100,180,100,0.08);
  color: #90C890;
  font-size: 0.9rem;
}
.form-success.visible { display: flex; }
.form-success__icon { width: 24px; height: 24px; flex-shrink: 0; }

.form-error-msg {
  display: none;
  padding: var(--sp-3);
  border: 1px solid rgba(192,96,96,0.4);
  border-radius: var(--radius);
  background: rgba(192,96,96,0.08);
  color: #E08080;
  font-size: 0.85rem;
}
.form-error-msg.visible { display: block; }
.form-error-msg a { color: var(--clr-stone-light); text-decoration: underline; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background-color: var(--clr-bg-dark);
  border-top: 1px solid var(--clr-border-inv);
  padding-block: var(--sp-8);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  border: 1px solid rgba(200,169,110,0.3);
  border-radius: var(--radius-lg);
  background: rgba(245,240,232,0.94);
  box-shadow: 0 10px 32px rgba(0,0,0,0.22);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.footer__logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}
.footer__logo:hover {
  background: var(--clr-bg);
  border-color: rgba(200,169,110,0.65);
  box-shadow: 0 12px 36px rgba(0,0,0,0.28);
}
.footer__logo-text { display: flex; flex-direction: column; }
.footer__logo-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--clr-text);
  line-height: 1.2;
}
.footer__logo-sub {
  font-size: 0.7rem;
  color: var(--clr-text-light);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.footer__nav {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.footer__nav a {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.4);
  transition: color var(--transition-fast);
}
body.theme-light .footer__nav a { color: rgba(42,35,24,0.48); }
.footer__nav a:hover { color: var(--clr-stone-light); }
body.theme-light .footer__nav a:hover { color: var(--clr-stone-dark); }

.footer__copy {
  font-size: 0.75rem;
  color: rgba(245,240,232,0.25);
  font-family: var(--font-mono);
}
body.theme-light .footer__copy { color: rgba(42,35,24,0.38); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nav__links { gap: var(--sp-2); }

  .services__grid { grid-template-columns: 1fr; }
  .service-card { padding: var(--sp-6) var(--sp-4); }

  .projects__grid { grid-template-columns: 1fr; }
  .project-card--featured,
  .project-card--drawing {
    grid-column: 1;
    display: flex;
    flex-direction: column;
  }

  .contact__container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 68px; }

  .nav__logo-img {
    width: 42px;
    height: 42px;
  }
  .nav__logo-text { font-size: 1.35rem; }

  /* Nav mobile */
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 0;
    background: rgba(14,12,10,0.97);
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-6);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    pointer-events: none;
  }
  body.theme-light .nav.scrolled .nav__links,
  body.theme-light .nav__links {
    background: rgba(245,240,232,0.98);
  }
  body.theme-light .nav__links .nav__link,
  body.theme-light .nav__links .theme-toggle {
    color: rgba(42,35,24,0.76);
  }
  .nav__links.open {
    transform: translateX(0);
    pointer-events: auto;
  }
  .nav__link { font-size: 1rem; letter-spacing: 0.08em; }
  .nav__link--cta { padding: 0.75rem 2rem; }

  /* About */
  .about__grid { grid-template-columns: 1fr; gap: var(--sp-8); }
  .about__image-col { max-width: 380px; margin-inline: auto; }
  .about__portrait { aspect-ratio: 1/1; }

  /* Hero */
  .hero__title { font-size: clamp(2.8rem, 12vw, 5rem); }
  .hero__actions { flex-direction: column; align-items: center; }

  /* Projects */
  .project-card--featured .project-card__img-wrap { aspect-ratio: 4/3; }

  /* Timeline */
  .timeline { padding-left: var(--sp-4); }
  .timeline__marker { left: calc(-1 * var(--sp-4) - 5px); }

  /* Form */
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer__inner { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .footer__nav { display: none; }

  /* About stats */
  .about__stats { gap: var(--sp-4); }

  /* Sections */
  .section { padding-block: var(--sp-12); }
  .contact { padding-block: var(--sp-16); }
}

@media (max-width: 480px) {
  .container, .container-wide { padding-inline: var(--sp-3); }
  .contact-form { padding: var(--sp-4); }
  .about__stats { flex-wrap: wrap; }
}

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

/* ═══════════════════════════════════════════════════════════
   ITERATION 2–3 ADDITIONS
   ═══════════════════════════════════════════════════════════ */

/* ── Hero: architectural grid overlay ────────────────────── */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,169,110,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,169,110,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  z-index: 1;
  pointer-events: none;
}
.hero__content { z-index: 2; }
.hero__scroll   { z-index: 2; }

/* ── Services: 2×2 grid for 4 cards ─────────────────────── */
.services__grid {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 768px) {
  .services__grid { grid-template-columns: 1fr; }
}

/* ── Manifesto Strip ─────────────────────────────────────── */
.manifesto {
  background-color: var(--clr-bg-dark);
  padding-block: var(--sp-12);
  border-top: 1px solid var(--clr-border-inv);
  border-bottom: 1px solid var(--clr-border-inv);
}

.manifesto__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.manifesto__rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--clr-stone), transparent);
  opacity: 0.4;
}

.manifesto__quote {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  font-style: normal;
  color: rgba(245,240,232,0.75);
  text-align: center;
  line-height: 1.55;
  flex-shrink: 0;
  max-width: 660px;
  letter-spacing: 0.01em;
}
body.theme-light .manifesto__quote { color: rgba(42,35,24,0.74); }
.manifesto__quote em {
  color: var(--clr-stone-light);
  font-style: italic;
}

@media (max-width: 768px) {
  .manifesto__inner { flex-direction: column; gap: var(--sp-4); }
  .manifesto__rule  { width: 80px; flex: none; }
}

/* ── About: Expertise Tags ───────────────────────────────── */
.about__expertise {
  margin-bottom: var(--sp-6);
}

.about__expertise-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-stone-dark);
  margin-bottom: var(--sp-2);
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--clr-border);
  border-radius: 2px;
  color: var(--clr-text-light);
  background-color: transparent;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.tag:hover {
  border-color: var(--clr-stone);
  color: var(--clr-stone-dark);
}

/* ── QANTARA Identity Section ────────────────────────────── */
.identity {
  background-color: var(--clr-bg);
  border-top: 1px solid var(--clr-border);
}

.identity__grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--sp-16);
  align-items: start;
}

/* Arabic column */
.identity__arabic-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: var(--sp-4);
}

.identity__arch-wrap {
  width: 120px;
  height: 150px;
  color: var(--clr-stone);
  margin-bottom: var(--sp-4);
  opacity: 0.5;
}
.identity__arch-svg { width: 100%; height: 100%; }

.identity__arabic {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 300;
  line-height: 1;
  color: var(--clr-text);
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-2);
  direction: rtl;
}

.identity__transliteration {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--clr-stone-dark);
  margin-bottom: var(--sp-4);
}

.identity__etymology {
  font-size: 0.875rem;
  color: var(--clr-text-light);
  line-height: 2;
  border-top: 1px solid var(--clr-border);
  padding-top: var(--sp-4);
}
.identity__etymology em { color: var(--clr-stone-dark); font-style: italic; }

/* Content column */
.identity__body {
  font-size: 1.05rem;
  color: var(--clr-text-light);
  line-height: 1.85;
  margin-bottom: var(--sp-4);
}

.identity__values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--clr-border);
  margin-top: var(--sp-2);
}

.identity__value {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.identity__value-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--clr-text);
  line-height: 1.2;
}

.identity__value-desc {
  font-size: 0.825rem;
  color: var(--clr-text-light);
  line-height: 1.7;
}

/* Identity section title italic */
.identity .section__title em {
  color: var(--clr-stone-dark);
  font-style: italic;
}

/* ── Counter animation ───────────────────────────────────── */
.about__stat-num[data-target] {
  display: inline-block;
  transition: none;
}

/* ── Identity responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  .identity__grid { grid-template-columns: 1fr; gap: var(--sp-8); }
  .identity__arabic-col {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-6);
    text-align: left;
    border-bottom: 1px solid var(--clr-border);
    padding-bottom: var(--sp-6);
  }
  .identity__arch-wrap { flex-shrink: 0; }
  .identity__etymology { border-top: none; padding-top: 0; }
  .identity__values { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .identity__arabic-col { flex-direction: column; text-align: center; }
  .identity__values { grid-template-columns: 1fr; gap: var(--sp-4); }
  /* Compact the arch SVG on mobile so it doesn't dominate */
  .identity__arch-wrap { width: 72px; height: 90px; margin-bottom: var(--sp-2); }
  .identity__arabic { font-size: clamp(2.8rem, 10vw, 4rem); }
}

/* ═══════════════════════════════════════════════════════════
   VISUAL AUDIT FIXES
   ═══════════════════════════════════════════════════════════ */

/* ── Fix 1: Featured & Drawing cards ─────────────────────────
   .project-card--featured / --drawing set display:grid BEFORE
   .project-card sets display:flex — same specificity so flex
   wins by cascade order. Double-class selector fixes it.    */
.project-card.project-card--featured,
.project-card.project-card--drawing {
  display: grid;
}

/* ── Fix 2: 6-column projects grid ───────────────────────────
   • featured & drawing: grid-column: 1/-1 (already set = full)
   • 2 regular cards:    span 3 each  →  50 / 50 row
   • 3 SM cards:         span 2 each  →  33 / 33 / 33 row     */
.projects__grid {
  grid-template-columns: repeat(6, 1fr);
}
.projects__grid > .project-card:not(.project-card--featured):not(.project-card--sm):not(.project-card--drawing) {
  grid-column: span 3;
}
.project-card--sm {
  grid-column: span 2;
}
/* Reset to single column at tablet/mobile — must come AFTER our 6-col
   declaration above to win the cascade, since we're appending to the file */
@media (max-width: 1024px) {
  .projects__grid {
    grid-template-columns: 1fr;
  }
  .project-card.project-card--featured,
  .project-card.project-card--drawing {
    display: flex;
    flex-direction: column;
  }
  .projects__grid > .project-card:not(.project-card--featured):not(.project-card--sm):not(.project-card--drawing),
  .project-card--sm {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .project-card__body {
    padding: var(--sp-4);
  }
  .project-card__desc {
    font-size: 0.95rem;
    line-height: 1.65;
  }
}

/* ── Fix 3: About stats — always 3 equal columns ─────────── */
.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
