/* ==========================================================================
   Kilian Pouderoux — portfolio
   Modern, clean, light one-page design.
   ========================================================================== */

/* Reset & base ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* sticky nav height */
}

:root {
  --bg:          #ffffff;
  --surface:     #f7f7f5;
  --surface-2:   #f1f1ee;
  --text:        #0a0a0a;
  --text-muted:  #606060;
  --border:      #e6e6e2;
  --accent:      #15803d;
  --accent-hover:#166534;
  --accent-soft: #dcfce7;
  --radius:      16px;
  --radius-sm:   10px;
  --container:   1240px;
  --measure:     72ch;
  --font-sans:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm:   0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md:   0 4px 12px rgba(15, 23, 42, 0.05), 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-lg:   0 12px 24px rgba(15, 23, 42, 0.07), 0 24px 48px rgba(15, 23, 42, 0.08);
  --ease-out:    cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
}

p { margin: 0 0 0.85rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

ul { margin: 0 0 0.75rem; padding-left: 1.25rem; }
li { margin-bottom: 0.3rem; }

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

::selection { background: var(--accent-soft); color: var(--text); }

/* Layout ------------------------------------------------------------------ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.75rem;
}

.section {
  padding: 6rem 0;
  scroll-margin-top: 80px;
}
.section--alt { background: var(--surface); }
.section__title {
  font-size: 2.15rem;
  font-weight: 700;
  margin-bottom: 2.75rem;
  margin-left: 3.5rem;
  letter-spacing: -0.025em;
}
.section__title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.6rem;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .section { padding: 4rem 0; }
  .section__title { font-size: 1.75rem; margin-bottom: 2rem; }
}

/* Nav --------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav__brand {
  font-weight: 600;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav__brand:hover { color: var(--text); }
.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav__links a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav__inner { padding: 0.85rem 1.15rem; }
  .nav__links { gap: 1.1rem; }
  .nav__links a { font-size: 0.88rem; }
  .nav__brand { font-size: 0.95rem; }
}
@media (max-width: 480px) {
  .nav__brand { display: none; }
  .nav__inner { justify-content: center; }
}

/* Hero / About ------------------------------------------------------------ */
.hero { padding: 6rem 0 5rem; }
.hero__inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}
.hero__photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.hero__name {
  font-size: clamp(2.5rem, 4.2vw, 3.25rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.hero__label {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.4rem;
}
.hero__summary {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 60ch;
  margin-bottom: 1.75rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

@media (max-width: 900px) {
  .hero { padding: 4rem 0 2.5rem; }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .hero__photo { width: 200px; height: 200px; margin: 0 auto; }
  .hero__summary { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(21, 128, 61, 0.5);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn svg { width: 17px; height: 17px; fill: currentColor; }

/* Entries (Experience / Education / Volunteer) ---------------------------- */
.entries {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 860px;
  margin: 0 auto;
}
.entry {
  border-left: 2px solid var(--border);
  padding-left: 1.4rem;
  position: relative;
}
.entry::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg);
}
.section--alt .entry::before { box-shadow: 0 0 0 4px var(--surface); }
.entry__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.entry__org {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}
.entry__org a { color: var(--text); }
.entry__org a:hover { color: var(--accent); }
.entry__date {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.entry__summary {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 0.85rem;
}
.entry__role { margin-top: 0.85rem; }
.entry__role:first-of-type { margin-top: 0.35rem; }
.entry__role-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.entry__location {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.1rem 0 0.5rem;
}
.entry__position { font-weight: 600; font-size: 1.05rem; }
.entry__highlights {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}
.entry__highlights li { margin-bottom: 0.25rem; }

/* Education collapsible courses ------------------------------------------- */
.courses {
  margin-top: 0.65rem;
  font-size: 0.95rem;
}
.courses summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  user-select: none;
}
.courses summary::-webkit-details-marker { display: none; }
.courses summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  text-align: center;
  font-weight: 600;
}
.courses[open] summary::before { content: "−"; }
.courses ul {
  margin-top: 0.55rem;
  columns: 2;
  column-gap: 1.75rem;
  color: var(--text-muted);
}
@media (max-width: 560px) { .courses ul { columns: 1; } }

/* Projects grid ----------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
@media (max-width: 1000px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: inherit;
}
.project-card__media {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}
.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s var(--ease-out);
}
.project-card:hover .project-card__media img { transform: scale(1.04); }
.project-card__body {
  padding: 1.25rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.project-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.3;
}
.project-card__date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.project-card__duration {
  color: var(--text-muted);
  opacity: 0.75;
}
.project-card__period {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.7rem;
}
.project-card__summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  flex: 1;
  line-height: 1.55;
}
.project-card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
}
.project-card__more {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: auto;
}
.project-card:hover .project-card__more { color: var(--accent-hover); }

/* Pills ------------------------------------------------------------------- */
.pill {
  display: inline-block;
  font-size: 0.76rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.pill--accent {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: transparent;
}
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Skills ------------------------------------------------------------------ */
.skills {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.6rem 2.2rem;
  align-items: baseline;
  max-width: 860px;
  margin: 0 auto;
}
.skills__category {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}
@media (max-width: 640px) {
  .skills { grid-template-columns: 1fr; gap: 0.5rem 0; }
  .skills__category { margin-top: 0.5rem; }
  .skills__category:first-child { margin-top: 0; }
}

/* Interests --------------------------------------------------------------- */
.interests-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem 4rem;
  max-width: 860px;
  margin: 0 auto;
  align-items: start;
}
.interests-split__intro p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.interests-split__intro p:last-child { margin-bottom: 0; }
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
}
.interests .pill { font-size: 0.85rem; padding: 0.35rem 0.85rem; }
@media (max-width: 720px) {
  .interests-split { grid-template-columns: 1fr; gap: 2rem; }
}

/* Contact / Footer -------------------------------------------------------- */
.contact { padding: 5rem 0; text-align: center; }
.contact__title {
  font-size: 2.4rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.03em;
}
.contact__text {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 50ch;
  margin: 0 auto 2rem;
}
.contact__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.footer {
  padding: 2.25rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.footer__socials { display: flex; gap: 1rem; }
.footer__socials a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}
.footer__socials a:hover { color: var(--accent); }

/* Social icon shared ------------------------------------------------------ */
.tf-social {
  width: 18px;
  height: 18px;
  fill: currentColor;
  vertical-align: middle;
}

/* Project overview card --------------------------------------------------- */
.project-overview {
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.project-overview__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.85rem;
}
.project-overview__list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.project-overview__row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  align-items: center;
}
.project-overview__row:first-child { border-top: 0; padding-top: 0.25rem; }
.project-overview__row dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-overview__row dd {
  margin: 0;
  color: var(--text);
}
.project-overview .pill-group { margin: 0; }
@media (max-width: 560px) {
  .project-overview { padding: 1rem 1.1rem 0.25rem; }
  .project-overview__row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.7rem 0;
  }
}

/* Project detail page ----------------------------------------------------- */
.project-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 1.75rem 4rem;
}
.project-page h1 {
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}
.project-page__lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
}
.project-page__body { margin-top: 0.5rem; }
.project-page__body > p:first-child { margin-top: 0; }
.project-page__meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}
.project-page p { color: var(--text); line-height: 1.75; font-size: 1.05rem; }
.project-page img,
.project-page video,
.project-page iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.75rem auto;
  border: 1px solid var(--border);
}
.project-page figure { margin: 1.75rem 0; }
.project-page figcaption {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 0.5rem;
}
.project-page .video-wrapper,
.drawer__body .video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.project-page .video-wrapper iframe,
.drawer__body .video-wrapper iframe {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.project-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1.75rem;
  color: var(--text-muted);
}
.project-page__back:hover { color: var(--accent); }

/* back-compat with old inline bootstrap wrappers in project .md bodies */
.project-page .container,
.drawer__body .container { padding: 0 !important; max-width: none !important; }
.project-page .py-3, .project-page .py-4,
.drawer__body .py-3, .drawer__body .py-4 { padding: 0 !important; }

/* Project drawer (slide-from-right) --------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
}
.drawer[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}
.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drawer[aria-hidden="false"] .drawer__backdrop { opacity: 1; }

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(900px, 94vw);
  height: 100vh;
  background: var(--bg);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.drawer[aria-hidden="false"] .drawer__panel { transform: translateX(0); }

.drawer__header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 2;
}
.drawer__title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.drawer__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.drawer__close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.15s var(--ease-out);
}
.drawer__close:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}
.drawer__close svg { width: 18px; height: 18px; }

.drawer__body { padding: 2rem; }
.drawer__body > h1 { display: none; }
.drawer__body .project-page__back,
.drawer__body .project-page__meta { display: none; }
.drawer__body p { color: var(--text); line-height: 1.75; font-size: 1.05rem; margin-bottom: 1rem; }
/* Drawer images: always fit available width, no upstream inline width wins */
.drawer__body img,
.drawer__body video,
.drawer__body iframe {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 1.5rem auto !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  object-fit: contain !important;
}
.drawer__body iframe {
  aspect-ratio: 16 / 9;
  height: auto !important;
  min-height: 280px;
}
.drawer__body figure { margin: 1.5rem 0 !important; max-width: 100% !important; }
.drawer__body figcaption {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 0.5rem;
}
.drawer__body .ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}
.drawer__body .ratio iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.drawer__loading,
.drawer__error {
  padding: 3rem 2rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 1rem;
}

/* body scroll lock when drawer open */
body.drawer-open { overflow: hidden; }

@media (max-width: 560px) {
  .drawer__panel { width: 100vw; }
  .drawer__body { padding: 1.5rem 1.25rem 2.5rem; }
  .drawer__header { padding: 0.9rem 1.25rem; }
}
