/* =========================================================
   SOREN PIGEAU — PORTFOLIO
   Style: éditorial, sobre, lisible.
   Palette: ivoire chaud + noir profond + accent bleu nuit.
   Typo:   Fraunces (titres) + Manrope (corps) + JetBrains Mono (tech).
   ========================================================= */

:root {
  /* Colors */
  --bg:           #F6F3EC;     /* ivoire chaud */
  --bg-alt:       #FFFFFF;
  --bg-dark:      #0F1115;     /* sections inversées */
  --text:         #14161B;
  --text-soft:    #4A4E58;
  --text-muted:   #8A8E96;
  --accent:       #2A4D6E;     /* bleu nuit profond */
  --accent-hot:   #B6552B;     /* terracotta — rare, signal */
  --line:         #E1DCCF;
  --line-soft:    #EDE7D8;

  /* Type scale */
  --serif:  'Fraunces', 'Times New Roman', serif;
  --sans:   'Manrope', system-ui, -apple-system, sans-serif;
  --mono:   'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
  --section-pad: clamp(72px, 10vw, 140px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }
button { font: inherit; cursor: pointer; }

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

/* Subtle paper grain on background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(20,22,27,0.018) 1px, transparent 0);
  background-size: 3px 3px;
  opacity: 0.7;
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav-wrap.scrolled { border-bottom-color: var(--line); }

.nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo-mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a {
  position: relative;
  color: var(--text-soft);
  transition: color 0.25s var(--ease);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--text);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after { width: 100%; }

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid var(--text);
  border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.nav-cta:hover { background: var(--text); color: var(--bg); }

@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(60px, 10vw, 120px) var(--gutter) clamp(80px, 12vw, 160px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  z-index: 1;
}
.hero-inner { max-width: 760px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 32px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-alt) 60%, transparent);
}
.eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2BB673;
  box-shadow: 0 0 0 0 rgba(43,182,115,0.5);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43,182,115,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(43,182,115,0); }
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-size: clamp(56px, 11vw, 156px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--text);
}
.hero-firstname,
.hero-lastname { display: block; }
.hero-lastname { font-weight: 500; }
.hero-period { color: var(--accent-hot); }

.hero-tagline {
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 560px;
  margin: 36px 0 40px;
}
.hero-tagline strong { color: var(--text); font-weight: 600; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); }
.btn-ghost {
  border-color: var(--text);
  color: var(--text);
}
.btn-ghost:hover { background: var(--text); color: var(--bg); transform: translateY(-2px); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero-meta .sep { opacity: 0.5; }

/* Hero side decorative grid */
.hero-aside {
  width: 220px;
  align-self: stretch;
  position: relative;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 70% 60%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 70% 60%, black 0%, transparent 75%);
  opacity: 0.7;
}
.hero-grid::after {
  content: '';
  position: absolute;
  right: 30px; bottom: 30px;
  width: 80px; height: 80px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%);
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-aside { display: none; }
}

/* =========================================================
   SECTIONS — SHARED
   ========================================================= */
.section {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-pad) var(--gutter);
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 56px;
}
.section-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #1a3a55);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.05),
    0 30px 60px -20px rgba(20,22,27,0.18);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}
.photo-initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 96px;
  font-weight: 500;
  color: var(--bg);
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  z-index: 1;
}
.photo-frame.photo-fallback { /* photo absente — initiales visibles */ }

.about-text { padding-top: 8px; }
.about-text .lead {
  font-family: var(--serif);
  font-variation-settings: "opsz" 60;
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}
.about-text p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-soft);
  margin: 0 0 18px;
}
.about-text strong { color: var(--text); font-weight: 600; }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .photo-frame { max-width: 280px; }
}

/* =========================================================
   SEARCH (ce que je recherche)
   ========================================================= */
.search-lead {
  font-family: var(--serif);
  font-variation-settings: "opsz" 60;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.4;
  color: var(--text);
  max-width: 800px;
  margin: 0 0 56px;
  letter-spacing: -0.01em;
}
.search-lead strong { color: var(--accent-hot); font-weight: 600; }

.search-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.search-card {
  padding: 28px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.search-card:hover {
  transform: translateY(-4px);
  border-color: var(--text);
}
.search-card h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.card-big {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.card-small {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 900px) { .search-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .search-cards { grid-template-columns: 1fr; } }

/* =========================================================
   PROJECTS
   ========================================================= */
.projects-intro {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 700px;
  margin: 0 0 56px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--text);
  box-shadow: 0 30px 60px -30px rgba(20,22,27,0.18);
}

.project-head { margin-bottom: 14px; }
.project-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 4px;
}
.project h3 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 4px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.project p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
  margin: 0 0 22px;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}
.project-stack li {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-soft);
}
.project-link {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}
.project-link:hover { color: var(--accent); gap: 12px; }
.project-link .arrow { transition: transform 0.25s var(--ease); }

.all-projects {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 48px;
  padding: 16px 28px;
  border: 1px solid var(--text);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), gap 0.25s var(--ease);
}
.all-projects:hover { background: var(--text); color: var(--bg); gap: 16px; }

@media (max-width: 820px) { .projects-grid { grid-template-columns: 1fr; } }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 56px;
}
.skills-cat {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.skills-list { display: flex; flex-direction: column; gap: 10px; }
.skills-list li {
  font-size: 16px;
  color: var(--text);
  position: relative;
  padding-left: 18px;
}
.skills-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.7em;
  width: 8px; height: 1px;
  background: var(--accent-hot);
}

@media (max-width: 820px) { .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 28px; } }
@media (max-width: 480px) { .skills-grid { grid-template-columns: 1fr; } }

/* =========================================================
   EXPERIENCE — TIMELINE
   ========================================================= */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--line);
  padding-left: 0;
  margin-left: 8px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 24px 0 40px 32px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 32px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 24px;
}
.timeline-date .year {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}
.timeline-date .period {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.timeline-body { padding-top: 22px; }
.timeline-body h3 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 4px;
  color: var(--text);
}
.timeline-role {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 14px;
}
.timeline-body > p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0 0 14px;
}
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.timeline-tags li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  border-radius: 4px;
}

@media (max-width: 700px) {
  .timeline-item { grid-template-columns: 1fr; gap: 6px; padding-left: 28px; }
  .timeline-date { flex-direction: row; align-items: baseline; padding-top: 0; gap: 12px; }
  .timeline-date .year { font-size: 22px; }
  .timeline-body { padding-top: 8px; }
}

/* =========================================================
   CONTACT
   ========================================================= */
.section-contact {
  background: var(--bg-dark);
  color: var(--bg);
  border-radius: 16px;
  margin-top: 80px;
  margin-bottom: 60px;
  padding-left: clamp(28px, 5vw, 80px);
  padding-right: clamp(28px, 5vw, 80px);
  border: none;
  max-width: calc(var(--container) - 32px);
  width: calc(100% - 32px);
}
.section-contact .section-num,
.section-contact .section-title {
  color: var(--bg);
}
.section-contact .section-num { color: rgba(246,243,236,0.55); }

.contact-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
.contact-headline {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.contact-headline .accent { color: var(--accent-hot); }
.contact-text p {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(246,243,236,0.7);
  margin: 0;
  max-width: 480px;
}

.contact-list { display: flex; flex-direction: column; gap: 0; }
.contact-list li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid rgba(246,243,236,0.1);
  font-size: 15px;
}
.contact-list li:last-child { border-bottom: none; }
.contact-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246,243,236,0.5);
}
.contact-list a {
  color: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.contact-list a:hover { border-bottom-color: var(--accent-hot); color: var(--accent-hot); }

@media (max-width: 820px) { .contact-inner { grid-template-columns: 1fr; } }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.footer-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* =========================================================
   REVEAL ANIMATIONS (JS-driven)
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .eyebrow .dot { animation: none; }
}
