/* ============================================================
   KOKI TAKAMATSU — animation layer (additive)
   Pre-hide states are gated behind `.anim` on <html> and use
   ONLY opacity / clip-path — never a transform offset. The motion
   (slide / scale / wipe) is supplied by GSAP at run time and is fully
   stripped on completion. The one layer kept: the text that rises in
   (below), so it looks the same from a standstill to a standstill. If
   JS never runs, a head-script failsafe removes `.anim` and the page
   is the original static layout.
   ============================================================ */

/* ---- pre-hide (only while .anim is present and JS is driving) ---- */
.anim .brand,
.anim .nav,
.anim .h,
.anim .copy,
.anim .cap,
.anim .tri,
.anim .sq,
.anim .ltick,
.anim .fr > i,
.anim .plus{
  opacity:0;
}
/* Text that rises in glides only on a layer of its own. Drawn in place, its letters are set on whole
   pixels: a slow rise stands still, then hops (measured, a heading's 42px rise: 17 frames standing still,
   12 hops at 1x; on its own layer, none), and as the motion let go of it the letters were set afresh, up
   to half a pixel across (a last hop). So it has its layer for good, never switched on or off (CLAUDE.md,
   "The flow of motion"): the same letters before, during and after. The triangles too (a clipped shape,
   drawn in place, wavered as it moved; they rest on whole pixels, css/style.css, so on their layer they
   look exactly as in place). Not a plain box or a mark (drawn in place, they move between pixels already)
   nor a picture (on a layer a picture is drawn softer, and a bright one's soft edge folds). */
.anim .brand,.anim .nav,.anim .h,.anim .copy,.anim .cap,.anim .tri{will-change:transform}
/* photos wipe in (top→down); only the <img> is clipped */
.anim .ph img{ clip-path:inset(0 0 100% 0); }
/* placeholder boxes wipe in left→right */
.anim .box{ clip-path:inset(0 100% 0 0); }

/* ---- preloader ------------------------------------------------- */
.preloader{
  position:fixed;inset:0;z-index:9999;
  background:var(--paper);
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.pl-inner{display:inline-block;overflow:hidden;padding:.16em 0;position:relative;z-index:1}
.pl-name{
  display:inline-block;
  font-family:var(--disp);font-weight:400;color:#434343;
  letter-spacing:.04em;
  font-size:clamp(15px,3.2vw,46px);
  white-space:nowrap;
  transform:translate(0,110%);will-change:transform;   /* (it rises and sinks: on its own layer, as all moving text) */
}
html:not(.anim) .preloader{display:none}
/* (its rise: by the compositor, once its face is in — js/wipe.js rise(): nothing the page does as it loads can stall it) */
@keyframes pl-rise{from{transform:translate(0,110%)}to{transform:translate(0,0)}}
.pl-name.rise{animation:pl-rise .9s cubic-bezier(.215,.61,.355,1) both}

/* ---- custom cursor (fine pointers only; driven by js/cursor.js) -- */
/* A small rhombus marks the exact point. Around it, Maison Auge's inverse square:
   filled with their #DCCBC3 and blended with "difference", so whatever passes
   under it shows |colour - #DCCBC3|, live (paper -> deep ink-blue, grey -> dark
   brown, red -> teal). 12pt, the site's square, sized and placed by the script.
   Two more squares (.cursor-fold) sit at the same spot UNDER the page content.
   Together they mirror the paper about #DCCBC3 (paper -> 2 x #DCCBC3 - paper),
   so inside the square the letters and the paper lie on the same side of it.
   Without them every anti-aliased letter edge crosses #DCCBC3, and the
   difference folds it through black: a dark outline round each letter, and thin
   type turning muddy. Solid colours come out exactly the same either way. */
.cursor-dot,.cursor-lens,.cursor-fold{position:fixed;top:0;left:0;pointer-events:none}
.cursor-lens,.cursor-fold{
  width:0;height:0;background:#dccbc3;mix-blend-mode:difference;will-change:transform;
}
.cursor-lens{z-index:10000}
.cursor-dot{z-index:10001}
.cursor-fold{z-index:1}
/* While testing colours (js/menu-shade.js, the ?shader panel) the square is a harmony lens
   instead: it recolours what is beneath it through the chosen harmony, with a backdrop filter
   on the finished pixels, so nothing can fold there and the under-squares rest. Where SVG
   backdrop filters are missing (Safari, Firefox), four blended squares make that harmony's
   two-colour tone instead: grey by luminosity, then scaled, lifted (screen) and flipped
   (difference) channel by channel, from black's colour to white's. */
html.cursor-harmony .cursor-lens{background:none;mix-blend-mode:normal;-webkit-backdrop-filter:var(--cursor-lens,none);backdrop-filter:var(--cursor-lens,none)}
html.cursor-harmony .cursor-fold{visibility:hidden}
.cursor-tone{position:fixed;top:0;left:0;width:0;height:0;pointer-events:none;z-index:10000;will-change:transform;display:none}
html.cursor-harmony.cursor-tones .cursor-tone{display:block}
.cursor-tone.t1{background:#808080;mix-blend-mode:color}
.cursor-tone.t2{background:var(--tone-mul);mix-blend-mode:multiply}
.cursor-tone.t3{background:var(--tone-lift);mix-blend-mode:screen}
.cursor-tone.t4{background:var(--tone-flip);mix-blend-mode:difference}
/* The white sheet (the preloader) covers the page and its under-squares, so it carries
   its own pair, beneath the name. While the sheet moves, js/wipe.js keeps it on whole
   device pixels and these ride back against it (--sheet-y), so they stay exactly under
   the square: the name, and the sheet's moving edge, stay clean inside it. */
.preloader .cursor-fold{z-index:0;translate:0 calc(-1 * var(--sheet-y,0px))}
/* The page content paints above the under-squares, so the browser lifts it onto a
   layer of its own whenever they show. Keep it lifted for as long as the cursor
   is live, or its text rendering would flip each time the mouse enters or leaves. */
html.cursor-live .stage{will-change:transform}
/* The open menu sits above the under-squares, and its white labels over the grey panel
   sit on both sides of #DCCBC3: inside the square their soft edges would fold through
   black. So there (js/cursor.js) each label shows only this copy, in white's mirror
   about #DCCBC3 (black's mirror is black, for hover): the square turns it into exactly
   the colour white would give, with clean edges. Hidden until the square is over it. */
.menu-nav a{position:relative}
.menu-nav a::after{
  content:attr(data-label);content:attr(data-label) / "";      /* (empty alt: not read twice) */
  position:absolute;left:0;top:0;white-space:nowrap;pointer-events:none;
  color:#b99787;transition:color .2s ease;
  clip-path:var(--cursor-copy,inset(0 0 100% 0));
}
.menu-nav a:hover::after{color:var(--nav-hover-m,#000)}   /* (js/menu-shade.js: the hover colour's mirror) */
/* The point itself: a rhombus (a square turned 45 degrees) whose tips sit on the
   old 6px dot's circle, inverting live with the same #DCCBC3 difference. Over the
   square it inverts the inverse, so it opens a small window back onto the page. */
.cursor-dot{
  width:6px;height:6px;background:#dccbc3;mix-blend-mode:difference;
  clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
  transform:translate3d(-50%,-50%,0);
  opacity:0;transition:opacity .3s cubic-bezier(.215,.61,.355,1);
}
@media (pointer:fine){
  html.cursor-ready,html.cursor-ready *{cursor:none !important}
  html.cursor-on .cursor-dot{opacity:1}
}
@media (hover:none),(pointer:coarse){
  .cursor-dot,.cursor-lens,.cursor-fold,.cursor-tone{display:none}
}
/* (a touch screen shows its own scroll indicator: the drawn bar stays away there, js/menu.js) */
@media (hover:none) and (pointer:coarse){
  .cscroll-rail,.cscroll-thumb{display:none}
}

/* ---- reduced motion: everything static, instantly ------------- */
@media (prefers-reduced-motion:reduce){
  .anim .brand,.anim .nav,.anim .h,.anim .copy,.anim .cap,
  .anim .tri,.anim .sq,.anim .ltick,.anim .fr > i,
  .anim .plus,.anim .ph img,.anim .box{
    opacity:1 !important;
    clip-path:none !important;
  }
  .preloader{display:none !important}
  .cursor-dot,.cursor-lens,.cursor-fold,.cursor-tone{display:none !important}
}

/* ---- fixed top-right menu -------------------------------------- */
/* --mk = px per artboard point, set by menu.js so the button scales with the
   design and lines up over the grey corner marks. Three states that morph:
   (1) camouflage at the top — two 12x12 squares over the marks, middle bar
   hidden, so it vanishes; (2) .scrolled (marks gone) — the squares split into
   a 3-bar hamburger that rises into the corner; (3) open — hamburger -> X. */
.menu-btn{
  position:fixed;z-index:90;left:0;top:0;right:auto;
  width:calc(var(--mk,4) * 12px);height:calc(var(--mk,4) * 36px);
  transform:translate(-50%,-50%);
  padding:0;box-sizing:border-box;background:transparent;border:0;cursor:pointer;
  /* vertical position is driven frame-by-frame by menu.js (ride-up + catch-up),
     so transform is NOT CSS-transitioned here — only the span morph is. */
}
/* keyboard focus (also after Esc closes the menu): a plain ink ring. The browser's own ring
   has a white halo, which the cursor's square would fold into a dark line (CLAUDE.md). */
.menu-btn:focus-visible{outline:max(1px,calc(var(--mk,4) * .5px)) solid #434343;outline-offset:calc(var(--mk,4) * 1px)}
.menu-btn span,.mc-btn span{
  position:absolute;left:0;width:100%;background:#b3b1b1;
  transition:background-color .3s ease;   /* (a tint from the picture beneath: js/menu-shade.js) */
}
/* The bars' shape is set every frame by js/menu.js, on the catch's and the menu's clocks (stepEase);
   these are the shapes it moves between, and what shows without it.
   (1) camouflage: two squares over the marks, middle hidden */
.menu-btn span:nth-child(1),.mc-btn span:nth-child(1){top:0;height:calc(var(--mk,4) * 12px)}
.menu-btn span:nth-child(2),.mc-btn span:nth-child(2){top:calc(var(--mk,4) * 16.75px);height:calc(var(--mk,4) * 2.5px);opacity:0}
.menu-btn span:nth-child(3),.mc-btn span:nth-child(3){top:calc(var(--mk,4) * 24px);height:calc(var(--mk,4) * 12px)}
/* (2) scrolled: split into a 3-bar hamburger (its position is driven by menu.js
   — it rides up with the page, then catches back up into the corner) */
.menu-btn.scrolled span,.mc-btn.scrolled span{height:max(2px,calc(var(--mk,4) * 2.4px))}
.menu-btn.scrolled span:nth-child(1),.mc-btn.scrolled span:nth-child(1){top:calc(var(--mk,4) * 12.75px)}
.menu-btn.scrolled span:nth-child(2),.mc-btn.scrolled span:nth-child(2){top:calc(var(--mk,4) * 16.75px);opacity:1}
.menu-btn.scrolled span:nth-child(3),.mc-btn.scrolled span:nth-child(3){top:calc(var(--mk,4) * 20.75px)}
/* The bars' inverse (js/menu.js): copies of the button's bars, one over it with "difference" and two beneath
   the page content that mirror the paper about #DCCBC3, as the cursor's square and its under-squares do. */
.menu-inv,.menu-lift,.menu-fold{position:fixed;left:0;top:0;width:0;height:0;overflow:visible;
  pointer-events:none;mix-blend-mode:difference;opacity:0;will-change:opacity}
.menu-inv,.menu-lift{z-index:10000}   /* (over the cursor's square, after it in the page, beneath its point: js/menu.js) */
/* (the lift: the inverse "screened" with a colour worked out so the paper comes out exactly the bars' grey,
   #b3b1b1, the band within 4 levels of it, ink light — grey as usual, every pixel beneath lively through it) */
.menu-lift{mix-blend-mode:screen}
.menu-lift span{background:#a89e9c}
.menu-fold{z-index:1}
.menu-cover{position:fixed;left:0;top:0;width:0;height:0;overflow:visible;pointer-events:none;z-index:10000;opacity:0;will-change:opacity}
.menu-cover .g,.menu-cover .c{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}
/* (the clone of the button, js/menu.js mirror(): the button's own rules below, its inline style copied each frame) */
.mc-btn{position:absolute;left:0;top:0;width:calc(var(--mk,4) * 12px);height:calc(var(--mk,4) * 36px);transform:translate(-50%,-50%)}
.mc-panel{position:absolute;transform-origin:0 0;background:#b3b1b1;visibility:hidden}
/* (inside the cursor's square: the clone as the square shows it, each part inverted against #dccbc3 on its own) */
.menu-cover .c span,.menu-cover .c .mc-panel{isolation:isolate}
.menu-cover .c span::after,.menu-cover .c .mc-panel::after{content:"";position:absolute;inset:0;background:#dccbc3;mix-blend-mode:difference}
.menu-inv span,.menu-fold span,.menu-lift span{position:absolute;left:0;top:0;width:100px;height:100px;transform-origin:0 0}
.menu-inv span,.menu-fold span{background:#dccbc3}
.menu-btn.covered span{visibility:hidden}   /* (the cover, a clone of them, shows instead: js/menu.js) */
/* (the page lifted onto a layer of its own while the under-bars can show, as for the cursor: its text drawn the same throughout) */
html.menu-inv-live .stage{will-change:transform}
.menu-btn.on-page span{visibility:hidden}   /* (a touch screen, riding with the page: the page's own squares show, js/menu.js) */
/* (3) open: hamburger -> X (from either state) */
.menu-btn[aria-expanded="true"] span,.mc-btn[aria-expanded="true"] span{height:max(2px,calc(var(--mk,4) * 2.4px));background:#b3b1b1}
.menu-btn[aria-expanded="true"] span:nth-child(1),.mc-btn[aria-expanded="true"] span:nth-child(1){top:calc(var(--mk,4) * 16.75px);transform:rotate(45deg)}
/* middle bar hides instantly — the panel background (.menu-bg) is seeded exactly
   over it and distorts out into the panel in one continuous shape (see menu.js) */
.menu-btn[aria-expanded="true"] span:nth-child(2),.mc-btn[aria-expanded="true"] span:nth-child(2){opacity:0}
.menu-btn[aria-expanded="true"] span:nth-child(3),.mc-btn[aria-expanded="true"] span:nth-child(3){top:calc(var(--mk,4) * 16.75px);transform:rotate(-45deg)}

.menu-nav{
  position:fixed;z-index:89;left:auto;right:0;top:0;
  display:flex;flex-direction:column;align-items:flex-end;
  gap:calc(var(--mk,4) * 5px);
  /* (the owner: the same margin on every side, three quarters of a square (9pt), as the eye measures it — from the letters'
     ink, not their boxes: ABOUT's capitals start 0.56pt below its box and CONTACT's baseline sits 0.72pt above
     its own, ILLUSTRATION's I is 0.28pt in from its box's left, the T's ink reaches its box's right less 0.04pt.
     Measured from the drawn pixels at --mk 6.25) */
  padding:calc(var(--mk,4) * 8.44px) calc(var(--mk,4) * 9.04px) calc(var(--mk,4) * 8.28px) calc(var(--mk,4) * 8.72px);
  pointer-events:none;
}
.menu-nav.open{pointer-events:auto}
/* The background panel IS the middle bar made large. menu.js seeds it (a FLIP)
   exactly over the hamburger's middle bar, then this single element distorts —
   translate+scale, on the menu's clock (stepEase) — out into the panel. It keeps the grey
   of the corner box (no recolour). No cross-fade: one continuous, warping shape.
   The text rides on top separately so it never warps. Its shadow comes in with it. */
.menu-bg{
  position:absolute;inset:0;z-index:-1;
  background:#b3b1b1;visibility:hidden;
  box-shadow:0 calc(var(--mk,4)*2px) calc(var(--mk,4)*9px) rgba(0,0,0,0);
  transform-origin:0 0;
}
.menu-nav.open .menu-bg{background:#b3b1b1}
.menu-nav a{
  /* --disp 400, pure white, 4pt (font-size 4 * --mk), -.008em. */
  font-family:var(--disp);font-weight:400;color:#fff;
  font-size:calc(var(--mk,4) * 4px);letter-spacing:-.008em;
  text-decoration:none;line-height:1;white-space:nowrap;
  opacity:0;transform:translateX(calc(var(--mk,4) * 5px));
  transition:color .2s ease;
}
/* Each label answers the pointer or a finger across its whole row of the panel (unseen): out to the panel's
   edges, half the gap to the next label above and below, the first and last to the panel's top and bottom.
   The rows tile the panel, none overlapping (--panel-w: the panel's width, js/menu.js). */
.menu-nav a::before{content:"";position:absolute;right:calc(var(--mk,4) * -9.04px);left:auto;width:var(--panel-w,100%);
  top:calc(var(--mk,4) * -2.5px);bottom:calc(var(--mk,4) * -2.5px)}
.menu-nav a:first-of-type::before{top:calc(var(--mk,4) * -8.44px)}
.menu-nav a:last-of-type::before{bottom:calc(var(--mk,4) * -8.28px)}
/* (they come in as the panel arrives under them, together, on its clock: js/menu.js) */
.menu-nav.open a{opacity:1;transform:translateX(0)}
.menu-nav a:hover{color:var(--nav-hover,#000)}   /* (a light tint on a coloured panel: js/menu-shade.js) */
.menu-nav a:focus-visible{outline-color:#000}     /* (the site's ring, css/style.css, in the hover's black) */

/* ---- custom scrollbar -------------------------------------------------- */
/* The native scrollbar is hidden; menu.js draws this one, so the hamburger's
   yield stays in EXACT sync with what is actually on screen (no overlay-rail
   guesswork). The rail (track) shows on hover; the thumb shows on scroll/hover.
   It sits ABOVE the menu (z>90) so the grabbable thumb is never painted under
   the grey camouflage box at the top: in catch the dodge keeps them apart, but
   in scrub (top of page) the box overlaps the thumb's column — a scrollbar must
   stay topmost, like the native one it replaces. */
html{scrollbar-width:none}
html::-webkit-scrollbar{width:0;height:0}
/* Dimensions use --mk (the menu's innerWidth-derived scale), so the bar keeps the
   same on-screen size under browser zoom — like the menu, not the zooming content.
   At default zoom --mk*px == the original px (11/5/3...). The thumb's LENGTH is set
   in JS from the viewport/content ratio and re-derives on the resize zoom fires. */
.cscroll-rail{
  position:fixed;top:0;right:0;bottom:0;width:calc(var(--mk,4) * 2.64px);z-index:91;
  background:rgba(67,67,67,.05);opacity:0;pointer-events:none;
  transition:opacity .25s cubic-bezier(.215,.61,.355,1);
}
.cscroll-rail.show{opacity:1}
/* The thumb is as wide as it grows over the rail (1.92), cut to its width (1.2, a pill) by a clip: it grows by
   moving the clip's edges, which glide between pixels. (Its width and place moving would be set on whole
   pixels each frame: standing still, then hopping.) */
.cscroll-thumb{
  position:fixed;top:0;right:calc(var(--mk,4) * 0.36px);width:calc(var(--mk,4) * 1.92px);z-index:92;
  background:rgba(67,67,67,.42);
  clip-path:inset(0 calc(var(--mk,4) * 0.36px) round calc(var(--mk,4) * 0.6px));
  opacity:0;pointer-events:none;
  /* vertical position is driven by transform:translateY (set in menu.js) so it
     tracks scroll on the compositor without forcing a layout each frame. */
  transition:opacity .35s cubic-bezier(.215,.61,.355,1),clip-path .16s cubic-bezier(.215,.61,.355,1),background-color .2s cubic-bezier(.215,.61,.355,1);
}
.cscroll-thumb.show{opacity:1;pointer-events:auto}
.cscroll-thumb.rail{clip-path:inset(0 0 round calc(var(--mk,4) * 0.72px));background:rgba(67,67,67,.62)}
@media (prefers-reduced-motion:reduce){
  .cscroll-rail,.cscroll-thumb{transition:opacity .15s cubic-bezier(.215,.61,.355,1)}
}

/* ---- middle-click autoscroll (js/autoscroll.js): its mark where the click was made ----------------------
   An ink square outline with an ink dot: ink is under #DCCBC3, so the cursor's square over it stays clean;
   whole pixels, placed by layout. It comes and goes on the flow's curve. */
.autoscroll-mark{position:fixed;left:0;top:0;z-index:95;pointer-events:none;box-sizing:border-box;
  width:round(calc(var(--mk,4) * 5px),2px);height:round(calc(var(--mk,4) * 5px),2px);
  border:max(1px,round(calc(var(--mk,4) * .4px),1px)) solid #434343;opacity:0;
  transition:opacity .25s cubic-bezier(.215,.61,.355,1)}
.autoscroll-mark::after{content:"";position:absolute;left:50%;top:50%;width:max(2px,round(calc(var(--mk,4) * 1px),2px));
  height:max(2px,round(calc(var(--mk,4) * 1px),2px));background:#434343;transform:translate(-50%,-50%)}
.autoscroll-mark.on{opacity:1}
