/* Kabuto Games: the studio's own layer over the kit (system.css + layout.css + motion.css).
   Shared by /, /games/, /studio/ and /privacy/. */

/* ---- bar: the client's logo file and the language switch ---- */
.nav__logo img { height: 30px; width: auto; display: block; }
.lang { display: inline-flex; gap: var(--s-1); }
.lang button { font: 500 var(--t-label)/1 var(--font-text); color: var(--muted); background: none; border: 0; min-width: 44px; min-height: 44px; cursor: pointer; transition: color var(--dur) var(--ease); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { color: var(--ink); }
.menu-col a > b { font-weight: inherit; }
.menu-card .panel { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); border: 1px solid var(--line); }
.menu-card:hover .panel { border-color: rgb(200 150 62 / .55); }
@media (max-width: 1023px) { .nav:not(.is-open) .nav__actions .lang { display: none; } }
/* over the hero the bar starts clear and takes the ground once the page scrolls */
.nav.kg-over:not(.kg-solid):not(.is-open) { background: transparent; border-color: transparent; }
.nav { transition: background-color .4s var(--ease), border-color .4s var(--ease); }

/* ---- the statement footer on the night ground, the name in brass ---- */
html .footer.footer--statement {
  --ground-bg: #12100e; --ground-surface: #1b1815; --ground-ink: #ece6da; --ground-muted: #a69d8e; --ground-accent: #c8963e;
  --action: #c8963e; --action-ink: #0e0d0c; border-top: 1px solid rgb(200 150 62 / .18);
  background: radial-gradient(1200px 500px at 50% 100%, rgb(200 150 62 / .10), transparent 70%), #12100e;
}
.footer--statement .close__word { background: linear-gradient(180deg, #ecd3a0 0%, #c8963e 45%, #6e5122 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* ---- the close word (footer statement) on one line at every width ---- */
.close__word { font-size: min(196px, calc((100vw - 2 * var(--gut)) / 7)); line-height: 1.12; }

/* ---- landing hero: the pagoda key art, the wordmark and the words in a frosted panel ---- */
.kg-hero { position: relative; isolation: isolate; min-height: 100svh; display: flex; align-items: center; overflow: hidden; background: #07080b; color: #f3eee4; }
.kg-hero__media { position: absolute; inset: -24px; z-index: -3; will-change: transform; }
.kg-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
@media (min-aspect-ratio: 1/1) and (max-width: 1279px) { .kg-hero__media img { --pos: 78% 50%; } }
@media (max-aspect-ratio: 1/1) { .kg-hero__media img { --pos: 64% 30%; } }
.kg-hero__moon { position: absolute; z-index: 1; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgb(255 238 205 / .30), rgb(255 226 170 / .12) 45%, transparent 100%); opacity: 0; mix-blend-mode: screen; }
.kg-hero__petals { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
/* a low mist at the foot so the hero meets the page ground without a hard line */
.kg-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 22%; z-index: -1; pointer-events: none; background: linear-gradient(to top, var(--bg), transparent); }
.kg-hero { padding: 0; }
main > .kg-hero > .wrap { height: auto; padding-top: calc(var(--nav) + var(--s-6)); padding-bottom: var(--s-9); }
/* a soft dark band under the clear bar so the logo and links read over the blossom */
.kg-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 180px; z-index: -1; pointer-events: none; background: linear-gradient(rgb(5 6 9 / .7), transparent); }
.kg-hero__in { max-width: 600px; display: flex; flex-direction: column; gap: var(--s-6); }
.kg-hero h1 { margin: 0; display: flex; flex-direction: column; gap: var(--s-4); font: 500 var(--t-label)/1.2 var(--font-text); letter-spacing: .22em; text-transform: uppercase; color: #e4c48a; }
.kg-hero h1 img { width: clamp(260px, 38vw, 560px); height: auto; filter: drop-shadow(0 10px 30px rgb(0 0 0 / .55)); }
.kg-hero h1 .kg-hero__tag { display: inline-flex; align-items: center; gap: var(--s-3); padding-left: 4px; }
.kg-hero h1 .kg-hero__tag::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }

.kg-glass {
  position: relative; padding: var(--s-6) var(--s-7); border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgb(28 26 24 / .52), rgb(14 13 12 / .38));
  -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgb(236 230 218 / .14); box-shadow: 0 30px 80px -30px rgb(0 0 0 / .7), inset 0 1px 0 rgb(255 255 255 / .06);
}
.kg-glass::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgb(200 150 62 / .55), transparent 38%, transparent 70%, rgb(200 150 62 / .25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.kg-hero .hero__lead { margin: 0 0 var(--s-5); font-size: var(--t-lead); line-height: 1.55; color: #ece6da; max-width: 44ch; }
.kg-hero .btn--secondary { color: #f3eee4; }
.kg-scroll { position: absolute; left: 50%; bottom: var(--s-6); transform: translateX(-50%); width: 22px; height: 36px; border-radius: 12px; border: 1.5px solid rgb(236 230 218 / .45); }
.kg-scroll::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: #e4c48a; animation: kg-scroll 2.2s var(--ease) infinite; }
@keyframes kg-scroll { 0% { transform: translateY(0); opacity: 0; } 25% { opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* entrance: the art settles, then the mark, the tag, the panel */
@media (prefers-reduced-motion: no-preference) {
  .kg-hero__media img { animation: kg-settle 2.4s cubic-bezier(.2,.7,.1,1) both; }
  .kg-hero h1 img { animation: kg-rise 1.1s .25s cubic-bezier(.2,.7,.1,1) both; }
  .kg-hero h1 .kg-hero__tag { animation: kg-rise 1s .45s cubic-bezier(.2,.7,.1,1) both; }
  .kg-hero .kg-glass { animation: kg-rise 1s .6s cubic-bezier(.2,.7,.1,1) both; }
  .kg-hero__moon.is-on { animation: kg-moon 7s ease-in-out infinite; }
}
@keyframes kg-settle { from { transform: scale(1.08); filter: brightness(.4); } to { transform: scale(1); filter: none; } }
@keyframes kg-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes kg-moon { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.kg-hero__moon.is-on { opacity: .85; }

@media (max-aspect-ratio: 1/1) {
  .kg-hero { align-items: flex-end; }
  /* portrait: the moon and the pagoda keep the top of the screen, the words sit under them */
  .kg-hero__media { inset: -24px -24px 30% -24px; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
  main > .kg-hero > .wrap { padding-bottom: var(--s-7); }
  .kg-hero h1 img { width: min(82vw, 440px); }
  .kg-glass { padding: var(--s-5); }
  .kg-scroll { display: none; }
}
@media (max-width: 639px) {
  .kg-hero .btn-row { flex-direction: column; align-items: stretch; }
  .kg-hero .btn-row .btn { justify-content: center; }
}

/* ---- cards that open a page: lift 2px, brass edge, a light that follows the pointer, the picture zooms ---- */
.kg-card { position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; overflow: hidden; color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease); }
.kg-card::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease);
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 0%), rgb(228 196 138 / .13), transparent 62%); }
.kg-card:hover, .kg-card:focus-visible { transform: translateY(-2px); border-color: rgb(200 150 62 / .55);
  box-shadow: 0 28px 70px -34px rgb(200 150 62 / .5), 0 0 0 1px rgb(200 150 62 / .22); }
.kg-card:hover::after, .kg-card:focus-visible::after { opacity: 1; }
.kg-card:active { transform: translateY(0); }
.kg-card__media { position: relative; overflow: hidden; background: #0a0a0a; }
.kg-card__media picture { display: block; width: 100%; height: 100%; }
.kg-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.7,.1,1); }
.kg-card:hover .kg-card__media img, .kg-card:focus-visible .kg-card__media img { transform: scale(1.03); }
.kg-card__body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5) var(--s-6) var(--s-6); flex: 1; }
.kg-card__body h3 { margin: 0; font: var(--display-weight) var(--t-h3)/1.15 var(--font-display); letter-spacing: var(--display-tracking); }
.kg-card__body p { margin: 0; color: var(--muted); }
.kg-label { font: 500 12px/1 var(--font-text); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.kg-go { white-space: nowrap; margin-top: auto; padding-top: var(--s-4); display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 500; color: var(--ink); }
.kg-go svg { width: 14px; height: 14px; transition: transform .35s var(--ease); }
.kg-card:hover .kg-go svg, .kg-card:focus-visible .kg-go svg { transform: translateX(4px); }
.kg-tag { align-self: flex-start; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); font: 500 12px/1 var(--font-text); color: var(--muted); }

/* the feature card: key art across the card, the words on a frosted panel at its foot */
.kg-feature { min-height: 100%; }
.kg-feature .kg-card__media { position: absolute; inset: 0; z-index: -1; }
.kg-feature .kg-card__body { justify-content: flex-end; padding: var(--s-6); position: relative; }
.kg-feature .kg-glass { background: linear-gradient(160deg, rgb(20 18 16 / .86), rgb(12 11 10 / .8)); max-width: 520px; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6); }
.kg-feature .kg-df-mark { width: min(300px, 70%); height: auto; filter: drop-shadow(0 6px 18px rgb(0 0 0 / .6)); }
.kg-feature p { color: #d9d2c4; }

/* the landing's entry grid: the game large, the projects and the studio beside it */
.kg-bento { display: grid; gap: var(--gutter); grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; min-height: min(72vh, 680px); }
.kg-bento > .kg-feature { grid-column: span 8; grid-row: span 2; }
.kg-bento > .kg-card:not(.kg-feature) { grid-column: span 4; }
.kg-mini { display: flex; gap: var(--s-2); padding: var(--s-5) var(--s-5) 0; }
.kg-mini img { flex: 1; min-width: 0; aspect-ratio: 40 / 21; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.kg-card:hover .kg-mini img:nth-child(1) { transform: translateY(-3px) rotate(-1.5deg); }
.kg-card:hover .kg-mini img:nth-child(2) { transform: translateY(-5px); }
.kg-card:hover .kg-mini img:nth-child(3) { transform: translateY(-3px) rotate(1.5deg); }
.kg-studio-card { flex-direction: row; align-items: stretch; }
.kg-studio-card .kg-card__body { order: 1; }
.kg-studio-card .kg-helm { order: 2; width: 42%; flex: none; display: grid; place-items: center; padding: var(--s-4); background: radial-gradient(closest-side, rgb(200 150 62 / .18), transparent); }
.kg-studio-card .kg-helm img { width: 100%; height: auto; transition: transform .9s cubic-bezier(.2,.7,.1,1), filter .9s; filter: drop-shadow(0 10px 24px rgb(0 0 0 / .6)); }
.kg-studio-card:hover .kg-helm img { transform: translateY(-4px) scale(1.03); filter: drop-shadow(0 10px 30px rgb(200 150 62 / .35)); }
@media (max-width: 1023px) {
  .kg-bento { grid-template-rows: auto; min-height: 0; }
  .kg-bento > .kg-feature { grid-column: 1 / -1; grid-row: auto; min-height: 520px; }
  .kg-bento > .kg-card:not(.kg-feature) { grid-column: span 6; }
}
@media (max-width: 639px) {
  .kg-studio-card .kg-helm { width: 34%; }
  .kg-bento > .kg-card:not(.kg-feature) { grid-column: 1 / -1; }
  .kg-bento > .kg-feature { min-height: 560px; }
  .kg-feature .kg-card__body { padding: var(--s-3); }
  .kg-feature .kg-glass { padding: var(--s-5); }
}

/* a section that grows with its content instead of one fixed screen */
main > section.kg-auto { height: auto; }

/* studio page: the helmet floats on a brass glow beside the words */
/* ---- studio: the hero (words and the helmet), then the facts beside the first game's art ---- */
.kg-studio { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav) + var(--s-7)) 0 var(--s-8); overflow: hidden; }
main > .kg-studio > .wrap { justify-content: center; }
.kg-st { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.kg-st__text { grid-column: 1 / span 6; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-5); }
.kg-st__text .t-lead { margin: 0; color: var(--muted); max-width: 46ch; }
.kg-st__text .btn-row { margin-top: var(--s-4); }
.kg-st .kg-helm-stage { grid-column: 8 / span 5; aspect-ratio: auto; }
.kg-st .kg-helm-stage img { width: 86%; }
.kg-studio h1 { margin: 0; font: var(--display-weight) var(--ly-h1, var(--t-h1))/1.04 var(--font-display); letter-spacing: var(--display-tracking-xl, var(--display-tracking)); text-wrap: balance; }
.kg-sf { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); min-height: 0; }
.kg-sf__art { grid-column: 8 / -1; grid-row: 1; min-height: 0; }
.kg-sf__art .kg-card__media { position: absolute; inset: 0; }
.kg-sf__art img { object-position: 60% 50%; }
.kg-sf__text { grid-column: 1 / span 6; grid-row: 1; display: flex; flex-direction: column; gap: var(--s-6); min-height: 0; }
.kg-sf__text p { margin: 0; }
.kg-sf__words { margin-top: var(--s-6); font: var(--display-weight) var(--t-h3)/1 var(--font-display); color: var(--muted); }
.kg-sf__words li:nth-child(odd) { color: var(--ink); }
@media (max-width: 1023px) {
  .kg-st { display: flex; flex-direction: column; gap: var(--s-6); }
  .kg-st .kg-helm-stage { order: -1; width: min(100%, 360px); align-self: center; }
  .kg-sf, main > section > .wrap > .kg-sf.fill { display: flex; flex-direction: column; gap: var(--s-6); flex: none; }
  .kg-sf__art { aspect-ratio: 16 / 9; }
}
@media (max-width: 639px) {
  .kg-studio { min-height: 0; padding: calc(var(--nav) + var(--s-4)) 0 var(--s-7); }
  .kg-st { gap: var(--s-4); }
  .kg-st .kg-helm-stage { width: 290px; }
  .kg-st__text .btn-row { margin-top: var(--s-2); }
  .kg-sf__art { aspect-ratio: 16 / 9; }
  .kg-sf__text { gap: var(--s-4); }
  .kg-sf__words { margin-top: var(--s-4); font-size: 17px; }
  .kg-sf__words.mo-mq .mo-mq__track { column-gap: var(--s-5); font-size: 17px; }
  .kg-sf .kg-facts { gap: var(--s-4) var(--gutter); }
  .kg-sf .kg-facts > div { padding-top: var(--s-3); }
  .kg-sf .kg-facts dd { margin-top: var(--s-2); font-size: 20px; }
}
.kg-helm-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.kg-helm-stage::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(closest-side, rgb(200 150 62 / .28), rgb(200 150 62 / .08) 55%, transparent); }
.kg-helm-stage::after { content: ""; position: absolute; inset: 14%; border-radius: 50%; border: 1px solid rgb(200 150 62 / .25); }
.kg-helm-stage img { position: relative; z-index: 1; width: 78%; height: auto; filter: drop-shadow(0 30px 50px rgb(0 0 0 / .7)); will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .kg-helm-stage img { animation: kg-float 7s ease-in-out infinite; }
  .kg-helm-stage::after { animation: kg-ring 7s ease-in-out infinite; }
}
@keyframes kg-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes kg-ring { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.04); opacity: .4; } }
.kg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--gutter); margin: 0; }
.kg-facts > div { padding-top: var(--s-4); border-top: 1px solid var(--line); }
.kg-facts dt { font: 500 12px/1 var(--font-text); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.kg-facts dd { margin: var(--s-4) 0 0; font: var(--display-weight) var(--t-h3)/1.15 var(--font-display); letter-spacing: var(--display-tracking); }


/* ---- /games/: the page's first screen, the words on the left line and the key art beside them ---- */
.kg-gh { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: stretch; height: 100%; }
.kg-gh__text { grid-column: 1 / span 5; display: flex; flex-direction: column; justify-content: flex-start; gap: var(--s-5); }
.kg-gh__text h1 { margin: 0; font: var(--display-weight) var(--ly-h1, var(--t-h1))/1.04 var(--font-display); letter-spacing: var(--display-tracking-xl, var(--display-tracking)); text-wrap: balance; }
.kg-gh__text .t-lead { margin: 0; color: var(--muted); }
.kg-gh__df { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.kg-gh__df .kg-df-mark { width: 200px; height: auto; }
.kg-gh__df p { margin: 0; }
.kg-gh__art { grid-column: 7 / -1; min-height: 0; }
.kg-gh__art .kg-card__media { position: absolute; inset: 0; }
@media (max-width: 1023px) {
  .kg-gh { display: flex; flex-direction: column; gap: var(--s-7); height: auto; }
  .kg-gh__art { aspect-ratio: 4 / 3; }
}
@media (max-width: 639px) { .kg-gh__art { aspect-ratio: 4 / 5; } }
.kg-proj .kg-card__media { aspect-ratio: 40 / 21; }
.kg-proj .kg-card__body h3 { font-size: 24px; }
@media (max-width: 639px) {
  .footer__legal { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .kg-proj .kg-card__body h3 { font-size: 20px; }
}
.kg-gh__art img { object-position: 74% 50%; }
@media (max-width: 639px) { .kg-gh__art img { object-position: 50% 50%; } }

/* ---- the footer's big name: the wordmark itself, across the wrap ---- */
html .footer--statement .close__word.kg-close-mark { flex: 1 1 0; min-height: 0; margin-top: var(--s-4); background: none; color: inherit; font-size: 0; line-height: 0; overflow: visible; }
.kg-close-mark img { display: block; width: 100%; height: 100%; max-height: 554px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 20px 50px rgb(0 0 0 / .55)); }
@media (max-width: 639px) { html .footer--statement .close__word.kg-close-mark { flex: none; } .kg-close-mark img { height: auto; } }

/* ---- landing: the living helmet between the words and the pagoda ---- */
.kg-helmfx { position: absolute; z-index: -1; pointer-events: none; --hw: min(24vw, 42svh);
  width: calc(var(--hw) * 2); height: calc(var(--hw) * 2.6); left: 64%; top: 50%; transform: translate(-50%, -50%); }
.kg-helmfx img { position: absolute; left: 25%; top: 30%; width: 50%; height: auto; filter: drop-shadow(0 30px 40px rgb(0 0 0 / .7)); }
.kg-helmfx canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the breath thins out before the edge of its canvas, never a hard line */
.kg-helmfx__fluid { -webkit-mask-image: radial-gradient(closest-side at 50% 58%, #000 55%, transparent); mask-image: radial-gradient(closest-side at 50% 58%, #000 55%, transparent); }
@media (prefers-reduced-motion: no-preference) { .kg-helmfx { animation: kg-helm-in 1.8s .35s cubic-bezier(.2,.7,.1,1) both; } }
@keyframes kg-helm-in { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@media (min-aspect-ratio: 1/1) and (max-width: 1199px) {
  .kg-hero__in { max-width: 460px; }
  .kg-helmfx { left: 70%; --hw: min(22vw, 40svh); }
}
@media (max-aspect-ratio: 1/1) {
  /* portrait: the helmet takes the first screen over the art; the name and the words come on scroll */
  main > .kg-hero { height: auto; min-height: 0; display: block; padding: 0 0 var(--s-6); }
  .kg-hero__media { inset: -24px -24px auto -24px; height: calc(100svh + 48px); }
  .kg-helmfx { left: 50%; top: calc(var(--nav) + 3svh - var(--hw) * .23); transform: translateX(-50%); --hw: min(60vw, 30svh); }
  main > .kg-hero > .wrap { padding-top: 76svh; }
}
