/* ==========================================================================
   KAPPAMILLA — Kamilla Nenastina Photography
   Design system: minimal / editorial / magazine
   ========================================================================== */

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/SpaceMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/SpaceMono-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/BebasNeue-Regular.woff2') format('woff2');
}

:root{
  --c-bg: #ffffff;
  --c-fg: #101010;
  --c-muted: #7a7a7a;
  --c-line: #e2e2e2;
  --c-line-strong: #101010;

  --font: 'Space Mono', ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;

  --nav-w: 300px;
  --gutter: clamp(20px, 3vw, 40px);
  --header-h: 96px;

  --ease: cubic-bezier(.16,.84,.44,1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body{
  margin: 0;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
h1,h2,h3,p{ margin: 0; }
button{ font-family: inherit; background: none; border: 0; color: inherit; cursor: pointer; }

.u{ text-transform: uppercase; }
.sr-only{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link{
  position: fixed; top: -60px; left: 8px; z-index: 999;
  background: var(--c-fg); color: var(--c-bg); padding: 10px 16px;
  transition: top .2s var(--ease);
}
.skip-link:focus{ top: 8px; }

/* ---------- Header (masthead) ---------- */
.site-header{
  position: fixed; top: 0; left: var(--nav-w); right: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,.94) 60%, rgba(255,255,255,0));
}
.site-header .logo{
  pointer-events: all;
  font-family: 'Bebas Neue', var(--font);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: 0.04em;
  text-align: center;
}
.site-header .scroll-hint{
  position: absolute; left: 50%; top: 34px; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .08em; color: var(--c-muted);
  display: flex; align-items: center; gap: 6px;
  opacity: 0; transition: opacity .3s var(--ease);
}
.site-header .scroll-hint.is-visible{ opacity: 1; pointer-events: all; }

/* ---------- Sidebar nav ---------- */
.site-nav{
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  width: var(--nav-w);
  padding: 48px var(--gutter);
  display: flex; flex-direction: column; justify-content: flex-start; gap: 2px;
  overflow-y: auto;
}
.site-nav .name{
  font-weight: 700; letter-spacing: .04em; margin-bottom: 10px;
}
.site-nav .role,
.site-nav .loc{
  color: var(--c-fg); letter-spacing: .02em;
}
.site-nav .loc{ margin-bottom: 22px; color: var(--c-muted); }

.site-nav .nav-links{ display: flex; flex-direction: column; gap: 4px; }
.site-nav .nav-links a{
  letter-spacing: .04em;
  padding: 2px 0;
  position: relative;
  width: fit-content;
}
.site-nav .nav-links a::after{
  content: ''; position: absolute; left: 0; right: 100%; bottom: -1px; height: 1px;
  background: currentColor; transition: right .28s var(--ease);
}
.site-nav .nav-links a:hover::after,
.site-nav .nav-links a:focus-visible::after{ right: 0; }
.site-nav .nav-links a[aria-current="page"]{ font-weight: 700; }

.site-nav .nav-foot{
  margin-top: auto; padding-top: 24px; color: var(--c-muted); font-size: 11px;
}

.nav-toggle{
  display: none;
  position: fixed; top: 26px; left: var(--gutter); z-index: 70;
  width: 34px; height: 24px; flex-direction: column; justify-content: space-between;
}
.nav-toggle span{ display: block; height: 1px; width: 100%; background: var(--c-fg); }

/* ---------- Layout shell ---------- */
.main{
  margin-left: var(--nav-w);
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ---------- Footer ---------- */
.site-footer{
  border-top: 1px solid var(--c-line);
  margin-left: var(--nav-w);
  padding: 28px var(--gutter) 60px;
  display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between;
  color: var(--c-muted); font-size: 11px; letter-spacing: .03em;
}
.site-footer a:hover{ color: var(--c-fg); }

/* ==========================================================================
   HOME — horizontal scroll grid
   ========================================================================== */
.home-hero{ padding: 0 var(--gutter); margin-bottom: 8px; }
.home-hero p{
  max-width: 640px; color: var(--c-muted); font-size: 12px; line-height: 1.8;
}

.hgrid-wrap{ position: relative; padding: 40px 0 60px; }
.hgrid{
  display: flex;
  align-items: flex-end;
  gap: clamp(28px, 4vw, 64px);
  padding: 0 var(--gutter) 40px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
}
.hgrid.is-dragging{ cursor: grabbing; scroll-behavior: auto; user-select: none; }
.hgrid::-webkit-scrollbar{ display: none; }

.hgrid figure{
  flex: 0 0 auto;
  width: clamp(160px, 16vw, 260px);
  margin: 0;
}
.hgrid figure:nth-child(6n+2){ margin-bottom: 46px; }
.hgrid figure:nth-child(6n+3){ margin-bottom: 12px; }
.hgrid figure:nth-child(6n+4){ margin-bottom: 58px; }
.hgrid figure:nth-child(6n+5){ margin-bottom: 4px; }
.hgrid figure:nth-child(6n+6){ margin-bottom: 30px; }

.hgrid a{ display: block; }
.hgrid .thumb{
  width: 100%; aspect-ratio: 4/5; overflow: hidden; background: #f2f2f2;
}
.hgrid img{ width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .3s; }
.hgrid a:hover img{ transform: scale(1.035); }
.hgrid.is-active a:not(:hover) img{ opacity: .55; }

.hgrid figcaption{
  margin-top: 10px; font-size: 11px; letter-spacing: .06em; color: var(--c-muted);
  display: flex; justify-content: space-between; gap: 8px;
}
.hgrid figcaption .t{ color: var(--c-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.viewall{
  flex: 0 0 auto; align-self: center;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .08em; font-weight: 700;
  padding: 0 40px 0 8px;
}
.viewall .arrow{ display: inline-block; transition: transform .25s var(--ease); }
.viewall:hover .arrow{ transform: translateX(6px); }

.hgrid-drag-hint{
  position: absolute; left: var(--gutter); bottom: 14px;
  font-size: 10px; letter-spacing: .1em; color: var(--c-muted);
}

/* ==========================================================================
   WORKS ARCHIVE — vertical stacked filmstrips
   ========================================================================== */
.works-list{ padding: 20px var(--gutter) 100px; }
.work-row{ padding: 46px 0; border-top: 1px solid var(--c-line); }
.work-row:first-child{ border-top: 0; padding-top: 10px; }

.work-row__head{
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px;
}
.work-row__head .idx{ color: var(--c-muted); font-size: 12px; }
.work-row__head h2{
  font-size: 13px; letter-spacing: .05em; font-weight: 700;
}
.work-row__head a{ display: flex; align-items: baseline; gap: 14px; }
.work-row__head a:hover h2{ text-decoration: underline; text-underline-offset: 4px; }
.work-row__head .cat{
  margin-left: auto; color: var(--c-muted); font-size: 11px; letter-spacing: .06em;
}

.filmstrip{
  display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; cursor: grab;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
}
.filmstrip.is-dragging{ cursor: grabbing; scroll-behavior: auto; user-select: none; }
.filmstrip::-webkit-scrollbar{ display: none; }
.filmstrip a{ flex: 0 0 auto; width: clamp(150px, 15vw, 240px); }
.filmstrip .thumb{ width: 100%; aspect-ratio: 4/5; overflow: hidden; background: #f2f2f2; }
.filmstrip img{ width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.filmstrip a:hover img{ transform: scale(1.035); }

/* ==========================================================================
   PROJECT DETAIL — large staggered cursor-pan gallery
   ========================================================================== */
.project-head{ padding: 0 var(--gutter); margin-bottom: 18px; }
.project-head .idx{ color: var(--c-muted); font-size: 12px; }
.project-head h1{
  font-size: clamp(20px, 3vw, 30px); letter-spacing: .02em; font-weight: 700; margin-top: 6px;
}
.project-head .meta{
  margin-top: 10px; display: flex; gap: 20px; flex-wrap: wrap;
  color: var(--c-muted); font-size: 11px; letter-spacing: .04em;
}
.project-head p.desc{
  max-width: 560px; margin-top: 18px; font-size: 12px; line-height: 1.8; color: var(--c-muted);
}

.pgallery-wrap{ position: relative; padding: 30px 0 70px; }
.pgallery{
  display: flex; align-items: flex-end; gap: clamp(24px, 3vw, 56px);
  padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none; cursor: grab;
  overscroll-behavior-x: contain;
}
.pgallery.is-dragging{ cursor: grabbing; scroll-behavior: auto; user-select: none; }
.pgallery::-webkit-scrollbar{ display: none; }
.pgallery figure{ flex: 0 0 auto; margin: 0; width: clamp(260px, 34vw, 520px); }
.pgallery figure:nth-child(4n+2){ margin-bottom: 64px; }
.pgallery figure:nth-child(4n+3){ margin-bottom: 0; }
.pgallery figure:nth-child(4n+4){ margin-bottom: 96px; }
.pgallery img{ width: 100%; height: auto; display: block; background: #f2f2f2; }

.project-nav{
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter); margin-bottom: 60px;
  font-size: 11px; letter-spacing: .06em; color: var(--c-muted);
}
.project-nav a{ font-size: 18px; }
.project-nav a:nth-child(2){ font-size: 11px; letter-spacing: .08em; font-weight: 700; }
.project-nav a:hover{ color: var(--c-fg); }

/* drag cue that follows the cursor on desktop */
.drag-cue{
  position: fixed; z-index: 80; pointer-events: none;
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(16,16,16,.92); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; letter-spacing: .08em; text-align: center;
  opacity: 0; transform: translate(-50%,-50%) scale(.7);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.drag-cue.is-visible{ opacity: 1; transform: translate(-50%,-50%) scale(1); }

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about{
  display: grid; grid-template-columns: minmax(280px, 560px) 1fr;
  gap: clamp(30px, 6vw, 90px);
  padding: 10px var(--gutter) 80px;
  align-items: start;
}
.about__text p{
  margin-bottom: 22px; font-size: 13px; line-height: 1.85; letter-spacing: .01em;
}
.about__text p.lead{ font-weight: 700; font-size: 14px; }
.about__contact{ margin-top: 36px; display: flex; flex-direction: column; gap: 8px; }
.about__contact a{ width: fit-content; border-bottom: 1px solid var(--c-line-strong); }
.about__contact a:hover{ opacity: .6; }
.about__photo{ width: 100%; }
.about__photo img{ width: 100%; height: auto; filter: grayscale(1) contrast(1.05); }
.about__photo figcaption{ margin-top: 10px; font-size: 10px; color: var(--c-muted); letter-spacing: .05em; }

/* ==========================================================================
   404
   ========================================================================== */
.notfound{ padding: 120px var(--gutter) 100px; }
.notfound h1{ font-size: 15px; margin-bottom: 14px; }
.notfound a{ text-decoration: underline; text-underline-offset: 4px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px){
  :root{ --nav-w: 240px; --header-h: 84px; }
  .about{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  :root{ --header-h: 76px; }
  .site-header{ left: 0; }
  .nav-toggle{ display: flex; }
  .site-nav{
    width: min(86vw, 340px);
    background: var(--c-bg);
    transform: translateX(-100%);
    transition: transform .32s var(--ease);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    padding-top: 96px;
  }
  .site-nav.is-open{ transform: translateX(0); box-shadow: 20px 0 40px rgba(0,0,0,.06); }
  .nav-scrim{
    position: fixed; inset: 0; background: rgba(16,16,16,.25); z-index: 40;
    opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
  }
  .nav-scrim.is-open{ opacity: 1; pointer-events: all; }

  .main, .site-footer{ margin-left: 0; }
  .site-header .logo{ font-size: 18px; }

  .hgrid figure{ width: 62vw; }
  .hgrid figure:nth-child(n){ margin-bottom: 0 !important; }
  .pgallery figure{ width: 82vw; }
  .pgallery figure:nth-child(n){ margin-bottom: 0 !important; }
  .drag-cue{ display: none; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition-duration: .001ms !important; animation-duration: .001ms !important; scroll-behavior: auto !important; }
}
