/* APEX LIGHT — dark photography theme */
:root {
  --bg: #191919;
  --bg-2: #202020;
  --bg-3: #292929;
  --line: rgba(255, 255, 255, .1);
  --text: #fff;
  --muted: #9a9a9a;
  --accent: #e8e8e8;
  --header-h: 80px;
  --bar-h: 76px;
  --gutter: 40px;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Lora", Georgia, serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  pointer-events: none;
  transition: opacity .6s var(--ease), visibility .6s;
}
.loader span {
  font-size: 12px; font-weight: 700; letter-spacing: .5em;
  animation: pulse 1.2s ease-in-out infinite alternate;
}
@keyframes pulse { from { opacity: .25; } to { opacity: 1; } }
body.loaded .loader { opacity: 0; visibility: hidden; }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 40px;
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-size: 12px; font-weight: 600; letter-spacing: .42em;
  white-space: nowrap;
}
.logo .br { font-weight: 300; font-size: 20px; color: var(--muted); margin: 0 .55em; letter-spacing: 0; vertical-align: -2px; }
.logo .br:first-child { margin-left: 0; }
.quick-nav { display: flex; gap: 32px; margin-left: auto; }
.quick-nav a {
  font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); position: relative; padding: 6px 0; transition: color .3s;
}
.quick-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--text); transition: width .35s var(--ease);
}
.quick-nav a:hover, .quick-nav a.is-active { color: var(--text); }
.quick-nav a:hover::after, .quick-nav a.is-active::after { width: 100%; }

.menu-btn { width: 34px; height: 30px; display: grid; align-content: center; gap: 6px; justify-items: end; }
.menu-btn span { display: block; height: 2px; background: var(--text); transition: transform .35s var(--ease), width .35s var(--ease), opacity .3s; }
.menu-btn span:nth-child(1) { width: 26px; }
.menu-btn span:nth-child(2) { width: 18px; }
.menu-btn span:nth-child(3) { width: 22px; }
.menu-btn:hover span { width: 26px; }
body.menu-open .menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); width: 26px; }
body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); width: 26px; }

/* ---------- slide-out menu ---------- */
.menu-panel {
  position: fixed; top: var(--header-h); right: 0; bottom: 0; z-index: 29;
  width: min(420px, 100%);
  background: var(--bg-2);
  transform: translateX(100%);
  transition: transform .55s var(--ease);
  overflow-y: auto;
}
body.menu-open .menu-panel { transform: none; }
.menu-overlay {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 28;
  background: rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s;
}
body.menu-open .menu-overlay { opacity: 1; visibility: visible; }
.menu-inner { padding: 50px 50px 40px; min-height: 100%; display: flex; flex-direction: column; }
.menu-label { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin: 0 0 30px; }
.menu-main, .menu-main ul { list-style: none; margin: 0; padding: 0; }
.menu-main > li { margin-bottom: 22px; }
.menu-main > li > a, .menu-sub > span {
  font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  transition: color .3s, padding .3s;
}
.menu-main > li > a:hover { color: var(--muted); padding-left: 8px; }
.menu-sub > span { color: var(--muted); font-size: 12px; letter-spacing: .25em; font-weight: 600; }
.menu-sub ul { margin-top: 12px !important; border-left: 1px solid var(--line); padding-left: 18px !important; }
.menu-sub li a { display: block; padding: 5px 0; font-size: 14px; font-weight: 500; color: #ccc; transition: color .3s, transform .3s; }
.menu-sub li a:hover { color: var(--text); transform: translateX(6px); }
.menu-foot { margin-top: auto; padding-top: 40px; font-size: 11px; color: var(--muted); letter-spacing: .05em; }

/* ---------- shared bits ---------- */
.line { display: block; width: 50px; height: 1px; background: var(--text); margin-bottom: 30px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.btn {
  display: inline-block; padding: 16px 34px;
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  background: var(--bg-3); border: 1px solid var(--line);
  transition: background .3s, color .3s;
}
.btn:hover { background: var(--text); color: var(--bg); }
.phone-icon {
  width: 14px; height: 24px; border: 1px solid var(--muted); border-radius: 3px; position: relative; flex: none;
}
.phone-icon::after {
  content: ""; position: absolute; left: 50%; top: 5px; width: 2px; height: 5px; margin-left: -1px;
  background: var(--text); border-radius: 1px; animation: scrollhint 1.8s ease-in-out infinite;
}
@keyframes scrollhint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- home carousel ---------- */
.page-home { height: 100vh; height: 100dvh; overflow: hidden; }
.home { position: fixed; top: var(--header-h); bottom: var(--bar-h); left: 0; right: 0; }
.carousel {
  height: 100%;
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 min(78vw, 1200px); height: 100%; scroll-snap-align: start; position: relative; overflow: hidden; }
.slide-link { display: block; height: 100%; }
.slide-media { position: absolute; inset: 0; }
.slide-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 1.4s var(--ease), filter .6s; filter: brightness(.82); }
.slide:hover .slide-media img { transform: scale(1); filter: brightness(.95); }
.slide-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0) 45%); }
.slide-caption { position: absolute; left: 40px; right: 40px; bottom: 40px; z-index: 1; }
.slide-num { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.slide-caption h2 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 40px); font-weight: 800; line-height: 1.1; }
.slide-caption p { margin: 0; max-width: 520px; font-family: var(--serif); font-style: italic; font-size: 14px; color: #ddd; }
.slide-count {
  display: inline-block; margin-top: 18px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.35);
  font-size: 10px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase;
  transition: letter-spacing .4s var(--ease);
}
.slide:hover .slide-count { letter-spacing: .35em; }
.slide-end { flex-basis: min(46vw, 560px); background: var(--bg-2); display: grid; place-items: center; }
.slide-end-inner { padding: 40px; }
.slide-end h2 { font-size: clamp(28px, 3vw, 44px); font-weight: 800; line-height: 1.1; margin: 0 0 30px; }

.home-bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar-h); z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  padding: 0 var(--gutter);
  background: var(--bg);
}
.hint { display: flex; align-items: center; gap: 18px; font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.arrows { display: flex; gap: 12px; }
.arrows button {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg-3);
  font-size: 18px; line-height: 1; transition: background .3s, color .3s;
}
.arrows button:hover { background: var(--text); color: var(--bg); }
.progress { justify-self: end; width: min(300px, 100%); height: 3px; background: var(--bg-3); position: relative; }
.progress span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--muted); transition: width .25s linear; }

/* ---------- page intro / hero ---------- */
main:not(.home) { padding-top: var(--header-h); }
.page-intro { padding: 90px var(--gutter) 40px; max-width: 900px; }
.page-intro h1, .hero h1 { margin: 0 0 14px; font-size: clamp(36px, 5vw, 64px); font-weight: 800; line-height: 1.05; }
.page-intro p, .hero p { margin: 0; font-family: var(--serif); font-style: italic; color: #ccc; max-width: 560px; }

.hero { position: relative; height: calc(100vh - var(--header-h)); min-height: 460px; overflow: hidden; display: flex; align-items: center; }
.hero-short { height: 60vh; min-height: 380px; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.72); animation: heroZoom 14s var(--ease) forwards; }
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 65%); }
.hero-inner { position: relative; z-index: 1; padding: 0 var(--gutter) 0 calc(var(--gutter) + 40px); }
.hero-scroll {
  position: absolute; left: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; gap: 20px;
  width: min(480px, 100%); padding: 32px var(--gutter) 32px calc(var(--gutter) + 40px);
  background: var(--bg);
  font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--gutter) 30px; }
.filters button {
  padding: 12px 20px; background: var(--bg-2);
  font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  transition: background .3s, color .3s;
}
.filters button:hover { color: var(--text); }
.filters button.is-active { background: var(--text); color: var(--bg); }

/* ---------- masonry grid ---------- */
.grid { columns: 3 320px; column-gap: 8px; padding: 0 var(--gutter) 40px; }
.grid-item {
  display: block; position: relative; margin-bottom: 8px; break-inside: avoid; overflow: hidden;
  background: var(--bg-2);
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.grid-item.in { opacity: 1; transform: none; }
.grid-item.hide { display: none; }
.grid-item img { width: 100%; height: auto; transition: transform 1s var(--ease), filter .5s; }
.grid-item:hover img { transform: scale(1.05); filter: brightness(.55); }
.grid-hover {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 24px;
  opacity: 0; transition: opacity .4s;
}
.grid-hover span {
  font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 1px solid var(--text);
  transform: translateY(10px); transition: transform .5s var(--ease);
}
.grid-item:hover .grid-hover { opacity: 1; }
.grid-item:hover .grid-hover span { transform: none; }

/* ---------- gallery page ---------- */
.gallery-body { padding-top: 90px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter) 40px calc(var(--gutter) + 40px); }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.section-num { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 14px; }
.section-num::before { content: ""; width: 30px; height: 1px; background: var(--line); }

.project-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  border-top: 1px solid var(--line); background: var(--bg);
}
.project-nav a { display: flex; align-items: center; gap: 20px; padding: 18px var(--gutter); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; transition: color .3s; }
.project-nav a:hover { color: var(--muted); }
.pn-next { justify-content: flex-end; }
.project-nav img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.pn-all { display: grid !important; grid-template-columns: 6px 6px; gap: 4px !important; padding: 18px !important; }
.pn-all i { width: 6px; height: 6px; background: var(--text); }

/* ---------- inner page bar ---------- */
.page-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 26px var(--gutter); border-top: 1px solid var(--line);
  font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.page-bar b { color: var(--text); }
.to-top:hover { color: var(--text); }

/* ---------- about ---------- */
.about-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 80px; padding: 100px var(--gutter) 80px calc(var(--gutter) + 40px); max-width: 1400px; }
.about-text h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 800; line-height: 1.15; margin: 0 0 30px; }
.about-text p:not(.eyebrow) { color: #c9c9c9; margin: 0 0 18px; max-width: 640px; }
.contact { margin-top: 44px; padding-top: 34px; border-top: 1px solid var(--line); max-width: 640px; }
.about-text .contact p { color: var(--text); font-family: var(--serif); font-style: italic; font-size: 17px; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 12px; padding-bottom: 6px;
  font-size: clamp(16px, 2vw, 22px); font-weight: 700; letter-spacing: .02em;
  border-bottom: 1px solid var(--muted); transition: border-color .3s, gap .3s;
  overflow-wrap: anywhere;
}
.contact-mail:hover { border-color: var(--text); gap: 18px; }
.about-side { border-left: 1px solid var(--line); padding-left: 50px; }
.about-side h3 { font-size: 11px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.tags { list-style: none; margin: 0 0 40px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 9px 16px; background: var(--bg-2); font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.stats { display: flex; gap: 50px; margin-bottom: 40px; }
.stats b { display: block; font-size: 44px; font-weight: 800; line-height: 1; }
.stats span { font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.about-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 var(--gutter) 40px; }
.about-strip a { overflow: hidden; aspect-ratio: 4 / 3; }
.about-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.about-strip a:hover img { transform: scale(1.06); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-columns: 80px 1fr 80px; align-items: center;
  background: #0c0c0c;
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox figure { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 0 20px; min-width: 0; }
.lightbox figure img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; }
.lightbox figcaption { margin-top: 16px; font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.lb-prev, .lb-next { font-size: 22px; height: 100%; color: var(--muted); transition: color .3s; }
.lb-prev:hover, .lb-next:hover { color: var(--text); }
.lb-close { position: absolute; top: 14px; right: 24px; font-size: 34px; line-height: 1; color: var(--muted); z-index: 1; }
.lb-close:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --gutter: 16px; --header-h: 64px; --bar-h: 64px; }
  .quick-nav { display: none; }
  .site-header { justify-content: space-between; }
  .slide { flex-basis: 88vw; }
  .slide-end { flex-basis: 80vw; }
  .slide-caption { left: 20px; right: 20px; bottom: 24px; }
  .home-bar { grid-template-columns: auto 1fr; }
  .hint { display: none; }
  .progress { width: 100%; }
  .hero-inner, .section-head { padding-left: var(--gutter); }
  .hero-scroll { padding-left: var(--gutter); width: auto; right: 30%; }
  .about-body { grid-template-columns: 1fr; gap: 50px; padding: 60px var(--gutter); }
  .about-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 40px; }
  .about-strip { grid-template-columns: repeat(2, 1fr); }
  .project-nav span { display: none; }
  .project-nav a { padding: 14px var(--gutter); }
  .page-intro { padding-top: 50px; }
  .grid { columns: 2 140px; column-gap: 6px; }
  .grid-item { margin-bottom: 6px; }
  .lightbox { grid-template-columns: 44px 1fr 44px; }
  .menu-inner { padding: 36px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .grid-item { opacity: 1; transform: none; }
}
