/* ============================================================
   Charbel Stockmans Daou — stockmans.me
   Minimal personal site
   ============================================================ */

:root {
  --bg:        #fafaf8;
  --surface:   #ffffff;
  --ink:       #16202e;   /* primary text */
  --ink-soft:  #54616f;   /* secondary text */
  --ink-faint: #5f6b78;   /* tertiary / labels — WCAG AA on --bg */
  --accent:    #1f3a5f;   /* deep navy */
  --accent-2:  #2f5d86;
  --line:      #e7e6e1;
  --line-soft: #f0efe9;
  --maxw:      940px;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(22,32,46,.04), 0 8px 28px rgba(22,32,46,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* Visible keyboard focus on all interactive elements */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Visually hidden, but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem clamp(1.2rem, 5vw, 3rem);
  background: rgba(250, 250, 248, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: .04em;
  color: var(--accent);
}
.nav__links {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
  font-size: .9rem;
  color: var(--ink-soft);
}
.nav__links a { transition: color .2s; position: relative; }
.nav__links a:hover { color: var(--accent); }
.nav__links a.is-current { color: var(--accent); font-weight: 600; }
.nav__links a.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font: inherit;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .03em;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .7rem;
  cursor: pointer;
  color: var(--ink-faint);
  transition: border-color .2s;
}
.lang-toggle:hover { border-color: var(--accent-2); }
.lang-toggle__opt.is-active { color: var(--accent); font-weight: 600; }
.lang-toggle__sep { color: var(--line); }

/* ---------- LAYOUT ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.2rem, 5vw, 3rem); }

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--line-soft); }
.section--flush { border-top: none; padding-top: clamp(1rem, 3vw, 2rem); }
.section__label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}
.section__more {
  display: inline-block;
  margin-top: 2.2rem;
  font-size: .92rem;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.section__more:hover { border-color: var(--accent); }

/* ---------- PAGE HEADER (sub-pages) ---------- */
.page-head {
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
}
.page-head__title {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.page-head__sub {
  margin-top: .9rem;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 34em;
}

/* ---------- HERO ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.hero__photo {
  position: relative;
  flex: 0 0 auto;
  width: clamp(120px, 28vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  box-shadow: var(--shadow);
}
.hero__photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.hero__photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Fraunces", serif;
  font-size: 3rem;
  color: #fff;
  opacity: .9;
}
.hero__eyebrow {
  font-size: .85rem;
  letter-spacing: .04em;
  color: var(--ink-faint);
  margin-bottom: .6rem;
}
.hero__name {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--ink);
}
.hero__title {
  margin-top: 1rem;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 30em;
}
.hero__actions { margin-top: 1.8rem; display: flex; gap: .8rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  font-size: .92rem;
  font-weight: 500;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  transition: transform .15s ease, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- ABOUT ---------- */
.about__lead {
  font-family: "Fraunces", serif;
  font-size: clamp(1.3rem, 3.2vw, 1.7rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  max-width: 26em;
}
.about__body {
  margin-top: 1.5rem;
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 40em;
}
.values {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 2rem;
}
.values li {
  font-size: .85rem;
  color: var(--accent);
  background: #eef2f7;
  padding: .35rem .9rem;
  border-radius: 999px;
}
.about__motto {
  margin-top: 1.8rem;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-faint);
}

/* ---------- EXPERIENCE / TIMELINE ---------- */
.timeline { display: flex; flex-direction: column; gap: 2.6rem; }
.job {
  padding-left: 1.4rem;
  border-left: 2px solid var(--line);
  position: relative;
}
.job::before {
  content: "";
  position: absolute;
  left: -6px;
  top: .45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.job__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .3rem 1rem;
  margin-bottom: 1rem;
}
.job__company {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
}
.job__period { font-size: .82rem; color: var(--ink-faint); }

.job__role {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .2rem .8rem;
  margin-top: 1.3rem;
}
.job__role h4 { font-size: 1rem; font-weight: 600; color: var(--accent); }
.job__role-period { font-size: .8rem; color: var(--ink-faint); }
.job > p {
  margin-top: .5rem;
  font-size: .96rem;
  color: var(--ink-soft);
  max-width: 44em;
}
.job__role--muted { opacity: .8; margin-bottom: 0; }
.job__role--muted h4 { color: var(--ink-soft); }

.job--compact .job__company { font-size: 1.1rem; color: var(--ink-soft); }
.job__earlier { list-style: none; display: flex; flex-direction: column; gap: .9rem; }
.job__earlier li { display: flex; flex-direction: column; }
.job__earlier strong { font-size: .98rem; font-weight: 600; }
.job__earlier span { font-size: .85rem; color: var(--ink-faint); }

/* ---------- EXPERTISE CARDS ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform .18s ease, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d9d8d2; }
.card h3 { font-size: 1.02rem; font-weight: 600; color: var(--ink); margin-bottom: .5rem; }
.card p { font-size: .9rem; color: var(--ink-soft); }

/* ---------- SPLIT (certs / education / languages) ---------- */
.section--split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(2rem, 5vw, 3rem);
}
.section--split .section__label { margin-bottom: 1.2rem; }
.list { list-style: none; display: flex; flex-direction: column; gap: .9rem; }
.list li { font-size: .95rem; display: flex; flex-direction: column; gap: .1rem; }
.list strong { font-weight: 600; }
.list span { font-size: .83rem; color: var(--ink-faint); }
.list--langs li {
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: .6rem;
}
.list--langs em { font-style: normal; font-size: .82rem; color: var(--ink-faint); }

/* ---------- PROJECTS ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.4rem;
}
.project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .2s, border-color .2s;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d9d8d2; }
.project__thumb {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f3a5f 0%, #2f5d86 100%);
  color: rgba(255,255,255,.7);
}
.project__thumb img { width: 100%; height: 100%; object-fit: cover; }
.project__thumb-icon {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 2.6rem;
  color: rgba(255,255,255,.92);
}
.project__body { padding: 1.4rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.project__tag {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: #eef2f7;
  padding: .25rem .65rem;
  border-radius: 999px;
}
.project__title { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.2rem; color: var(--ink); }
.project__desc { font-size: .9rem; color: var(--ink-soft); flex: 1; }
.project__tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .7rem;
}
.project__tech li {
  font-size: .72rem;
  color: var(--ink-soft);
  background: #f3f2ee;
  border: 1px solid var(--line);
  padding: .2rem .55rem;
  border-radius: 6px;
}
.project__links { display: flex; gap: 1.1rem; margin-top: .4rem; }
.project__links a {
  font-size: .85rem;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.project__links a:hover { border-color: var(--accent); }
.projects__note {
  margin-top: 2.5rem;
  font-size: .9rem;
  color: var(--ink-faint);
  font-style: italic;
}
.projects-group {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 1.4rem;
}
.projects-group--spaced { margin-top: 3.4rem; }

/* ---------- PUBLICATIONS ---------- */
.pubs { list-style: none; display: flex; flex-direction: column; }
.pub { padding: 1.7rem 0; border-top: 1px solid var(--line); }
.pub:first-child { border-top: none; padding-top: 0; }
.pub__title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--ink);
  max-width: 40em;
}
.pub__meta { display: block; margin-top: .4rem; font-size: .82rem; color: var(--ink-faint); }
.pub__abstract { margin-top: .85rem; font-size: .92rem; color: var(--ink-soft); max-width: 48em; }
.pub__link {
  display: inline-block;
  margin-top: .9rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.pub__link:hover { border-color: var(--accent); }

/* ---------- CONTACT ---------- */
.section--contact { text-align: left; }
.contact__headline {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  line-height: 1.2;
  max-width: 16em;
  margin-bottom: 1.8rem;
}
.contact__links { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .98rem; }
.contact__links a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.contact__links a:hover { border-color: var(--accent); }
.contact__links span { color: var(--ink-faint); }

/* ---------- FOOTER ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem clamp(1.2rem, 5vw, 3rem) 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .85rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--line-soft);
}
.footer a { transition: color .2s; }
.footer a:hover { color: var(--accent); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 620px) {
  .hero { flex-direction: column; text-align: center; align-items: center; }
  .hero__title { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }

  /* Nav wraps to a second, centered row instead of hiding links */
  .nav { flex-wrap: wrap; row-gap: .6rem; padding-top: .8rem; padding-bottom: .8rem; }
  .nav__links {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: center;
    gap: 1.1rem;
    font-size: .85rem;
  }
  .nav__links a.is-current::after { bottom: -3px; }
}

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