/* ============================================================
   Behnaz Ghanbari — Architecture Studio
   Design system: warm minimalist, architectural, RTL
   ============================================================ */

:root {
  --ink: #1c1a17;
  --ink-soft: #3a362f;
  --paper: #f7f4ee;
  --paper-alt: #efeae0;
  --accent: #a9743d;
  --accent-dark: #8a5d2e;
  --line: #ddd6c7;
  --line-strong: #c9bfa8;
  --muted: #7a7468;
  --white: #ffffff;
  --radius: 2px;
  --container: 1180px;
  --serif: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
}

body {
  min-height: 100vh;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  background-attachment: fixed;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.25; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { color: var(--ink-soft); margin: 0 0 1em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  letter-spacing: .18em;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--accent);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand .name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.brand .role {
  font-size: .72rem;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}
.main-nav a {
  font-size: .93rem;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
}
.main-nav a:hover,
.main-nav a.active { color: var(--accent-dark); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0; left: 0;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: .92rem;
  letter-spacing: .03em;
  cursor: pointer;
  transition: all .2s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-soft);
}
.btn.outline:hover { background: var(--ink); color: var(--paper); }
.btn.small { padding: 9px 18px; font-size: .82rem; }
.btn.danger { border-color: #9a3324; background: #9a3324; }
.btn.danger:hover { background: #7a2318; border-color: #7a2318; }

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 60px;
  align-items: center;
}
.hero h1 { margin-bottom: 22px; }
.hero .lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-figure {
  position: relative;
  aspect-ratio: 4/5;
  border: 1px solid var(--line-strong);
  background: var(--paper-alt);
  overflow: hidden;
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-figure .blueprint { position: absolute; inset: 0; }
.hero-figure .frame-index {
  position: absolute;
  top: 16px; left: 16px;
  font-size: .7rem;
  letter-spacing: .2em;
  color: var(--accent-dark);
  background: rgba(247,244,238,.9);
  padding: 5px 10px;
  border: 1px solid var(--line);
}

/* ---------- Sections ---------- */
section.block { padding: 78px 0; }
section.block.alt { background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .desc { color: var(--muted); max-width: 50ch; margin: 8px 0 0; }

/* ---------- Project grid ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
}
.project-card {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
}
.project-card .thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, var(--paper-alt), #e4ddcd);
}
.project-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease, filter .5s ease;
  filter: grayscale(.35);
}
.project-card:hover .thumb img { transform: scale(1.06); filter: grayscale(0); }
.project-card .num {
  position: absolute; top: 12px; right: 12px;
  font-size: .72rem; letter-spacing: .15em;
  color: var(--accent-dark);
  background: rgba(247,244,238,.92);
  padding: 4px 9px;
  border: 1px solid var(--line);
}
.project-card .body { padding: 22px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.project-card .cat {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-dark); margin-bottom: 8px; font-weight: 700;
}
.project-card h3 { margin-bottom: 8px; font-size: 1.18rem; }
.project-card p { font-size: .92rem; margin-bottom: 14px; }
.project-card .meta {
  margin-top: auto;
  display: flex; gap: 14px; font-size: .8rem; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 12px;
}
.project-card .more { color: var(--accent-dark); font-size: .85rem; font-weight: 700; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.filters a {
  padding: 8px 18px; border: 1px solid var(--line-strong); font-size: .85rem; color: var(--ink-soft);
}
.filters a.active, .filters a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* svg placeholder plan sketch */
.plan-sketch { width: 100%; height: 100%; }
.plan-sketch line, .plan-sketch rect, .plan-sketch circle, .plan-sketch path {
  stroke: var(--line-strong); fill: none; stroke-width: 1;
}

/* ---------- Project details ---------- */
.project-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 50px;
}
.project-hero .cover {
  aspect-ratio: 16/8;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  margin-bottom: 34px;
  background: var(--paper-alt);
}
.project-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.project-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.project-facts .fact .label { font-size: .72rem; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.project-facts .fact .value { font-size: 1.05rem; font-weight: 700; }

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  margin-top: 20px;
}
.project-gallery figure {
  margin: 0; aspect-ratio: 4/3; overflow: hidden; background: var(--paper-alt);
}
.project-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Article grid ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
}
.article-card {
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.article-card .thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--paper-alt), #e4ddcd);
}
.article-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease, filter .5s ease;
  filter: grayscale(.35);
}
.article-card:hover .thumb img { transform: scale(1.06); filter: grayscale(0); }
.article-card .body { padding: 22px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.article-card .cat {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-dark); margin-bottom: 8px; font-weight: 700;
}
.article-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.article-card p { font-size: .9rem; margin-bottom: 14px; }
.article-card .meta {
  margin-top: auto;
  font-size: .8rem; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 10px;
}
.article-card .more { color: var(--accent-dark); font-size: .85rem; font-weight: 700; }

/* ---------- Certificates ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.cert-card {
  display: flex; gap: 20px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
}
.cert-card .icon {
  flex: none;
  width: 56px; height: 56px;
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.cert-badge-svg { width: 38px; height: 38px; }
.cert-badge-svg line, .cert-badge-svg circle, .cert-badge-svg path {
  stroke: var(--line-strong); fill: none; stroke-width: 1;
}
.cert-card .thumb-img { width: 90px; height: 90px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.cert-card h3 { margin-bottom: 6px; font-size: 1.05rem; }
.cert-card .org { font-size: .85rem; color: var(--accent-dark); margin-bottom: 6px; }
.cert-card .year { font-size: .8rem; color: var(--muted); }
.cert-card p { font-size: .9rem; margin: 8px 0 0; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 60px;
  align-items: start;
}
.about-photo {
  aspect-ratio: 3/4;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: var(--paper-alt);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 26px;
}
.about-stats .stat .n { font-size: 1.8rem; font-weight: 700; color: var(--accent-dark); }
.about-stats .stat .l { font-size: .8rem; color: var(--muted); letter-spacing: .05em; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
}
.contact-info .item { margin-bottom: 26px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.contact-info .item .k { font-size: .74rem; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.contact-info .item .v { font-size: 1.05rem; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .85rem; margin-bottom: 8px; color: var(--ink-soft); font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 130px; }
.text-danger { color: #9a3324; font-size: .8rem; }
.alert {
  padding: 16px 18px; border: 1px solid var(--accent); background: #fbf1e4; color: var(--accent-dark);
  margin-bottom: 24px; font-size: .92rem;
}
.alert.error { border-color: #9a3324; background: #fbeae7; color: #9a3324; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 50px 0 30px;
  margin-top: 40px;
}
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-bottom: 30px; }
.footer-note { font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 20px; flex-wrap: wrap; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .project-grid, .article-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: 1fr; }
  .project-facts { grid-template-columns: repeat(2, 1fr); }
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 900px) {
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 84px; right: 0; left: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 20px 28px;
    gap: 16px;
  }
}
@media (max-width: 640px) {
  .project-grid, .article-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .project-gallery { grid-template-columns: 1fr; }
}
