/* nleonora.info: one stylesheet, no build step.
   Direction: minimal, photo-led editorial (refs: matthieugivelet.com, perappelgren.de, aat-architecten.be). */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b1a;
  --muted: #6a655e;
  --line: #e2ddd4;
  --accent: #a4161a;
  --accent-ink: #ffffff;
  --accent-soft: #f7e9e8;
  --radius: 14px;
  --max: 1080px;
  --wide: 1320px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Easing and timing measured on the references with analyze_scroll_map. */
  --ease-out: cubic-bezier(.18, .66, .18, 1);   /* matthieugivelet.com reveals */
  --ease-fade: cubic-bezier(.25, .46, .45, .94); /* aat-architecten.be crossfades */
  --t-rise: 1.2s;
  --t-fade: 1.7s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1d1b1a;
    --text: #edeae4;
    --muted: #a8a39b;
    --line: #34302c;
    --accent: #ef5a5f;
    --accent-ink: #141312;
    --accent-soft: #2c1b1b;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: var(--wide); }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

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

/* Small bracketed labels, numbers */
.label { font: 500 14px/1.2 var(--sans); color: var(--muted); letter-spacing: .01em; margin: 0 0 18px; }
.idx { font: 500 13px/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }

/* Hairline rules that draw in from the left */
.rule { position: relative; }
.rule::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform-origin: 0 50%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; max-width: var(--wide); }
.brand { font: 500 15px/1 var(--sans); color: var(--text); text-decoration: none; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav a:not(.btn) { color: var(--text); text-decoration: none; position: relative; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: 100% 50%; transition: transform .6s var(--ease-out); }
.nav a:not(.btn):hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav sup { font-size: 10px; color: var(--muted); margin-left: 2px; }
@media (max-width: 760px) { .nav .hide-sm { display: none; } .nav { gap: 18px; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font: 500 15px/1 var(--sans); text-decoration: none;
  border: 1px solid var(--line); color: var(--text); background: transparent;
  transition: transform .25s var(--ease-out), border-color .3s ease, background-color .3s ease;
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.nav .btn { padding: 8px 14px; font-size: 14px; }

.arrow-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.arrow-link span { display: inline-block; color: var(--accent); transition: transform .6s var(--ease-out); }
.arrow-link:hover span { transform: translateX(6px); }
.arrow-link:hover { text-decoration: underline; }

/* Hero */
.hero { padding: clamp(48px, 9vh, 104px) 0 72px; text-align: center; }
.status { display: block; font: 500 14px/1.5 var(--sans); text-wrap: balance; color: var(--muted); margin-bottom: clamp(20px, 4vh, 40px); }
.status .dot { display: inline-block; vertical-align: .08em; margin-right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #2f9e44; box-shadow: 0 0 0 0 rgba(47,158,68,.5); }
.status .sep { color: var(--line); margin: 0 6px; }

.name {
  --size: clamp(64px, 11.5vw, 184px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0 .14em;
  font: 600 var(--size)/.92 var(--sans);
  letter-spacing: -.055em;
  margin: 0 0 clamp(20px, 3vh, 32px);
}
.name .w { display: inline-block; overflow: hidden; padding: 0 .04em .06em; margin-bottom: -.06em; }
.name .c { display: inline-block; }
.slot + .w { margin-left: -.06em; } /* trailing negative tracking leaves the left gap tighter; even it out */
.slot {
  position: relative; display: inline-block; flex: none;
  width: 1.7em; height: .74em; margin: 0 .04em;
  border-radius: .07em; overflow: hidden;
  background: var(--line);
}
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.slot img:not(:first-child) { opacity: 0; }
@media (max-width: 640px) {
  .name { --size: 25vw; letter-spacing: -.06em; }
  .slot { width: 1.45em; height: .7em; }
}

.headline { font: 400 clamp(18px, 2.1vw, 24px)/1.45 var(--serif); color: var(--muted); max-width: 820px; margin: 0 auto 48px; }
.headline strong { color: var(--text); font-weight: 500; }

.hero-row {
  display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 24px; align-items: start;
  text-align: left; padding-top: 18px; border-top: 1px solid var(--line); margin-bottom: 36px;
}
.hero-row .label { margin: 0; }
.hero-row p { margin: 0; max-width: 40ch; }
.hero-row .idx { margin-right: 12px; }
.hero-row .arrow-link { justify-self: end; }
@media (max-width: 760px) {
  .hero-row { grid-template-columns: 1fr; gap: 12px; }
  .hero-row .arrow-link { justify-self: start; }
}

.cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 24px; margin: 64px 0 0; text-align: left; }
.stat { padding-top: 16px; border-top: 1px solid var(--line); }
.stat dt { font-size: 14px; color: var(--muted); max-width: 26ch; min-height: 2.8em; }
.stat dd { margin: 0; font: 400 clamp(40px, 5vw, 64px)/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; gap: 20px; margin-top: 48px; }
  .stat dt { min-height: 0; }
  .hero { padding-bottom: 48px; }
}

/* Sections */
section.block { padding: clamp(64px, 10vw, 120px) 0; }
.section-head { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: baseline; margin-bottom: 40px; }
.section-head .label { margin: 0; }
.block h2 { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -.02em; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; gap: 0; margin-bottom: 28px; } .section-head .label { margin-bottom: 12px; } }

/* About: centered portrait, short copy */
.about { text-align: center; }
.about .label { margin-bottom: 28px; }
.portrait { width: 180px; aspect-ratio: 4 / 5; margin: 0 auto 36px; overflow: hidden; border-radius: 4px; background: var(--line); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transform: scale(var(--zoom, 1)); transform-origin: var(--pos, 50% 50%); }
.about h2 { max-width: 16ch; margin: 0 auto 28px; }
.about p { max-width: 620px; margin-left: auto; margin-right: auto; }
.lede { font-size: 19px; }
.recent { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; text-align: left; }
.recent li { padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.recent .idx { display: block; margin-bottom: 10px; color: var(--accent); }
@media (max-width: 760px) { .recent { grid-template-columns: 1fr; gap: 16px; } }

/* Experience: ruled editorial rows */
.timeline { list-style: none; }
.job { display: grid; grid-template-columns: 200px 1fr 170px; gap: 24px; padding: 32px 0 40px; }
.job .when { font: 400 22px/1.2 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.job .where { font-size: 14px; color: var(--muted); text-align: right; line-height: 1.5; }
.job h3 { font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 10px; }
.job .org { display: block; font: 500 15px/1.4 var(--sans); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.job .context { color: var(--muted); margin: 0 0 14px; }
.job-body > ul:not(.tags) { padding-left: 20px; }
.job-body li { margin-bottom: 8px; }
.job-body li::marker { color: var(--accent); }
.job.minor { padding: 24px 0 28px; }
.job.minor .context { margin: 0; }
.job.minor h3 { font-size: 21px; margin-bottom: 6px; }
@media (max-width: 860px) {
  .job { grid-template-columns: 1fr auto; grid-template-areas: "when where" "body body"; gap: 12px 16px; padding: 24px 0 32px; }
  .job .when { grid-area: when; font-size: 19px; }
  .job .where { grid-area: where; }
  .job-body { grid-area: body; }
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin-top: 16px; padding: 0 !important; }
.tags li { font-size: 13px; line-height: 1.4; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin: 0; }
.tags li::marker { content: none; }

/* Projects: numbered rows with a big serif title */
.projects { border-bottom: 1px solid var(--line); }
.project { display: grid; grid-template-columns: 60px 1fr 1.15fr; gap: 24px; padding: 36px 0 44px; align-items: start; }
.project .idx { padding-top: 14px; }
.project-title { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.project h3 { font-size: clamp(44px, 6.4vw, 88px); line-height: .95; letter-spacing: -.035em; transition: transform .8s var(--ease-out), color .4s ease; }
.project:hover h3 { transform: translateX(12px); color: var(--accent); }
.pill { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.project-body p { color: var(--muted); margin-bottom: 0; }
.project-body .arrow-link { margin-top: 20px; }
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; gap: 14px; padding: 28px 0 36px; }
  .project .idx { padding-top: 0; }
}
.small-list { margin-top: 28px; color: var(--muted); font-size: 15px; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.skill { padding-top: 18px; }
.skill h3 { font-size: 19px; }
@media (max-width: 960px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; gap: 28px; } }

/* Beyond code: text list + photo. On wide screens with JS, the photo becomes a
   sticky frame that crossfades as each item scrolls into focus (aat-architecten.be). */
.split-list { display: grid; gap: 48px; }
.beyond-item .shot { margin: 0 0 18px; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 4px; background: var(--line); }
.beyond-item .shot img { width: 100%; height: 100%; object-fit: cover; }
.beyond-item .idx { display: block; margin-bottom: 8px; color: var(--accent); }
.beyond-item h3 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.02em; margin-bottom: 10px; }
.beyond-item p { color: var(--muted); max-width: 46ch; }
.split-frame { display: none; }
@media (min-width: 900px) {
  .split-list { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .split.live { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; align-items: start; }
  .split.live .split-list { grid-template-columns: 1fr; gap: 0; }
  .split.live .beyond-item { min-height: 46vh; padding: 28px 0; border-top: 1px solid var(--line); opacity: .35; transition: opacity 1s var(--ease-fade); }
  .split.live .beyond-item.on { opacity: 1; }
  .split.live .beyond-item .shot { display: none; }
  .split.live .split-frame { display: block; position: sticky; top: 96px; aspect-ratio: 4 / 3; max-height: calc(100vh - 140px); width: 100%; overflow: hidden; border-radius: 4px; background: var(--line); }
  .split-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 2s var(--ease-fade), transform 3s var(--ease-fade); }
  .split-frame img.on { opacity: 1; transform: none; }
}

/* Contact */
.contact { text-align: center; }
.contact .label { margin-bottom: 24px; }
.contact .giant { --size: clamp(64px, 12vw, 176px); font-size: var(--size); letter-spacing: -.055em; margin-bottom: 32px; font-family: var(--sans); }
.slot.small { width: 1.25em; }
.contact-copy { color: var(--muted); font-size: 19px; max-width: 560px; margin: 0 auto 28px; }
.contact-mail { position: relative; display: inline-block; font: 400 clamp(24px, 4vw, 44px)/1.2 var(--serif); color: var(--text); text-decoration: none; margin-bottom: 32px; letter-spacing: -.01em; }
.contact-mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform-origin: 100% 50%; transition: transform .8s var(--ease-out); }
.contact-mail:hover::after { animation: redraw .9s var(--ease-out); }
@keyframes redraw { 0% { transform: scaleX(1); transform-origin: 100% 50%; } 45% { transform: scaleX(0); transform-origin: 100% 50%; } 46% { transform-origin: 0 50%; } 100% { transform: scaleX(1); transform-origin: 0 50%; } }
.contact-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; font-size: 15px; }
.contact-links a { color: var(--text); text-decoration: none; }
.contact-links a:hover { color: var(--accent); }
@media (max-width: 640px) { .contact .giant { --size: 21vw; } }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: var(--wide); }
footer a { color: var(--muted); }

/* Gallery pages (ministry, phovid) */
.page-head { padding: 72px 0 32px; }
.page-head h1 { font-size: clamp(38px, 6vw, 64px); letter-spacing: -.02em; margin-bottom: 12px; }
.page-head p { color: var(--muted); font-size: 19px; max-width: 680px; }
.back { display: inline-block; margin-bottom: 24px; font-size: 15px; text-decoration: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; padding-bottom: 80px; }
.tile { display: block; color: var(--text); text-decoration: none; }
.tile img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.tile:hover img { transform: scale(1.04); }
.tile .cap { padding: 12px 0; font-weight: 500; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.tile .cap small { color: var(--muted); font-weight: 400; }
.tile .media { overflow: hidden; position: relative; border-radius: 4px; }
.tile .play { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .play span { width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; transition: transform .6s var(--ease-out); }
.tile:hover .play span { transform: scale(1.1); }
.tile .play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }

/* ---------- Motion ----------
   Progressive: every hidden start state needs html.js and no reduced-motion
   preference. With JS off or reduced motion on, the page is complete and still. */

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 6; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

@media (prefers-reduced-motion: no-preference) {
  /* Load sequence (hero), measured cadence: 1.2s rises, ~80ms steps */
  html.js .hero .rise { animation: rise var(--t-rise) var(--ease-out) both, fade var(--t-fade) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
  html.js .hero .name .c { animation: mask-up var(--t-rise) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 100ms); }
  html.js .hero .slot { animation: slot-open 1.4s var(--ease-out) .35s both; }
  html.js .hero .slot img:first-child { animation: settle 2.2s var(--ease-out) .35s both; }
  .status .dot { animation: ping 2.4s ease-out infinite; }
  /* Header links drop in 50ms apart (matthieugivelet.com nav) */
  html.js .home .site-header .brand, html.js .home .nav > a { animation: rise var(--t-rise) var(--ease-out) both, fade var(--t-fade) var(--ease-out) both; }
  html.js .home .nav > a:nth-child(1) { animation-delay: 50ms; }
  html.js .home .nav > a:nth-child(2) { animation-delay: 100ms; }
  html.js .home .nav > a:nth-child(3) { animation-delay: 150ms; }
  html.js .home .nav > a:nth-child(4) { animation-delay: 200ms; }
  html.js .home .nav > a:nth-child(5) { animation-delay: 250ms; }

  /* The photo slot cycles four shots: 6s loop, 1.5s apart (matthieugivelet.com) */
  .hero .slot img { animation: cycle4 6s linear infinite both; }
  .hero .slot img:nth-child(2) { animation-delay: 1.5s; }
  .hero .slot img:nth-child(3) { animation-delay: 3s; }
  .hero .slot img:nth-child(4) { animation-delay: 4.5s; }
  html.js .hero .slot img:first-child { animation: settle 2.2s var(--ease-out) .35s both, cycle4 6s linear 6s infinite; }
  .contact .slot img { animation: cycle2 6s linear infinite both; }
  .contact .slot img:nth-child(2) { animation-delay: 3s; }

  /* Scroll reveals */
  html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--t-fade) var(--ease-out), transform var(--t-rise) var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  html.js .reveal.in { opacity: 1; transform: none; }
  html.js .rule::before { transform: scaleX(0); transition: transform 1.4s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  html.js .rule.in::before { transform: scaleX(1); }
  html.js .rule:not(.reveal) > * { opacity: 0; transform: translateY(18px); transition: opacity var(--t-fade) var(--ease-out), transform var(--t-rise) var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms + 120ms); }
  html.js .rule.in > * { opacity: 1; transform: none; }
  html.js .contact .name .c { transform: translateY(105%); transition: transform var(--t-rise) var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
  html.js .contact .name.in .c { transform: none; }
  html.js .contact .slot { clip-path: inset(0 50% 0 50% round .07em); transition: clip-path 1.4s var(--ease-out) .2s; }
  html.js .contact .name.in .slot { clip-path: inset(0 0 0 0 round .07em); }
}

@keyframes rise { from { transform: translateY(24px); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mask-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes slot-open { from { clip-path: inset(0 50% 0 50% round .07em); } to { clip-path: inset(0 0 0 0 round .07em); } }
@keyframes settle { from { transform: scale(1.3); } to { transform: none; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47,158,68,.45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(47,158,68,0); } }
@keyframes cycle4 {
  0% { opacity: 0; transform: scale(1.08); }
  5% { opacity: 1; }
  25% { opacity: 1; }
  32% { opacity: 0; }
  100% { opacity: 0; transform: none; }
}
@keyframes cycle2 {
  0% { opacity: 0; transform: scale(1.08); }
  8% { opacity: 1; }
  50% { opacity: 1; }
  58% { opacity: 0; }
  100% { opacity: 0; transform: none; }
}

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