/* ============================================================
   Kohei Kutomi — Landscape Photography
   Dark editorial system · ultra-thin sans + technical mono
   ============================================================ */

:root{
  --bg:        #0a0a0b;
  --bg-soft:   #101011;
  --fg:        #f1efe9;
  --fg-dim:    #b6b4ad;
  --muted:     #6f6e69;
  --line:      rgba(241,239,233,0.12);
  --accent:    oklch(0.78 0.04 80);     /* faint warm sand */
  --scrim-rgb: 10,10,11;
  --w-display: 200;
  --track-display: -0.02em;

  --ff-display: "Jost", system-ui, sans-serif;
  --ff-mono:    "Space Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(20px, 4.4vw, 64px);
}

*{ margin:0; padding:0; box-sizing:border-box; }

html{ -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }

body{
  background:var(--bg);
  color:var(--fg);
  font-family:var(--ff-display);
  font-weight:200;
  line-height:1.3;
  overflow-x:hidden;
  cursor:none;
  transition:background .8s var(--ease), color .8s var(--ease);
}
@media (max-width:820px){ body{ cursor:auto; } }

img{ display:block; width:100%; height:100%; object-fit:cover; }

::selection{ background:var(--fg); color:var(--bg); }

/* ---- WebGL canvas (fixed, BEHIND the scrolling content) ---- */
#gl{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  z-index:1;
  pointer-events:none;
}

/* ---- Smooth-scroll content wrapper (transparent — planes show through) ---- */
#scroll{
  position:fixed;
  top:0; left:0;
  width:100%;
  will-change:transform;
  z-index:2;
}

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader{
  position:fixed; inset:0; z-index:60;
  background:var(--bg);
  display:flex; align-items:flex-end; justify-content:space-between;
  padding:var(--pad);
  transition:opacity 1s var(--ease), visibility 1s;
}
#preloader.done{ opacity:0; visibility:hidden; }
.pre__word{
  font-size:clamp(36px,9vw,140px);
  font-weight:200;
  letter-spacing:-0.02em;
  line-height:0.9;
  overflow:hidden;
}
.pre__word span{ display:block; transform:translateY(110%); transition:transform 0.9s var(--ease); }
#preloader.in .pre__word span{ transform:translateY(0); }
.pre__count{
  font-family:var(--ff-mono);
  font-size:13px;
  font-weight:400;
  color:var(--muted);
  letter-spacing:0.05em;
}
.pre__bar{
  position:absolute; left:var(--pad); right:var(--pad); bottom:calc(var(--pad) + 64px);
  height:1px; background:var(--line);
}
.pre__bar i{ display:block; height:100%; width:0%; background:var(--fg); transition:width 0.2s linear; }

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
#cursor{
  position:fixed; top:0; left:0; z-index:80;
  width:7px; height:7px; border-radius:50%;
  background:var(--fg);
  pointer-events:none;
  transform:translate(-50%,-50%);
  transition:width .35s var(--ease), height .35s var(--ease), background .35s var(--ease), opacity .3s;
  mix-blend-mode:difference;
}
#cursor.hover{ width:64px; height:64px; background:var(--fg); }
#cursor .cursor__label{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--ff-mono); font-size:9px; font-weight:400; letter-spacing:0.08em;
  color:var(--bg); opacity:0; text-transform:uppercase;
  transition:opacity .3s; white-space:nowrap;
}
#cursor.hover .cursor__label{ opacity:1; }
@media (max-width:820px){ #cursor{ display:none; } }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.head{
  position:fixed; top:0; left:0; width:100%; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  padding:clamp(18px,2.4vw,30px) var(--pad);
  mix-blend-mode:difference;
}
.head__brand{
  font-size:15px; font-weight:300; letter-spacing:0.04em;
  text-decoration:none; color:var(--fg);
}
.head__brand b{ font-weight:400; }
.head__nav{ display:flex; gap:clamp(18px,2.4vw,40px); align-items:center; }
.head__nav a, .menu-toggle{
  font-family:var(--ff-mono); font-size:11px; font-weight:400;
  letter-spacing:0.12em; text-transform:uppercase;
  color:var(--fg); text-decoration:none; background:none; border:none;
  position:relative;
}
.head__nav a::after{
  content:""; position:absolute; left:0; bottom:-4px; width:100%; height:1px;
  background:currentColor; transform:scaleX(0); transform-origin:right;
  transition:transform .5s var(--ease);
}
.head__nav a:hover::after{ transform:scaleX(1); transform-origin:left; }
@media (max-width:820px){ .head__nav .nav-link{ display:none; } }

/* clock */
.head__time{ font-family:var(--ff-mono); font-size:11px; letter-spacing:0.1em; color:var(--fg); }

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
section{ position:relative; padding-left:var(--pad); padding-right:var(--pad); }

.eyebrow{
  font-family:var(--ff-mono); font-size:11px; font-weight:400;
  letter-spacing:0.18em; text-transform:uppercase; color:var(--muted);
  display:flex; align-items:center; gap:12px;
}
.eyebrow::before{ content:""; width:28px; height:1px; background:var(--muted); display:inline-block; }

/* ============================================================
   HERO
   ============================================================ */
.hero{
  height:100vh; min-height:640px;
  display:flex; flex-direction:column; justify-content:flex-end;
  padding-bottom:clamp(40px,7vh,90px);
  position:relative;
}
.hero__media{
  position:absolute; inset:0;
  z-index:-1;
}
.hero__media img{ opacity:0; }   /* WebGL renders it; DOM img is texture source */
.hero__scrim{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(var(--scrim-rgb),0.55) 0%, rgba(var(--scrim-rgb),0.12) 40%, rgba(var(--scrim-rgb),0.78) 100%);
  z-index:0; pointer-events:none;
}
.hero__inner{ position:relative; z-index:1; }
.hero__title{
  font-size:clamp(58px,15vw,260px);
  font-weight:200; line-height:0.84; letter-spacing:-0.03em;
}
.hero__title .l{ display:block; overflow:hidden; }
.hero__title .l span{ display:block; transform:translateY(110%); }
.hero__meta{
  display:flex; justify-content:space-between; align-items:flex-end;
  margin-top:clamp(24px,4vh,48px); gap:24px; flex-wrap:wrap;
}
.hero__tag{ font-size:clamp(15px,1.5vw,22px); font-weight:200; color:var(--fg-dim); max-width:34ch; }
.hero__coords{ font-family:var(--ff-mono); font-size:11px; letter-spacing:0.08em; color:var(--muted); text-align:right; line-height:1.8; }

.scroll-cue{
  position:absolute; left:50%; bottom:26px; transform:translateX(-50%);
  font-family:var(--ff-mono); font-size:10px; letter-spacing:0.2em; color:var(--muted);
  text-transform:uppercase; display:flex; flex-direction:column; align-items:center; gap:10px;
}
.scroll-cue i{ width:1px; height:38px; background:linear-gradient(var(--muted),transparent); display:block; animation:cue 2.4s var(--ease) infinite; transform-origin:top; }
@keyframes cue{ 0%{transform:scaleY(0);opacity:0;} 40%{transform:scaleY(1);opacity:1;} 100%{transform:scaleY(1) translateY(38px);opacity:0;} }

/* ============================================================
   INTRO STATEMENT
   ============================================================ */
.intro{ padding-top:clamp(120px,22vh,260px); padding-bottom:clamp(120px,22vh,260px); }
.intro__lead{
  font-size:clamp(28px,4.6vw,76px); font-weight:200; line-height:1.08;
  letter-spacing:-0.015em; max-width:18ch;
}
.intro__lead em{ font-style:normal; color:var(--muted); }
.intro__row{
  display:flex; justify-content:space-between; gap:40px; flex-wrap:wrap;
  margin-top:clamp(50px,9vh,120px); border-top:1px solid var(--line); padding-top:28px;
}
.intro__col{ max-width:30ch; }
.intro__col h4{ font-family:var(--ff-mono); font-size:11px; font-weight:400; letter-spacing:0.14em; text-transform:uppercase; color:var(--muted); margin-bottom:14px; }
.intro__col p{ font-size:15px; font-weight:300; color:var(--fg-dim); line-height:1.6; }

/* ============================================================
   WORKS — editorial asymmetric grid
   ============================================================ */
.works{ padding-top:clamp(40px,8vh,90px); padding-bottom:clamp(80px,14vh,180px); }
.works__head{ display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:clamp(50px,9vh,120px); flex-wrap:wrap; gap:20px; }
.works__head h2{ font-size:clamp(30px,5vw,84px); font-weight:200; letter-spacing:-0.02em; line-height:0.95; }
.works__count{ font-family:var(--ff-mono); font-size:12px; color:var(--muted); letter-spacing:0.08em; }

.works__grid{ display:grid; grid-template-columns:repeat(12,1fr); gap:clamp(28px,5vw,90px) clamp(20px,3vw,48px); align-items:start; }

.work{ position:relative; }
.work__media{
  position:relative; overflow:hidden;
  border:1px solid var(--line);
}
.work__media img{ opacity:0; }   /* WebGL renders */
.work__media::after{ /* drop hint */
  content:"⌖ DROP PHOTO"; position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--ff-mono); font-size:11px; letter-spacing:0.12em; color:var(--muted);
  opacity:0; transition:opacity .3s; pointer-events:none; z-index:3;
}
.work.dragover .work__media::after{ opacity:1; }
.work.dragover .work__media{ border-color:var(--fg); }

.work__cap{ display:flex; justify-content:space-between; margin-top:16px; gap:14px; }
.work__cap .t{ font-size:clamp(16px,1.4vw,21px); font-weight:300; }
.work__cap .loc{ font-family:var(--ff-mono); font-size:11px; color:var(--muted); letter-spacing:0.06em; text-align:right; line-height:1.6; }
.work__idx{ font-family:var(--ff-mono); font-size:10px; color:var(--muted); letter-spacing:0.1em; margin-bottom:10px; display:block; }

/* sizing variants via column span + aspect */
.work--a{ grid-column:1 / span 6; }
.work--a .work__media{ aspect-ratio:4/5; }
.work--b{ grid-column:8 / span 5; margin-top:clamp(80px,16vh,200px); }
.work--b .work__media{ aspect-ratio:3/4; }
.work--c{ grid-column:2 / span 7; margin-top:clamp(20px,4vh,60px); }
.work--c .work__media{ aspect-ratio:16/10; }
.work--d{ grid-column:9 / span 4; margin-top:clamp(-60px,-6vh,-20px); }
.work--d .work__media{ aspect-ratio:3/4; }
.work--e{ grid-column:1 / span 5; margin-top:clamp(30px,6vh,90px); }
.work--e .work__media{ aspect-ratio:1/1; }
.work--f{ grid-column:6 / span 7; }
.work--f .work__media{ aspect-ratio:16/9; }

@media (max-width:820px){
  .works__grid{ gap:42px 16px; }
  .work[class*="work--"]{ grid-column:1 / -1 !important; margin-top:0 !important; }
}

/* ============================================================
   SERIES INDEX
   ============================================================ */
.series{ padding-top:clamp(80px,14vh,160px); padding-bottom:clamp(80px,14vh,160px); border-top:1px solid var(--line); }
.series h2{ font-size:clamp(26px,3.4vw,52px); font-weight:200; letter-spacing:-0.02em; margin-bottom:clamp(30px,6vh,70px); }
.series__list{ list-style:none; }
.series__item{
  display:grid; grid-template-columns:60px 1fr auto auto; gap:24px; align-items:center;
  padding:clamp(22px,3vw,40px) 0; border-top:1px solid var(--line);
  position:relative; text-decoration:none; color:var(--fg);
}
.series__item:last-child{ border-bottom:1px solid var(--line); }
.series__item .no{ font-family:var(--ff-mono); font-size:12px; color:var(--muted); }
.series__item .name{ font-size:clamp(24px,3.6vw,56px); font-weight:200; letter-spacing:-0.02em; transition:transform .5s var(--ease), color .5s; }
.series__item .yr{ font-family:var(--ff-mono); font-size:12px; color:var(--muted); }
.series__item .arrow{ font-size:20px; opacity:0; transform:translateX(-12px); transition:.5s var(--ease); }
.series__item:hover .name{ transform:translateX(24px); }
.series__item:hover .arrow{ opacity:1; transform:translateX(0); }
.series__item .hoverfill{ position:absolute; left:0; bottom:0; width:100%; height:0; background:rgba(241,239,233,0.03); z-index:-1; transition:height .5s var(--ease); }
.series__item:hover .hoverfill{ height:100%; }
@media (max-width:620px){
  .series__item{ grid-template-columns:40px 1fr auto; }
  .series__item .yr{ display:none; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about{ padding-top:clamp(80px,14vh,180px); padding-bottom:clamp(80px,14vh,180px); }
.about__grid{ display:grid; grid-template-columns:5fr 6fr; gap:clamp(36px,6vw,100px); align-items:start; }
.about__portrait{ position:relative; aspect-ratio:4/5; overflow:hidden; border:1px solid var(--line); }
.about__portrait img{ opacity:0; }
.about__body .eyebrow{ margin-bottom:clamp(24px,4vh,40px); }
.about__body p{ font-size:clamp(18px,1.9vw,28px); font-weight:200; line-height:1.45; letter-spacing:-0.01em; margin-bottom:1.2em; color:var(--fg-dim); }
.about__body p strong{ color:var(--fg); font-weight:300; }
.about__stats{ display:flex; gap:clamp(30px,5vw,72px); margin-top:clamp(36px,6vh,60px); flex-wrap:wrap; }
.about__stats div .n{ font-size:clamp(34px,4vw,60px); font-weight:200; letter-spacing:-0.02em; }
.about__stats div .k{ font-family:var(--ff-mono); font-size:11px; color:var(--muted); letter-spacing:0.1em; text-transform:uppercase; }
@media (max-width:820px){ .about__grid{ grid-template-columns:1fr; } }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact{ padding-top:clamp(90px,16vh,220px); padding-bottom:clamp(40px,7vh,70px); border-top:1px solid var(--line); min-height:90vh; display:flex; flex-direction:column; justify-content:space-between; }
.contact__big{ font-size:clamp(46px,12vw,200px); font-weight:200; letter-spacing:-0.03em; line-height:0.9; }
.contact__big a{ color:var(--fg); text-decoration:none; display:inline-block; }
.contact__big a:hover{ color:var(--muted); }
.contact__row{ display:flex; justify-content:space-between; align-items:flex-end; gap:30px; flex-wrap:wrap; margin-top:clamp(40px,8vh,90px); }
.contact__socials{ display:flex; gap:26px; }
.contact__socials a{ font-family:var(--ff-mono); font-size:12px; letter-spacing:0.08em; color:var(--fg-dim); text-decoration:none; text-transform:uppercase; }
.contact__socials a:hover{ color:var(--fg); }
.foot{ display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap; margin-top:clamp(40px,7vh,80px); padding-top:24px; border-top:1px solid var(--line); }
.foot span{ font-family:var(--ff-mono); font-size:11px; color:var(--muted); letter-spacing:0.06em; }

/* ============================================================
   FULLSCREEN MENU OVERLAY
   ============================================================ */
#menu{
  position:fixed; inset:0; z-index:50; background:var(--bg);
  clip-path:inset(0 0 100% 0);
  transition:clip-path .9s var(--ease);
  display:flex; flex-direction:column; justify-content:center; padding:var(--pad);
}
#menu.open{ clip-path:inset(0 0 0 0); }
#menu ul{ list-style:none; }
#menu li{ overflow:hidden; }
#menu li a{
  display:inline-block; font-size:clamp(40px,9vw,130px); font-weight:200; letter-spacing:-0.03em;
  color:var(--fg); text-decoration:none; line-height:1.04; transform:translateY(110%);
  transition:transform .8s var(--ease), color .4s; padding:0.04em 0;
}
#menu.open li a{ transform:translateY(0); }
#menu li a:hover{ color:var(--muted); }
#menu li:nth-child(1) a{ transition-delay:.08s; }
#menu li:nth-child(2) a{ transition-delay:.14s; }
#menu li:nth-child(3) a{ transition-delay:.20s; }
#menu li:nth-child(4) a{ transition-delay:.26s; }
#menu li:nth-child(5) a{ transition-delay:.32s; }
.menu__foot{ display:flex; justify-content:space-between; margin-top:clamp(40px,8vh,80px); flex-wrap:wrap; gap:20px; }
.menu__foot span, .menu__foot a{ font-family:var(--ff-mono); font-size:12px; color:var(--muted); letter-spacing:0.08em; text-decoration:none; text-transform:uppercase; }
.menu__foot a:hover{ color:var(--fg); }

/* reveal helper */
.reveal{ opacity:0; transform:translateY(40px); transition:opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in{ opacity:1; transform:none; }

/* hero title lines */
.hero__title .l span{ transition:transform 1.1s var(--ease); }
body.loaded .hero__title .l span{ transform:translateY(0); }
.hero__title .l:nth-child(2) span{ transition-delay:.08s; }
.hero__title .l:nth-child(3) span{ transition-delay:.16s; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
#lightbox{
  position:fixed; inset:0; z-index:70; background:rgba(7,7,8,0.94);
  display:flex; align-items:center; justify-content:center; flex-direction:column;
  opacity:0; visibility:hidden; transition:opacity .6s var(--ease), visibility .6s;
  padding:var(--pad); backdrop-filter:blur(6px);
}
#lightbox.open{ opacity:1; visibility:visible; }
#lightbox img{
  max-width:min(86vw,1100px); max-height:78vh; width:auto; height:auto; object-fit:contain;
  border:1px solid var(--line);
  transform:scale(0.96); transition:transform .7s var(--ease);
}
#lightbox.open img{ transform:scale(1); }
.lb__bar{ display:flex; justify-content:space-between; width:min(86vw,1100px); margin-top:20px; align-items:center; gap:20px; }
.lb__bar .t{ font-size:clamp(16px,2vw,24px); font-weight:200; }
.lb__bar .m{ font-family:var(--ff-mono); font-size:11px; color:var(--muted); letter-spacing:0.08em; }
.lb__close{ position:absolute; top:var(--pad); right:var(--pad); font-family:var(--ff-mono); font-size:12px; letter-spacing:0.1em; color:var(--fg); background:none; border:none; text-transform:uppercase; }
.lb__hint{ font-family:var(--ff-mono); font-size:10px; color:var(--muted); letter-spacing:0.1em; margin-top:6px; }

/* ============================================================
   HINT TOAST
   ============================================================ */
#hint{
  position:fixed; left:var(--pad); bottom:var(--pad); z-index:45;
  font-family:var(--ff-mono); font-size:11px; letter-spacing:0.06em; color:var(--fg-dim);
  background:rgba(16,16,17,0.7); border:1px solid var(--line); padding:12px 16px;
  display:flex; align-items:center; gap:10px; backdrop-filter:blur(8px);
  opacity:0; transform:translateY(12px); transition:opacity .7s var(--ease), transform .7s var(--ease);
  pointer-events:none; max-width:78vw;
}
#hint.show{ opacity:1; transform:none; }
#hint b{ color:var(--fg); font-weight:400; }

/* ============================================================
   MOOD HOOKS — display weight / tracking driven by CSS vars
   ============================================================ */
.pre__word,
.hero__title,
.intro__lead,
.works__head h2,
.series h2,
.series__item .name,
.about__stats div .n,
.contact__big,
#menu li a{
  font-weight:var(--w-display, 200);
  letter-spacing:var(--track-display, -0.02em);
}

/* serif & grotesk moods read better with a touch more line-height on display */
body[data-mood="bone"] .hero__title,
body[data-mood="sepia"] .hero__title{ line-height:0.92; }

/* light mood: invert the scroll cue + soften borders already handled by vars */
body.is-light .hero__media img,
body.is-light .work__media img,
body.is-light .about__portrait img{ opacity:0; }

/* ============================================================
   FILM GRAIN OVERLAY (mood- or tweak-toggled)
   ============================================================ */
#grain{
  position:fixed; inset:0; z-index:30; pointer-events:none;
  opacity:0; transition:opacity .6s var(--ease);
  mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size:160px 160px;
}
body.grain #grain{ opacity:0.5; }
body.is-light.grain #grain{ opacity:0.32; mix-blend-mode:multiply; }
