@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root, [data-theme="dark"] {
  --bg: #0a0f14;
  --fg: #e8f1f4;
  --dim: rgba(232, 241, 244, .42);
  --soft: rgba(232, 241, 244, .72);
  --rule: rgba(232, 241, 244, .14);
  --header-bg: rgba(10, 15, 20, .55);
  --g1: rgba(20, 184, 166, .62);   /* teal   */
  --g2: rgba(56, 130, 246, .52);   /* blue   */
  --g3: rgba(34, 211, 238, .30);   /* cyan   */
  --g4: rgba(67, 56, 202, .44);    /* indigo */
  --veil: rgba(5, 8, 11, .94);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #faf6f3;
  --fg: #1d1716;
  --dim: rgba(29, 23, 22, .42);
  --soft: rgba(29, 23, 22, .72);
  --rule: rgba(29, 23, 22, .12);
  --header-bg: rgba(250, 246, 243, .6);
  --g1: rgba(240, 150, 165, .62);  /* rose  */
  --g2: rgba(255, 190, 150, .52);  /* coral */
  --g3: rgba(245, 215, 160, .58);  /* gold  */
  --g4: rgba(230, 170, 200, .48);  /* pink  */
  --veil: rgba(250, 246, 243, .96);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  transition: background-color .4s, color .4s;
}
.glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 6% 0%, var(--g1), transparent 70%),
    radial-gradient(50% 50% at 100% 12%, var(--g2), transparent 70%),
    radial-gradient(55% 50% at 85% 100%, var(--g3), transparent 70%),
    radial-gradient(40% 45% at 0% 100%, var(--g4), transparent 70%);
}
/* still, cinematic film grain over the background */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  mix-blend-mode: overlay; opacity: .32;
}
[data-theme="light"] body::after { mix-blend-mode: soft-light; opacity: .55; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 28px clamp(20px, 4vw, 56px) 18px;
  transition: background-color .3s, backdrop-filter .3s;
}
.site-header.scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.name {
  font-weight: 200; letter-spacing: .3em; text-decoration: none; white-space: nowrap;
  font-size: clamp(15px, 1.7vw, 28px); line-height: 1.2;
  margin-right: auto;
}
.name { display: inline-flex; align-items: center; gap: .55em; }
.logo { flex-shrink: 0; width: 1.8em; height: 1.8em; margin: -.2em 0; display: block; }
.logo .warm { display: none; }
[data-theme="light"] .logo .warm { display: inline; }
[data-theme="light"] .logo .cool { display: none; }
.logo-big { width: 72px; height: 72px; margin: 0 0 28px; }
.inner .name { font-size: clamp(14px, 1.5vw, 19px); }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav-link {
  text-decoration: none; font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim); transition: color .2s;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--fg); }
.toggle {
  display: inline-flex; gap: 2px; padding: 3px; border: 0; border-radius: 99px; cursor: pointer;
  background: rgba(127, 127, 127, .16); color: inherit; font: inherit; font-size: 12px; flex-shrink: 0;
}
.toggle span { padding: 3px 9px; border-radius: 99px; opacity: .55; }
[data-theme="dark"] .toggle .t-dark { background: rgba(255, 255, 255, .28); opacity: 1; }
[data-theme="light"] .toggle .t-light { background: rgba(29, 23, 22, .12); opacity: 1; }

main { padding: 0 clamp(20px, 4vw, 56px) 64px; }

/* ---------- home ---------- */
.index {
  display: grid; grid-template-columns: minmax(280px, 42%) 1fr; gap: clamp(20px, 3vw, 44px);
  align-items: stretch;
}
.index-left .label { font-size: clamp(11px, .8vw, 13px); }
.index-left { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 4px; }
.label { margin: 0; font-weight: 400; font-size: 10px; letter-spacing: .3em; color: var(--soft); opacity: .85; }
.para { margin: 28px 0 0; font-size: clamp(15px, 1.2vw, 19px); line-height: 1.75; letter-spacing: .02em; color: var(--soft); }
.welcome { margin: 22px 0 0; font-size: clamp(12px, .92vw, 15px); letter-spacing: .3em; }
.sections { display: flex; flex-direction: column; margin-top: 32px; }
.sec {
  text-decoration: none; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.45; letter-spacing: .02em;
  color: var(--dim); transition: color .25s; width: fit-content;
}
.sec.active, .sec:hover, .sec:focus-visible { color: var(--fg); }
.arrow { font-size: .7em; }
.index-right { position: relative; aspect-ratio: 4 / 3; max-height: calc(100vh - 130px); width: 100%; }
.index-right img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity .35s ease;
}
.index-right img.fading { opacity: 0; }

/* ---------- section pages ---------- */
.page-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 28px 0 26px; }
.page-head h1 { margin: 0; font-weight: 300; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; }
.page-head p { margin: 0; font-size: 12px; letter-spacing: .08em; color: var(--soft); }

.wall { columns: 280px; column-gap: 8px; }
.wall figure { margin: 0 0 8px; break-inside: avoid; }
.wall a { display: block; }
.wall img { display: block; width: 100%; height: auto; transition: opacity .25s; }
.wall a:hover img { opacity: .85; }
/* about: words left, photo mosaic right */
.about-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.wall.mosaic { columns: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(70px, 7.2vw, 124px); grid-auto-flow: dense; gap: 6px; }
.mosaic figure { margin: 0; overflow: hidden; }
.mosaic .wide { grid-column: span 2; }
.mosaic .tall { grid-row: span 2; }
.mosaic .big { grid-column: span 2; grid-row: span 2; }
.mosaic a, .mosaic img { width: 100%; height: 100%; }
.mosaic img { object-fit: cover; transition: opacity .25s, transform .6s; }
.mosaic a:hover img { transform: scale(1.03); }
@media (max-width: 900px) {
  .about-layout { grid-template-columns: minmax(0, 1fr); }
  .wall.mosaic { margin-top: 24px; grid-auto-rows: 28vw; }
}
.wall figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: none;
  grid-template-rows: 1fr auto; background: var(--veil);
}
.lightbox.open { display: grid; }
.lb-stage { display: flex; align-items: center; justify-content: center; padding: 56px 64px 12px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-info { padding: 8px 64px 28px; max-width: 760px; }
.lb-title { margin: 0; font-size: 11px; letter-spacing: .28em; text-transform: uppercase; }
.lb-meta { margin: 4px 0 0; font-size: 11px; letter-spacing: .08em; color: var(--soft); }
.lb-caption { margin: 8px 0 0; font-size: 12.5px; color: var(--soft); white-space: pre-line; max-height: 7.5em; overflow: auto; }
.lb-btn {
  position: absolute; border: 0; background: none; color: var(--fg); cursor: pointer;
  font: 300 28px/1 "Montserrat", sans-serif; padding: 14px; opacity: .7;
}
.lb-btn:hover { opacity: 1; }
.lb-close { top: 10px; right: 14px; font-size: 22px; letter-spacing: .1em; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- video ---------- */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px 20px; }
.video .frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video .frame img, .video .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video .play {
  text-decoration: none;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border: 0; background: rgba(0, 0, 0, .25); color: #fff; cursor: pointer; font-size: 38px; transition: background .2s;
}
.video .play:hover { background: rgba(0, 0, 0, .1); }
.video h2 { margin: 12px 0 0; font-weight: 300; font-size: 13px; letter-spacing: .02em; line-height: 1.5; }

/* ---------- writing / about ---------- */
.posts { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.posts li { padding: 22px 0; border-top: 1px solid var(--rule); }
.posts a { text-decoration: none; }
.posts h2 { margin: 0; font-weight: 400; font-size: 19px; line-height: 1.4; }
.posts time, .post time { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--soft); }
.posts p { margin: 8px 0 0; font-size: 14px; color: var(--soft); }
.prose { max-width: 680px; font-size: 16px; line-height: 1.8; }
.prose h1 { font-weight: 300; font-size: clamp(24px, 3vw, 34px); line-height: 1.3; margin: 8px 0 28px; }
.prose h2, .prose h3 { font-weight: 400; }
.prose img { display: block; margin: 28px 0; height: auto; }
.prose blockquote { margin: 24px 0; padding-left: 20px; border-left: 1px solid var(--rule); color: var(--soft); }
.prose .lead-img { margin: 0 0 32px; }
.site-footer {
  display: flex; align-items: center; flex-wrap: wrap; gap: 20px 36px;
  margin: 0 clamp(20px, 4vw, 56px); padding: 8px 0 96px; /* room below for Netlify's corner badge */
}
.site-footer .back { margin: 0; }
.socials { display: flex; gap: 18px; margin: 0; }
.socials a { display: block; padding: 4px; margin: -4px; color: var(--dim); transition: color .2s, transform .2s; }
.socials a:hover, .socials a:focus-visible { transform: translateY(-1px); }
.socials svg { display: block; width: 22px; height: 22px; }
.socials a:hover { color: var(--fg); }
.back { display: inline-block; margin-top: 40px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; text-decoration: none; color: var(--soft); }

/* ---------- contact ---------- */
.contact { max-width: 560px; }
.contact label { display: block; margin: 0 0 18px; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--soft); }
.contact input, .contact textarea {
  display: block; width: 100%; margin-top: 8px; padding: 10px 0;
  background: transparent; color: var(--fg); border: 0; border-bottom: 1px solid var(--rule);
  font: 300 16px/1.5 "Montserrat", sans-serif; border-radius: 0;
}
.contact input:focus, .contact textarea:focus { outline: none; border-bottom-color: var(--fg); }
.contact textarea { min-height: 140px; resize: vertical; }
.contact button {
  margin-top: 8px; padding: 12px 28px; border: 1px solid var(--fg); border-radius: 99px; background: none;
  color: var(--fg); font: 400 11px/1 "Montserrat", sans-serif; letter-spacing: .26em; text-transform: uppercase; cursor: pointer;
}
.contact button:hover { background: var(--fg); color: var(--bg); }
.hp { position: absolute; left: -9999px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; gap: 12px 16px; padding-top: 20px; }
  .home .site-header { flex-wrap: nowrap; }
  .home .name { font-size: clamp(11px, 3.6vw, 20px); letter-spacing: .2em; }
  .nav { order: 3; width: 100%; gap: 6px 16px; }
  .index { grid-template-columns: 1fr; min-height: 0; }
  .index-right { order: -1; aspect-ratio: 4 / 3; min-height: 0; }
  .sections { margin-top: 28px; }
  .lb-stage { padding: 52px 8px 8px; }
  .lb-info { padding: 8px 18px 22px; }
  .lb-prev, .lb-next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* home: centre the index vertically in tall windows */
.home main { min-height: calc(100vh - 110px); display: flex; flex-direction: column; justify-content: center; padding-bottom: 48px; }
.home .index { width: 100%; }
@media (max-width: 760px) { .home main { min-height: 0; display: block; } }

/* inner pages: name + toggle on one row, sections on their own row beneath */
.inner .site-header { flex-wrap: wrap; row-gap: 10px; }
.inner .nav { order: 3; width: 100%; }
