/* Screen-only design. The original stylesheet owns the logo film and A4 output. */
:root {
  --text: #f3f5f2;
  --muted: #bcc3bb;
  --faint: #a0aaa0;
  --line: #323c34;
  --brand-surface: #141414;
  --on-gold: #192017;
  --body-size: 1.0625rem;
  --label-size: .875rem;
  --title-size: 2rem;
}
html[data-theme="light"] {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-raised: #edf1f4;
  --text: #1b2421;
  --muted: #48564e;
  --faint: #5d6b62;
  --line: #d4dce0;
  --line-strong: #aebcb3;
  --gold: #946516;
  --on-gold: #ffffff;
}
body { font-size: var(--body-size); line-height: 1.95; }
body, button, select, h1, h2, h3, p, li, dt, dd, small { letter-spacing: 0; }
button, select { font-family: var(--font); }
p, li, dt, dd, h1, h2, h3 { overflow-wrap: break-word; }
bdi { unicode-bidi: isolate; }
section[id] { scroll-margin-block-start: 110px; }
.shell { width: min(1160px, calc(100% - 64px)); }
.site-header { background: color-mix(in srgb, var(--bg), transparent 5%); }
.nav { min-height: 84px; gap: 24px; }
.brand { gap: 12px; }
.brand strong { font-size: 1rem; font-weight: 700; line-height: 1.65; }
.brand small { font-size: .8125rem; line-height: 1.7; }
.brand-mark { flex-basis: 44px; width: 44px; height: 44px; }
.brand-mark img, .identity-monogram img { background: var(--brand-surface); }
.nav-links { gap: 22px; }
.nav-links a { font-size: var(--label-size); line-height: 1.8; padding-block: 8px; }
.nav-links a::after { inset-block-end: 0; }
.nav-tools { gap: 8px; flex-wrap: wrap; }
.icon-button, .print-action { min-width: 2.75rem; min-height: 2.75rem; height: auto; line-height: 1.5; }
.print-action { padding: 10px 12px; font-size: var(--label-size); }
.language-control { width: 116px; height: 2.75rem; }
.language-control select { font: 600 var(--label-size)/1.5 var(--font); }
.language-control select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* A restrained first viewport: one name, one profession, one short introduction. */
.hero { min-height: 0; padding-block: 80px 72px; }
.hero-layout { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 72px; align-items: center; }
.hero-ledger-lines { opacity: .25; }
.eyebrow, .section-heading > p:not(.contact-copy) {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; color: var(--gold);
  font: 600 var(--label-size)/1.85 var(--font);
}
.eyebrow::before, .section-heading > p:not(.contact-copy)::before {
  content: ""; flex: 0 0 24px; width: 24px; height: 1px; background: var(--gold);
}
h1 { max-width: none; margin: 0; font-size: 3.5rem; font-weight: 730; line-height: 1.5; }
.hero-specialty { min-height: 4.1rem; margin: 12px 0 20px; color: var(--muted); font-size: 1.25rem; line-height: 1.95; }
.hero-specialty b { color: var(--green-strong); font-weight: 600; }
.hero-specialty b::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-inline-start: 6px; background: var(--gold); vertical-align: -.1em; }
.hero-specialty b.is-typing::after { animation: blink 1.1s steps(1) infinite; }
.hero-summary { max-width: 62ch; margin: 0 0 30px; color: var(--muted); font-size: 1.125rem; font-weight: 400; line-height: 2.05; }
.hero-actions { gap: 22px; }
.primary-button { min-height: 3rem; padding: 12px 22px; background: var(--gold); color: var(--on-gold); font-size: .9375rem; font-weight: 650; line-height: 1.6; }
.primary-button:hover { background: var(--gold); box-shadow: 0 6px 20px -12px var(--gold); }
.primary-button::before { display: none; }
.text-button { font-size: .9375rem; font-weight: 550; padding-block: 12px; }
.quick-facts { gap: 22px; margin-top: 36px; }
.quick-facts dt { font-size: var(--label-size); line-height: 1.8; color: var(--faint); }
.quick-facts dd { margin-top: 5px; font-size: .9375rem; font-weight: 500; line-height: 1.9; }
.identity-panel { padding: 28px; border-color: var(--line); border-radius: 6px; background: var(--surface); box-shadow: none; }
.identity-panel:hover { border-color: var(--line-strong); box-shadow: none; }
.identity-head { gap: 16px; flex-wrap: wrap; }
.identity-monogram { flex: 0 0 72px; width: 72px; height: 72px; border: 1px solid var(--line); }
.identity-head strong { font-size: 1rem; line-height: 1.9; font-weight: 650; }
.identity-head small { font-size: var(--label-size); line-height: 1.8; }
.identity-rule { margin-block: 24px; }
.metrics { border: 0; background: transparent; gap: 20px 16px; }
.metrics div { min-height: 70px; padding: 0; background: transparent; border-inline-start: 2px solid var(--line-strong); padding-inline-start: 14px; overflow: visible; }
.metrics div:hover { background: transparent; }
.metrics div::after { display: none; }
.metrics strong { font: 650 1.0625rem/1.6 var(--font); color: var(--green-strong); }
.metrics span { font-size: var(--label-size); line-height: 1.8; }
.identity-note { font-size: var(--label-size); line-height: 1.8; flex-wrap: wrap; margin-top: 24px; }
.identity-note span:last-child { direction: ltr; unicode-bidi: isolate; }

/* Section titles and prose share a consistent, Persian-first reading rhythm. */
.section { padding-block: 80px; }
.section-tinted { background: var(--surface); }
.split-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr); gap: 80px; }
.section-heading h2 { max-width: 30ch; font-size: var(--title-size); font-weight: 650; line-height: 1.7; }
.centered { max-width: none; margin-inline: 0; text-align: start; }
.centered h2 { max-width: 38ch; }
.prose { font-size: var(--body-size); line-height: 2.1; }
.prose p { margin-bottom: 24px; }
.goal { margin-bottom: 0 !important; padding: 4px 22px; background: transparent; border-color: var(--gold); }
.goal:hover { background: transparent; }

/* Logical positioning puts both the line and the markers at the reading start. */
.timeline { max-width: none; margin-top: 42px; gap: 0; }
.timeline::before, [dir="rtl"] .timeline::before { inset: 10px auto 20px; inset-inline-start: 9px; inset-inline-end: auto; background: var(--line-strong); }
.timeline-item, [dir="rtl"] .timeline-item { padding: 0; padding-inline-start: 48px; }
.timeline-item::before, [dir="rtl"] .timeline-item::before { inset: 10px auto auto; inset-inline-start: 4px; inset-inline-end: auto; width: 11px; height: 11px; border: 2px solid var(--surface); background: var(--gold); box-shadow: 0 0 0 1px var(--line-strong); }
.timeline-card { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); column-gap: 48px; padding: 0 0 30px; margin-bottom: 30px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.timeline-card:hover { box-shadow: none; border-color: var(--line); }
.timeline-card::before { display: none; }
.timeline-item:last-child .timeline-card { border: 0; margin-bottom: 0; padding-bottom: 0; }
.timeline-meta { grid-column: 1; grid-row: 1; color: var(--gold); font: 500 var(--label-size)/1.9 var(--font); }
.timeline-card h3 { grid-column: 1; grid-row: 2; margin: 8px 0 0; font-size: 1.25rem; font-weight: 600; line-height: 1.9; }
.timeline-card p { grid-column: 2; grid-row: 1 / 3; margin: 0; color: var(--muted); font-size: var(--body-size); line-height: 2; }
.timeline-card .clean-list { grid-column: 2; }
.clean-list { gap: 10px; margin-top: 16px; font-size: 1rem; line-height: 1.95; }
.clean-list li { padding-inline-start: 16px; }
.clean-list li::before, [dir="rtl"] .clean-list li::before { inset: .85em auto auto; inset-inline-start: 0; inset-inline-end: auto; width: 4px; height: 4px; background: var(--green); }

.skill-grid { gap: 20px; margin-top: 36px; align-items: stretch; }
.skill-card { min-height: 0; padding: 26px; border-color: var(--line); border-radius: 6px; background: var(--surface); }
.skill-card:hover { box-shadow: none; border-color: var(--line-strong); }
.skill-card::before { display: none; }
.skill-heading { display: flex; justify-content: space-between; align-items: center; }
.skill-icon { width: 40px; height: 40px; border: 0; color: var(--gold); }
.skill-icon svg { width: 24px; height: 24px; }
.skill-index { color: var(--faint); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.skill-card h3 { margin: 16px 0 18px; font-size: 1.1875rem; font-weight: 600; line-height: 1.8; }
.pill-list { display: grid; gap: 10px; }
.pill-list li { padding: 0; border: 0; font-size: 1rem; font-weight: 400; line-height: 1.9; color: var(--muted); }

/* Wide case-study rows make the existing animated screenshots inspectable. */
.project-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 36px; }
.project-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; border-color: var(--line); border-radius: 6px; background: var(--bg); }
.project-card:hover { border-color: var(--line-strong); box-shadow: none; }
.project-preview { aspect-ratio: auto; min-height: 340px; height: 100%; display: grid; align-content: center; border-bottom: 0; border-inline-end: 1px solid var(--line); border-radius: 0; background: var(--surface-raised); transition: transform 250ms var(--ease); }
.project-preview img { aspect-ratio: 16 / 10; width: 100%; height: auto; object-fit: contain; }
.project-preview::before, .project-preview::after { display: none; }
.project-preview.is-tilting { transform: perspective(1200px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); }
.project-body { padding: 30px; }
.project-type { color: var(--gold); font: 500 var(--label-size)/1.8 var(--font); }
.project-card h3 { font-size: 1.25rem; font-weight: 650; line-height: 1.9; margin: 10px 0 14px; }
.project-card p { min-height: 0; margin: 0; font-size: 1rem; line-height: 2; }
.project-tech { margin-top: 18px; gap: 8px 14px; }
.project-tech span { font: 500 var(--label-size)/1.8 var(--font); color: var(--green-strong); direction: ltr; unicode-bidi: isolate; }
.project-tech span:not(:last-child)::after { display: none; }
.project-card .clean-list { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.details-grid { gap: 32px; margin-top: 36px; }
.details-grid article { padding: 22px 0 0; border-top: 1px solid var(--line-strong); background: transparent; }
.details-grid article:hover { transform: none; box-shadow: none; }
.details-grid h3 { font-size: 1.1875rem; line-height: 1.8; margin-bottom: 14px; }
.details-grid p, .details-grid ul, .details-grid strong { font-size: 1rem; font-weight: 400; line-height: 1.95; }
.details-grid ul { gap: 8px; }
.contact-layout { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 80px; align-items: center; }
.contact-section .section-heading h2 { max-width: 26ch; }
.section-heading > .contact-copy { display: block; margin: 24px 0 0; color: var(--muted); font: 400 1.125rem/2.05 var(--font); letter-spacing: 0; }
.section-heading > .contact-copy::before { content: none; }
.contact-side { gap: 18px; }
.contact-links { gap: 0; }
.contact-link { padding: 18px 0; gap: 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.contact-link:hover, [dir="rtl"] .contact-link:hover { transform: none; box-shadow: none; border-color: var(--gold); }
.contact-link > span:last-child { min-width: 0; flex: 1; }
.contact-icon { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 4px; color: var(--gold); }
.contact-icon svg { width: 22px; height: 22px; }
.contact-link strong { font-size: 1rem; font-weight: 550; line-height: 1.8; }
.contact-link small { margin-top: 3px; color: var(--muted); font: 400 .9375rem/1.8 var(--font); text-align: match-parent; unicode-bidi: isolate; overflow-wrap: anywhere; }
.qr-card { gap: 22px; padding: 12px 0 0; border: 0; font-size: var(--label-size); line-height: 1.9; }
.qr-card:hover { transform: none; }
.qr-card img { flex: 0 0 100px; width: 100px; height: 100px; }
.site-footer { font-size: var(--label-size); padding-block: 32px; }
.footer-copy { gap: 8px; }
.footer-gratitude { font-size: 1rem; line-height: 1.85; font-weight: 550; }
.footer-credit { font-size: var(--label-size); line-height: 1.95; align-items: flex-start; }
.code-run { margin-top: 4px; }
.site-footer a { font-size: var(--label-size); }
.pointer-glow { z-index: 1; opacity: 0; }
body.has-pointer .pointer-glow { opacity: .5; }
.reveal { transition-duration: 400ms; }
.loader-story-head p, .loader-status-text, .loader-steps span { font-family: var(--font); font-size: var(--label-size); line-height: 1.8; letter-spacing: 0; }

@media (max-width: 1120px) {
  .nav { gap: 16px; }
  .nav-toggle { display: grid; }
  .nav-links { position: absolute; inset: 100% 0 auto; display: none; padding: 20px 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .nav-links.is-open { display: flex; justify-content: center; flex-wrap: wrap; }
  .hero-layout { gap: 40px; }
  h1 { font-size: 3rem; }
  .contact-layout, .split-layout { gap: 48px; }
}
@media (max-width: 900px) {
  .hero-layout { grid-template-columns: minmax(0, 1fr); }
  .identity-panel { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 32px; }
  .identity-rule { display: none; }
  .metrics { grid-column: 2; grid-row: 1 / 3; }
  .identity-note { grid-column: 1; }
  .hero { padding-block: 48px; }
  .split-layout, .contact-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline-card { column-gap: 30px; }
  .project-preview { min-height: 260px; }
  .project-body { padding: 24px; }
  .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding-block: 60px; }
}
@media (max-width: 690px) {
  :root { --title-size: 1.625rem; }
  .shell { width: calc(100% - 40px); }
  .nav { gap: 12px; padding-block: 14px; }
  .brand { flex: 1 1 calc(100% - 60px); }
  .brand strong { font-size: .9375rem; white-space: normal; }
  .nav-tools { padding-top: 12px; justify-content: flex-end; }
  .language-control { width: 116px; }
  .print-action span { display: inline; }
  .nav-links.is-open { display: grid; justify-content: stretch; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; padding-inline: 20px; }
  .nav-links a { padding: 8px 0; }
  .hero { padding-block: 36px 44px; }
  .hero-layout { gap: 30px; }
  h1 { font-size: 2.375rem; font-weight: 700; line-height: 1.6; }
  .hero-specialty { font-size: 1.125rem; min-height: 4.5rem; margin-top: 10px; margin-bottom: 12px; }
  .hero-summary { font-size: 1.0625rem; line-height: 2.05; }
  .hero-actions { gap: 12px 20px; }
  .quick-facts { grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
  .identity-panel { display: block; padding: 24px; }
  .identity-head { flex-wrap: nowrap; }
  .identity-head > div { min-width: 0; }
  .identity-monogram { flex-basis: 56px; width: 56px; height: 56px; }
  .identity-head strong { font-size: .9375rem; }
  .identity-rule { display: block; margin-block: 20px; }
  .identity-note { margin-top: 20px; }
  .section { padding-block: 48px; }
  .section-heading h2 { line-height: 1.8; }
  .section-heading > p:not(.contact-copy), .eyebrow { margin-bottom: 12px; }
  .prose { line-height: 2.05; }
  .goal { padding-inline: 16px 0; }
  .timeline { margin-top: 30px; }
  .timeline-item, [dir="rtl"] .timeline-item { padding-inline-start: 30px; }
  .timeline-card { display: block; padding-bottom: 26px; margin-bottom: 26px; }
  .timeline-card h3 { margin: 8px 0 14px; font-size: 1.1875rem; }
  .timeline-card p { font-size: 1rem; }
  .clean-list { font-size: 1rem; line-height: 2; }
  .skill-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 28px; }
  .skill-card { padding: 24px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); margin-top: 28px; }
  .project-card { grid-template-columns: minmax(0, 1fr); }
  .project-preview { aspect-ratio: 16 / 10; min-height: 0; height: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .project-body { padding: 24px 20px; }
  .project-card h3 { font-size: 1.1875rem; }
  .details-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 26px; }
  .contact-layout { gap: 26px; }
  .section-heading > .contact-copy { font-size: 1.0625rem; line-height: 2.05; }
  .site-footer .shell { align-items: start; gap: 24px; }
  section[id] { scroll-margin-block-start: 155px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-specialty b::after { display: none; }
  .project-preview.is-tilting { transform: none; }
  .pointer-glow { display: none; }
}
