/* کوکارو — یک فایل CSS، بدون فریم‌ورک و بدون build */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --c-bg: #ffffff;
  --c-soft: #f6f7f1;
  --c-ink: #17180f;
  --c-text: #3d3e35;
  --c-muted: #707164;
  --c-line: #e5e7dc;
  --c-olive: #3b461e;       /* پنل عکس و بخش‌های تیره */
  --c-olive-2: #5a5628;     /* دکمه‌ی اصلی */
  --c-olive-3: #6e8233;
  --c-accent: #9cb654;      /* سبز روشن خوشنویسی */
  --c-accent-soft: #eef3df;
  --c-dark: #111111;
  --c-ok: #2f6b2f;
  --c-error: #a3271f;
  --radius: 10px;
  --wrap: 1180px;
  --gutter: 20px;
  --shadow: 0 1px 2px rgb(23 24 15 / 6%), 0 8px 24px rgb(23 24 15 / 6%);
}

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

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: 400 16px/1.9 "Vazirmatn", Tahoma, sans-serif;
  font-feature-settings: "ss01";
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-olive-2); text-underline-offset: 3px; }
a:hover { color: var(--c-olive); }
h1, h2, h3 { color: var(--c-ink); line-height: 1.45; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }

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

.skip { position: absolute; inset-inline-start: -999px; top: 8px; z-index: 50; background: var(--c-dark); color: #fff; padding: 8px 14px; border-radius: 6px; }
.skip:focus { inset-inline-start: 8px; }

/* ---------- buttons, chips ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border: 1.5px solid transparent; border-radius: 4px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-sm { min-height: 40px; padding: 0 20px; font-size: .92rem; }
.btn-olive { background: var(--c-olive-2); color: #fff; }
.btn-olive:hover { background: var(--c-olive); color: #fff; }
.btn-outline { border-color: var(--c-olive-2); color: var(--c-olive-2); background: transparent; }
.btn-outline:hover { background: var(--c-olive-2); color: #fff; }
.btn-dark { background: var(--c-dark); color: #fff; }
.btn-dark:hover { background: var(--c-olive); color: #fff; }
.btn-light { background: #fff; color: var(--c-olive); }
.btn-light:hover { background: var(--c-accent); color: var(--c-ink); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 18px 0 0; padding: 0; }
.chips li {
  padding: 3px 12px; border-radius: 999px; background: var(--c-accent-soft); color: var(--c-olive);
  font-size: .85rem; font-weight: 600; direction: ltr; unicode-bidi: isolate;
}
.chips-sm li { font-size: .78rem; padding: 2px 10px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-progress { background: #fff4d6; color: #7a5800; }

.eyebrow { margin: 0 0 .6em; color: var(--c-olive-3); font-size: .95rem; font-weight: 700; letter-spacing: 0; }

.lead { font-size: 1.12rem; color: var(--c-muted); max-width: 46rem; }

/* ---------- header ---------- */

.site-header { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / 92%); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-ink); font-weight: 800; font-size: 1.2rem; }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--c-olive); color: var(--c-accent); font-size: 1.25rem; line-height: 1; }
.logo-light { color: #fff; }
.logo-light:hover { color: #fff; }

/* mobile menu without JavaScript: a hidden checkbox and its label */
.menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.menu-button { display: none; }
.menu nav { display: flex; align-items: center; gap: 28px; }
.menu ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.menu ul a { color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: .97rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.menu ul a:hover, .menu ul a[aria-current] { border-bottom-color: var(--c-accent); color: var(--c-ink); }

@media (max-width: 860px) {
  .menu-button {
    display: grid; gap: 5px; place-content: center; width: 44px; height: 44px; cursor: pointer;
    border-radius: 8px; border: 1px solid var(--c-line);
  }
  .menu-button span { display: block; width: 20px; height: 2px; background: var(--c-ink); border-radius: 2px; }
  .menu-toggle:focus-visible + .menu-button { outline: 3px solid var(--c-accent); outline-offset: 2px; }
  .menu nav {
    display: none;
    position: absolute; inset-inline: 0; top: 72px; flex-direction: column; align-items: stretch; gap: 14px;
    padding: 16px var(--gutter) 22px; background: #fff; border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow);
  }
  .menu-toggle:checked ~ nav { display: flex; }
  .menu ul { flex-direction: column; gap: 0; }
  .menu ul a { display: block; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
}

/* ---------- breadcrumbs ---------- */

.breadcrumbs { padding-top: 18px; font-size: .85rem; color: var(--c-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "‹"; margin-inline-end: 6px; color: var(--c-line); }
.breadcrumbs a { color: var(--c-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-olive-2); }

/* ---------- hero ---------- */

/* home: one full-screen section, photo + menu on the green panel, text beside it */
.hero { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.hero-photo { position: relative; background: var(--c-olive); display: flex; flex-direction: column; overflow: hidden; }
.hero-portrait { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 680px; margin-inline: auto; object-fit: cover; object-position: top center; }
.hero-text { padding: clamp(32px, 5vw, 72px) clamp(20px, 6vw, 110px); align-self: center; max-width: 860px; }
.hero-headline { width: min(100%, 640px); margin: 12px 0 30px; }
.hero-text p { color: var(--c-muted); font-size: 1.04rem; margin-bottom: .4em; }
.tech { margin-top: 40px; }

.hero-nav { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px clamp(20px, 3vw, 40px) 16px; }
.hero-nav ul { display: flex; flex-wrap: wrap; gap: 4px 28px; list-style: none; margin: 0; padding: 0; }
.hero-nav ul a { color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem; border-bottom: 2px solid transparent; padding: 4px 0; }
.hero-nav ul a:hover { border-bottom-color: var(--c-accent); color: #fff; }
.hero-nav .btn-dark:hover { background: var(--c-accent); color: var(--c-ink); }
.menu-button-light { border-color: rgb(255 255 255 / 30%) !important; }
.menu-button-light span { background: #fff !important; }

@media (max-width: 1100px) and (min-width: 861px) {
  .hero-nav { flex-direction: column; align-items: stretch; }
  .hero-nav .btn { align-self: flex-start; }
}

.hero-nav > .hero-slogan { display: none; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  /* mobile: the whole portrait, shoulder to shoulder; the slogan sits small and white in the menu row */
  .hero-photo { height: auto; }
  .hero-portrait { flex: none; width: 100%; max-width: none; height: auto; object-fit: initial; }
  .hero-nav { gap: 12px; }
  .hero-nav .btn, .hero-nav .menu-button { flex: 0 0 auto; white-space: nowrap; }
  .hero-nav > .hero-slogan {
    display: block; flex: 1 1 auto; min-width: 0; width: auto; max-width: 180px; height: auto; margin: 0 auto;
    filter: brightness(0) invert(1); /* the dark calligraphy turns white */
  }
  .hero-text .hero-headline { display: none; }
  .hero-nav { padding: 14px var(--gutter); }
  .hero-nav .menu-button { display: grid; }
  .hero-nav ul {
    display: none; position: absolute; inset-inline: 0; top: 72px; flex-direction: column; gap: 0;
    padding: 6px var(--gutter) 14px; background: var(--c-olive); border-bottom: 1px solid rgb(255 255 255 / 12%);
  }
  .hero-nav ul a { display: block; padding: 12px 0; border-bottom: 1px solid rgb(255 255 255 / 12%); }
  .hero-nav .menu-toggle:checked ~ ul { display: flex; }
}

/* ---------- sections ---------- */

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-tight { padding-top: 24px; }
.section-soft { background: var(--c-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.section-head a::after { content: " ←"; }

.page-head { padding-top: 28px; padding-bottom: 8px; }

.empty { padding: 40px; text-align: center; color: var(--c-muted); background: var(--c-soft); border-radius: var(--radius); }

/* services */

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.service-card {
  display: block; padding: 26px; border: 1px solid var(--c-line); border-radius: var(--radius);
  text-decoration: none; color: var(--c-text); background: #fff; transition: border-color .15s, transform .15s;
}
.service-card:hover { border-color: var(--c-accent); transform: translateY(-2px); color: var(--c-text); }
.service-card p { margin: 0; color: var(--c-muted); font-size: .95rem; }
.service-num { display: block; color: var(--c-accent); font-weight: 800; font-size: 1.05rem; margin-bottom: 8px; }

.services-list { display: grid; gap: 0; }
.service-row {
  display: grid; grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px;
  padding: 34px 0; border-bottom: 1px solid var(--c-line); scroll-margin-top: 90px;
}
.service-row:first-child { border-top: 1px solid var(--c-line); }
.service-row h2 { font-size: 1.35rem; }
.service-row p { color: var(--c-muted); margin: 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-inline-start: 26px; margin-bottom: 6px; }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .65em; width: 12px; height: 7px; border-inline-start: 2px solid var(--c-olive-3); border-bottom: 2px solid var(--c-olive-3); transform: rotate(-45deg); }

@media (max-width: 760px) {
  .service-row { grid-template-columns: 1fr; gap: 10px; }
}

/* projects */

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.project-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.project-cover { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--c-olive); overflow: hidden; text-decoration: none; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.project-card:hover .project-cover img { transform: scale(1.03); }
.project-cover-type { display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; color: #fff; }
.project-cover-type::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgb(156 182 84 / 45%), transparent 60%);
}
.cover-kind { position: relative; font-size: .8rem; color: var(--c-accent); font-weight: 700; }
.cover-title { position: relative; font-size: 2.1rem; font-weight: 800; line-height: 1.3; }
.cover-host { position: relative; font-size: .85rem; opacity: .75; align-self: flex-start; }
.project-cover .badge { position: absolute; top: 14px; inset-inline-start: 14px; }
.project-body { padding: 20px 22px 24px; }
.project-body h3 { margin-bottom: .3em; }
.project-body h3 a { color: var(--c-ink); text-decoration: none; }
.project-body h3 a:hover { color: var(--c-olive-2); }
.project-body p { color: var(--c-muted); font-size: .95rem; margin: 0; }
.project-body .chips { margin-top: 14px; }

/* principles */

.principles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; list-style: none; margin: 0; padding: 0; counter-reset: p; }
.principles li { counter-increment: p; border-top: 3px solid var(--c-accent); padding-top: 18px; }
.principles li::before { content: counter(p, persian); display: block; font-weight: 800; color: var(--c-olive-3); margin-bottom: 6px; }
.principles p { color: var(--c-muted); font-size: .95rem; margin: 0; }

/* posts */

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post-card { padding: 24px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); }
.post-card h3 a { color: var(--c-ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--c-olive-2); }
.post-card p { color: var(--c-muted); font-size: .95rem; }
.meta { color: var(--c-muted); font-size: .85rem; margin: 0; }

/* CTA */

.cta { background: var(--c-olive); color: #e9eddc; padding: clamp(40px, 6vw, 64px) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta h2 { color: #fff; margin-bottom: .3em; }
.cta p { margin: 0; max-width: 40rem; }

/* ---------- case study ---------- */

.case-head { padding: 24px 0 36px; }
.case-head h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); margin-bottom: .2em; }
.case-meta { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 26px 0 0; }
.case-meta div { min-width: 120px; }
.case-meta dt { font-size: .8rem; color: var(--c-muted); }
.case-meta dd { margin: 0; font-weight: 700; color: var(--c-ink); }

.stats { background: var(--c-olive); color: #dfe5cc; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { padding: 30px 22px; border-inline-start: 1px solid rgb(255 255 255 / 12%); }
.stat:first-child { border-inline-start: 0; }
.stat strong { display: block; color: var(--c-accent); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 800; line-height: 1.3; }
.stat span { font-size: .9rem; }

.case-cover { margin-top: 40px; }
.case-cover img { border-radius: var(--radius); box-shadow: var(--shadow); }

.case-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 48px; padding-bottom: 64px; align-items: start; }
.case-layout > .prose:only-child { grid-column: 1 / -1; max-width: 760px; }
.toc { position: sticky; top: 96px; font-size: .9rem; }
.toc-title { font-weight: 800; color: var(--c-ink); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--c-line); }
.toc a { display: block; padding: 5px 14px; color: var(--c-muted); text-decoration: none; margin-inline-start: -2px; border-inline-start: 2px solid transparent; }
.toc a:hover { color: var(--c-olive-2); border-inline-start-color: var(--c-accent); }
.toc-inline { position: static; background: var(--c-soft); padding: 18px 20px; border-radius: var(--radius); margin: 0 0 32px; }

@media (max-width: 900px) {
  .case-layout { grid-template-columns: 1fr; gap: 24px; }
  .case-layout .toc { position: static; background: var(--c-soft); padding: 16px 18px; border-radius: var(--radius); }
}

/* ---------- prose (Markdown) ---------- */

.prose { font-size: 1.04rem; max-width: 760px; }
.prose h2 { margin-top: 2em; scroll-margin-top: 90px; }
.prose h3 { margin-top: 1.6em; font-size: 1.15rem; scroll-margin-top: 90px; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose code { direction: ltr; unicode-bidi: isolate; background: var(--c-soft); border: 1px solid var(--c-line); padding: 1px 6px; border-radius: 4px; font-size: .88em; }
.prose pre { direction: ltr; text-align: left; background: #1b1c16; color: #e8ead9; padding: 16px 18px; border-radius: var(--radius); overflow-x: auto; font-size: .88rem; line-height: 1.7; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose blockquote { margin: 1.4em 0; padding: 4px 20px; border-inline-start: 4px solid var(--c-accent); color: var(--c-muted); }
.prose img { border-radius: var(--radius); margin: 1.4em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1.4em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--c-line); padding: 8px 12px; text-align: start; }
.prose th { background: var(--c-soft); }

/* architecture flow inside case studies */
.prose .flow { list-style: none; padding: 0; margin: 1.6em 0 2em; counter-reset: f; display: grid; gap: 0; }
.prose .flow li {
  counter-increment: f; position: relative; margin: 0; padding: 16px 20px 16px 20px; padding-inline-start: 64px;
  background: var(--c-soft); border: 1px solid var(--c-line); border-radius: var(--radius);
}
.prose .flow li + li { margin-top: 26px; }
.prose .flow li + li::after {
  content: "↓"; position: absolute; top: -26px; inset-inline-start: 30px; line-height: 26px; color: var(--c-olive-3); font-weight: 800;
}
.prose .flow li::before {
  content: counter(f, persian); position: absolute; inset-inline-start: 18px; top: 16px;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-olive); color: var(--c-accent); font-weight: 800; font-size: .95rem;
}
.prose .flow strong { display: block; color: var(--c-ink); }
.prose .flow span { display: block; color: var(--c-muted); font-size: .95rem; }

/* ---------- blog post ---------- */

.post { max-width: 800px; padding-top: 24px; padding-bottom: 64px; }
.post-head { margin-bottom: 28px; }
.post-cover { margin: 0 0 32px; }
.post-cover img { border-radius: var(--radius); }

/* ---------- about ---------- */

.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); padding-top: 28px; padding-bottom: 64px; align-items: start; }
.about-photo { background: var(--c-olive); border-radius: var(--radius); overflow: hidden; }
.about-text h1 { margin-bottom: .1em; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; }
.skills h3 { margin: 0; }

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 360px; }
}

/* ---------- contact ---------- */

.contact-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-bottom: 40px; }
.contact-aside { background: var(--c-soft); padding: 26px; border-radius: var(--radius); }
.contact-aside h2 { font-size: 1.15rem; }

@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.form { display: grid; gap: 18px; max-width: 620px; }
.field label { display: block; font-weight: 700; color: var(--c-ink); margin-bottom: 6px; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; font: inherit; color: var(--c-ink); background: #fff;
  border: 1.5px solid var(--c-line); border-radius: 6px; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--c-olive-3); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.field [aria-invalid="true"] { border-color: var(--c-error); }
.field-error { color: var(--c-error); font-size: .88rem; margin: 6px 0 0; }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: 16px 20px; border-radius: var(--radius); }
.notice p { margin: 4px 0 0; }
.notice-ok { background: #e9f3e3; color: var(--c-ok); }
.notice-error { background: #fbeceb; color: var(--c-error); }

.channels { list-style: none; margin: 0; padding: 0; }
.channels a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--c-line); text-decoration: none; color: var(--c-ink); }
.channels a span { color: var(--c-muted); }
.channels a:hover bdi { color: var(--c-olive-2); }
.channels-light a { border-bottom-color: rgb(255 255 255 / 12%); color: #fff; }
.channels-light a span { color: #b7bea3; }
.channels-light a:hover bdi { color: var(--c-accent); }

/* ---------- footer ---------- */

.site-footer { background: #1a1d10; color: #b7bea3; padding-top: 56px; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; }
.footer-about { margin-top: 14px; max-width: 26rem; }
.footer-title { color: #fff; font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer nav a { display: inline-block; padding: 4px 0; color: #b7bea3; text-decoration: none; }
.site-footer nav a:hover { color: var(--c-accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid rgb(255 255 255 / 10%); font-size: .82rem; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

.not-found { padding-top: 60px; padding-bottom: 80px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
