/* yassinechahdi.com */

:root {
  --bg: #fcfbf9;
  --text: #1a1917;
  --muted: #5f5c56;
  --faint: #8a8680;
  --rule: #e5e1d9;
  --hover: #f4f1ec;
  --accent: #8a4520;
  --pill-bg: #f1e8e1;
  --pill-text: #8a4520;
  --card-pad: 1.15rem;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111110;
    --text: #eae8e3;
    --muted: #9d9a93;
    --faint: #74716b;
    --rule: #2a2926;
    --hover: #1b1a18;
    --accent: #dc8f56;
    --pill-bg: #241b14;
    --pill-text: #dc8f56;
  }
}

:root[data-theme="dark"] {
  --bg: #111110;
  --text: #eae8e3;
  --muted: #9d9a93;
  --faint: #74716b;
  --rule: #2a2926;
  --hover: #1b1a18;
  --accent: #dc8f56;
  --pill-bg: #241b14;
  --pill-text: #dc8f56;
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

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

a { color: inherit; }
h1, h2, h3 { font-weight: 500; margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- shell ---------- */

.shell { max-width: 70rem; margin: 0 auto; padding: 0 1.5rem; }

@media (min-width: 64rem) {
  .shell {
    display: grid;
    grid-template-columns: 22rem minmax(0, 1fr);
    gap: 4.5rem;
    padding: 0 3rem;
  }
}

/* ---------- rail ---------- */

.rail { padding: 4rem 0 0; }

@media (min-width: 64rem) {
  .rail {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5.5rem 0 3.5rem;
  }
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.role { color: var(--text); margin-top: 0.5rem; }

.pitch {
  color: var(--muted);
  margin-top: 1rem;
  max-width: 22rem;
  text-wrap: pretty;
}

.sections { display: none; }

@media (min-width: 64rem) {
  .sections { display: block; margin-top: 3rem; }
  .sections a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 0;
    font-size: 0.72rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--faint);
    text-decoration: none;
  }
  .sections a::before {
    content: "";
    width: 1.6rem;
    height: 1px;
    background: var(--faint);
    transition: width 150ms, background 150ms;
  }
  .sections a:hover { color: var(--text); }
  .sections a:hover::before { width: 2.8rem; background: var(--text); }
}

.rail-foot { margin-top: 2.25rem; }

@media (min-width: 64rem) { .rail-foot { margin-top: 0; } }

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  font-size: 0.875rem;
}
.contact a { color: var(--muted); text-decoration: none; }
.contact a:hover { color: var(--accent); }

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--faint);
}

#theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
#theme:hover { border-color: var(--accent); color: var(--accent); }
#theme svg { width: 15px; height: 15px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

.lang a { color: var(--faint); text-decoration: none; }
.lang a:hover { color: var(--accent); }
.lang [aria-current] { color: var(--text); }

/* ---------- main ---------- */

main { padding: 3.5rem 0 0; }
@media (min-width: 64rem) { main { padding: 5.5rem 0 3.5rem; } }

section { margin-bottom: 3.5rem; scroll-margin-top: 2rem; }

h2 {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}

/* ---------- cards ---------- */

/* Cards are inset by their own padding so a card's first line of text sits the
   same distance below the section title as a plain paragraph does. */
section > ul { margin: calc(var(--card-pad) * -1) 0; }

.card {
  position: relative;
  display: grid;
  gap: 0.6rem;
  padding: var(--card-pad);
  margin: 0 calc(var(--card-pad) * -1);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 150ms, border-color 150ms;
}

.card:hover { background: var(--hover); border-color: var(--rule); }

.card h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.card:hover h3 { color: var(--accent); }
.arrow {
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.3em;
  fill: currentColor;
  transition: transform 150ms;
}
.card:hover .arrow { transform: translate(2px, -2px); }

.card p { color: var(--muted); text-wrap: pretty; }

.tech { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tech li {
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
}

/* ---------- publications ---------- */

.paper .authors, .paper .venue { font-size: 0.875rem; }
.paper b { color: var(--text); font-weight: 500; }

/* ---------- about ---------- */

.about p { color: var(--muted); max-width: 34rem; text-wrap: pretty; }

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

footer {
  padding: 1.5rem 0 3.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--faint);
}
footer .contact { margin-bottom: 0.8rem; }
@media (min-width: 64rem) { footer .contact { display: none; } }

@media print {
  :root { --bg: #fff; --text: #000; --muted: #333; --faint: #555; --accent: #000; --hover: #fff; --pill-bg: #eee; --pill-text: #000; }
  .sections, .controls { display: none; }
  .card { page-break-inside: avoid; }
}
