/* Reza Etemadi Idgahi — personal site. */
:root {
  --paper: #fafaf8;
  --white: #fff;
  --ink: #202522;
  --muted: #657068;
  --faint: #6c756e;
  --rule: #dddfd8;
  --accent: #245947;
  --accent-dark: #193e32;
  --wash: #eeefe9;
  --measure: 1120px;
  --sans: Arial, Helvetica, "Segoe UI", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
::selection { color: var(--ink); background: #d9e6da; }
img, svg, video { max-width: 100%; }
img { display: block; height: auto; }
button, input, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
h1, h2, h3, h4, p, figure, blockquote { margin-top: 0; }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(42px, 5.8vw, 72px); }
h2 { font-size: 36px; }
h3 { font-size: 25px; }
p { margin-bottom: 1.15em; }
.container { width: min(var(--measure), calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; transform: translateY(-180%); padding: 12px 20px; background: var(--ink); color: white; text-decoration: none; }
.skip-link:focus { transform: none; color: white; }

a.ext::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.28em;
  vertical-align: -0.1em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M4.15 3.15h8.7v8.7h-1.45V5.55L4.55 12.4 3.5 11.35l6.85-6.85H4.15z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M4.15 3.15h8.7v8.7h-1.45V5.55L4.55 12.4 3.5 11.35l6.85-6.85H4.15z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.site-header { border-bottom: 1px solid var(--rule); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 36px; min-height: 76px; }
.wordmark { display: block; min-width: 0; color: var(--ink); font-size: 20px; line-height: 1.25; letter-spacing: -.045em; font-weight: 600; text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.site-nav { display: flex; flex-shrink: 0; align-items: center; flex-wrap: wrap; gap: 29px; }
.site-nav a { position: relative; padding: 9px 0; color: var(--muted); font-size: 13px; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { position: absolute; right: 0; bottom: 2px; left: 0; height: 1px; background: var(--accent); content: ""; }

.eyebrow, .post-meta, .article-meta { font-size: 11px; line-height: 1.6; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { color: var(--accent); margin-bottom: 26px; }
.inline-links { display: flex; align-items: center; flex-wrap: wrap; gap: 23px; }
.inline-links a, .text-link, button.linkish { font-size: 13px; font-weight: 500; text-decoration: none; }
.inline-links a:hover, .text-link:hover, button.linkish:hover { text-decoration: underline; }
.text-link { display: inline-block; }
button.linkish { padding: 0; border: 0; background: none; color: var(--accent); cursor: pointer; }
button.linkish:hover { color: var(--accent-dark); }

.page-intro { padding: 71px 0 55px; }
.page-intro .eyebrow { margin-bottom: 20px; }
.page-intro h1 { margin-bottom: 23px; }
.lede { max-width: 690px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.page-intro .lede { max-width: 760px; }

.about-intro { display: grid; grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "heading portrait" "summary portrait"; align-items: start; gap: 28px 64px; padding: 72px 0; }
.about-heading { grid-area: heading; min-width: 0; }
.about-heading .eyebrow { margin-bottom: 20px; }
.about-heading h1 { margin-bottom: 20px; font-size: clamp(42px, 5vw, 64px); line-height: 1.1; letter-spacing: -.045em; }
.about-heading .lede { max-width: none; margin-bottom: 0; font-size: 18px; line-height: 1.6; }
.about-portrait { grid-area: portrait; align-self: center; overflow: hidden; border-radius: 4px; background: var(--wash); }
.about-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 18%; }
.about-summary { grid-area: summary; min-width: 0; max-width: 720px; font-size: 16px; line-height: 1.85; }
.about-summary p:last-of-type { margin-bottom: 24px; }
.about-links { gap: 28px; }
.about-links a { padding-block: 6px; }

.about-page .section-head { margin-bottom: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 22px; margin-bottom: 27px; }
.section-head h2 { margin-bottom: 0; font-size: 28px; }
.about-page .experience-grid { column-gap: 48px; row-gap: 0; margin-top: 24px; margin-bottom: 64px; }
.experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.experience-item { padding: 26px 0 28px; border-top: 1px solid var(--rule); }
.about-page .experience-item .eyebrow { margin-bottom: 10px; color: var(--accent); font-size: 11px; }
.experience-item h3 { margin-bottom: 8px; font-size: 23px; }
.experience-item p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.experience-item .role-meta { margin-bottom: 12px; color: var(--faint); font-size: 12px; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.about-page .experience-item p:last-child { margin-bottom: 0; }

.about-page .talk-list { margin-top: 24px; margin-bottom: 64px; }
.talk-list { margin: 20px 0 56px; border-top: 1px solid var(--rule); }
.talk { padding: 24px 0; border-bottom: 1px solid var(--rule); }
.about-page .talk { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 36px; padding-block: 30px; }
.about-page .talk .post-meta { display: block; margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.7; letter-spacing: 0; text-transform: none; }
.about-page .talk .post-meta span { display: block; margin-bottom: 5px; color: var(--ink); }
.talk-content { min-width: 0; }
.talk h3 { margin-bottom: 8px; font-size: 21px; }
.about-page .talk h3 { font-size: 22px; line-height: 1.35; }
.talk h3 a { color: inherit; text-decoration: none; }
.talk h3 a:hover { color: var(--accent); }
.talk p { max-width: 850px; margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.publication-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 13px; }
.publication-links a { padding-block: 4px; text-decoration: none; font-weight: 500; }
.publication-links a:hover { text-decoration: underline; }

.about-contact { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 36px; padding: 36px 0 64px; border-top: 1px solid var(--rule); }
.about-contact h2 { margin-bottom: 0; font-size: 28px; }
.about-contact p { max-width: none; margin-bottom: 12px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.about-contact .contact-email { font-size: 18px; font-weight: 500; text-decoration: none; }
.about-contact .contact-email:hover { text-decoration: underline; }
.contact-email { overflow-wrap: anywhere; }

.feature-post { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 64px; padding: 32px 36px; border: 1px solid var(--rule); }
.post-meta { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 18px; row-gap: 5px; margin-bottom: 11px; color: var(--muted); font-size: 10px; }
.feature-post h2 { margin-bottom: 18px; font-size: clamp(30px, 3.5vw, 40px); line-height: 1.12; letter-spacing: -.045em; }
.feature-post h2 a { color: inherit; text-decoration: none; }
.feature-post h2 a:hover { color: var(--accent); }
.summary { color: var(--muted); font-size: 14px; line-height: 1.8; }
.feature-post .summary { max-width: 640px; margin-bottom: 27px; }
.feature-post .text-link { margin-top: 4px; }

.project-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-bottom: 72px; }
.project-card { display: flex; flex-direction: column; align-items: flex-start; padding: 32px; border: 1px solid var(--rule); }
.project-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 24px; background: var(--wash); }
.project-card .eyebrow { margin-bottom: 18px; }
.project-card h2, .project-card h3 { margin-bottom: 18px; font-size: 28px; }
.project-card h2 a, .project-card h3 a { color: inherit; text-decoration: none; }
.project-card h2 a:hover, .project-card h3 a:hover { color: var(--accent); }
.project-card p { color: var(--muted); font-size: 15px; line-height: 1.8; }
.project-card .text-link { margin-top: auto; padding-top: 15px; }
.project-card .text-link + .text-link { margin-top: 0; padding-top: 9px; }

.article-header { padding-top: 44px; padding-bottom: 42px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 39px; color: var(--muted); font-size: 12px; text-decoration: none; }
.breadcrumbs:hover { color: var(--accent); }
.article-meta { margin-bottom: 18px; color: var(--muted); font-size: 11px; letter-spacing: .09em; }
.article-header h1 { max-width: 940px; margin-bottom: 25px; font-size: clamp(42px, 5.1vw, 62px); line-height: 1.1; letter-spacing: -.05em; }
.article-deck { max-width: 780px; margin-bottom: 24px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.article-layout { display: grid; grid-template-columns: minmax(0, 800px); padding-top: 40px; padding-bottom: 66px; border-top: 1px solid var(--rule); }
.article-body { min-width: 0; max-width: 800px; font-size: 18px; line-height: 1.75; overflow-wrap: break-word; }
.article-body p { margin-bottom: 1.35em; }
.article-body h2 { margin: 62px 0 23px; font-size: 31px; line-height: 1.25; letter-spacing: -.035em; }
.article-body > :first-child { margin-top: 0; }
.article-body figure { margin: 0 0 36px; }
.article-body figure img { width: 100%; height: auto; }
.article-body figcaption { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.article-end { margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; }
.article-end .text-link { margin-top: 8px; }

.cite-dialog { width: min(720px, calc(100% - 48px)); padding: 28px 28px 24px; border: 1px solid var(--rule); background: var(--white); color: var(--ink); }
.cite-dialog::backdrop { background: rgb(32 37 34 / 40%); }
.cite-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cite-head h2 { margin: 0; font-size: 22px; }
.cite-dialog pre { max-height: 50vh; margin: 0 0 18px; padding: 16px; overflow: auto; border: 1px solid var(--rule); background: #f1f2ed; color: #303a34; font-family: var(--mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.cite-actions { display: flex; gap: 18px; }

.site-footer { border-top: 1px solid var(--rule); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 110px; padding-block: 26px; color: var(--muted); font-size: 11px; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--muted); font-size: 11px; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.back-top { display: inline-block; }

@media (max-width: 1099px) {
  .about-intro { grid-template-columns: minmax(0, 1fr) 220px; column-gap: 40px; }
}

@media (max-width: 760px) {
  .container { width: calc(100% - 48px); }
  .header-inner { min-height: 72px; gap: 24px; }
  .wordmark { font-size: 18px; }
  .site-nav { gap: 19px; }
  .site-nav a { font-size: 12px; }
  .section-head h2 { font-size: 26px; }
  .page-intro { padding: 52px 0 36px; }
  .page-intro h1 { font-size: 48px; }
  .lede { font-size: 16px; }
  .about-intro { grid-template-columns: minmax(0, 1fr) 180px; grid-template-areas: "heading portrait" "summary summary"; align-items: center; gap: 30px; padding-block: 48px; }
  .about-heading h1 { font-size: clamp(34px, 6vw, 46px); }
  .about-heading .lede { font-size: 16px; }
  .about-page .experience-grid { margin-bottom: 48px; }
  .about-page .experience-item { padding-block: 24px; }
  .about-page .talk { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-block: 24px; }
  .about-page .talk .post-meta { display: flex; column-gap: 16px; }
  .about-page .talk .post-meta span { margin-bottom: 0; }
  .about-page .talk-list { margin-bottom: 48px; }
  .about-contact { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 28px 48px; }
  .experience-grid { grid-template-columns: minmax(0, 1fr); }
  .project-cards { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-bottom: 48px; }
  .project-card { padding: 28px; }
  .feature-post { padding: 28px; margin-bottom: 48px; }
  .article-header { padding: 31px 0 32px; }
  .breadcrumbs { margin-bottom: 30px; font-size: 11px; }
  .article-header h1 { font-size: clamp(38px, 7.5vw, 53px); }
  .article-deck { font-size: 16px; }
  .article-layout { padding-top: 26px; padding-bottom: 40px; }
  .article-body { font-size: 17px; line-height: 1.8; }
  .article-body h2 { margin-top: 43px; font-size: 28px; }
  .footer-inner { align-items: flex-start; min-height: 105px; font-size: 10px; }
  .footer-links { gap: 16px; }
  .footer-links a { font-size: 10px; }
}

@media (max-width: 520px) {
  .container { width: calc(100% - 40px); }
  .header-inner { flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; min-height: 0; padding-block: 20px 16px; }
  .site-nav { justify-content: flex-start; width: 100%; gap: 22px; }
  .site-nav a { padding: 5px 0; font-size: 12px; }
  .site-nav a[aria-current="page"]::after { bottom: 0; }
  .page-intro h1 { font-size: 42px; }
  .about-intro { grid-template-columns: minmax(0, 1fr); grid-template-areas: "heading" "portrait" "summary"; gap: 26px; padding-block: 36px 44px; }
  .about-heading .eyebrow { margin-bottom: 16px; }
  .about-heading h1 { margin-bottom: 16px; font-size: clamp(36px, 9.5vw, 46px); }
  .about-portrait { width: 180px; }
  .about-summary { font-size: 15px; }
  .about-contact .contact-email { font-size: 16px; }
  .inline-links { gap: 18px 22px; }
  .feature-post { padding: 26px 24px; }
  .feature-post h2 { font-size: 33px; }
  .section-head h2 { font-size: 25px; }
  .article-header h1 { font-size: 37px; overflow-wrap: break-word; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 26px; }
  .footer-inner { flex-direction: column; gap: 17px; padding-block: 27px; }
  .footer-links { gap: 18px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  :root { --paper: #fff; --ink: #000; --muted: #444; --accent: #000; }
  .site-header, .site-footer, .skip-link, .back-top, .breadcrumbs { display: none !important; }
  .container { width: 100%; }
  a { color: #000; }
}
