:root {
  --bg: #F2EFE9;
  --text: #1C1A17;
  --muted: #655F56;
  --accent: #86684C;
  --line: rgba(28, 26, 23, .14);
  --panel: #E9E5DD;
  --paper: #FFFFFF;
  --logo-ink: #1C1B19;
  --logo-fill: #EADFCB;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1360px;
}
:root[data-theme="dark"] {
  --bg: #161513;
  --text: #ECE7DF;
  --muted: #A8A196;
  --accent: #C9AE8E;
  --line: rgba(236, 231, 223, .16);
  --panel: #201E1B;
  --paper: #F4F1EB;
  --logo-ink: #ECE7DF;
  --logo-fill: #3B352D;
}
:root[lang="fa"] {
  --sans: "Vazirmatn", Tahoma, sans-serif;
  --mono: "Vazirmatn", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
:root[lang="fa"] body { line-height: 1.95; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; }
ul, dl, dd { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.label {
  font: 500 .72rem/1.5 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
:root[lang="fa"] .label { font-size: .82rem; letter-spacing: 0; }
.muted { color: var(--muted); }
.link { border-bottom: 1px solid var(--line); transition: border-color .2s, color .2s; }
.link:hover { border-color: var(--accent); color: var(--accent); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 3.75rem; flex-wrap: wrap; padding-block: .6rem;
}
.brand { display: inline-flex; align-items: center; gap: .9rem; direction: ltr; margin-inline-end: auto; }
.logo-mark { height: 1.75rem; width: auto; flex: none; }
.wordmark { font: 300 1rem/1.1 "Jost", "Futura", "Century Gothic", sans-serif; letter-spacing: .22em; white-space: nowrap; }
@media (max-width: 420px) { .brand .wordmark { font-size: .82rem; } }
.logo-full { direction: ltr; display: flex; flex-direction: column; align-items: center; gap: .9rem; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.logo-full svg { width: min(100%, 540px); height: auto; overflow: visible; }
.logo-full .wordmark { font-size: clamp(1.4rem, 5vw, 2.875rem); margin-right: -.22em; }
.logo-full .tagline { font: 400 clamp(.6rem, 1.6vw, .8125rem)/1.4 "IBM Plex Mono", "Courier New", monospace; letter-spacing: .34em; margin-right: -.34em; opacity: .75; }
.nav, .tools { display: flex; align-items: center; gap: 1.5rem; }
.nav a, .tools button { transition: color .2s; }
.nav a:hover, .tools button:hover { color: var(--text); }
.tools { padding-inline-start: 1.5rem; border-inline-start: 1px solid var(--line); gap: 1.1rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; }
.icon-btn:hover { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 720px) {
  .nav { order: 3; width: 100%; gap: 1.25rem; overflow-x: auto; padding-bottom: .15rem; }
  .tools { border: 0; padding: 0; }
}

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 7rem); border-top: 1px solid var(--line); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.02em; }
:root[lang="fa"] h1, :root[lang="fa"] h2, :root[lang="fa"] h3 { letter-spacing: 0; }

/* Home slider */
.slider { position: relative; height: clamp(300px, 44vw, 78vh); overflow: hidden; background: var(--panel); }
.slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 1.1s ease; }
.slide.is-on { opacity: 1; pointer-events: auto; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: auto 0 0 0; height: 60%; background: linear-gradient(to top, rgba(15, 14, 12, .78), transparent); }
.slide-cap, .slider-dots { position: absolute; inset: auto 0 0 0; padding-bottom: clamp(1.25rem, 3.2vw, 2.75rem); }
.slide-cap { z-index: 1; display: flex; flex-direction: column; gap: .4rem; color: #F2EFE9; }
.slide-cap .label { color: rgba(242, 239, 233, .8); }
.slide-cap strong { font-weight: 500; font-size: clamp(1.3rem, 3vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; max-width: min(22em, 78%); }
:root[lang="fa"] .slide-cap strong { letter-spacing: 0; line-height: 1.5; }
.slider-dots { z-index: 2; display: flex; justify-content: flex-end; gap: .5rem; pointer-events: none; }
.slider-dots button { position: relative; width: 2rem; height: 1.5rem; pointer-events: auto; }
.slider-dots button::before { content: ""; position: absolute; inset: 50% 0 auto 0; height: 2px; background: rgba(242, 239, 233, .4); transition: background-color .3s; }
.slider-dots button[aria-current]::before, .slider-dots button:hover::before { background: #F2EFE9; }
@media (max-width: 720px) {
  .slide-cap { padding-bottom: 2.5rem; }
  .slide-cap strong { max-width: 100%; }
  .slider-dots { padding-bottom: .5rem; }
}
.slider + .hero { padding-top: clamp(3rem, 7vw, 5.5rem); }

/* Hero */
.hero { padding-block: clamp(4rem, 12vw, 9.5rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero h1 {
  font-size: clamp(2.2rem, 5.6vw, 5rem);
  line-height: 1.04; letter-spacing: -.035em;
  max-width: 17em; margin-block: 1.25rem 2.25rem;
  text-wrap: balance;
}
:root[lang="fa"] .hero h1 { line-height: 1.45; font-size: clamp(2rem, 4.6vw, 4rem); }
.hero-foot { display: flex; flex-wrap: wrap; gap: 1.75rem 3rem; align-items: flex-end; justify-content: space-between; }
.hero-foot p { max-width: 36em; font-size: 1.15rem; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .8rem 1.25rem; border: 1px solid var(--text); border-radius: 999px;
  font-weight: 500; font-size: .95rem; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn.quiet { border-color: var(--line); }
.btn.quiet:hover { background: none; color: var(--accent); border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.filters button { padding-block: .25rem; border-bottom: 1px solid transparent; }
.filters button[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
.filters sup { margin-inline-start: .3em; font-size: .85em; opacity: .7; }

/* Project grid */
/* Project index: a list of titles; hovering a row opens it, and the project's cover fills the row */
.plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.plist li { border-bottom: 1px solid var(--line); }
.prow {
  --open: .12s;                                   /* short pause before opening, so a pointer passing over the list does not open every row */
  position: relative; display: grid; align-items: center; overflow: hidden;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(10rem, auto) 2rem; gap: 1.75rem;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  transition: padding .55s cubic-bezier(.4, 0, .2, 1), opacity .35s ease;
}
.prow > :not(.prow-bg) { position: relative; z-index: 1; }
.prow-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #1C1A17; opacity: 0; transition: opacity .45s ease; }
.prow-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.prow-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 14, 12, .72), rgba(15, 14, 12, .25) 55%, rgba(15, 14, 12, .55)); }
:root[dir="rtl"] .prow-bg::after { background: linear-gradient(-90deg, rgba(15, 14, 12, .72), rgba(15, 14, 12, .25) 55%, rgba(15, 14, 12, .55)); }
.prow-no { font: 400 clamp(.95rem, 1.2vw, 1.1rem)/1 var(--mono); color: var(--muted); align-self: start; padding-top: .9rem; transition: color .4s; }
.prow-title { font-size: clamp(2rem, 4.6vw, 4.2rem); font-weight: 500; line-height: 1; letter-spacing: -.04em; text-wrap: balance; transition: color .4s; }
.prow-title small { display: block; margin-top: .7rem; font-size: .95rem; font-weight: 400; letter-spacing: .02em; line-height: 1.4; color: var(--muted); transition: color .4s; }
:root[lang="fa"] .prow-title { letter-spacing: 0; line-height: 1.4; font-size: clamp(1.8rem, 3.9vw, 3.5rem); }
:root[lang="fa"] .prow-title small { margin-top: .2rem; letter-spacing: 0; }
.prow-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; text-align: end; font-size: .92rem; color: var(--muted); transition: color .4s; }
.prow-arrow { font-size: 1.6rem; color: #F2EFE9; opacity: 0; transform: translateX(-.75rem); transition: opacity .35s, transform .6s cubic-bezier(.2, .7, .2, 1); }
:root[dir="rtl"] .prow-arrow { transform: translateX(.75rem); }
.plist:hover .prow { opacity: .4; }
.plist .prow:hover, .plist .prow:focus-visible { opacity: 1; }

/* open: the lines above and below move apart, the cover fades in and settles from a slight zoom */
.prow:hover, .prow:focus-visible {
  padding: clamp(5rem, 11vw, 9rem) clamp(1rem, 2.5vw, 2.25rem);
  transition: padding .65s cubic-bezier(.2, .7, .2, 1) var(--open), opacity .35s ease;
}
.prow:hover .prow-bg, .prow:focus-visible .prow-bg { opacity: 1; transition: opacity .5s ease var(--open); }
.prow:hover .prow-bg img, .prow:focus-visible .prow-bg img { transform: scale(1.03); transition: transform 1.6s cubic-bezier(.2, .7, .2, 1) var(--open); }
.prow:hover .prow-title, .prow:focus-visible .prow-title,
.prow:hover .prow-no, .prow:focus-visible .prow-no { color: #F2EFE9; transition-delay: var(--open); }
.prow:hover .prow-title small, .prow:focus-visible .prow-title small,
.prow:hover .prow-meta, .prow:focus-visible .prow-meta { color: rgba(242, 239, 233, .82); transition-delay: var(--open); }
.prow:hover .prow-arrow, .prow:focus-visible .prow-arrow { opacity: 1; transform: none; transition-delay: var(--open); }
@media (max-width: 1100px) { .prow { grid-template-columns: 3rem minmax(0, 1fr) minmax(8rem, auto) 1.5rem; gap: 1.25rem; } }

/* rows fade up as they scroll into view (only when JavaScript adds .will-reveal) */
.plist li.will-reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.plist li.will-reveal.is-in { opacity: 1; transform: none; }

/* touch screens and narrow windows: nothing to hover, so every row is shown open, as an image band */
@media (hover: none), (pointer: coarse), (max-width: 720px) {
  .plist { border-top: 0; }
  .plist li { border-bottom: 0; margin-bottom: .75rem; }
  .plist:hover .prow { opacity: 1; }
  .prow, .prow:hover {
    grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .5rem 1rem;
    min-height: 15rem; padding: 1.25rem; transition: none;
  }
  .prow-bg, .prow:hover .prow-bg { opacity: 1; }
  .prow-bg img, .prow:hover .prow-bg img { transform: none; }
  .prow-bg::after, :root[dir="rtl"] .prow-bg::after { background: linear-gradient(to top, rgba(15, 14, 12, .85), rgba(15, 14, 12, .5) 55%, rgba(15, 14, 12, .15)); }
  .prow-no { grid-column: 2; grid-row: 1; align-self: start; padding-top: 0; color: rgba(242, 239, 233, .82); }
  .prow-title { grid-column: 1 / -1; grid-row: 2; color: #F2EFE9; font-size: clamp(1.6rem, 7vw, 2.2rem); }
  :root[lang="fa"] .prow-title { font-size: clamp(1.4rem, 6.2vw, 1.9rem); }
  .prow-title small, .prow-meta { color: rgba(242, 239, 233, .82); }
  .prow-meta { grid-column: 1 / -1; grid-row: 3; align-items: flex-start; text-align: start; font-size: .85rem; }
  .prow-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .prow, .prow:hover, .prow-bg, .prow-bg img { transition: none !important; } }
.empty { padding: 3rem 0; color: var(--muted); }

/* Ventures */
.venture { display: grid; grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr) auto; align-items: center; gap: 1.5rem 3rem; padding-block: 1.75rem; border-block: 1px solid var(--line); }
.venture-logo { display: block; height: 2.25rem; width: auto; }
.venture-text { display: flex; flex-direction: column; gap: .3rem; font-size: 1.1rem; max-width: 34em; }
.venture-go { color: var(--accent); }
a.venture:hover .venture-go { text-decoration: underline; }
.only-dark { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }
@media (max-width: 640px) { .venture { grid-template-columns: 1fr; gap: 1rem; } }

/* Project process diagram */
.process-legend { color: var(--muted); }
.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step { --node: 3.25rem; position: relative; display: flex; flex-direction: column; padding-inline-end: clamp(1rem, 2.4vw, 2.25rem); }
/* connector: from this node to the next, with an arrowhead */
.step:not(:last-child)::before {
  content: ""; position: absolute; top: calc(var(--node) / 2); height: 1px;
  inset-inline: calc(var(--node) + .75rem) .75rem; background: var(--line);
  transform-origin: left center; transition: transform .7s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * .18s + .25s);
}
:root[dir="rtl"] .step:not(:last-child)::before { transform-origin: right center; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: calc(var(--node) / 2 - 4px); inset-inline-end: .75rem; width: 8px; height: 8px;
  border-top: 1px solid var(--muted); border-right: 1px solid var(--muted); transform: rotate(45deg);
}
:root[dir="rtl"] .step:not(:last-child)::after { transform: rotate(-135deg); }
.step-node {
  display: grid; place-items: center; flex: none; width: var(--node); height: var(--node); border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
}
.step-node svg { width: 1.45rem; height: 1.45rem; }
.step-stepProblem .step-node { border-color: var(--accent); color: var(--accent); }
.step-stepSolution .step-node { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.step-stepOutcome .step-node { border-color: var(--text); background: var(--text); color: var(--bg); }
.step-body { display: flex; flex-direction: column; flex: 1; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.step-stepSolution .step-body { border-top-color: var(--accent); }
.step-body .label { color: var(--muted); }
.step-stepProblem .step-body .label, .step-stepSolution .step-body .label { color: var(--accent); }
.step h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.25; margin-block: .6rem .75rem; text-wrap: balance; }
.step p { color: var(--muted); font-size: .96rem; max-width: 26em; }
.step-facts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: 1.1rem; }
.step-facts li { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; line-height: 1.3; }
.step-stepSolution .step-facts li { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* steps appear one after another; the connectors draw across */
.process.will-reveal .step { opacity: 0; transform: translateY(1.25rem); }
.process.will-reveal .step:not(:last-child)::before { transform: scaleX(0); }
.process.will-reveal.is-in .step { opacity: 1; transform: none; transition: opacity .7s ease calc(var(--i) * .18s), transform .8s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * .18s); }
.process.will-reveal.is-in .step:not(:last-child)::before { transform: scaleX(1); }

@media (max-width: 860px) {
  .process { grid-template-columns: 1fr; }
  .step { --node: 2.75rem; display: grid; grid-template-columns: var(--node) minmax(0, 1fr); column-gap: 1.25rem; padding-inline-end: 0; padding-bottom: 2.25rem; }
  .step:not(:last-child)::before { top: calc(var(--node) + .5rem); bottom: .5rem; inset-inline: calc(var(--node) / 2) auto; width: 1px; height: auto; transform-origin: center top; }
  .process.will-reveal .step:not(:last-child)::before { transform: scaleY(0); }
  .process.will-reveal.is-in .step:not(:last-child)::before { transform: scaleY(1); }
  .step:not(:last-child)::after { top: auto; bottom: .35rem; inset-inline-end: auto; inset-inline-start: calc(var(--node) / 2 - 4px); transform: rotate(135deg); }
  :root[dir="rtl"] .step:not(:last-child)::after { transform: rotate(135deg); }
  .step-body { margin-top: 0; padding-top: 0; border-top: 0; }
  .step h3 { margin-top: .4rem; }
}
@media (prefers-reduced-motion: reduce) { .process.will-reveal .step, .process.will-reveal .step::before { opacity: 1 !important; transform: none !important; transition: none !important; } }

.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, transparent 0 11px, var(--line) 11px 12px);
  color: var(--muted); font: 400 clamp(2rem, 5vw, 3.5rem)/1 var(--mono);
}
.hint {
  border: 1px dashed var(--line); padding: 1.5rem; color: var(--muted);
  font-size: .92rem; background: color-mix(in srgb, var(--panel) 45%, transparent);
}
.hint code { font-family: "IBM Plex Mono", Consolas, monospace; font-size: .85em; direction: ltr; unicode-bidi: isolate; }

/* Expertise */
.cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 1000px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cols-4 { grid-template-columns: 1fr; } }
.x-icon { display: block; width: 2.5rem; height: 2.5rem; color: var(--accent); margin-bottom: 1.25rem; }
.expertise h3 { font-size: 1.3rem; margin-block: .6rem .75rem; }
.expertise p { color: var(--muted); font-size: .98rem; }
.expertise ul { margin-top: 1.25rem; border-top: 1px solid var(--line); }
.expertise li { padding-block: .55rem; border-bottom: 1px solid var(--line); font-size: .95rem; }

/* About */
.about-top { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.portrait { aspect-ratio: 4 / 5; background: var(--panel); overflow: hidden; max-width: 420px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.bio { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.5; max-width: 34em; }
:root[lang="fa"] .bio { line-height: 2; }
.bio + .btn-row { margin-top: 2rem; }
.about-cols { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 3rem clamp(2rem, 5vw, 5rem); margin-top: clamp(3rem, 6vw, 5rem); }
@media (max-width: 800px) { .about-top, .about-cols { grid-template-columns: 1fr; } }
.block + .block { margin-top: 2.75rem; }
.block > .label { display: block; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.rows li { display: grid; grid-template-columns: 8.5rem 1fr; gap: .25rem 1rem; padding-block: .8rem; border-bottom: 1px solid var(--line); }
.rows .label { padding-top: .2rem; }
.rows strong { font-weight: 500; display: block; }
.rows span.muted { font-size: .93rem; }
@media (max-width: 480px) { .rows li { grid-template-columns: 1fr; } }
.stack li { padding-block: .8rem; border-bottom: 1px solid var(--line); }
.stack .label { display: block; margin-bottom: .2rem; }

/* Contact */
.contact-mail { font-size: clamp(1.7rem, 5.2vw, 4.2rem); letter-spacing: -.03em; line-height: 1.1; overflow-wrap: anywhere; }
.contact-mail:hover { color: var(--accent); }
.contact-list { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 2.5rem; }
.cchip {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 3rem; padding: .6rem 1.2rem .6rem 1rem;
  border: 1px solid var(--line); border-radius: 999px; font-size: 1rem;
  transition: border-color .25s, background-color .25s, color .25s;
}
:root[dir="rtl"] .cchip { padding: .6rem 1rem .6rem 1.2rem; }
.cchip span { white-space: nowrap; }
.cchip svg { width: 1.3rem; height: 1.3rem; flex: none; color: var(--accent); transition: color .25s; }
.cchip:focus-visible { border-color: var(--text); background: var(--text); color: var(--bg); }
.cchip:focus-visible svg { color: var(--bg); }
@media (hover: hover) { .cchip:hover { border-color: var(--text); background: var(--text); color: var(--bg); } .cchip:hover svg { color: var(--bg); } }
.cplace { display: inline-flex; align-items: center; gap: .45rem; margin-inline-start: .75rem; font-size: .92rem; color: var(--muted); }
.cplace svg { width: 1.1rem; height: 1.1rem; }
@media (max-width: 560px) { .cchip { flex: 1 1 calc(50% - .75rem); justify-content: center; } .cchip:first-child { flex-basis: 100%; } .cplace { flex-basis: 100%; margin: .5rem 0 0; } }

.site-footer { border-top: 1px solid var(--line); padding-bottom: 1.75rem; }
.site-footer .wrap.label { padding-inline-end: calc(var(--gutter) + 3.5rem); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.to-top {
  position: fixed; z-index: 9; inset-block-end: 1.5rem; inset-inline-end: 1.5rem;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  opacity: 0; visibility: hidden; transform: translateY(.5rem);
  transition: opacity .25s, transform .25s, visibility .25s, color .2s, border-color .2s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* Project page */
.project-head { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem); }
.project-head h1 { font-size: clamp(2.2rem, 6vw, 5rem); line-height: 1.05; letter-spacing: -.035em; margin-block: 1.5rem .75rem; }
:root[lang="fa"] .project-head h1 { line-height: 1.4; }
.meta { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem; margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.25rem; border-top: 1px solid var(--line); }
@media (max-width: 1000px) { .meta { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.meta dt { margin-bottom: .3rem; }
.meta dd { font-size: .98rem; }
.hero-img { background: var(--panel); aspect-ratio: 16 / 9; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img.portrait { background: var(--paper); }
.hero-img.portrait img { object-fit: contain; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem clamp(2rem, 5vw, 5rem); }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.two h2 { font-size: 1.5rem; margin-block: .5rem 1rem; }
.prose { max-width: 38em; }
.prose p, .bio p { text-align: justify; hyphens: auto; }

.shots { display: grid; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.75rem); }
.shots.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shots > :first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.shots.three > :first-child { grid-column: auto; }
.shots > figure.wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .shots.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .shots, .shots.three { grid-template-columns: 1fr; } }
figure { margin: 0; }
.zoom { display: block; cursor: zoom-in; background: var(--panel); }
.zoom img { width: 100%; }
.paper .zoom { background: var(--paper); padding: clamp(.75rem, 2vw, 1.5rem); border: 1px solid var(--line); }
figcaption { display: flex; justify-content: space-between; gap: 1rem; padding-top: .6rem; font-size: .9rem; color: var(--muted); }

.next { display: block; padding-block: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.next strong { display: block; font-weight: 500; font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.03em; line-height: 1.1; margin-top: .75rem; transition: color .2s; }
.next:hover strong { color: var(--accent); }

/* Lightbox */
dialog.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(15, 14, 12, .95); color: #ECE7DF; }
dialog.lightbox::backdrop { background: transparent; }
.lightbox-inner { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.lightbox-bar { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem var(--gutter); }
.lightbox-bar .label, .lightbox-bar button { color: #A8A196; }
.lightbox-bar button:hover { color: #ECE7DF; }
.lightbox-stage { min-height: 0; overflow: hidden; display: grid; place-items: center; padding-inline: var(--gutter); }
.lightbox-stage img { max-width: 100%; max-height: calc(100vh - 8.5rem); width: auto; object-fit: contain; }
.lightbox-stage img.on-paper { background: #fff; }
.lightbox-cap { padding: 1rem var(--gutter); text-align: center; font-size: .92rem; color: #A8A196; min-height: 3.25rem; }
.lightbox-nav { display: flex; gap: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Design to built: the same view, stage by stage */
.compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 1rem; }
.compare .zoom { aspect-ratio: 16 / 9; overflow: hidden; }
.compare .zoom img { width: 100%; height: 100%; object-fit: cover; }
.compare figcaption { justify-content: flex-start; gap: .75rem; }
.compare-arrow { align-self: center; margin-top: -1.5rem; font-size: 1.4rem; color: var(--accent); }
@media (max-width: 760px) {
  .compare { grid-template-columns: 1fr; gap: .5rem; }
  .compare-arrow { justify-self: center; margin: 0; transform: rotate(90deg); }
}
