/* ---------------------------------------------------------------
   Yassin Alaya — personal site
   One stylesheet, no build step, no dependencies.
   Colours are defined once as variables and swapped for dark mode.
   --------------------------------------------------------------- */

:root {
  --bg:        #fdfdfc;
  --surface:   #f4f3f0;
  --text:      #1c1c1a;
  --muted:     #6b6b66;
  --rule:      #e0dfda;
  --accent:    #7a2e2e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #16161a;
    --surface: #1f1f24;
    --text:    #e6e5e0;
    --muted:   #9b9a94;
    --rule:    #33333a;
    --accent:  #d98c8c;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* --- header / nav ------------------------------------------------ */

header {
  padding: 3.5rem 0 0;
}

.name {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.name a { color: inherit; text-decoration: none; }

.affil {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 1rem;
}

nav {
  margin: 1.75rem 0 0;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

nav a:hover { color: var(--text); }

nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* --- typography --------------------------------------------------- */

main { padding-top: 2.5rem; }

h2 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.75rem 0 1rem;
}

main > section:first-child > h2 { margin-top: 0; }

h3 {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.4;
}

p { margin: 0 0 1.1rem; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }

ul { padding-left: 1.15rem; }
li { margin-bottom: 0.4rem; }

/* --- papers ------------------------------------------------------- */

.paper {
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
}

.paper:first-of-type { border-top: none; padding-top: 0; }

.paper .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.7rem;
}

.paper .abstract {
  font-size: 0.96rem;
  margin: 0.7rem 0 0.9rem;
  color: var(--text);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.1rem 0.45rem;
  vertical-align: 0.15em;
  margin-left: 0.4rem;
}

/* Collapsible abstracts degrade to plain visible text without JS. */
details.abstract-toggle > summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  list-style: none;
}
details.abstract-toggle > summary::-webkit-details-marker { display: none; }
details.abstract-toggle > summary::before { content: "▸ "; }
details.abstract-toggle[open] > summary::before { content: "▾ "; }
details.abstract-toggle > summary:hover { color: var(--text); }

/* --- contact list -------------------------------------------------- */

dl.contact { margin: 0; }
dl.contact > div {
  display: flex;
  gap: 1rem;
  padding: 0.3rem 0;
}
dl.contact dt {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 6.5rem;
  flex: 0 0 auto;
}
dl.contact dd { margin: 0; font-size: 0.95rem; }

/* --- footer -------------------------------------------------------- */

footer {
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- small screens -------------------------------------------------- */

@media (max-width: 34rem) {
  body { font-size: 16px; }
  header { padding-top: 2.5rem; }
  .name { font-size: 1.6rem; }
  nav { gap: 0.9rem 1rem; }
  dl.contact > div { flex-direction: column; gap: 0; }
}

/* --- course list (teaching page) ------------------------------------ */
/* Course on the left, years flush right — the \hfill layout of a CV. */

p.note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
}

ul.courses {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.courses > li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}

ul.courses > li:last-child { border-bottom: none; }

.course em {
  font-style: italic;
}

.level {
  color: var(--muted);
  font-size: 0.88rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.years {
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: auto;
}

@media (max-width: 34rem) {
  ul.courses > li { gap: 0.15rem 1rem; }
  .level { margin-left: 0; display: block; }
  .years { margin-left: auto; }
}
