/* Etienne Porche — portfolio */
:root {
  --bg: #fdfdfc;
  --fg: #111;
  --muted: #8a8a86;
  --line: #e9e9e6;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Inter", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0c0c; --fg: #f2f2f0; --muted: #999; --line: #232320; }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.protect img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem clamp(1.2rem, 4vw, 3.5rem);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-weight: 800;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  letter-spacing: .16em;
  white-space: nowrap;
}
nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }
nav a {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .3rem 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
nav a:hover, nav a.active { color: var(--fg); border-color: var(--fg); }
.burger { display: none; }

@media (max-width: 720px) {
  .burger {
    display: block; background: none; border: 0; color: var(--fg);
    font-size: 1.4rem; cursor: pointer;
  }
  nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  nav a { padding: 1rem clamp(1.2rem, 4vw, 3.5rem); border-bottom: 1px solid var(--line); }
  .nav-open nav { display: flex; }
}

/* ---------- vues ---------- */
main { flex: 1; }
.view { animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* apparition au scroll */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.6,.2,1); }
.rv.in { opacity: 1; transform: none; }

/* accueil */
.hero {
  position: relative;
  height: calc(100vh - 72px);
  min-height: 420px;
  overflow: hidden;
  background: #000;
}
.hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.6s ease;
  transform: scale(1);
}
.hero img.on { opacity: 1; animation: kenburns 7s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }
.hero .hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 45%);
}
.hero .hero-text {
  position: absolute; left: clamp(1.2rem, 4vw, 3.5rem); bottom: clamp(1.6rem, 5vh, 3.5rem);
  color: #fff;
}
.hero .hero-text h1 {
  font-size: clamp(1.8rem, 5.5vw, 4rem);
  font-weight: 800; letter-spacing: .1em;
}
.hero .hero-text p {
  margin-top: .6rem;
  font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; opacity: .85;
}
.hero .hero-cta {
  display: inline-block; margin-top: 1.5rem;
  font-size: .72rem; letter-spacing: .26em; text-transform: uppercase;
  color: #fff; border: 1px solid rgba(255,255,255,.7);
  padding: .75rem 1.5rem;
  transition: background .25s, color .25s;
}
.hero .hero-cta:hover { background: #fff; color: #111; }
.hero-dots {
  position: absolute; right: clamp(1.2rem, 4vw, 3.5rem); bottom: clamp(1.6rem, 5vh, 3.5rem);
  display: flex; gap: .5rem;
}
.hero-dots i {
  width: 22px; height: 2px; background: rgba(255,255,255,.35); transition: background .4s;
}
.hero-dots i.on { background: #fff; }

/* pages */
.page {
  max-width: 1500px; margin: 0 auto; width: 100%;
  padding: clamp(1.6rem, 4vw, 3.5rem);
}
.page-title {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1;
  margin-bottom: clamp(1.6rem, 4vw, 2.8rem);
  display: flex; align-items: baseline; gap: 1.2rem; flex-wrap: wrap;
}
.pt-count { font-size: .72rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.gal-desc { max-width: 60ch; color: var(--muted); line-height: 1.7; margin: -1.2rem 0 2rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: clamp(.8rem, 2vw, 1.6rem);
}
.card { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--line); }
.card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.6,.2,1);
}
.card:hover img { transform: scale(1.05); }
.card .card-label {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; gap: .7rem;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%);
  color: #fff;
  font-size: .8rem; letter-spacing: .28em; text-transform: uppercase;
}
.card .card-label b { font-weight: 300; opacity: .6; letter-spacing: .1em; }
.card .count { margin-left: auto; font-size: .68rem; opacity: .8; letter-spacing: .1em; }

/* galerie */
.masonry { columns: 3 340px; column-gap: 1rem; }
.masonry a { display: block; margin-bottom: 1rem; break-inside: avoid; overflow: hidden; background: var(--line); }
.masonry img { width: 100%; transition: transform .7s cubic-bezier(.2,.6,.2,1), opacity .5s; opacity: 0; }
.masonry img.ld { opacity: 1; }
.masonry a:hover img { transform: scale(1.03); }
.back {
  display: inline-block; margin-bottom: 1.4rem;
  font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
}
.back:hover { color: var(--fg); }

/* galerie privée */
.locked .intro { color: var(--muted); margin-bottom: 1.6rem; max-width: 50ch; line-height: 1.7; }
#unlock { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
#unlock input {
  font: inherit; color: inherit; background: none;
  border: 1px solid var(--line); padding: .7rem 1rem; min-width: 240px;
}
#unlock button, #cform button {
  font: inherit; cursor: pointer; background: var(--fg); color: var(--bg); border: 0;
  padding: .75rem 1.6rem; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase;
}
#unlock .err { width: 100%; color: #c0262d; font-size: .85rem; min-height: 1.2em; }

/* about */
.about {
  display: grid; gap: clamp(1.6rem, 4vw, 4rem);
  grid-template-columns: minmax(260px, 420px) 1fr;
  align-items: start;
}
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }
.about img { width: 100%; }
.about .bio p { margin-bottom: 1.2rem; line-height: 1.85; font-size: 1.02rem; max-width: 58ch; }

/* contact */
.contact { max-width: 720px; }
.contact .intro { color: var(--muted); line-height: 1.7; margin-bottom: 2rem; }
#cform { display: grid; gap: .9rem; }
#cform input, #cform textarea {
  font: inherit; color: inherit; background: none;
  border: 1px solid var(--line); padding: .8rem 1rem; width: 100%;
}
#cform textarea { min-height: 140px; resize: vertical; }
#cform input:focus, #cform textarea:focus { outline: none; border-color: var(--fg); }
#cform button { justify-self: start; }
#cform .hp { position: absolute; left: -9999px; }
.cf-status { font-size: .88rem; color: var(--muted); min-height: 1.2em; }
.contact .alt { margin-top: 2rem; color: var(--muted); font-size: .95rem; }
.contact .email { color: var(--fg); border-bottom: 1px solid var(--fg); }
.contact .socials { margin-top: 1.6rem; display: flex; gap: 2rem; }
.contact .socials a {
  font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
}
.contact .socials a:hover { color: var(--fg); }

/* footer */
footer {
  padding: 2.2rem clamp(1.2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
}

/* lightbox */
dialog#lightbox {
  border: 0; padding: 0; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; background: rgba(5,5,5,.97); color: #fff;
}
dialog#lightbox::backdrop { background: rgba(5,5,5,.97); }
#lightbox figure {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .9rem;
  padding: 3.4rem 4.5rem;
}
#lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; }
#lightbox figcaption { font-size: .78rem; letter-spacing: .14em; color: #bbb; min-height: 1em; display: flex; gap: 1.2rem; }
#lb-n { color: #777; }
#lightbox button {
  position: absolute; z-index: 2;
  background: none; border: 0; color: #ddd; cursor: pointer;
  font-size: 2.4rem; line-height: 1; padding: 1rem;
  transition: color .2s;
}
#lightbox button:hover { color: #fff; }
.lb-close { top: .6rem; right: .8rem; }
.lb-play { top: .9rem; left: .8rem; font-size: 1.1rem !important; color: #999; }
.lb-prev { left: .3rem; top: 50%; transform: translateY(-50%); font-size: 3.2rem; }
.lb-next { right: .3rem; top: 50%; transform: translateY(-50%); font-size: 3.2rem; }
@media (max-width: 720px) {
  #lightbox figure { padding: 3rem .6rem; }
  .lb-prev, .lb-next { font-size: 2.2rem; padding: .6rem; }
}
