:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --white: #fcfbf7;
  --ink: #142b31;
  --muted: #435b60;
  --rule: #cbd5cf;
  --teal: #006656;
  --mint: #94f4cf;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 system-ui, sans-serif; }
html[lang=fa] body { font-family: Tahoma, system-ui, sans-serif; }
.shell { width: min(1120px, calc(100% - 44px)); margin-inline: auto; }
a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 2px solid #b44d24; outline-offset: 5px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; border-bottom: 1px solid var(--rule); }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px clamp(10px, 2vw, 24px); font-size: .88rem; font-weight: 650; }
nav a, .brand { text-decoration: none; }
nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.brand { font-size: 1.7rem; font-weight: 900; letter-spacing: -.07em; }
.brand span, em, .eyebrow { color: var(--teal); }
nav a[hreflang], .nav-cv { border: 1px solid var(--rule); padding: 5px 9px; border-radius: 6px; }
.nav-cv { background: var(--ink); color: white; }
.hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 6vw, 84px); padding-block: clamp(42px, 7vw, 90px); }
.eyebrow, figcaption, footer { font: 700 .76rem/1.6 ui-monospace, monospace; letter-spacing: .09em; }
html[lang=fa] :is(.eyebrow, figcaption, footer) { font-family: inherit; letter-spacing: normal; }
h1, h2, h3 { line-height: 1.06; letter-spacing: -.045em; margin: .25em 0; }
html[lang=fa] :is(h1,h2,h3) { line-height: 1.4; letter-spacing: normal; }
h1 { font-size: clamp(2.8rem, 6.8vw, 6rem); }
html[lang=fa] h1 { font-size: clamp(2.45rem, 5vw, 4.8rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2.25rem); }
p, li { color: var(--muted); }
em { font-style: normal; }
.intro { font-size: 1.12rem; max-width: 54ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.button, .secondary { display: inline-flex; align-items: center; gap: 9px; padding: 11px 15px; font-weight: 750; text-decoration: none; border-radius: 6px; }
.button { background: var(--ink); color: white; }
.button:hover { background: var(--teal); }
.secondary { border: 1px solid var(--rule); background: var(--white); }
.secondary:hover { border-color: var(--teal); }
.secondary small { font: .66rem ui-monospace, monospace; background: #deebe4; padding: 3px 5px; border-radius: 4px; }
figure { margin: 0; }
.portrait { background: var(--ink); color: white; padding: 8px; border-radius: 16px; box-shadow: 12px 12px 0 #dbe8df; }
.portrait img { display: block; width: 100%; aspect-ratio: 1 / 1.03; object-fit: cover; border-radius: 10px; }
.portrait figcaption { display: grid; gap: 2px; padding: 10px 12px; }
.portrait figcaption strong { font: 750 1.06rem system-ui, sans-serif; }
.portrait figcaption span { color: var(--mint); }
#work { border-top: 1px solid var(--rule); padding-top: 30px; }
.projects { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 26px; }
article { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--teal); border-radius: 10px; padding: clamp(18px,3vw,32px); }
article:nth-child(2) { border-top-color: #ad613b; }
.metrics { display: flex; flex-wrap: wrap; gap: 12px 20px; padding-block: 14px; padding-inline: 0; list-style: none; border-block: 1px solid var(--rule); font-size: .82rem; margin-top: auto; }
.metrics strong { display: block; color: var(--teal); font-size: 1.35rem; }
summary { cursor: pointer; font-weight: 700; }
.services { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(20px,5vw,64px); align-items: center; margin-block: clamp(44px,7vw,90px); }
.services ul { list-style: none; padding: 0; }
.services li { padding-block: 10px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 26px 1fr; gap: 3px 9px; }
.services li span { color: var(--teal); font: 700 .75rem/2 ui-monospace, monospace; }
.services li h3 { font-size: 1.2rem; color: var(--ink); margin: 0; }
.services li p { grid-column: 2; margin: 0; }
.telemetry { background: #12282b; color: white; border-radius: 10px; padding: clamp(16px,3vw,26px); }
.telemetry figcaption { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; color: var(--mint); }
.telemetry p { color: #c1d9d0; font-size: .82rem; }
svg { width: 100%; height: auto; display: block; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-radius: 12px; padding: clamp(22px,5vw,50px); background: var(--ink); color: white; }
.contact p { color: #c8ddd8; }
.contact .eyebrow { color: var(--mint); }
.contact .button { flex-shrink: 0; color: var(--ink); background: var(--mint); }
.contact .button:hover { background: white; }
footer { padding-block: 22px; color: var(--muted); }
@media (max-width: 720px) {
  .hero, .projects, .services { grid-template-columns: 1fr; }
  .portrait { max-width: 420px; }
  .contact { align-items: flex-start; flex-direction: column; }
}
.more { margin-top: clamp(38px,6vw,74px); }
.compact { grid-template-columns: repeat(3,minmax(0,1fr)); }
.compact article { border-top: 1px solid var(--rule); }
.compact h3 { font-size: 1.35rem; }
.compact p { margin-bottom: 0; }
.about { margin-bottom: clamp(38px,6vw,74px); padding-top: 26px; border-top: 1px solid var(--rule); }
.about p { max-width: 76ch; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
html[dir=rtl] .stack { justify-content: flex-end; }
.stack li { border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; background: var(--white); font: .8rem/1.5 ui-monospace,monospace; }
@media (max-width: 720px) { .compact { grid-template-columns: 1fr; } }
.portrait { width: min(100%, 300px); justify-self: center; }
.portrait img { aspect-ratio: 1 / 1; }
.compact .eyebrow { margin: 0 0 6px; }
@media (max-width: 720px) {
  .portrait { width: min(100%, 220px); justify-self: start; }
}
