/* Clément Beautru — site styles
   Palette: paper, ink and deep water. One typeface: Cormorant Garamond. */
:root {
  --paper: #F2F2ED;
  --paper-2: #E8E8E1;
  --ink: #15202A;
  --text: #39424A;
  --mist: #7A848B;
  --rule: #D6D6CD;
  --deep: #0E2A3F;
  --surface: #F7F7F2;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --s-body: 1.25rem;          /* 20px */
  --s-small: 1.0625rem;       /* 17px */
  --s-h3: 1.75rem;
  --s-h2: clamp(2.25rem, 4vw, 3.25rem);
  --s-display: clamp(3.25rem, 10vw, 10rem);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1440px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--s-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); font-weight: 400; margin: 0; line-height: 1.08; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--deep); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.1rem var(--gutter);
  background: var(--paper);
  color: var(--ink);
  transition: background-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease);
}
.site-nav a { text-decoration: none; }
.nav-name { font-size: 1.375rem; font-weight: 500; letter-spacing: .01em; }
.site-nav nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); font-size: var(--s-small); }
.site-nav nav a { position: relative; }
.site-nav nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.site-nav nav a:hover::after, .site-nav nav a:focus-visible::after { transform: scaleX(1); }

.site-nav.is-overlay { position: fixed; left: 0; right: 0; background: transparent; color: var(--surface); }
.site-nav.is-overlay .nav-name { opacity: 0; transition: opacity .4s var(--ease); }
.site-nav.is-overlay.is-solid { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--rule); }
.site-nav.is-overlay.is-solid .nav-name { opacity: 1; }

/* ---------- hero: the name sits on the waterline ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 520px;
  overflow: hidden; background: var(--deep); color: var(--surface);
}
.hero-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 33%;   /* the surface line sits at ~33% of the frame */
  max-width: none;
}
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,20,30,0) 55%, rgba(8,20,30,.55) 100%); }
.hero-name {
  position: absolute; left: 0; right: 0; top: 33%;
  transform: translateY(-82%);                    /* letters rest on the surface */
  text-align: center; color: var(--surface);
  font-size: var(--s-display); font-weight: 300; line-height: 1; letter-spacing: -0.015em;
  padding: 0 var(--gutter);
  animation: surface 2.4s var(--ease) both .2s;
}
@keyframes surface { from { opacity: 0; transform: translateY(-60%); } to { opacity: 1; transform: translateY(-82%); } }
.hero-foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(1.5rem, 5vh, 3rem);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap;
}
.hero-tagline { font-size: clamp(1.375rem, 2.4vw, 2rem); font-style: italic; margin: 0; max-width: 24ch; line-height: 1.25; }
.hero-role { font-size: var(--s-small); margin: 0; opacity: .85; }

/* ---------- work ---------- */
.work { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(3rem, 8vw, 6rem); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--rule); padding-bottom: 1rem; }
.section-head h2 { font-size: var(--s-h2); }
.section-head p { margin: 0; color: var(--mist); font-style: italic; font-size: var(--s-small); }

.tile { display: block; text-decoration: none; color: var(--ink); }
.tile-media { position: relative; overflow: hidden; background: var(--paper-2); aspect-ratio: 16 / 9; }
.tile-media img, .tile-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none;
  transition: transform 1.6s var(--ease), opacity .6s var(--ease);
}
.tile-loop { opacity: 0; }
.tile.is-playing .tile-loop { opacity: 1; }
.tile:hover .tile-media img, .tile:focus-visible .tile-media img { transform: scale(1.03); }
.tile-caption {
  display: grid; grid-template-columns: 1fr auto; column-gap: 1rem;
  padding: 1rem 0 0;
}
.tile-caption h3 { font-size: var(--s-h3); font-weight: 500; }
.tile--featured .tile-caption h3 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 400; }
.tile-caption p { grid-column: 1; margin: .25rem 0 0; font-style: italic; color: var(--mist); font-size: var(--s-small); }
.tile-year { grid-column: 2; grid-row: 1; color: var(--mist); font-size: var(--s-small); font-variant-numeric: lining-nums tabular-nums; align-self: baseline; }

.grid {
  display: grid; grid-template-columns: 1fr; gap: clamp(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}
@media (min-width: 760px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .tile:nth-child(even) { margin-top: clamp(3rem, 8vw, 7rem); }   /* gentle offset, like a contact sheet */
}

/* ---------- about ---------- */
.about {
  max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(5rem, 10vw, 8rem);
  display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
@media (min-width: 860px) { .about { grid-template-columns: 5fr 7fr; } }
.about-portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1); }
.about-text { max-width: 36rem; }
.about-text h2 { font-size: var(--s-h2); margin-bottom: 1.5rem; }
.about-text p:first-of-type { font-size: clamp(1.5rem, 2.2vw, 1.875rem); line-height: 1.35; color: var(--ink); }
.creds { margin: 2.5rem 0 0; border-top: 1px solid var(--rule); }
.creds div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.creds dt { font-style: italic; color: var(--mist); }
.creds dd { margin: 0; }

/* ---------- contact ---------- */
.contact { background: var(--deep); color: #CBD6DD; }
.contact-inner { max-width: var(--max); margin: 0 auto; padding: clamp(5rem, 12vw, 9rem) var(--gutter) clamp(3rem, 8vw, 5rem); }
.contact h2 { color: var(--surface); font-size: var(--s-h2); margin-bottom: 1.5rem; }
.contact-email {
  display: inline-block; color: var(--surface); text-decoration: none;
  font-size: clamp(1.75rem, 6vw, 5rem); font-weight: 300; line-height: 1.1; letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(247,247,242,.35); padding-bottom: .15em; word-break: break-word;
  transition: border-color .3s var(--ease);
}
.contact-email:hover { border-color: var(--surface); }
.contact-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: clamp(3rem, 6vw, 5rem); font-size: var(--s-small); }
.contact-meta p { margin: 0; }
.footer { max-width: var(--max); margin: 0 auto; padding: 1.25rem var(--gutter) 2rem; font-size: .95rem; color: #8A9BA8; border-top: 1px solid rgba(247,247,242,.12); }

/* ---------- project page ---------- */
.project-main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.film { padding-top: clamp(.5rem, 2vw, 1.5rem); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; max-width: none; }
.player .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(4rem, 8vw, 6rem); aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid rgba(247,247,242,.9); background: rgba(8,20,30,.2); cursor: pointer;
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.player .play span { position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: .7rem 0 .7rem 1.15rem; border-color: transparent transparent transparent #F7F7F2; }
.player .play:hover { background: rgba(8,20,30,.45); transform: translate(-50%, -50%) scale(1.05); }
.player-fallback { margin: .6rem 0 0; font-size: var(--s-small); font-style: italic; color: var(--mist); text-align: right; }
.player-fallback a { color: var(--mist); }

.project-body {
  display: grid; gap: 2rem clamp(2rem, 5vw, 5rem);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 5rem);
}
@media (min-width: 900px) {
  .project-body { grid-template-columns: 5fr 7fr; }
  .project-head { grid-column: 1 / -1; }
}
.project-head h1 { font-size: clamp(2.75rem, 7vw, 6rem); font-weight: 300; }
.project-sub { font-style: italic; color: var(--mist); font-size: clamp(1.25rem, 2vw, 1.5rem); margin: .75rem 0 0; }
.project-meta { margin: 0; border-top: 1px solid var(--rule); align-self: start; }
.project-meta div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.project-meta dt { font-style: italic; color: var(--mist); }
.project-meta dd { margin: 0; color: var(--ink); }
.project-text { max-width: 38rem; }
.project-text > p:first-child { font-size: clamp(1.375rem, 2vw, 1.625rem); line-height: 1.45; color: var(--ink); }
.extras { margin-top: 2.5rem; }
.extras h2 { font-size: var(--s-h3); margin-bottom: .75rem; }
.extras ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.extras li { border-bottom: 1px solid var(--rule); }
.extras a { display: block; padding: .7rem 0; text-decoration: none; }
.extras a:hover { color: var(--deep); font-style: italic; }

.stills { columns: 1; column-gap: clamp(1rem, 2vw, 1.5rem); }
@media (min-width: 640px) { .stills { columns: 2; } }
.stills:has(> img:only-child) { columns: 1; }
@media (min-width: 1000px) { .stills--many { columns: 3; } }
.stills img { width: 100%; height: auto; margin: 0 0 clamp(1rem, 2vw, 1.5rem); break-inside: avoid; }

.next {
  position: relative; display: block; margin: clamp(4rem, 9vw, 7rem) 0 clamp(4rem, 9vw, 7rem);
  text-decoration: none; color: var(--surface); overflow: hidden; aspect-ratio: 21 / 7; min-height: 220px; background: var(--deep);
}
.next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; opacity: .72; transition: transform 1.6s var(--ease), opacity .6s var(--ease); }
.next:hover img { transform: scale(1.03); opacity: .85; }
.next-label, .next-title { position: relative; z-index: 1; display: block; padding: 0 clamp(1.25rem, 3vw, 2.5rem); }
.next-label { padding-top: clamp(1.25rem, 3vw, 2.25rem); font-style: italic; font-size: var(--s-small); }
.next-title { font-size: clamp(2rem, 5vw, 4rem); font-weight: 300; line-height: 1.1; }

@media (max-width: 560px) {
  .nav-name { font-size: 1.2rem; }
  .site-nav nav { gap: .9rem; font-size: 1rem; }
  .hero-name { font-size: clamp(2.5rem, 11.5vw, 5rem); white-space: nowrap; }
  .creds div, .project-meta div { grid-template-columns: 1fr; gap: .1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
