/* Amir Paksaz: academic site. Self-hosted fonts, light and dark themes, no JavaScript. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --ink: #242524;
  --muted: #565c61;
  --accent: #891d2c;
  --btn: #891d2c;
  --btn-hover: #681321;
  --line: #e3dfda;
  --paper: #ffffff;
  --soft: #f8f6f3;
  --focus: #9a6420;
  --shadow: rgba(30, 24, 21, .13);
  --header-bg: rgba(255, 255, 255, .88);
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece8e3;
    --muted: #aaa49c;
    --accent: #ee9ca8;
    --btn: #a3283b;
    --btn-hover: #b8374b;
    --line: #34302d;
    --paper: #161514;
    --soft: #1e1c1a;
    --focus: #e2a94f;
    --shadow: rgba(0, 0, 0, .5);
    --header-bg: rgba(22, 21, 20, .88);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 17px/1.78 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 3px; }
img, svg { max-width: 100%; }
.wrap { width: min(1160px, calc(100% - 72px)); margin: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header and navigation */
header {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
.head { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; flex-wrap: wrap; }
.brand { font: 600 26px/1.2 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.5px; }
nav { display: flex; gap: 29px; flex-wrap: wrap; align-items: center; }
nav a {
  color: var(--muted); font-size: 16px; font-weight: 500; line-height: 1.3; text-decoration: none;
  padding: 14px 0 11px; border-bottom: 3px solid transparent;
}
nav a:hover { color: var(--accent); }
nav a[aria-current=page] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.skip { position: absolute; left: -10000px; }
.skip:focus { left: 10px; top: 10px; background: var(--paper); color: var(--ink); padding: 12px; z-index: 30; border-radius: 6px; }

/* Type */
main { padding: 60px 0 78px; min-height: 65vh; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.23; margin: 0 0 14px; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: clamp(36px, 4vw, 48px); letter-spacing: -1.1px; }
h2 { font-size: 30px; margin-top: 44px; letter-spacing: -.45px; }
h3 { font-size: 23px; letter-spacing: -.2px; }
p { margin: 0 0 19px; text-wrap: pretty; }
strong { font-weight: 600; }
.eyebrow { font-size: 12px; line-height: 1.5; letter-spacing: 1.65px; text-transform: uppercase; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.lead { font-family: var(--serif); font-size: 23px; line-height: 1.45; color: var(--muted); max-width: 770px; }
.lead-wide { max-width: none; }
.nb { white-space: nowrap; }
.muted, .meta { color: var(--muted); font-size: 15px; line-height: 1.6; }
.tag { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .3px; }
.rule { width: 54px; height: 3px; background: var(--accent); margin: 22px 0 26px; border-radius: 2px; }

/* Home layout: hero and body sit in the right column, profile card on the left */
.home {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-areas: "side hero" "side body";
  grid-template-rows: auto 1fr;
  column-gap: 56px;
  align-items: start;
}
.hero { grid-area: hero; min-width: 0; position: relative; }
.hero > * { position: relative; }
.hero::before {
  content: ""; position: absolute; right: -10px; top: -26px; width: 300px; height: 200px; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--line) 1.4px, transparent 1.6px); background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent);
}
.home .body { grid-area: body; min-width: 0; }
.home aside { grid-area: side; align-self: start; }
.hero { padding-bottom: 30px; }
.hero .lead { margin-bottom: 0; }
.hero p, .body > p { max-width: 70ch; }
.hero .lead { max-width: 770px; }

.portrait { display: block; width: 100%; aspect-ratio: 594 / 791; border-radius: 14px; overflow: hidden; background: var(--soft); box-shadow: 0 7px 23px var(--shadow); }
.portrait picture, .portrait img { display: block; width: 100%; height: 100%; }
.portrait img { object-fit: cover; object-position: center top; }
.profile { padding-top: 23px; font-size: 15px; line-height: 1.65; color: var(--muted); }
.profile p { margin-bottom: 12px; }
.profile strong { color: var(--ink); }
.office-address { font-style: normal; line-height: 1.65; margin: 16px 0; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 4px 19px; font-size: 15px; }
.contact-icon { width: 17px; height: 17px; flex: 0 0 17px; display: block; }
.profile .contact-link { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 28px; }
.contact-link span, .address-line span { min-width: 0; overflow-wrap: anywhere; }
.address-line { display: flex; align-items: flex-start; gap: 8px; }
.address-line .contact-icon { margin-top: 4px; color: var(--muted); }
.profile .links .contact-link { text-decoration: none; }
.profile .links .contact-link:hover span { text-decoration: underline; }

@media (min-width: 901px) and (min-height: 780px) {
  .home aside { position: sticky; top: 100px; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 4px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  background: var(--btn); color: #fff; padding: 10px 22px; text-decoration: none; border-radius: 8px;
  font-weight: 600; font-size: 15px; line-height: 1.3; border: 1.5px solid var(--btn);
}
.button:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.button.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.button.secondary:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.arrow { width: 15px; height: 15px; flex: 0 0 15px; display: inline-block; vertical-align: -2px; }

/* Cards */
.feature { border-left: 3px solid var(--accent); background: var(--soft); padding: 26px 28px; margin: 30px 0; border-radius: 0 10px 10px 0; }
.feature-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 290px); gap: 18px 32px; align-items: center; }
.feature h2, .feature h3 { font-size: 23px; letter-spacing: -.2px; margin: 0 0 9px; }
.feature p:last-child { margin-bottom: 0; }
.feature .teaser { margin: 12px 0 18px; }
.feature .text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; font-weight: 600; text-decoration: none; }
.feature .text-link:hover span { text-decoration: underline; }
.illustration { margin: 0; }
.illustration svg { display: block; width: 100%; height: auto; }
.illustration figcaption { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 8px; }
.il-route { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.il-seen { fill: var(--accent); }
.il-ring { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .45; }
.il-halo { fill: color-mix(in srgb, var(--muted) 14%, transparent); stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 2.5 3.5; }
.il-unseen { fill: var(--soft); stroke: var(--muted); stroke-width: 1.4; }
.il-depot { fill: var(--ink); }

.chips, .interests { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li, .interests li { border: 1px solid var(--line); background: var(--soft); padding: 5px 15px; border-radius: 999px; font-size: 15px; line-height: 1.5; }
.chips { margin: 14px 0 0; }
.chips li { font-size: 13.5px; padding: 3px 12px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 32px 0 6px; padding: 0; list-style: none; }
.stat { display: block; height: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 15px; text-decoration: none; color: var(--ink); background: var(--paper); }
.stat b { display: block; font: 600 36px/1.1 var(--serif); color: var(--accent); letter-spacing: -.5px; }
.stat span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.stat:hover { border-color: var(--accent); }

.entry { padding: 24px 0; border-bottom: 1px solid var(--line); }
.entry h3, .entry h2 { margin-bottom: 9px; }
.entry h2 { font-size: 23px; letter-spacing: -.2px; margin-top: 0; text-wrap: pretty; }
.entry p { margin-bottom: 9px; }
.entry p:last-child { margin-bottom: 0; }
.entry .tag { margin-bottom: 4px; }
.entry .venue { color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.5; margin-bottom: 4px; }
.feature .venue { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0 0 14px; }
.duties { margin: 0; padding-left: 20px; }
.feature-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.feature-foot .chips { margin: 0; }
.foot-label { font-size: 12px; line-height: 1.5; letter-spacing: 1.65px; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.duties li { margin-bottom: 4px; }
.duties li::marker { color: var(--accent); }
.feature-grid.has-photo { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
.class-photo { margin: 0; }
.class-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.class-photo figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (prefers-color-scheme: dark) { .class-photo img { filter: brightness(.92); } }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 14px; margin-top: 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1.4; }
.pill:hover { border-color: var(--accent); background: var(--soft); }

.news { padding: 0; list-style: none; }
.news li { display: grid; grid-template-columns: 105px 1fr; gap: 16px; border-bottom: 1px solid var(--line); padding: 13px 0; font-size: 15px; }
time { color: var(--muted); font-variant-numeric: tabular-nums; }
.content { max-width: 850px; }
.content > h1 { font-size: clamp(38px, 4.2vw, 50px); }
.plain-list { padding-left: 20px; }
.plain-list li { margin-bottom: 4px; }

/* CV */
.cv-content { margin-inline: auto; width: 100%; max-width: 850px; }
.cv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 6px 0 0; }
.cv-preview { display: block; border: 1px solid var(--line); width: 100%; max-width: 850px; height: min(900px, 78vh); min-height: 620px; margin: 30px auto 0; border-radius: 10px; overflow: hidden; background: var(--soft); }

footer { border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); padding: 24px 0; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.foot a { display: inline-flex; align-items: center; min-height: 28px; }
.notfound { text-align: center; padding: 80px 0; }
.notfound .lead { margin-inline: auto; }
.notfound .actions { justify-content: center; }

/* Touch devices: comfortable tap targets */
@media (pointer: coarse) {
  .brand { display: inline-flex; align-items: center; min-height: 44px; }
  .profile .contact-link, .foot a, .feature .text-link, .pill { min-height: 44px; }
  .links { gap: 0 20px; }
}

/* Motion: only for people who have not asked for less. */
@media (prefers-reduced-motion: no-preference) {
  .button, .stat, .pill, nav a { transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
  .stat:hover, .button:hover { transform: translateY(-2px); }
}

@media (max-width: 900px) {
  .head { gap: 4px; padding-top: 6px; }
  nav { gap: 22px; width: 100%; }
  .home { grid-template-columns: 230px minmax(0, 1fr); column-gap: 34px; }
  h1 { font-size: clamp(33px, 4.6vw, 43px); }
  .wrap { width: calc(100% - 48px); }
  .feature-grid, .feature-grid.has-photo { grid-template-columns: minmax(0, 1fr); }
  .illustration { max-width: 400px; }
  .feature .class-photo { max-width: 560px; }
  .hero::before { display: none; }
}

@media (max-width: 760px) {
  header { position: static; }
  .home { display: flex; flex-direction: column; gap: 30px; }
  .home aside { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0 18px; align-items: start; order: 2; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
  .hero { order: 1; }
  .home .body { order: 3; }
  .portrait { border-radius: 10px; box-shadow: none; }
  .profile { padding: 0; font-size: 14px; }
  .profile p { margin-bottom: 6px; }
  .office-address { margin: 6px 0 8px; line-height: 1.5; }
  .links { gap: 2px 14px; font-size: 14px; }
  .contact-icon { width: 15px; height: 15px; flex-basis: 15px; }
  .profile .contact-link, .address-line { gap: 6px; }
}

@media (max-width: 660px) {
  .wrap { width: calc(100% - 36px); }
  .brand { font-size: 24px; }
  .head { min-height: 0; padding-top: 14px; }
  nav { gap: 0; justify-content: space-between; }
  nav a { font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 0 5px; }
  main { padding: 30px 0 50px; }
  body { font-size: 16px; line-height: 1.72; }
  .lead { font-size: 21px; }
  h2 { font-size: 27px; margin-top: 36px; }
  h3, .entry h2 { font-size: 22px; }
  .interests { gap: 8px; }
  .feature { padding: 20px; }
  .feature .class-photo { max-width: none; }
  .cv-preview { display: none; }
  .news li { grid-template-columns: 85px 1fr; gap: 10px; }
  .stats { gap: 10px; }
  .stat { padding: 14px 12px 12px; }
  .stat b { font-size: 30px; }
  .stat span { font-size: 13px; }
  .actions .button { flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .home aside { grid-template-columns: 96px minmax(0, 1fr); gap: 0 14px; padding: 14px; }
  .profile { font-size: 13.5px; }
}
@media (max-width: 360px) {
  nav a { font-size: 13px; }
  .brand { font-size: 22px; }
}

@media print {
  header, footer, .actions, .button, .illustration, .stats, .skip, .cv-preview, .hero::before { display: none !important; }
  body { font-size: 11.5pt; line-height: 1.5; color: #000; background: #fff; }
  main { padding: 0; min-height: 0; }
  .wrap { width: 100%; }
  .home { display: block; }
  .home aside { position: static; display: block; border: 0; padding: 0; background: none; }
  .portrait { width: 150px; box-shadow: none; }
  .feature { background: none; border-left-color: #000; }
  a { color: #000; }
  .content a[href^="http"]::after, .body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  .entry, .class-photo { break-inside: avoid; }
}
