/* ============================================================
   Toghrul Aghbabali — site styles
   Classic academic look. Change colors in the :root block.
   ============================================================ */

:root {
  --ink:        #1c1a17;   /* main text */
  --ink-soft:   #4a463f;   /* secondary text */
  --ink-mute:   #7d776d;   /* dates, labels */
  --paper:      #fbfaf7;   /* page background */
  --paper-2:    #f3f0ea;   /* subtle panels */
  --rule:       #e2ddd3;   /* hairlines */
  --accent:     #1f3a5f;   /* deep navy — links, headings */
  --accent-2:   #8b6b2e;   /* muted gold — small highlights */
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(31,58,95,.25); transition: border-color .15s; }
a:hover { border-bottom-color: var(--accent); }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.2; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251,250,247,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 20px; }
.nav .brand { font-family: var(--serif); font-size: 17px; letter-spacing: .01em; border: 0; color: var(--ink); white-space: nowrap; }
.nav .brand span { color: var(--ink-mute); font-style: italic; margin-left: 8px; display: none; }
.nav ul { display: flex; gap: 22px; font-family: var(--sans); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.nav ul a { color: var(--ink-soft); border: 0; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav ul a:hover, .nav ul a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 10px; font: 13px var(--sans); color: var(--ink-soft); cursor: pointer; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; border-bottom: 1px solid var(--rule); position: relative; color: #fff;
  background: linear-gradient(100deg, rgba(16,30,52,.92) 0%, rgba(20,38,64,.78) 45%, rgba(20,38,64,.45) 100%),
              url("banner.jpg") center 40% / cover no-repeat, var(--accent); }
.hero .kicker { color: #e6c88a; }
.hero .btn { border-color: rgba(255,255,255,.85); color: #fff; }
.hero .btn.primary { background: #fff; color: var(--accent); border-color: #fff; }
.hero .iconlinks a { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); color: #fff; }
.hero .wrap { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: center; }
.hero.no-photo .wrap { grid-template-columns: 1fr; }
.kicker { font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 14px; }
.hero h1 { color: #fff; font-size: clamp(38px, 5vw, 56px); font-weight: 400; letter-spacing: -.01em; margin-bottom: 14px; }
.hero .role { font-size: 20px; color: rgba(255,255,255,.92); margin: 0 0 4px; }
.hero .inst { font-size: 17px; color: rgba(255,255,255,.78); margin: 0 0 22px; }
.hero .tagline { font-style: italic; color: rgba(255,255,255,.92); margin: 0 0 28px; font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { font-family: var(--sans); font-size: 13.5px; letter-spacing: .02em; padding: 10px 18px; border-radius: 4px; border: 1px solid var(--accent); color: var(--accent); background: transparent; display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn:hover { border-bottom-color: var(--accent); filter: brightness(1.08); }
.iconlinks { display: flex; gap: 8px; margin-left: 6px; }
.iconlinks a { border: 1px solid var(--rule); border-radius: 50%; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); background: #fff; }
.iconlinks a:hover { color: var(--accent); border-color: var(--accent); }
.iconlinks svg { width: 17px; height: 17px; fill: currentColor; }
.portrait { width: 100%; }
.portrait .track { box-shadow: 0 18px 40px -16px rgba(0,0,0,.6); }

/* ---------- Sections ---------- */
section { padding: 64px 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: 0; }

/* ---------- Header photo carousel ---------- */
.carousel { position: relative; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; border-radius: 6px; scrollbar-width: none; background: rgba(0,0,0,.25); }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; position: relative; aspect-ratio: 4 / 3; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide.full { overflow: hidden; }
.slide.full img { position: relative; object-fit: contain; }
.slide.full img.bg { position: absolute; inset: 0; object-fit: cover; filter: blur(18px) brightness(.95); transform: scale(1.15); }
.slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 18px 14px; font-family: var(--sans); font-size: 14px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.cbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--accent); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; padding-bottom: 4px; }
.cbtn.prev { left: 10px; } .cbtn.next { right: 10px; }
.carousel:not(:hover) .cbtn { opacity: .75; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.dots:empty { display: none; }
.dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.4); cursor: pointer; }
.dots button.on { background: #fff; }
.section-head { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.section-head h2 { font-size: 15px; font-family: var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; padding-top: 6px; }
.section-body { min-width: 0; }
.lead p { font-size: 18.5px; line-height: 1.7; margin: 0 0 18px; }
.lead p:last-child { margin-bottom: 0; }

/* interests as tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tags li { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 13px; }

/* papers */
.paper { padding: 26px 0; border-top: 1px solid var(--rule); }
.paper:first-child { border-top: 0; padding-top: 0; }
.paper h3 { font-size: 21px; font-weight: 500; margin-bottom: 6px; }
.paper h3 a { border: 0; color: var(--ink); }
.paper h3 a:hover { color: var(--accent); }
.paper .meta { color: var(--ink-soft); font-size: 16px; }
.paper .meta .sep { color: var(--ink-mute); margin: 0 8px; }
.status { font-family: var(--sans); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); border: 1px solid var(--rule); padding: 2px 8px; border-radius: 3px; vertical-align: 2px; margin-left: 8px; }
.paper .award { margin-top: 10px; font-size: 15.5px; color: var(--accent-2); }
.paper .award::before { content: "★ "; }
.paper .notes { margin-top: 8px; color: var(--ink-soft); font-size: 15.5px; }
.paper .notes li { padding-left: 14px; position: relative; }
.paper .notes li::before { content: "—"; position: absolute; left: 0; color: var(--ink-mute); }
.paper .plinks { margin-top: 12px; display: flex; gap: 14px; font-family: var(--sans); font-size: 13px; letter-spacing: .03em; }
.paper .plinks a { border: 0; }
.paper .plinks a::after { content: " ↗"; font-size: 11px; }
details.abs { margin-top: 10px; font-size: 16px; color: var(--ink-soft); }
details.abs summary { cursor: pointer; font-family: var(--sans); font-size: 13px; letter-spacing: .03em; color: var(--accent); list-style: none; }
details.abs summary::-webkit-details-marker { display: none; }
details.abs summary::before { content: "+ "; }
details[open].abs summary::before { content: "− "; }
details.abs p { margin: 8px 0 0; }

/* timeline-style lists (year + text) */
.yl li { display: grid; grid-template-columns: 96px 1fr; gap: 20px; padding: 10px 0; border-top: 1px solid var(--rule); }
.yl li:first-child { border-top: 0; padding-top: 0; }
.yl .yr { font-family: var(--sans); font-size: 13.5px; color: var(--ink-mute); padding-top: 4px; letter-spacing: .02em; }

/* entries (education, teaching, experience) */
.entry { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; padding: 20px 0; border-top: 1px solid var(--rule); }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry h3 { font-size: 19px; font-weight: 500; }
.entry .sub { color: var(--ink-soft); }
.entry .when { font-family: var(--sans); font-size: 13.5px; color: var(--ink-mute); text-align: right; white-space: nowrap; padding-top: 5px; }
.entry .notes { grid-column: 1 / -1; color: var(--ink-soft); font-size: 15.5px; margin-top: 2px; }
.entry .notes li { padding-left: 14px; position: relative; }
.entry .notes li::before { content: "·"; position: absolute; left: 2px; color: var(--ink-mute); }
.entry .courses { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.entry .courses li { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; padding: 3px 10px; }

/* two-column misc grid */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 48px; }
.grid2 h3 { font-family: var(--sans); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 12px; font-weight: 600; }
.grid2 ul:not(.tags) li { padding: 5px 0; border-top: 1px solid var(--rule); font-size: 16px; }
.grid2 ul:not(.tags) li:first-child { border-top: 0; padding-top: 0; }
.media li { padding: 10px 0; border-top: 1px solid var(--rule); }
.media li:first-child { border-top: 0; padding-top: 0; }
.media .outlet { display: block; font-family: var(--sans); font-size: 13px; color: var(--ink-mute); margin-top: 2px; }

/* contact */
.contact p { margin: 0 0 12px; font-size: 18px; }
.contact .email { font-size: 22px; }

/* footer */
footer { padding: 36px 0 48px; color: var(--ink-mute); font-family: var(--sans); font-size: 13px; border-top: 1px solid var(--rule); }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; gap: 18px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
  .hero .wrap .portrait { order: -1; width: 100%; max-width: 420px; }
  .grid2 { grid-template-columns: 1fr; }
  .nav .brand span { display: inline; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 44px 0 40px; }
  section { padding: 44px 0; }
  .nav ul { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px 18px 14px; }
  .nav ul.open { display: flex; }
  .nav ul a { display: block; padding: 10px 0; }
  .nav-toggle { display: inline-block; }
  .entry { grid-template-columns: 1fr; }
  .entry .when { text-align: left; padding-top: 0; }
  .yl li { grid-template-columns: 1fr; gap: 2px; }
  .lead p { font-size: 17px; }
}
@media print {
  .nav, .actions, .nav-toggle { display: none; }
  body { background: #fff; font-size: 12pt; }
  section { padding: 24px 0; }
}
