/* Mahnaz Aliyar – personal site. Soft lilac palette, light + dark. */

:root {
  --bg: #f6f2fc;
  --surface: #ffffff;
  --tint: #ece5f8;
  --tint-strong: #ddd2f2;
  --line: #e0d6f0;
  --ink: #2b2538;
  --muted: #635b72;
  --accent: #6c4fb3;
  --accent-strong: #55399a;
  --shadow: 0 1px 2px rgba(60, 40, 110, 0.05), 0 8px 24px rgba(60, 40, 110, 0.06);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16121e;
    --surface: #1e1929;
    --tint: #221c30;
    --tint-strong: #2d2442;
    --line: #342b47;
    --ink: #ece7f5;
    --muted: #aca3bf;
    --accent: #b9a1ec;
    --accent-strong: #d3c2f6;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: min(100% - 2rem, 62rem); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .25rem 1.5rem; padding-block: .75rem;
}
.brand {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand:hover { color: var(--accent); }
nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
nav a {
  display: block; padding: .35rem .85rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500;
}
nav a:hover { background: var(--tint); color: var(--ink); }
nav a[aria-current="page"] { background: var(--tint-strong); color: var(--accent-strong); }

/* ---------- Banner ---------- */
.banner { margin-top: 1.5rem; position: relative; }
.credit {
  position: absolute; right: .9rem; bottom: .6rem; font-size: .72rem; letter-spacing: .02em;
  color: rgba(255, 255, 255, .88); text-shadow: 0 1px 3px rgba(0, 0, 0, .55); pointer-events: none;
}
.banner img {
  width: 100%; height: clamp(150px, 26vw, 290px); object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: 1.6rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.lede-sm { font-size: 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: .5rem; }

main { padding-block: 2.5rem 4rem; }
section { margin-top: 3.5rem; }
section:first-child { margin-top: 0; }

/* ---------- Hero ---------- */
.hero { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.avatar {
  width: 136px; height: 136px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--tint-strong);
  flex: none;
}
.hero-text { flex: 1 1 18rem; }
.hero .role { color: var(--muted); margin: .35rem 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.chips a {
  display: inline-block; padding: .3rem .85rem; border-radius: 999px;
  background: var(--tint); border: 1px solid var(--line);
  color: var(--accent-strong); font-size: .9rem; font-weight: 500; text-decoration: none;
}
.chips a:hover { background: var(--tint-strong); }

.intro { max-width: var(--measure); margin-top: 2rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem 1.4rem; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .5rem; }
.card p:last-child { margin-bottom: 0; }
.card .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--accent); margin-bottom: .4rem; }
.card ul { margin: 0; padding-left: 1.1rem; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { transform: translateY(-2px); border-color: var(--accent); color: inherit; }
.card-link .more { color: var(--accent); font-weight: 500; font-size: .95rem; }

/* ---------- Page heading ---------- */
.page-head { max-width: var(--measure); margin-bottom: 2rem; }

/* ---------- CV ---------- */
.toc { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1.25rem 0 0; }
.toc a {
  display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .85rem;
  color: var(--muted); border: 1px solid var(--line); text-decoration: none;
}
.toc a:hover { color: var(--accent-strong); background: var(--tint); }

.cv-section { scroll-margin-top: 5rem; }
.cv-section > h2 { padding-bottom: .6rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.cv-section h3.sub { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 1.75rem 0 .75rem; }

.entry { display: grid; grid-template-columns: 9.5rem 1fr; gap: .25rem 1.5rem; margin-bottom: 1.5rem; }
.entry .when { color: var(--muted); font-size: .92rem; padding-top: .15rem; font-variant-numeric: tabular-nums; }
.entry .what { font-weight: 600; }
.entry .where { color: var(--muted); font-style: italic; }
.entry ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.entry li { margin-bottom: .3rem; }
.entry .note { color: var(--muted); font-size: .95rem; margin: .25rem 0 0; }
.entry > div > :first-child { margin-top: 0; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.tags li {
  padding: .4rem .9rem; border-radius: 12px; font-size: .95rem; font-weight: 500; line-height: 1.4;
  color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 13%, transparent);
}

.simple { list-style: none; margin: 0; padding: 0; }
.simple li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.simple li:last-child { border-bottom: 0; }
.simple .amount { color: var(--muted); font-size: .92rem; }

/* Skills section */
.skill-cols { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); align-items: start; }
.skill-col { display: grid; gap: 1rem; }
@media (max-width: 40rem) { .skill-cols { grid-template-columns: 1fr; } }
.skill-card.skill-card-compact { padding-block: .85rem; }
.skill-card.skill-card-compact h3 { margin: 0; }
.skill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.skill-card h3 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 0 0 .75rem; }
.tags-sm li { font-size: .9rem; padding: .3rem .75rem; }
.level-list, .detail-list { list-style: none; margin: 0; padding: 0; }
.level-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.level-list li:last-child { border-bottom: 0; }
.level { color: var(--muted); font-size: .92rem; }
.detail-list li { padding: .35rem 0 .6rem; }
.detail-list strong { display: block; }
.detail-list span { display: block; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.member-list { list-style: none; margin: 0; padding: 0; columns: 2 20rem; column-gap: 2rem; }
.member-list li { break-inside: avoid; padding: .4rem 0 .4rem 1.1rem; position: relative; border-bottom: 1px solid var(--line); }
.member-list li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .6; }
.entry-link { margin: .15rem 0 0; font-size: .92rem; }

.kv { display: grid; grid-template-columns: 11rem 1fr; gap: .5rem 1.5rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .92rem; }
.kv dd { margin: 0; }
.kv ul.plain { list-style: none; margin: 0; padding: 0; }
.kv ul.plain li { margin-bottom: .3rem; }

/* ---------- Research ---------- */
.pub { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.pub .meta { font-size: .85rem; color: var(--accent); font-weight: 600; margin-bottom: .35rem; }
.pub h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.pub .cite { color: var(--muted); font-size: .92rem; margin-bottom: .75rem; }
.pub .summary { margin-bottom: .75rem; }
.pub .links a { font-size: .9rem; font-weight: 500; margin-right: 1rem; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .small { display: block; color: var(--muted); font-size: .92rem; }

.year-group { display: grid; grid-template-columns: 5rem 1fr; gap: .25rem 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.year-group:last-child { border-bottom: 0; }
.year-group .year { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.year-group ul { list-style: none; padding: 0; margin: 0; }
.year-group li { margin-bottom: .6rem; }
.year-group li:last-child { margin-bottom: 0; }
.year-group .small { display: block; color: var(--muted); font-size: .92rem; }

/* ---------- Interests ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }

.gallery { columns: 3 15rem; column-gap: 1rem; margin-top: 3rem; }
.gallery figure {
  margin: 0 0 1rem; break-inside: avoid; overflow: hidden; position: relative;
  border-radius: var(--radius); background: var(--tint); box-shadow: var(--shadow);
}
.gallery img { width: 100%; height: auto; }
.gallery figure::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3rem; pointer-events: none;
  background: linear-gradient(rgba(30, 20, 55, .5), transparent);
}
.gallery figure::after {
  z-index: 1;
  content: "© Mahnaz Aliyar"; position: absolute; top: .6rem; right: .75rem;
  font-size: .72rem; letter-spacing: .02em; color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6); pointer-events: none;
}
.gallery figure[data-credit]::after { content: attr(data-credit); }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 1.75rem 1rem .75rem; font-size: .88rem; color: #fff;
  background: linear-gradient(transparent, rgba(30, 20, 55, .72));
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Small screens ---------- */
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .entry, .year-group, .kv { grid-template-columns: 1fr; gap: .1rem; }
  .entry .when { order: -1; }
  .gallery { columns: 2 10rem; column-gap: .75rem; }
  .gallery figure { margin-bottom: .75rem; }
  main { padding-block: 1.75rem 3rem; }
}

@media print {
  .site-header, .site-footer, .toc, .banner { display: none; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-link { transition: none; }
}
