/* Stephane Morera, personal site. One photograph, one accent, the numbers are the decoration. */

:root {
  --bg: #232120;
  --bg-deep: #1a1818;
  --fg: #ede8df;
  --fg-muted: #a9a49b;
  --fg-faint: #6f6a63;
  --gold: #c9a24a;
  --gold-dim: #6b5628;
  --paper: #ece7dc;
  --paper-2: #e3ddd0;
  --ink: #17150f;
  --ink-muted: #4d4941;
  --ink-faint: #8a8479;
  --gold-ink: #8a6a1c;
  --rule: rgba(237, 232, 223, 0.14);
  --rule-strong: rgba(237, 232, 223, 0.38);
  --rule-ink: rgba(23, 21, 15, 0.14);
  --rule-ink-strong: rgba(23, 21, 15, 0.42);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --max: 1400px;
  --gutter: clamp(20px, 4vw, 64px);
  --section: clamp(5rem, 4rem + 6vw, 11rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Moving backdrop: the studio wall behind the portrait, lit by a slow light. */
#backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  background:
    radial-gradient(120% 90% at 78% 30%, #34302d 0%, #262322 45%, #1d1b1a 100%);
}

main, header, footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 10;
  background: var(--gold); color: var(--ink); padding: 8px 12px;
}
.skip:focus { left: 8px; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; }

/* Nav. The container blends (difference) so text reads on the wall and on paper.
   The crown sits in its own sticky layer, outside the blend, so it stays gold. */
.nav-crown {
  position: sticky; top: 0; z-index: 6; height: 0;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.nav-crown .crown { position: absolute; top: 22px; }
.crown { width: 22px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.crown-space { display: inline-block; width: 22px; height: 16px; }
.nav {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}
.nav-mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.125rem; letter-spacing: 0.005em; }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: 0.9375rem; }
.nav nav a { color: rgba(255,255,255,0.72); transition: color .2s; }
.nav nav a:hover { color: #fff; }
.nav-evoix {
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.5); border-radius: 999px;
  padding: 7px 14px; line-height: 1;
}
.nav-evoix:hover { border-color: #fff; }
@media (max-width: 720px) {
  .nav nav a:not(.nav-evoix) { display: none; }
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100svh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 0 0 var(--gutter);
}
.hero-text { padding: 12vh 0 clamp(3rem, 7vh, 6rem); max-width: 40rem; position: relative; z-index: 2; }
.name {
  font-size: clamp(4.5rem, 12.5vw, 12.5rem);
  line-height: 0.86;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144, "SOFT" 0;
  font-weight: 300;
  margin-left: -0.05em;
}
.name .line { display: block; overflow: hidden; }
.name .w { display: inline-block; transform: translateY(110%); }
.role { margin: 2.2rem 0 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem); font-variation-settings: "opsz" 40; color: var(--fg); }
.lede { margin: 1rem 0 0; max-width: 34rem; color: var(--fg-muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2.25rem; }
.btn {
  display: inline-flex; align-items: center; height: 46px; padding: 0 22px;
  border-radius: 999px; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.01em;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--fg); color: var(--ink); }
.btn-solid:hover { background: #fff; }
.btn-line { border: 1px solid var(--rule-strong); color: var(--fg); }
.btn-line:hover { border-color: var(--fg); }

.portrait {
  margin: 0; position: relative; align-self: stretch;
  min-height: 70svh;
}
.portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 12%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%), linear-gradient(to top, transparent 0%, #000 18%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%), linear-gradient(to top, transparent 0%, #000 18%);
  mask-composite: intersect;
  opacity: 0;
  will-change: transform, opacity;
}
.portrait figcaption {
  position: absolute; right: var(--gutter); bottom: 1.5rem;
  font-size: 0.8125rem; color: var(--fg-faint);
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 0 var(--gutter); align-items: start; min-height: 0; }
  .hero-text { order: 2; padding: 2rem 0 3rem; }
  .portrait { order: 1; min-height: 0; aspect-ratio: 4 / 5; margin: 1rem calc(-1 * var(--gutter)) 0 auto; width: min(100%, 520px); }
  .portrait img { mask-image: linear-gradient(to top, transparent 0%, #000 22%); -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 22%); }
  .portrait figcaption { right: var(--gutter); }
  .name { font-size: clamp(4.25rem, 19vw, 8rem); }
}

/* The claim */
.claim {
  max-width: var(--max); margin: 0 auto; padding: var(--section) var(--gutter);
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 6rem); align-items: start;
}
.claim-line {
  margin: 0;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(2.6rem, 1.5rem + 5vw, 6.25rem); line-height: 1.02; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  text-wrap: balance;
}
.claim-notes { color: var(--fg-muted); max-width: 34rem; padding-top: 0.6rem; }
.claim-notes p { margin: 0 0 1rem; }
@media (max-width: 900px) { .claim { grid-template-columns: 1fr; } }

/* Receipts */
.receipts { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--gutter); border-top: 1px solid var(--rule); }
.receipts h2, .work h2, .about h2, .contact h2 {
  font-size: clamp(2.25rem, 1.5rem + 2.5vw, 3.75rem); line-height: 1.02; letter-spacing: -0.02em; font-variation-settings: "opsz" 144;
}
.receipts-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 6rem); align-items: end; }
.receipts-head p { margin: 0; color: var(--fg-muted); max-width: 40rem; }
@media (max-width: 900px) { .receipts-head { grid-template-columns: 1fr; } }

.ledger { margin-top: 3.5rem; display: grid; gap: 3.5rem; }
.ledger-group .q { font-size: clamp(1.375rem, 1rem + 1.2vw, 1.875rem); font-variation-settings: "opsz" 40; margin-bottom: 1rem; letter-spacing: -0.01em; }
.row {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 5fr); gap: 1rem; align-items: center;
  padding: 1rem 0; border-top: 1px solid var(--rule);
}
.row.head { color: var(--fg-faint); font-size: 0.875rem; border-top: 1px solid var(--rule-strong); padding: 0.6rem 0; }
.engine { font-family: var(--serif); font-size: 1.375rem; font-variation-settings: "opsz" 40; }
.pred { color: var(--fg-muted); }
.dots { display: inline-flex; gap: 7px; flex-wrap: wrap; }
.dots i {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: transparent;
  transform: scale(0.6);
  transition: background .35s ease, border-color .35s ease, transform .5s cubic-bezier(.2,.9,.2,1.2);
}
.dots i.on { background: var(--gold); border-color: var(--gold); transform: scale(1); }
.dots i.off { transform: scale(1); }
@media (max-width: 640px) {
  .row { grid-template-columns: 1fr 1fr; }
  .row .dots, .row.head span:last-child { grid-column: 1 / -1; }
  .row.head span:nth-child(2) { text-align: right; }
  .pred { text-align: right; }
}

.tally { margin-top: 4rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; border-top: 1px solid var(--rule-strong); padding-top: 2rem; }
.tally div { display: grid; gap: 0.4rem; }
.tally b { font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 2rem + 4vw, 6rem); line-height: 0.95; letter-spacing: -0.03em; font-variation-settings: "opsz" 144; font-variant-numeric: tabular-nums; }
.tally span { color: var(--fg-muted); max-width: 22rem; }
@media (max-width: 800px) { .tally { grid-template-columns: 1fr; } }
.receipts-foot { margin: 3rem 0 0; color: var(--fg-muted); max-width: 46rem; }
.receipts-foot a { color: var(--fg); border-bottom: 1px solid var(--rule-strong); transition: border-color .2s; }
.receipts-foot a:hover { border-color: var(--gold); }

/* Paper sections */
.paper { background: var(--paper); color: var(--ink); }
.work { padding: var(--section) 0 0; }
.work > h2, .work > .worklist, .about > * { max-width: var(--max); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.worklist { list-style: none; margin: 2.5rem auto 0; padding-bottom: var(--section); }
.worklist li { border-top: 1px solid var(--rule-ink); }
.worklist li:last-child { border-bottom: 1px solid var(--rule-ink); }
.worklist a {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 2fr); gap: 1.5rem; align-items: baseline;
  padding: 1.6rem 0; transition: padding-left .3s cubic-bezier(.2,.8,.2,1);
}
.worklist a:hover { padding-left: 0.5rem; }
.w-name { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); letter-spacing: -0.015em; font-variation-settings: "opsz" 72; }
.w-desc { color: var(--ink-muted); max-width: 44rem; }
.w-url { color: var(--ink-faint); font-size: 0.9375rem; text-align: right; }
.worklist a:hover .w-url { color: var(--gold-ink); }
@media (max-width: 800px) {
  .worklist a { grid-template-columns: 1fr; gap: 0.5rem; }
  .w-url { text-align: left; }
}

.about { padding: 0 0 var(--section); background: var(--paper-2); }
.about > h2 { padding-top: var(--section); }
.about-body { margin-top: 2rem; columns: 2; column-gap: 4rem; font-size: 1.125rem; line-height: 1.65; color: var(--ink-muted); }
.about-body p { margin: 0 0 1.2rem; break-inside: avoid; }
.about-body p:first-child { color: var(--ink); }
@media (max-width: 800px) { .about-body { columns: 1; } }

/* Contact */
.contact { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--gutter); }
.email {
  display: inline-block; margin-top: 1.5rem;
  font-family: var(--serif); font-weight: 300; font-variation-settings: "opsz" 144;
  font-size: clamp(2rem, 1rem + 5vw, 6rem); line-height: 1; letter-spacing: -0.03em;
  border-bottom: 1px solid var(--rule-strong); padding-bottom: 0.15em;
  transition: border-color .25s, color .25s;
  overflow-wrap: anywhere;
}
.email:hover { border-color: var(--gold); color: #fff; }
.social { list-style: none; display: flex; gap: 2rem; padding: 0; margin: 2.5rem 0 0; color: var(--fg-muted); }
.social a { transition: color .2s; border-bottom: 1px solid transparent; }
.social a:hover { color: var(--fg); border-color: var(--gold); }

/* Footer */
.foot {
  max-width: var(--max); margin: 0 auto; padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  color: var(--fg-faint); font-size: 0.875rem;
}

/* Motion. One authored moment on load, one data reveal on scroll. */
.loaded .name .w { animation: rise 1.1s cubic-bezier(.2,.8,.2,1) forwards; }
.loaded .name .line:nth-child(2) .w { animation-delay: .12s; }
.loaded .portrait img { animation: appear 1.6s ease .2s forwards; }
.loaded .role, .loaded .lede, .loaded .actions { animation: fade 1s ease .5s both; }
.role, .lede, .actions { opacity: 0; }
@keyframes rise { to { transform: translateY(0); } }
@keyframes appear { to { opacity: 1; } }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .name .w, .portrait img, .role, .lede, .actions { animation: none !important; transform: none !important; opacity: 1 !important; }
  .dots i { transition: none; transform: scale(1); }
  .btn, .worklist a { transition: none; }
}
