/* ============================================================
   Nicolas Laurent - portfolio
   Aucune dépendance, aucun build.
   ============================================================ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

img, svg { display: block; max-width: 100%; }

button { font: inherit; color: inherit; }

/* ---- Thème ------------------------------------------------ */
:root {
  --bg:          #0b0d10;
  --bg-alt:      #101317;
  --bg-card:     #14181d;
  --line:        #232830;
  --line-soft:   #1a1f25;
  --text:        #e7eaee;
  --text-dim:    #9aa4b1;
  --text-faint:  #6b7684;
  --accent:      #2eb871;
  --accent-soft: rgba(46, 184, 113, 0.12);
  --accent-line: rgba(46, 184, 113, 0.35);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --wrap: 68rem;
  --radius: 14px;
}

:root[data-theme="light"] {
  --bg:          #fbfaf9;
  --bg-alt:      #f3f1ef;
  --bg-card:     #ffffff;
  --line:        #e2ded9;
  --line-soft:   #ece9e5;
  --text:        #15181c;
  --text-dim:    #545c66;
  --text-faint:  #7d8791;
  --accent:      #16824b;
  --accent-soft: rgba(22, 130, 75, 0.09);
  --accent-line: rgba(22, 130, 75, 0.3);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:          #fbfaf9;
    --bg-alt:      #f3f1ef;
    --bg-card:     #ffffff;
    --line:        #e2ded9;
    --line-soft:   #ece9e5;
    --text:        #15181c;
    --text-dim:    #545c66;
    --text-faint:  #7d8791;
    --accent:      #16824b;
    --accent-soft: rgba(22, 130, 75, 0.09);
    --accent-line: rgba(22, 130, 75, 0.3);
  }
}

/* ---- Base ------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

::selection {
  background: var(--accent);
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
}

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

/* ---- Typographie ------------------------------------------ */
h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}

code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: .1em .35em;
  border-radius: 4px;
}

/* ---- Header ----------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line-soft); }

.nav {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}

.nav__mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.nav__links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  padding: 0;
  font-size: .92rem;
}
.nav__links a {
  text-decoration: none;
  color: var(--text-dim);
  transition: color .2s ease;
}
.nav__links a:hover { color: var(--text); }

.theme-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent-line); background: var(--accent-soft); }

.theme-toggle__icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: linear-gradient(to right, currentColor 50%, transparent 50%);
}

@media (max-width: 44rem) {
  .nav__links { display: none; }
}

/* ---- Hero ------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(4rem, 12vw, 8.5rem) 0 clamp(3.5rem, 8vw, 6rem);
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: -30%;
  left: 50%;
  width: min(60rem, 130vw);
  aspect-ratio: 1;
  translate: -50% 0;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  pointer-events: none;
}

.hero__inner { position: relative; }

.hero__title {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  max-width: 16ch;
  margin-bottom: 1.6rem;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hero__title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .08em;
  height: .07em;
  background: var(--accent-line);
}

.hero__lede {
  max-width: 56ch;
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--text-dim);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2.2rem;
}

.hero__meta {
  list-style: none;
  padding: 2.6rem 0 0;
  margin-top: 2.6rem;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.4rem;
  font-size: .92rem;
  color: var(--text-faint);
}
.hero__meta strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: .2rem;
}

/* ---- Boutons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent);
  filter: brightness(1.1);
}

/* ---- Sections --------------------------------------------- */
.section {
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
  border-top: 1px solid var(--line-soft);
}
.section--alt { background: var(--bg-alt); }

.section__head { margin-bottom: 2.8rem; }
.section__head--center {
  text-align: center;
  max-width: 44rem;
  margin-inline: auto;
}
.section__sub {
  margin-top: 1rem;
  max-width: 58ch;
  color: var(--text-dim);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.grid-2 .section__head { margin-bottom: 0; position: sticky; top: 6rem; }

@media (max-width: 52rem) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 .section__head { position: static; }
}

.prose p + p { margin-top: 1.1rem; }
.prose p { color: var(--text-dim); }

/* ---- Tags ------------------------------------------------- */
.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.2rem;
}
.tags li {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .02em;
  padding: .28rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-faint);
  background: var(--bg);
}
.tags--lg li {
  font-family: var(--font-sans);
  font-size: .85rem;
  padding: .38rem .85rem;
  border-radius: 999px;
  color: var(--text-dim);
}

/* ---- Cartes savoir-faire ---------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color .25s ease, transform .25s ease;
}
.card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.card__title {
  font-size: 1.08rem;
  margin-bottom: .6rem;
}
.card__title::before {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  margin-bottom: .9rem;
}
.card__text {
  font-size: .93rem;
  color: var(--text-dim);
}

/* ---- Filtres ---------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.filter {
  padding: .42rem 1rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .86rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s ease;
}
.filter:hover { border-color: var(--accent-line); color: var(--text); }
.filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- Projets ---------------------------------------------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.1rem;
  align-items: start;
}

.project {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.7rem;
  transition: border-color .25s ease;
}
.project:hover { border-color: var(--accent-line); }

.project--feature {
  grid-column: 1 / -1;
  background: linear-gradient(160deg, var(--bg-card), var(--bg-alt));
  border-color: var(--line);
}

@media (min-width: 60rem) {
  .project--feature { padding: 2.2rem 2.4rem; }
}

.project.is-hidden { display: none; }

.project__role {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}

.project__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
}

.project__title { font-size: 1.22rem; }
.project--feature .project__title { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }

.project__status {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.project__status a {
  color: var(--accent);
  text-decoration: none;
}
.project__status a:hover { text-decoration: underline; }

.project__pitch {
  font-size: .98rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .6rem;
}
.project--feature .project__pitch { font-size: 1.06rem; }

.project__text {
  font-size: .92rem;
  color: var(--text-dim);
}
.project--feature .project__text { max-width: 72ch; }

.projects__note {
  margin-top: 2rem;
  font-size: .9rem;
  color: var(--text-faint);
  text-align: center;
}

/* ---- Stack ------------------------------------------------ */
.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 2rem 1.5rem;
}
.stack__col h3 {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: .7rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.stack__col ul {
  list-style: none;
  padding: 0;
  font-size: .92rem;
  color: var(--text-dim);
}
.stack__col li + li { margin-top: .35rem; }

/* ---- Contact ---------------------------------------------- */
.section--contact { text-align: center; }

.contact__title {
  max-width: 20ch;
  margin-inline: auto;
}
.contact__text {
  margin-top: 1rem;
  color: var(--text-dim);
}
.contact__links {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
}

/* ---- Footer ----------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 2rem 0;
  font-size: .85rem;
  color: var(--text-faint);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
}

/* ---- Apparition au scroll --------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---- Impression ------------------------------------------- */
@media print {
  .site-header, .filters, .hero__glow, .theme-toggle { display: none; }
  body { background: #fff; color: #000; }
  .project, .card { break-inside: avoid; border-color: #ccc; }
}
