/* =========================================================
   Frédéric Vinot — Site
   Esthétique : sumi-e japonais, paysage washi, encre indigo
   Typographie : EB Garamond (Garamond web)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

:root {
  /* Palette papier washi */
  --washi-1: #f0e6cf;            /* crème claire */
  --washi-2: #e8dcc0;             /* crème médian (fond) */
  --washi-3: #d9c79e;             /* crème ombre */
  --washi-edge: #b89b6d;          /* bord papier */

  /* Encres */
  --sumi: #1d1a14;                /* encre noire profonde */
  --sumi-soft: #3a342a;           /* encre adoucie */
  --sumi-fade: #6b5d48;           /* encre délavée (texte secondaire) */
  --sepia: #5a6b41;               /* vert pin (ancien sépia) */
  --sepia-soft: #899a6a;          /* vert sauge clair */

  /* Indigo (ipomée) */
  --indigo: #2a3a5e;
  --indigo-soft: #3d5278;
  --indigo-deep: #1a2440;

  /* Vert pin */
  --pin: #6b7d5c;

  /* Cartouches */
  --cartouche-bg: rgba(244, 235, 215, 0.86);
  --cartouche-border: rgba(184, 155, 109, 0.35);
  --cartouche-shadow: 0 1px 0 rgba(255, 252, 240, 0.6) inset, 0 18px 60px -25px rgba(60, 45, 20, 0.45);

  /* Typographies */
  --serif: 'EB Garamond', 'Garamond', 'Adobe Garamond Pro', 'Times New Roman', serif;
  --display: 'Cormorant Garamond', 'EB Garamond', 'Garamond', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

html {
  background-color: var(--washi-2);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--serif);
  color: var(--sumi);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: transparent;
}

/* Fond paysage en image fixe — un <img> derrière tout */
.page-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.page-bg-portrait { display: none; }

@media (max-aspect-ratio: 1/1) {
  .page-bg:not(.page-bg-portrait) { display: none; }
  .page-bg-portrait { display: block; }
}

/* Tout le contenu au-dessus */
.nav, .page, .home-main, .foot, .home > main, .home > footer {
  position: relative;
  z-index: 1;
}

/* Léger voile crème sur pages intérieures pour la lisibilité */
.page-bg.veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(240, 230, 207, 0.5) 0%,
    rgba(240, 230, 207, 0.35) 40%,
    rgba(240, 230, 207, 0.55) 100%);
  pointer-events: none;
}

/* =====================================================
   Navigation
   ===================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.85rem 2.5rem;
  background: rgba(240, 230, 207, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(184, 155, 109, 0.28);
}

.nav-brand {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--sumi);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-brand em {
  font-style: normal;
  color: inherit;
  font-weight: inherit;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--sumi-soft);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.15rem 0;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--indigo);
}

.nav-links a.active {
  color: var(--indigo-deep);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--indigo);
  opacity: 0.6;
}

/* =====================================================
   Cartouche papier
   ===================================================== */
.page {
  position: relative;
  min-height: calc(100vh - 60px);
  padding: 3.5rem 1.5rem 5rem;
  display: flex;
  justify-content: center;
}

.cartouche {
  width: 100%;
  max-width: 920px;
  background: var(--cartouche-bg);
  border: 1px solid var(--cartouche-border);
  padding: 4rem 4.5rem 5rem;
  box-shadow: var(--cartouche-shadow);
  position: relative;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.cartouche::before,
.cartouche::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(120, 95, 55, 0.45);
}

.cartouche::before {
  top: 16px; left: 16px;
  border-right: none; border-bottom: none;
}

.cartouche::after {
  bottom: 16px; right: 16px;
  border-left: none; border-top: none;
}

/* =====================================================
   Titres
   ===================================================== */
.page-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 0.35rem;
  color: var(--sumi);
  letter-spacing: 0.005em;
}

.page-title em {
  font-style: normal;
  color: inherit;
}

.page-kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--sumi-fade);
  margin: 0 0 2.5rem;
  letter-spacing: 0.04em;
}

.page-kicker::before {
  content: '— ';
  color: var(--sepia-soft);
}

h2.section {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  margin: 3rem 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(120, 95, 55, 0.3);
}

h2.section:first-of-type {
  margin-top: 0.5rem;
}

h3.subsection {
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--sepia);
  margin: 1.5rem 0 0.6rem;
}

/* Année — pilier visuel des listes chronologiques */
.year {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.75rem;
  color: var(--indigo-deep);
  letter-spacing: 0.05em;
  margin: 2.2rem 0 0.8rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px dotted rgba(120, 95, 55, 0.35);
}

.year:first-of-type { margin-top: 0; }

/* Liste de références */
.refs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ref {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 1rem;
  padding: 0.2rem 0;
}

.ref-text {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--sumi-soft);
}

.ref-text a.title-link {
  color: var(--sumi);
  text-decoration: none;
  border-bottom: 1px solid rgba(42, 58, 94, 0.25);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ref-text a.title-link:hover {
  color: var(--indigo);
  border-bottom-color: var(--indigo);
}

.ref-text em {
  font-style: italic;
}

.ref-text .editor {
  color: var(--sumi-fade);
  font-style: italic;
}

.ref-read {
  align-self: start;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sepia);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(122, 93, 59, 0.4);
  border-radius: 1px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ref-read:hover {
  color: var(--washi-1);
  background: var(--indigo);
  border-color: var(--indigo);
}

.ref-read::after {
  content: '↗';
  font-family: var(--serif);
  font-size: 0.85rem;
  line-height: 1;
}

.ref-read.video::after {
  content: '▶';
  font-size: 0.7rem;
}

/* Paragraphes / corps */
.cartouche p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--sumi-soft);
  margin: 0 0 1rem;
}

.cartouche p + p { margin-top: 0; }

.cartouche a {
  color: var(--indigo);
  text-decoration: none;
  border-bottom: 1px solid rgba(42, 58, 94, 0.3);
  transition: border-color 0.2s ease;
}

.cartouche a:hover {
  border-bottom-color: var(--indigo);
}

/* Pied de page */
.foot {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sumi-fade);
  padding: 2.5rem 1rem 1.5rem;
  font-family: var(--serif);
}

.foot::before {
  content: '◦   ◦   ◦';
  display: block;
  margin-bottom: 1rem;
  color: var(--sepia-soft);
  letter-spacing: 0.6em;
  font-size: 0.7rem;
}

/* =====================================================
   Accueil immersif
   ===================================================== */
.home {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.home-nav {
  background: linear-gradient(180deg, rgba(240, 230, 207, 0.72) 0%, rgba(240, 230, 207, 0.35) 70%, rgba(240, 230, 207, 0) 100%);
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2.5rem;
  padding: 2rem 4rem 4rem;
}

.home-stage {
  align-self: center;
  justify-self: start;
  max-width: 620px;
  padding: 2.5rem 3rem;
  background: rgba(240, 230, 207, 0.72);
  border: 1px solid rgba(184, 155, 109, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 18px 60px -28px rgba(60, 45, 20, 0.45);
  position: relative;
}

.home-stage::before,
.home-stage::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(120, 95, 55, 0.5);
}

.home-stage::before {
  top: 10px; left: 10px;
  border-right: none; border-bottom: none;
}

.home-stage::after {
  bottom: 10px; right: 10px;
  border-left: none; border-top: none;
}

.home-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 3.4rem;
  line-height: 1;
  margin: 0 0 0.4rem;
  letter-spacing: 0.005em;
  color: var(--sumi);
}

.home-name em {
  font-style: normal;
  color: inherit;
  font-weight: inherit;
}

.home-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--sepia);
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}

.home-title .line {
  display: block !important;
}

.home-title .line.spaced {
  display: block !important;
  margin: 1em 0 0;
}

.home-quote {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.18rem;
  line-height: 1.45;
  color: var(--sumi-soft);
  margin: 1.5rem 0 1.6rem;
  padding-left: 1rem;
  border-left: 1px solid var(--sepia-soft);
}

.home-themes {
  font-size: 0.95rem;
  color: var(--sumi-soft);
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.home-themes strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sepia);
  margin-bottom: 0.45rem;
}

.home-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  text-decoration: none;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--indigo-deep);
  margin-top: 0.5rem;
  transition: all 0.25s ease;
}

.home-cta:hover {
  background: var(--indigo-deep);
  color: var(--washi-1);
}

.home-cta::after {
  content: '→';
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0;
}

/* Carte « dernier ouvrage » dans accueil */
.home-feature {
  align-self: end;
  justify-self: end;
  width: min(380px, 42vw);
  max-width: 100%;
  padding: 1.7rem 2rem 2rem;
  background: rgba(244, 235, 215, 0.84);
  border: 1px solid rgba(184, 155, 109, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  font-size: 0.92rem;
  color: var(--sumi-soft);
  line-height: 1.5;
  box-shadow: 0 12px 40px -20px rgba(60, 45, 20, 0.4);
  overflow-wrap: break-word;
}

.home-feature-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sepia);
  margin: 0 0 0.6rem;
}

.home-feature-title {
  display: block;
  font-family: var(--display);
  font-style: normal;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--sumi);
  margin: 0 0 0.5rem;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease;
}

.home-feature-title:hover {
  color: var(--indigo);
}

.home-feature-cover {
  display: block;
  margin-bottom: 0.9rem;
  line-height: 0;
  box-shadow: 0 10px 30px -14px rgba(60, 45, 20, 0.55);
}

.home-feature-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.home-feature-meta {
  font-size: 0.95rem;
  color: var(--sumi-fade);
  font-style: italic;
  margin: 0;
}

/* Responsive */
@media (max-width: 1100px) {
  .home-main {
    grid-template-columns: 1fr;
    padding: 2rem;
    gap: 1.5rem;
  }
  .home-stage { justify-self: stretch; max-width: 100%; }
  .home-feature { justify-self: stretch; width: auto; max-width: 480px; }
}

@media (max-width: 920px) {
  body { font-size: 17px; }
  .nav { padding: 0.7rem 1.2rem; gap: 1rem; flex-wrap: wrap; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.92rem; }
  .nav-brand { font-size: 1.05rem; }

  .cartouche { padding: 2.5rem 1.5rem 3rem; }
  .page-title { font-size: 2rem; }
  .year { font-size: 1.4rem; }
  h2.section { font-size: 1.2rem; }

  .home-stage { padding: 2rem 1.5rem; }
  .home-name { font-size: 2.4rem; }
  .home-title { font-size: 1rem; }
  .home-quote { font-size: 1.05rem; }
  .ref { grid-template-columns: 1fr; }
  .ref-read { justify-self: start; }
}

@media (max-width: 520px) {
  .home-name { font-size: 1.9rem; }
  .nav { padding: 0.6rem 0.8rem; }
  .nav-brand { font-size: 0.95rem; }
  .nav-links { gap: 0.55rem; }
  .nav-links a { font-size: 0.82rem; }
  .cartouche { padding: 2rem 1rem 2.5rem; }
}
