/* 格輝 — scroll gimmicks. Motion states are scoped to html.gx, which gimmicks.js
   only sets when JavaScript runs and the visitor has not asked for reduced motion. */
:root{--gx-gold:#e8ba70;--gx-gold-hi:#ffe4a1;--gx-ease:cubic-bezier(.2,.65,.3,1);--gx-ease-io:cubic-bezier(.77,0,.18,1)}

/* ---------- Scroll progress ---------- */
.gx-progress{position:fixed;left:0;right:0;top:0;height:2px;z-index:60;pointer-events:none}
.gx-progress span{display:block;height:100%;transform-origin:0 50%;transform:scaleX(0);background:linear-gradient(90deg,rgba(232,186,112,0),var(--gx-gold) 30%,var(--gx-gold-hi));box-shadow:0 0 12px rgba(255,214,140,.8),0 0 2px #fff}

/* ---------- Section dots ---------- */
.gx-dots{position:fixed;right:22px;top:50%;transform:translateY(-50%);z-index:40;display:flex;flex-direction:column;gap:6px}
.gx-dot{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:8px;color:#e9e2d2;font:10px "Yu Gothic",sans-serif;letter-spacing:.12em}
.gx-dot i{display:block;width:8px;height:8px;border-radius:50%;border:1px solid rgba(232,186,112,.75);transition:transform .4s var(--gx-ease),background .4s,box-shadow .4s}
.gx-dot-label{opacity:0;transform:translateX(8px);transition:opacity .3s,transform .3s var(--gx-ease);white-space:nowrap;text-shadow:0 1px 6px rgba(0,0,0,.8)}
.gx-dot:hover .gx-dot-label,.gx-dot:focus-visible .gx-dot-label{opacity:1;transform:none}
.gx-dot.is-active i{background:var(--gx-gold);transform:scale(1.5);box-shadow:0 0 12px rgba(255,210,130,.9)}
.gx-dot:focus-visible{outline:2px solid var(--gx-gold);outline-offset:2px;border-radius:12px}
@media(max-width:900px){.gx-dots{display:none}}

/* ---------- Opening curtain ---------- */
.gx-curtain{position:fixed;inset:0;z-index:9999;pointer-events:none;display:grid;place-items:center}
.gx-curtain-panel{position:absolute;left:0;right:0;height:50.5%;background:#030713;transition:transform 1.05s var(--gx-ease-io)}
.gx-top{top:0}.gx-bottom{bottom:0}
.gx-curtain.is-open .gx-top{transform:translateY(-100%)}
.gx-curtain.is-open .gx-bottom{transform:translateY(100%)}
.gx-curtain-mark{position:relative;display:flex;flex-direction:column;align-items:center;gap:14px;color:#fff4df;transition:opacity .5s,transform 1s var(--gx-ease-io),filter .8s}
.gx-curtain.is-open .gx-curtain-mark{opacity:0;transform:scale(1.25);filter:blur(8px)}
.gx-curtain-name{font:400 clamp(44px,7vw,84px) "Yu Mincho","Hiragino Mincho ProN",serif;letter-spacing:.3em;margin-right:-.3em;opacity:0;animation:gx-fade-up .9s var(--gx-ease) .1s forwards;text-shadow:0 0 30px rgba(255,214,140,.45)}
.gx-curtain-line{display:block;width:min(260px,60vw);height:1px;background:linear-gradient(90deg,transparent,var(--gx-gold-hi),transparent);transform:scaleX(0);animation:gx-line .9s var(--gx-ease-io) .35s forwards}
.gx-curtain-sub{font:10px Arial,sans-serif;letter-spacing:.6em;margin-right:-.6em;color:var(--gx-gold);opacity:0;animation:gx-fade-up .8s var(--gx-ease) .55s forwards}
html.gx-intro .statement-hero h1 .hero-title-shine{animation-delay:1.5s}
@keyframes gx-fade-up{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes gx-line{to{transform:scaleX(1)}}

/* ---------- Hero ---------- */
html.gx #home{--hp:0;--mx:0;--my:0}
html.gx #hero-title{position:relative;z-index:1;transform:translate3d(0,calc(var(--hp) * -22vh),0) scale(calc(1 + var(--hp) * .22));translate:calc(var(--mx) * -26px) calc(var(--my) * -18px);opacity:calc(1 - var(--hp) * 1.25);filter:blur(calc(var(--hp) * 7px));transition:translate .6s var(--gx-ease);will-change:transform,opacity}
html.gx .hero-company{transform:translate3d(0,calc(var(--hp) * -14vh),0);opacity:calc(1 - var(--hp) * 1.4)}
.gx-hero-halo{position:absolute;left:50%;top:50%;width:min(70vw,900px);aspect-ratio:2.4/1;transform:translate(-50%,-50%) scale(calc(1 + var(--hp,0) * 1.6));translate:calc(var(--mx,0) * 40px) calc(var(--my,0) * 30px);background:radial-gradient(ellipse at center,rgba(255,214,140,.24),rgba(255,190,110,.08) 40%,transparent 70%);opacity:calc(1 - var(--hp,0));pointer-events:none;z-index:0;animation:gx-breathe 6s ease-in-out infinite;transition:translate .8s var(--gx-ease)}
@keyframes gx-breathe{50%{filter:brightness(1.5)}}
.gx-scroll-cue{position:absolute;left:50%;bottom:clamp(18px,4vh,40px);transform:translateX(-50%);z-index:2;display:flex;flex-direction:column;align-items:center;gap:10px;color:#f1e3c8;font:10px Arial,sans-serif;letter-spacing:.35em;margin-right:-.35em;opacity:calc(1 - var(--hp,0) * 4);pointer-events:none;text-shadow:0 1px 8px rgba(0,0,0,.7)}
.gx-scroll-cue i{position:relative;display:block;width:1px;height:54px;overflow:hidden;background:rgba(241,227,200,.22)}
.gx-scroll-cue i:after{content:"";position:absolute;left:0;top:0;width:1px;height:100%;background:linear-gradient(transparent,var(--gx-gold-hi));animation:gx-drip 1.8s var(--gx-ease-io) infinite}
@keyframes gx-drip{0%{transform:translateY(-100%)}60%,100%{transform:translateY(100%)}}

/* ---------- Particles & cursor glow ---------- */
.gx-particles{position:fixed;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none}
.gx-glow{position:fixed;left:0;top:0;z-index:55;width:340px;height:340px;margin:-170px 0 0 -170px;border-radius:50%;pointer-events:none;background:radial-gradient(circle,rgba(255,214,140,.16),rgba(255,190,110,.05) 40%,transparent 68%);mix-blend-mode:screen;opacity:0;transition:opacity .4s,width .4s var(--gx-ease),height .4s var(--gx-ease),margin .4s var(--gx-ease)}
.gx-glow.is-on{opacity:1}
.gx-glow.is-big{width:520px;height:520px;margin:-260px 0 0 -260px}

/* ---------- Section labels: gold line draws in ---------- */
html.gx .section-label{position:relative}
html.gx .section-label:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:linear-gradient(90deg,var(--gx-gold-hi),rgba(232,186,112,.5) 40%,transparent);transform:scaleX(0);transform-origin:0 50%;transition:transform 1.4s var(--gx-ease-io) .15s;box-shadow:0 0 8px rgba(255,214,140,.6)}
html.gx .section-label.gx-in:after{transform:scaleX(1)}

/* ---------- Headings: characters rise in ---------- */
.gx-split{display:inline}
html.gx .gx-ch{display:inline-block;opacity:0;transform:translateY(.7em) rotate(10deg);filter:blur(8px);transition:opacity .7s var(--gx-ease),transform .9s var(--gx-ease),filter .7s;transition-delay:calc(var(--i) * 45ms)}
html.gx .gx-heading.gx-in .gx-ch{opacity:1;transform:none;filter:none}

/* ---------- Philosophy: text lights up with scroll ---------- */
html.gx .gx-lc{color:rgba(214,222,232,.22);text-shadow:none;transition:color .5s,text-shadow .9s}
html.gx .gx-lc.is-lit{color:inherit;text-shadow:0 0 14px rgba(255,214,140,.55),0 2px 10px rgba(0,0,0,.6)}
html.gx .philosophy-copy .lead .gx-lc.is-lit{color:#ffe5b8;text-shadow:0 0 22px rgba(255,200,120,.85),0 2px 10px rgba(0,0,0,.6)}

/* ---------- Business cards ---------- */
html.gx .business.section{perspective:1400px}
html.gx .business-row{position:relative;transform-style:preserve-3d;transition:opacity .75s ease,transform .75s var(--gx-ease),border-color .3s,box-shadow .3s,rotate .35s var(--gx-ease)}
html.gx .business-row:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:radial-gradient(circle at var(--gx-gx,50%) var(--gx-gy,50%),rgba(255,226,170,.16),transparent 45%);opacity:0;transition:opacity .4s}
html.gx .business-row:hover:after{opacity:1}
/* image wipes open, alternating sides */
html.gx .business-art{clip-path:inset(0 100% 0 0 round 15px);transition:clip-path 1.2s var(--gx-ease-io)}
html.gx .business-row:nth-of-type(even) .business-art{clip-path:inset(0 0 0 100% round 15px)}
html.gx .business-row.gx-in .business-art{clip-path:inset(0 0 0 0 round 15px)}
html.gx .business-art img{transform:translate3d(0,var(--gx-py,0%),0) skewY(var(--gx-skew,0deg)) scale(1.18);scale:1;transition:scale 1.4s var(--gx-ease)}
html.gx .business-row.gx-in .business-art img{scale:1}
html.gx .business-row:not(.gx-in) .business-art img{scale:1.25}
html.gx .business-row:hover .business-art img{scale:1.05}
/* gold shutter sweeping across the image as it opens */
html.gx .business-art:before{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(255,228,170,.55),transparent);transform:translateX(-110%);transition:none}
html.gx .business-row.gx-in .business-art:before{transform:translateX(110%);transition:transform 1.3s var(--gx-ease-io) .25s}
/* text staggers in */
html.gx .business-content>*{opacity:0;transform:translateX(26px);transition:opacity .7s var(--gx-ease),transform .9s var(--gx-ease)}
html.gx .business-row:nth-of-type(even) .business-content>*{transform:translateX(-26px)}
html.gx .business-row.gx-in .business-content>*{opacity:1;transform:none}
html.gx .business-row.gx-in .business-content>:nth-child(1){transition-delay:.35s}
html.gx .business-row.gx-in .business-content>:nth-child(2){transition-delay:.47s}
html.gx .business-row.gx-in .business-content>:nth-child(3){transition-delay:.59s}
html.gx .business-row.gx-in .business-content>:nth-child(4){transition-delay:.71s}
html.gx .opening-badge{animation:gx-badge 2.4s ease-in-out infinite}
@keyframes gx-badge{50%{box-shadow:0 0 16px rgba(255,210,130,.55);border-color:rgba(255,220,150,.9)}}

/* ---------- Company ---------- */
html.gx .company dl>div{opacity:0;transform:translateX(34px);transition:opacity .6s var(--gx-ease),transform .8s var(--gx-ease)}
html.gx .company dl.gx-in>div{opacity:1;transform:none}
html.gx .company dl.gx-in>div:nth-child(1){transition-delay:.05s}
html.gx .company dl.gx-in>div:nth-child(2){transition-delay:.12s}
html.gx .company dl.gx-in>div:nth-child(3){transition-delay:.19s}
html.gx .company dl.gx-in>div:nth-child(4){transition-delay:.26s}
html.gx .company dl.gx-in>div:nth-child(5){transition-delay:.33s}
html.gx .company dl.gx-in>div:nth-child(6){transition-delay:.40s}
html.gx .company dl.gx-in>div:nth-child(7){transition-delay:.47s}
html.gx .company dl.gx-in>div:nth-child(8){transition-delay:.54s}
html.gx .company dl.gx-in>div:nth-child(9){transition-delay:.61s}
html.gx .representative-photo img{clip-path:circle(0% at 50% 35%);transition:clip-path 1.5s var(--gx-ease-io)}
html.gx .representative-photo.gx-in img{clip-path:circle(80% at 50% 35%)}
html.gx .representative-photo figcaption{opacity:0;letter-spacing:.5em;transition:opacity 1s .6s,letter-spacing 1.4s var(--gx-ease) .6s}
html.gx .representative-photo.gx-in figcaption{opacity:1;letter-spacing:.08em}
html.gx .head-office-map{opacity:0;transform:translateY(30px) scale(.97);transition:opacity .9s var(--gx-ease),transform 1s var(--gx-ease)}
html.gx .head-office-map.gx-in{opacity:1;transform:none}

/* ---------- Magnetic links ---------- */
.gx-magnet{display:inline-block;transition:translate .35s var(--gx-ease)}

/* ---------- Phone layout balance ---------- */
@media(max-width:700px){
  /* particles stay put while the browser toolbar slides in and out */
  .gx-particles{bottom:auto;height:100vh;height:100lvh}
  /* keep the philosophy heading on one line inside the card */
  #philosophy-title{font-size:clamp(16px,calc((100vw - 78px) / 14),24px);letter-spacing:0}
  /* centre the representative photo and its caption */
  .representative-photo{margin-left:auto;margin-right:auto}
}

/* ---------- Safety nets ---------- */
@media(prefers-reduced-motion:reduce){.gx-curtain,.gx-particles,.gx-glow,.gx-hero-halo,.gx-scroll-cue{display:none!important}}
@media print{.gx-progress,.gx-dots,.gx-curtain,.gx-particles,.gx-glow,.gx-hero-halo,.gx-scroll-cue{display:none!important}
html.gx *{opacity:1!important;clip-path:none!important;filter:none!important;transform:none!important}
html.gx .gx-lc{color:inherit!important}}
