/* =====================================================================
   MahyarParts Proposal — Document CSS
   Monochrome: #000 / #fff / #525252 only
   RTL, dense, editorial — like a premium PDF on screen
   ===================================================================== */

/* --- Fonts --- */
@font-face {
  font-family: 'Amiri';
  src: url('fonts/amiri/Amiri-1.000/Amiri-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Amiri';
  src: url('fonts/amiri/Amiri-1.000/Amiri-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/vazirmatn/fonts/webfonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/vazirmatn/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/vazirmatn/fonts/webfonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/vazirmatn/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0 !important;
}

/* --- Root Variables --- */
:root {
  --black: #000000;
  --white: #ffffff;
  --gray: #525252;
  --gray-light: #f5f5f5;
  --gray-border: #d0d0d0;
  --rule-thick: 4px;
  --rule-thin: 1px;
  --page-max: 860px;
  --col-pad: clamp(20px, 4vw, 48px);
  --section-gap: 52px;
  --line-height-body: 1.9;
}

/* --- Base --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: var(--line-height-body);
  color: var(--black);
  background-color: var(--white);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  /* Subtle paper texture via fine grid */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(0,0,0,0.022) 27px,
      rgba(0,0,0,0.022) 28px
    );
}

::selection {
  background: var(--black);
  color: var(--white);
}

a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: none;
}

/* --- Page Wrapper --- */
.page-wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--col-pad);
}

/* =====================================================================
   HEADER
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: var(--rule-thick) solid var(--black);
  padding: 10px 0;
}

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

.header-brand {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--black);
  text-decoration: none;
}

.header-label {
  font-size: 0.75rem;
  color: var(--gray);
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* =====================================================================
   TITLE BLOCK
   ===================================================================== */
.title-block {
  padding: 48px 0 36px;
  border-bottom: var(--rule-thick) solid var(--black);
}

.title-block h1 {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--black);
}

.title-block .subtitle {
  font-size: 0.95rem;
  color: var(--gray);
  margin-bottom: 28px;
  line-height: 1.5;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--black);
  border-right: none;
}

.meta-item {
  padding: 8px 20px;
  font-size: 0.8rem;
  line-height: 1.4;
  border-right: 1px solid var(--black);
  color: var(--black);
}

.meta-item strong {
  font-weight: 600;
}

/* =====================================================================
   DOCUMENT BODY
   ===================================================================== */
.doc-body {
  padding-top: 0;
  padding-bottom: 80px;
}

/* =====================================================================
   SECTIONS
   ===================================================================== */
.doc-section {
  padding: var(--section-gap) 0;
  border-bottom: var(--rule-thick) solid var(--black);
}

.doc-section:last-child {
  border-bottom: none;
}

/* Section header row */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--black);
  padding-bottom: 10px;
}

.section-num {
  font-family: 'Amiri', serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gray);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-title {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  line-height: 1.3;
  color: var(--black);
}

/* =====================================================================
   TYPOGRAPHY — BODY TEXT
   ===================================================================== */
.doc-body p {
  margin-bottom: 1.1em;
  line-height: var(--line-height-body);
}

.doc-body p:last-child {
  margin-bottom: 0;
}

/* =====================================================================
   INVERTED CARD
   ===================================================================== */
.inverted-card {
  background: var(--black);
  color: var(--white);
  padding: 28px 32px;
  margin: 28px 0;
  border-right: 6px solid var(--black);
}

.inverted-card p {
  color: rgba(255,255,255,0.88);
  line-height: 2;
  margin-bottom: 0;
}

/* =====================================================================
   PROCESS / TIMELINE
   ===================================================================== */
.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: process-counter;
}

.process-item {
  counter-increment: process-counter;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  align-items: start;
}

.process-item:last-child {
  border-bottom: none;
}

.process-num {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1.6;
  text-align: center;
  border: 2px solid var(--black);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.process-content strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.process-content span {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.7;
}

/* =====================================================================
   FEATURE LIST WITH DETAILS
   ===================================================================== */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.feature-item {
  border-top: 1px solid rgba(0,0,0,0.1);
  padding: 0;
}

.feature-item:last-child {
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.feature-summary-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 14px;
  padding: 16px 0;
  align-items: start;
}

.feature-bullet {
  color: var(--black);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.7;
  flex-shrink: 0;
}

.feature-text strong {
  font-weight: 700;
  display: block;
  margin-bottom: 3px;
  font-size: 0.95rem;
}

.feature-text span {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.75;
}

/* details/summary for technical details */
.tech-details {
  margin-top: 6px;
  border: none;
}

.tech-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--black);
  font-weight: 700;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  user-select: none;
  background: var(--gray-light);
  border: 1px solid var(--gray-border);
}

.tech-details summary::-webkit-details-marker { display: none; }

.tech-details summary::before {
  content: '▼';
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  display: inline-block;
  transform: rotate(90deg);
}

.tech-details[open] summary::before {
  transform: rotate(0deg);
}

.tech-details-body {
  background: var(--gray-light);
  padding: 14px 18px;
  margin-top: 10px;
  border-right: 3px solid var(--black);
  font-size: 0.875rem;
  color: #333;
  line-height: 1.85;
}

/* =====================================================================
   TECH STACK (details sections)
   ===================================================================== */
.tech-stack {
  margin-top: 12px;
}

.tech-entry {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.tech-entry:first-child {
  border-top: 1px solid rgba(0,0,0,0.08);
}

.tech-entry details {
  padding: 14px 0;
}

.tech-entry details summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  user-select: none;
}

.tech-entry details summary::-webkit-details-marker { display: none; }

.tech-entry-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--black);
}

.tech-entry-value {
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 2px;
}

.tech-expand-hint {
  font-size: 0.8rem;
  color: var(--black);
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-light);
  padding: 6px 12px;
  border: 1px solid var(--gray-border);
}

.tech-expand-hint::before {
  content: '▼';
  font-size: 0.75rem;
  transition: transform 0.2s;
  transform: rotate(90deg);
}

.tech-entry details[open] .tech-expand-hint::before {
  transform: rotate(0deg);
}

.tech-entry details[open] .tech-expand-hint {
  opacity: 0;
}

.tech-entry-detail {
  background: var(--gray-light);
  border-right: 3px solid var(--black);
  padding: 14px 18px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: #333;
  line-height: 1.85;
}

/* =====================================================================
   CALLOUT BOX
   ===================================================================== */
.callout-box {
  border: 2px solid var(--black);
  border-right: 6px solid var(--black);
  padding: 20px 24px;
  margin: 24px 0;
}

.callout-box.callout-note {
  border-color: var(--gray-border);
  border-right-color: var(--gray);
}

.callout-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-title::before {
  content: '⚠';
  font-size: 0.9rem;
}

.callout-box.callout-ai .callout-title::before {
  content: '◈';
}

.callout-box p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.8;
  margin-bottom: 0;
}

/* =====================================================================
   PRICING TIERS
   ===================================================================== */
.pricing-tier {
  border: 2px solid var(--black);
  margin-bottom: -2px;
  position: relative;
}

.pricing-tier-header {
  background: var(--black);
  color: var(--white);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-tier-title {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.pricing-tier-price {
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  direction: ltr;
  white-space: nowrap;
}

.pricing-tier-body {
  padding: 24px 28px;
}

.pricing-deliverables {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.pricing-deliverables li {
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-size: 0.9rem;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.6;
}

.pricing-deliverables li:last-child {
  border-bottom: none;
}

.pricing-deliverables li::before {
  content: '✓';
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 2px;
}

.pricing-justification {
  font-size: 0.875rem;
  color: var(--gray);
  line-height: 1.8;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: 14px;
  margin-top: 4px;
}

.pricing-payment {
  margin-top: 24px;
  background: var(--gray-light);
  padding: 16px 20px;
  font-size: 0.875rem;
  line-height: 1.9;
  border-right: 4px solid var(--black);
}

.pricing-payment strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

/* =====================================================================
   PORTFOLIO / TEAM
   ===================================================================== */
.portfolio-entry {
  padding: 28px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.portfolio-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.portfolio-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.portfolio-num {
  font-family: 'Amiri', serif;
  font-size: 0.8rem;
  color: var(--gray);
  flex-shrink: 0;
}

.portfolio-name {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--black);
}

.portfolio-link {
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 400;
}

.portfolio-desc {
  font-size: 0.9rem;
  line-height: 1.85;
  color: #222;
  margin-bottom: 16px;
}

/* Image Placeholder */
.img-placeholder {
  background: var(--gray-light);
  border: 2px dashed var(--black);
  padding: 28px 24px;
  text-align: center;
  margin: 14px 0;
}

.img-placeholder-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
  opacity: 0.4;
  display: block;
}

.img-placeholder-text {
  font-size: 0.8rem;
  color: var(--gray);
  line-height: 1.6;
}

.img-placeholder-label {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray);
  border: 1px solid var(--gray-border);
  padding: 2px 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Portfolio Images */
.portfolio-img-wrap {
  margin: 20px 0;
  text-align: center;
}

.portfolio-img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--gray-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: block;
  margin: 0 auto;
}

/* =====================================================================
   CLOSING SECTION
   ===================================================================== */
.closing-para {
  font-size: 0.95rem;
  line-height: 2;
  color: #1a1a1a;
  margin-bottom: 24px;
}

.confidentiality-note {
  font-size: 0.78rem;
  color: var(--gray);
  text-align: center;
  padding: 16px;
  border-top: 1px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
  font-style: italic;
  line-height: 1.7;
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
  border-top: var(--rule-thick) solid var(--black);
  padding: 18px 0;
  margin-top: 0;
}

.site-footer .page-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-brand {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: 0.95rem;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--gray);
}

/* =====================================================================
   SECTION INTRO TEXT
   ===================================================================== */
.section-intro {
  font-size: 0.95rem;
  line-height: var(--line-height-body);
  margin-bottom: 20px;
  color: #1a1a1a;
}

/* =====================================================================
   UTILITY
   ===================================================================== */
.spacer-sm { height: 12px; }
.spacer-md { height: 24px; }

/* =====================================================================
   ANIMATIONS — fast, no bounce
   ===================================================================== */
.anim-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.anim-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 600px) {
  .meta-row {
    flex-direction: column;
  }
  .meta-item {
    border-right: none;
    border-top: 1px solid var(--black);
  }
  .meta-item:first-child {
    border-top: none;
  }
  .pricing-tier-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-header .page-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .portfolio-header {
    flex-direction: column;
    gap: 4px;
  }
}

/* =====================================================================
   PRINT
   ===================================================================== */
@media print {
  .site-header { position: static; }
  .anim-in { opacity: 1; transform: none; }
  body { background-image: none; }
  .tech-details-body, .tech-entry-detail { display: block !important; }
  details { display: block; }
  details summary::before { display: none; }
}
