/* Wajdi Belgacem — wajdibelgacem.com */
:root {
  --ink: #132c36;        /* navy: hero, contact, dark cards */
  --ink-light: #1e414d;
  --text: #4c5e65;       /* body grey */
  --line: #d9e1e3;
  --paper: #f2f5f5;      /* pale section background */
  --accent: #226c62;     /* teal */
  --mint: #c0d7d1;
  --gold: #b77427;
  --serif: 'Libre Caslon Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', Arial, Helvetica, sans-serif;
  --max: 1320px;
  --pad: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
p, h1, h2, h3, h4, figure, ul { margin: 0; }
h1, h2, h3 { font-weight: 400; }
h1, h2, .serif { font-family: var(--serif); }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.skip { position: absolute; top: -100px; left: 20px; z-index: 40; background: #fff; padding: 10px 14px; }
.skip:focus { top: 16px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 32px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; font-weight: 600; font-size: 17px; white-space: nowrap; }
.monogram { font-family: var(--serif); width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); font-size: 20px; letter-spacing: -1px; }
nav { display: flex; gap: 26px; margin-left: auto; font-size: 14px; }
nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
nav a:hover { border-color: var(--accent); }
.cv-link { border: 1px solid var(--ink); padding: 9px 14px; text-decoration: none; font-size: 14px; white-space: nowrap; }
.cv-link:hover { background: var(--ink); color: #fff; }
.cv-link span { margin-left: 12px; }

/* ---------- shared ---------- */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent); line-height: 1.6; }
.eyebrow.light { color: var(--mint); }
.section-number { color: #72898e; margin-right: 18px; }
.section { padding-top: 90px; padding-bottom: 90px; }
.section-title { display: grid; grid-template-columns: 1fr 2.2fr; gap: 40px; margin-bottom: 48px; }
.section-title > .eyebrow { padding-top: 10px; }
.section-title h2 { font-size: clamp(38px, 4vw, 56px); line-height: 1.1; letter-spacing: -.7px; }
.section-intro { max-width: 640px; color: var(--text); font-size: 17px; margin-top: 18px; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 30px; padding: 13px 20px; text-decoration: none; font-size: 14px; font-weight: 500; transition: background .2s, transform .2s; }
.light-button { color: var(--ink); background: #fff; }
.light-button:hover { background: #e2efeb; transform: translateY(-2px); }
.ghost-button { color: #fff; border: 1px solid #6d858d; }
.ghost-button:hover { border-color: #fff; color: #fff; }
.inline-link { display: inline-block; font-size: 14px; font-weight: 500; text-decoration: none; border-bottom: 1px solid #a4b5b9; padding-bottom: 4px; }
.inline-link:hover { border-color: var(--accent); }
.inline-link span { margin-left: 12px; }
.section-end { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 25px; font-size: 14px; color: var(--text); flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero { background: var(--ink); color: #fff; }
.hero-inner { padding-top: 60px; padding-bottom: 64px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 70px; }
h1 { font-size: clamp(64px, 8vw, 118px); letter-spacing: -2.5px; line-height: .92; margin: 30px 0 28px; }
.hero-discipline { font-size: 24px; letter-spacing: -.4px; line-height: 1.4; }
.hero-description { font-size: 17px; color: #c0ced2; max-width: 460px; margin-top: 17px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-visual { position: relative; min-height: 470px; overflow: hidden; background: #23434a; }
.hero-visual img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: center; }
.hero-visual figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px 20px; background: rgba(10,30,35,.82); font-size: 12px; letter-spacing: 1.65px; color: #e7f0ed; }
.hero-foot { border-top: 1px solid #415660; padding-top: 25px; padding-bottom: 25px; display: grid; grid-template-columns: 1.15fr 1fr .85fr; gap: 32px; font-size: 14px; }
.hero-foot p > span { display: block; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: #a9bec7; margin-bottom: 7px; }

/* ---------- research areas ---------- */
.areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.area { padding: 32px 30px 34px; position: relative; transition: transform .2s; }
.area:hover { transform: translateY(-3px); }
.area .num { font-family: var(--serif); font-size: 40px; line-height: 1; margin-bottom: 18px; }
.area h3 { font-size: 19px; font-weight: 600; margin-bottom: 12px; line-height: 1.3; }
.area p { font-size: 14.5px; line-height: 1.65; }
.area-ink { background: var(--ink); color: #fff; }
.area-ink .num { color: var(--mint); }
.area-ink p { color: #c0ced2; }
.area-teal { background: var(--accent); color: #fff; }
.area-teal .num { color: #d6ebe5; }
.area-teal p { color: #e2f0ec; }
.area-mint { background: #e3eeeb; color: var(--ink); border: 1px solid #cfe0da; }
.area-mint .num { color: var(--accent); }
.area-mint p { color: var(--text); }

/* ---------- job market papers ---------- */
.project { padding: 44px 0; border-top: 1px solid var(--line); }
.project-summary { max-width: 820px; }
.project h3 { font-family: var(--serif); font-size: clamp(28px, 2.8vw, 38px); line-height: 1.15; letter-spacing: -.4px; margin: 16px 0 14px; }
.project .authors { font-size: 15px; margin-bottom: 8px; }
.project .authors strong { font-weight: 600; }
.status { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); background: #e6f0ee; padding: 4px 10px; margin-bottom: 18px; }
.project-summary > p.body { color: var(--text); max-width: 760px; }
.project details { margin-top: 16px; }
.project summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); list-style: none; display: inline-flex; align-items: center; gap: 10px; border-bottom: 1px solid #a4b5b9; padding-bottom: 4px; }
.project summary::-webkit-details-marker { display: none; }
.project summary::after { content: '+'; font-size: 18px; line-height: 1; }
.project details[open] summary::after { content: '−'; }
.project details p { color: var(--text); font-size: 15px; margin-top: 16px; max-width: 760px; }
.project-meta { display: grid; grid-template-columns: 1.6fr 1fr; max-width: 760px; gap: 32px; margin-top: 26px; font-size: 14px; line-height: 1.65; }
.project-meta p > span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--text); margin-bottom: 7px; }
.project .inline-link { margin-top: 24px; }
.study-scope { padding: 29px 34px; background: var(--ink); color: #fff; align-self: start; }
.study-scope > .eyebrow { color: var(--mint); }
.scope-number { font-family: var(--serif); font-size: 94px; line-height: 1.04; margin-top: 9px; font-variant-numeric: lining-nums; }
.scope-unit { font-size: 17px; color: #d7e3e6; }
.scope-rule { height: 1px; background: #45616a; margin: 22px 0; }
.scope-body { font-size: 15px; line-height: 1.6; }
.scope-period { font-family: var(--serif); font-size: 25px; }
.scope-caption { font-size: 12px; color: #a8c5c9; margin-top: 12px; }
.study-scope.pale { background: var(--paper); color: var(--ink); }
.pale > .eyebrow { color: var(--accent); }
.pale .scope-unit, .pale .scope-caption { color: var(--text); }
.pale .scope-rule { background: var(--line); }

/* dairy chart */
.data-figure { padding: 30px 0 20px; align-self: start; }
.data-figure figcaption { font-size: 17px; line-height: 1.5; font-weight: 500; margin-bottom: 30px; }
.bar-row { display: grid; grid-template-columns: 42px minmax(0,1fr) 44px; align-items: center; gap: 14px; font-size: 14px; margin: 20px 0; }
.bar-track { height: 27px; background: #eff3f3; }
.bar { width: var(--value); height: 100%; background: var(--accent); }
.bar.old { background: #7a959b; }
.bar-row strong { font-size: 16px; font-weight: 500; text-align: right; }
.chart-note { font-size: 12px; line-height: 1.7; color: var(--text); border-top: 1px solid var(--line); padding-top: 18px; margin-top: 26px; }

/* ---------- publications ---------- */
.research { background: var(--paper); }
.pub-group { margin-top: 44px; }
.pub-group:first-of-type { margin-top: 0; }
.pub-group > .eyebrow { border-bottom: 1px solid #cdd7d9; padding-bottom: 12px; }
.publication { border-top: 1px solid #cdd7d9; display: grid; grid-template-columns: 1fr 2.2fr; gap: 40px; padding: 26px 0; }
.pub-list .publication:first-child { border-top: none; }
.publication-meta .kind { color: var(--accent); font-weight: 600; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; }
.publication-meta { display: flex; flex-direction: column; gap: 4px; color: var(--text); font-size: 13px; }
.year { font-family: var(--serif); font-size: 30px; color: var(--ink); line-height: 1.2; }
.publication h3 { font-family: var(--serif); font-size: clamp(21px, 2vw, 26px); line-height: 1.3; }
.publication h3 a { text-decoration: none; }
.publication h3 span { display: inline-block; font-family: var(--sans); font-size: 18px; margin-left: 8px; }
.publication p { font-size: 14px; color: var(--text); margin-top: 10px; }
.publication p strong { font-weight: 600; color: var(--ink); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.15fr 1fr; gap: 90px; align-items: start; }
.about h2 { font-size: clamp(38px, 4vw, 56px); line-height: 1.1; letter-spacing: -.7px; margin: 26px 0 28px; }
.about-intro > p { color: var(--text); margin-bottom: 18px; max-width: 560px; }
.about-intro > .about-lead { font-size: 21px; line-height: 1.55; color: var(--ink); }
.about-side { padding-top: 6px; }
.education { margin: 0 0 30px; }
.education > .eyebrow { margin-bottom: 14px; }
.edu-label { font-weight: 700; font-size: 14px; color: var(--ink); }
.education > div { display: flex; gap: 25px; border-top: 1px solid var(--line); padding: 16px 0; font-size: 14px; }
.education > div:last-child { border-bottom: 1px solid var(--line); }
.education-year { color: var(--text); font-variant-numeric: tabular-nums; min-width: 92px; }
.education strong { font-weight: 500; display: block; font-size: 15px; }
.education p > span { display: block; color: var(--text); font-size: 13px; }
.docs { display: flex; flex-wrap: wrap; gap: 24px; }

/* ---------- contact ---------- */
.contact { background: var(--ink); color: #fff; }
.contact-inner { padding-top: 70px; padding-bottom: 74px; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.contact h2 { font-size: clamp(40px, 4.5vw, 58px); line-height: 1.08; margin: 24px 0 20px; }
.contact-inner > div > p:not(.eyebrow) { font-size: 16px; color: #bdd0d7; max-width: 480px; }
.contact-links { padding-top: 10px; }
.contact-list { margin: 0; }
.contact-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid #3f5761; font-size: 15px; }
.contact-list > div:last-child { border-bottom: 1px solid #3f5761; }
.contact-list dt { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: #a9bec7; padding-top: 3px; }
.contact-list dd { margin: 0; color: #fff; overflow-wrap: anywhere; }
.contact-list a { text-decoration: none; border-bottom: 1px solid #6d858d; padding-bottom: 2px; }
.contact-list a:hover { color: #c6e5dc; border-color: #c6e5dc; }
footer { padding-top: 24px; padding-bottom: 24px; display: flex; justify-content: space-between; gap: 24px; font-size: 12px; color: var(--text); flex-wrap: wrap; }
footer a { text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --pad: 36px; }
  nav { gap: 18px; }
  .hero-inner { gap: 40px; }
  .project { gap: 38px; }
  .about { gap: 55px; }
}
@media (max-width: 820px) {
  :root { --pad: 24px; }
  .areas { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .brand { margin-right: auto; }
  .header-inner nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 12px; }
  .hero-inner { grid-template-columns: 1fr .8fr; gap: 28px; padding-top: 44px; }
  .hero-visual { min-height: 420px; }
  .hero-foot { gap: 20px; font-size: 13px; grid-template-columns: 1fr 1fr; }
  .section { padding-top: 64px; padding-bottom: 64px; }
  .section-title { grid-template-columns: 1fr 2fr; gap: 20px; }
  .project { grid-template-columns: 1fr; gap: 28px; }
  .project-meta { grid-template-columns: 1fr; gap: 16px; }
  .study-scope { padding: 24px; }
  .scope-number { font-size: 80px; }
  .publication { grid-template-columns: 1fr 2fr; gap: 20px; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .contact-inner { grid-template-columns: 1fr; gap: 36px; padding-top: 54px; }
}
@media (max-width: 580px) {
  :root { --pad: 20px; }
  html { scroll-padding-top: 140px; }
  .brand { font-size: 15px; gap: 10px; }
  .monogram { width: 34px; height: 36px; font-size: 17px; }
  .cv-link { font-size: 12px; padding: 8px 10px; }
  .header-inner nav { font-size: 13px; gap: 8px; }
  .hero-inner { display: flex; flex-direction: column; padding-top: 38px; padding-bottom: 28px; gap: 32px; }
  h1 { font-size: clamp(60px, 20vw, 84px); margin: 24px 0; }
  .hero-discipline { font-size: 22px; }
  .hero-visual { height: 245px; min-height: 245px; }
  .hero-visual img { object-position: center 57%; }
  .hero-foot { grid-template-columns: 1fr; gap: 18px; padding-top: 22px; }
  .section { padding-top: 52px; padding-bottom: 52px; }
  .section-title { display: block; margin-bottom: 32px; }
  .section-title > .eyebrow { padding: 0; margin-bottom: 16px; }
  .section-title h2 { font-size: 40px; }
  .areas { grid-template-columns: 1fr; }
  .project { padding: 30px 0; gap: 24px; }
  .project h3 { font-size: 30px; }
  .study-scope { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; padding: 22px; }
  .study-scope > .eyebrow { grid-column: 1 / -1; }
  .scope-number { grid-column: 1; grid-row: 2; font-size: 72px; }
  .scope-unit { grid-column: 1; grid-row: 3; font-size: 14px; }
  .scope-rule { display: none; }
  .scope-body { grid-column: 2; grid-row: 2; align-self: center; font-size: 14px; }
  .scope-caption { grid-column: 2; grid-row: 3; align-self: start; margin: 0; }
  .publication { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .publication-meta { flex-direction: row; align-items: baseline; gap: 14px; }
  .year { font-size: 24px; }
  .about h2 br { display: none; }
  .about-intro > .about-lead { font-size: 19px; }
  .contact h2 { font-size: 40px; }
  .contact-list > div { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .button { transition: none; } }
@media print {
  .site-header, .hero-visual, .button, .contact, footer, .hero-actions { display: none; }
  .hero, .study-scope, .research { background: #fff; color: var(--ink); }
  .hero-description, .hero-foot p > span, .eyebrow.light, .scope-unit, .scope-caption { color: var(--text); }
  .hero-inner { display: block; }
  h1 { font-size: 44px; }
  .section { padding: 24px 0; }
  .project, .publication, .about { break-inside: avoid; }
  .project details { display: block; } .project details > *:not(summary) { display: block; }
}
