/* fl4me. — site styles
   Plain CSS, no build step. Edit freely. */

:root {
  --bg: #474747;
  --bg-deep: #3a3a3a;
  --ink: #ffffff;
  --ink-2: #ffffff;
  --ink-3: #dedede;
  --nav-idle: #b5b5b5;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ffffff;

  --sans: "Helvetica Neue", Helvetica, Inter, Arial, system-ui, sans-serif;
  --serif: "Times New Roman", Times, Georgia, serif;

  --side: 220px;
  --col: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 220ms;
  --t-med: 420ms;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ---------- Page transitions (View Transitions API, cross-document) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out var(--t-fast) ease both; }
::view-transition-new(root) { animation: vt-in var(--t-med) var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Sidebar stays put during transitions */
.side { view-transition-name: side; }
::view-transition-old(side), ::view-transition-new(side) { animation: none; }
/* Cover -> hero morph (name is assigned by JS on click) */
::view-transition-old(hero), ::view-transition-new(hero) { animation-duration: var(--t-med); mix-blend-mode: normal; }

/* JS fallback fade for browsers without cross-document view transitions */
body.is-leaving { opacity: 0; transition: opacity var(--t-fast) ease; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  body.is-leaving { transition: none; }
}

/* ---------- Layout ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  padding: 36px 28px; display: flex; flex-direction: column; gap: 40px;
  z-index: 20;
}
.wordmark {
  font-family: var(--serif); font-size: 17px; letter-spacing: 0.02em; color: var(--ink);
  white-space: nowrap;
}
.nav { display: flex; flex-direction: column; gap: 10px; }
.nav a { color: var(--nav-idle); font-size: 13px; transition: color var(--t-fast) ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.socials { margin-top: auto; display: flex; gap: 14px; }
.socials a { color: var(--ink-3); display: inline-flex; transition: color var(--t-fast) ease; }
.socials a:hover { color: var(--ink); }
.socials svg { width: 15px; height: 15px; fill: currentColor; }

.main { margin-left: var(--side); padding: 36px var(--gutter) 80px; min-height: 100vh; }
.main > * { max-width: var(--col); margin-inline: auto; }
.main > .landing { max-width: none; }

/* Mobile top bar */
.topbar { display: none; }
@media (max-width: 800px) {
  .side { display: none; }
  .side.open { display: flex; background: var(--bg); inset: 0; width: 100%; padding-top: 84px; }
  .topbar {
    position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  }
  .topbar .wordmark { font-size: 16px; }
  .menu-btn { background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; padding: 6px 0; z-index: 40; position: relative; }
  .main { margin-left: 0; padding: 14px 20px 60px; }
}

/* ---------- Grid (work index) ---------- */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 28px; }
.page-title { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; letter-spacing: 0.01em; }
.page-count { color: var(--ink-3); font-size: 12px; }

.grid {
  display: grid; gap: 28px 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; gap: 24px; } }

.card { display: block; }
.card .thumb {
  aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-deep); border-radius: 2px;
}
.card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.001); filter: brightness(0.94);
  transition: transform 900ms var(--ease), filter var(--t-med) ease, opacity var(--t-med) ease;
  opacity: 0;
}
.card .thumb img.loaded { opacity: 1; }
.card:hover .thumb img { transform: scale(1.035); filter: brightness(1); }
.card .meta { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px 0; }
.card .title { color: var(--ink); font-size: 13px; line-height: 1.35; }
.card .title small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.card .year { color: var(--ink-3); font-size: 12px; flex: none; }

/* ---------- Project page ---------- */
.project { max-width: 1120px; }
.project-head { margin: 0 0 26px; display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: end; }
.project-title { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 3vw, 30px); margin: 0; line-height: 1.15; }
.project-title small { display: block; font-family: var(--sans); font-size: 13px; color: var(--ink-2); margin-top: 6px; letter-spacing: 0.01em; }
.project-year { color: var(--ink-3); font-size: 13px; }
.project-meta { grid-column: 1 / -1; color: var(--ink-2); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.project-meta span::before { content: ""; }
.project-meta .award { color: var(--ink); }

.blocks { display: flex; flex-direction: column; gap: 22px; }
.blocks figure { margin: 0; }
.blocks .img img {
  max-width: 100%; max-height: 82vh; width: auto; height: auto; margin-inline: auto;
  border-radius: 2px; opacity: 0; transition: opacity var(--t-med) ease;
}
.blocks .img img.loaded { opacity: 1; }
.blocks .imgs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.blocks .imgs img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 2px; opacity: 0; transition: opacity var(--t-med) ease; }
.blocks .imgs img.loaded { opacity: 1; }
.blocks h3 { font-family: var(--serif); font-weight: 400; font-size: 17px; margin: 12px 0 -6px; color: var(--ink); }
.blocks p { max-width: 68ch; color: var(--ink-2); margin: 0; font-size: 14px; }
.blocks ul.credits { list-style: none; padding: 0; margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.blocks .links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid rgba(255,255,255,0.38); border-radius: 999px; padding: 11px 20px;
  background: rgba(255,255,255,0.10);
  color: var(--ink); font-size: 13.5px; letter-spacing: 0.02em;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease, transform var(--t-fast) ease;
}
.btn:hover { border-color: #fff; background: rgba(255,255,255,0.20); transform: translateY(-1px); }
.btn-primary { background: #fff; color: #1d1d1d; border-color: #fff; font-weight: 500; }
.btn-primary:hover { background: #e6e6e6; border-color: #e6e6e6; color: #1d1d1d; }
.btn-primary svg { stroke: #1d1d1d; }
.btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
figcaption { color: var(--ink-3); font-size: 12px; margin-top: 8px; }

/* Lazy YouTube facade: loads the real player only on click */
.yt { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: 2px; overflow: hidden; cursor: pointer; }
.yt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity var(--t-med) ease, transform 900ms var(--ease); }
.yt:hover img { opacity: 1; transform: scale(1.02); }
.yt .play {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.35); display: grid; place-items: center;
  transition: background var(--t-fast) ease, transform var(--t-fast) ease;
}
.yt:hover .play { background: rgba(0,0,0,0.75); transform: scale(1.05); }
.yt .play svg { width: 18px; height: 18px; fill: #fff; margin-left: 3px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: 2px; overflow: hidden; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.project-nav { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.project-nav a { color: var(--ink-3); transition: color var(--t-fast) ease; }
.project-nav a:hover { color: var(--ink); }
.project-nav .next { text-align: right; }
.project-nav small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }

/* ---------- Landing ---------- */
.landing { position: relative; min-height: calc(100vh - 72px); display: grid; place-items: center; text-align: center; }
.landing .bg { position: absolute; inset: -36px var(--gutter-neg, -56px); z-index: 0; overflow: hidden; pointer-events: none; }
.landing .bg img, .landing .bg video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  filter: brightness(0.38) saturate(0.9) blur(14px);
  transition: opacity 1600ms ease; transform: scale(1.14);
}
.landing .bg video.show, .landing .bg img.show { opacity: 1; }
.landing .bg img.show { opacity: 1; }
.landing .inner { position: relative; z-index: 1; padding: 40px 0; }
.landing .big { font-family: var(--serif); font-size: clamp(34px, 6vw, 64px); letter-spacing: 0.06em; margin: 0; font-weight: 400; }
.landing .tag { color: var(--ink-2); margin: 14px 0 34px; font-size: 14px; }
.landing .enter { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.landing .enter a { border-bottom: 1px solid var(--line); padding: 4px 2px; color: var(--ink-2); font-size: 13px; letter-spacing: 0.04em; transition: color var(--t-fast) ease, border-color var(--t-fast) ease; }
.landing .enter a:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- About / Contact ---------- */
.prose { max-width: 66ch; }
.prose p { color: var(--ink-2); font-size: 15px; line-height: 1.7; margin: 0 0 18px; }
.prose strong { color: var(--ink); font-weight: 500; }
.about-reel { max-width: 1120px; margin: 0 0 40px; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.contact-list a { color: var(--ink-2); border-bottom: 1px solid transparent; transition: color var(--t-fast) ease, border-color var(--t-fast) ease; }
.contact-list a:hover { color: var(--ink); border-color: var(--ink-3); }
.contact-list span { color: var(--ink-3); display: inline-block; width: 92px; }

form.contact { max-width: 480px; margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
form.contact label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
form.contact input, form.contact textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink);
  font: inherit; padding: 8px 0; border-radius: 0; outline: none; transition: border-color var(--t-fast) ease;
}
form.contact input:focus, form.contact textarea:focus { border-color: var(--ink-2); }
form.contact textarea { min-height: 120px; resize: vertical; }
form.contact button { align-self: flex-start; margin-top: 10px; cursor: pointer; background: none; font: inherit; }
form.contact .status { color: var(--ink-3); font-size: 12px; min-height: 1em; }

.footer { margin-top: 80px; color: var(--ink-3); font-size: 11.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.notfound h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; margin: 0 0 8px; }

/* ---------- Instagram embed ---------- */
.ig { max-width: 440px; margin-inline: auto; width: 100%; }
.ig iframe { width: 100%; height: 780px; border: 0; border-radius: 3px; background: #111; display: block; }
.ig .ig-fallback { margin-top: 12px; display: flex; justify-content: center; }
@media (max-width: 520px) { .ig iframe { height: 680px; } }
