
@import "base.css";
@import "layout.css";
@import "hero.css";
@import "works.css";
@import "modal.css";
@import "animation.css";
@import "theme.css";
@import "responsive.css";


/* ===== v27.4 mobile menu ===== */

.menu-toggle{
  display:none;
  background:none;
  border:none;
  font-size:26px;
  cursor:pointer;
}

@media (max-width: 768px){

  .menu-toggle{
    display:block;
  }

  .nav{
    position:fixed;
    top:0;
    right:-100%;
    width:260px;
    height:100vh;
    background:#fff;
    display:flex;
    flex-direction:column;
    padding:80px 30px;
    gap:20px;
    transition:right .3s ease;
    box-shadow:-10px 0 30px rgba(0,0,0,.15);
    z-index:9998;
  }

  .nav.open{
    right:0;
  }

  .nav a{
    font-size:18px;
  }

  body.menu-open{
    overflow:hidden;
  }

}


/* ===== v27.5 mobile menu outside click close ===== */
.menu-backdrop{
  display:none;
}

@media (max-width: 768px){
  .menu-backdrop{
    display:block;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.14);
    opacity:0;
    pointer-events:none;
    transition:opacity .3s ease;
    z-index:9997;
  }

  .menu-backdrop.open{
    opacity:1;
    pointer-events:auto;
  }
}


/* ===== v27.6 mobile drawer close button ===== */
.mobile-menu-head,
.menu-close{
  display:none;
}

@media (max-width: 768px){
  .mobile-menu-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:28px;
  }

  .mobile-menu-logo{
    font-size:28px;
    font-weight:700;
    color:#566577;
    letter-spacing:-0.02em;
  }

  .menu-close{
    display:inline-flex;
    align-items:center;
    justify-content:flex-start;
    width:58px;
    height:58px;
    border:none;
    border-radius:999px;
    background:#5a697b;
    color:#fff;
    font-size:34px;
    line-height:1;
    cursor:pointer;
    flex-shrink:0;
  }

  .nav{
    left:0;
    right:auto;
    width:min(86vw, 460px);
    max-width:460px;
    height:100vh;
    padding:32px 40px 40px;
    gap:28px;
    box-shadow:14px 0 36px rgba(0,0,0,.12);
  }

  .nav a{
    font-size:34px;
    line-height:1.45;
    color:#5c6978;
    font-weight:500;
  }

  .menu-backdrop{
    background:rgba(0,0,0,.26);
  }

  .lang-switch{
    position:relative;
    z-index:10000;
  }
}


/* ===== v27.7 mobile menu refine ===== */
@media (max-width: 768px){
  .nav{
    width:min(82vw, 430px);
    padding:34px 32px 40px;
    gap:22px;
    overflow-y:auto;
    overscroll-behavior:contain;
  }

  .mobile-menu-head{
    margin-bottom:22px;
  }

  .mobile-menu-logo{
    font-size:26px;
    line-height:1.1;
  }

  .menu-close{
    margin-left:auto;
    margin-right:-6px;
    width:64px;
    height:64px;
    font-size:38px;
  }

  .nav a{
    font-size:30px;
    line-height:1.25;
    letter-spacing:-0.02em;
    color:#5d6978;
    padding:8px 0;
  }

  .nav a.active-menu-item{
    color:#111;
    font-weight:700;
  }

  .nav a.active-menu-item::after{
    content:"";
    display:block;
    width:100%;
    height:4px;
    margin-top:12px;
    background:#111;
  }

  .menu-backdrop{
    background:rgba(0,0,0,.22);
    touch-action:none;
  }

  body.menu-open{
    overflow:hidden !important;
    position:fixed;
    width:100%;
    touch-action:none;
  }
}


/* ===== v27.8 mobile menu initial closed fix ===== */
@media (max-width: 768px){
  .nav{
    position:fixed !important;
    top:0 !important;
    left:-100% !important;
    right:auto !important;
    width:min(82vw, 430px) !important;
    max-width:430px !important;
    height:100vh !important;
    background:#fff !important;
    display:flex !important;
    flex-direction:column !important;
    padding:34px 32px 40px !important;
    gap:22px !important;
    box-shadow:14px 0 36px rgba(0,0,0,.12) !important;
    transition:left .32s ease !important;
    z-index:9998 !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
  }

  .nav.open{
    left:0 !important;
  }

  .mobile-menu-head{
    display:flex !important;
  }

  .menu-toggle{
    display:block !important;
    position:relative;
    z-index:10001;
  }

  .header-inner{
    display:flex;
    align-items:center;
  }

  .lang-switch{
    margin-left:16px;
  }
}


/* ===== v27.9 mobile menu final ===== */
@media (max-width: 768px){
  .nav{
    position:fixed !important;
    top:0 !important;
    left:-100% !important;
    right:auto !important;
    width:80vw !important;
    max-width:420px !important;
    height:100vh !important;
    background:#fff !important;
    display:flex !important;
    flex-direction:column !important;
    padding:34px 32px 40px !important;
    gap:22px !important;
    box-shadow:14px 0 36px rgba(0,0,0,.12) !important;
    transition:left .35s ease !important;
    z-index:9998 !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
  }

  .nav.open{
    left:0 !important;
  }

  .nav a{
    font-size:24px !important;
    line-height:1.4 !important;
    letter-spacing:-0.01em !important;
  }

  .menu-toggle{
    display:block !important;
    position:relative !important;
    z-index:10001 !important;
  }

  .menu-backdrop{
    display:block !important;
    position:fixed !important;
    inset:0 !important;
    background:rgba(0,0,0,.22) !important;
    opacity:0 !important;
    pointer-events:none !important;
    transition:opacity .3s ease !important;
    z-index:9997 !important;
    touch-action:none !important;
  }

  .menu-backdrop.open{
    opacity:1 !important;
    pointer-events:auto !important;
  }

  body.menu-open{
    overflow:hidden !important;
    position:fixed !important;
    width:100% !important;
    touch-action:none !important;
  }
}


/* ===== v27.9.1 mobile hamburger spacing ===== */
@media (max-width:768px){
  .menu-toggle{
    margin-left:auto !important;
    margin-right:15px !important;
  }
}


/* ===== v27.9.2 hamburger position tweak ===== */
@media (max-width:768px){
  .menu-toggle{
    margin-left:auto !important;
    margin-right:-37px !important;
    margin-bottom:7px !important;
  }
}


/* ===== v27.9.8 mobile body mount fix ===== */
@media (max-width: 768px){
  .nav{
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    right: auto !important;
    width: 80vw !important;
    max-width: 420px !important;
    height: 100dvh !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 34px 32px 40px !important;
    gap: 22px !important;
    box-shadow: 14px 0 36px rgba(0,0,0,.12) !important;
    transition: left .35s ease !important;
    z-index: 10020 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  .nav.open{
    left: 0 !important;
  }

  .menu-backdrop{
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    background: rgba(0,0,0,.22) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .3s ease !important;
    z-index: 10010 !important;
    touch-action: none;
  }

  .menu-backdrop.open{
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .menu-toggle{
    position: relative;
    z-index: 10001;
  }

  .lang-switch{
    position: relative;
    z-index: 10000;
  }

  body.menu-open{
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    touch-action: none;
  }
}

@media (min-width: 769px){
  .menu-backdrop{
    display: none !important;
  }
}


/* ===== v28.3 scrollspy active menu ===== */
.nav a{
  position: relative;
}

.nav a.active-menu-item{
  color: var(--text-primary, #111) !important;
}

.nav a.active-menu-item::after{
  width: 100% !important;
}

@media (max-width: 768px){
  .nav a.active-menu-item{
    font-weight: 700;
  }

  .nav a.active-menu-item::after{
    bottom: -2px;
  }
}


/* ===== v28.4 active underline refine ===== */
.nav a{
  display: inline-block;
}

.nav a::after{
  left: 50% !important;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: #FF7262 !important;
  transform: translateX(-50%);
  transform-origin: center;
  transition: width .25s ease;
}

.nav a:hover::after,
.nav a.active-menu-item::after{
  width: 100% !important;
}

@media (max-width: 768px){
  .nav a{
    display: inline-block !important;
    width: fit-content;
  }

  .nav a::after{
    bottom: -2px;
    height: 3px;
  }
}

/* ===== v28.5 theme color system ===== */
:root{
  --accent-color:#079BDA;
}

/* nav underline accent */
.nav a::after{
  background:var(--accent-color) !important;
}

/* language accent */
.lang-btn:hover{
  color:var(--accent-color) !important;
}

.lang-btn.active{
  color:var(--accent-color) !important;
  font-weight:600;
}

/* contact icon hover accent */
.contact-icon-link:hover img{
  filter:brightness(0) saturate(100%) invert(58%) sepia(79%) saturate(492%) hue-rotate(322deg) brightness(100%) contrast(101%);
}

/* ===== v28.6 logo accent ===== */
.logo{
  color: var(--accent-color) !important;
}

/* ===== v28.7 footer name accent ===== */
.footer-name{
  color: var(--accent-color) !important;
  font-weight: bold;
}


/* ===== v29.0 game section v1 ===== */
.game-section{
  padding-top: 72px;
}

.game-section-head{
  max-width: 760px;
}

.game-kicker{
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 700;
}

.game-desc{
  max-width: 760px;
  margin: 0 0 30px;
  color: var(--text-secondary, #55606d);
  font-size: 18px;
  line-height: 1.75;
}

.game-frame-wrap{
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.36));
  box-shadow: 0 20px 46px rgba(0,0,0,.06);
  border: 1px solid rgba(17,24,39,.06);
  padding: 18px;
}

.game-frame{
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: transparent;
  border-radius: 22px;
}

@media (max-width: 768px){
  .game-section{
    padding-top: 56px;
  }

  .game-desc{
    font-size: 16px;
    margin-bottom: 22px;
  }

  .game-frame-wrap{
    border-radius: 22px;
    padding: 12px;
  }

  .game-frame{
    height: 380px;
    border-radius: 18px;
  }
}


/* ===== v29.1 clean game section ===== */
.game-frame-wrap{
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.game-frame{
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: transparent;
  border-radius: 0 !important;
}

.mobile-game-note{
  display: none;
  margin: 10px 0 0;
  color: var(--text-secondary, #55606d);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 768px){
  .game-frame-wrap{
    display: none !important;
  }

  .mobile-game-note{
    display: block;
  }
}


/* ===== v29.4 game ui polish ===== */
.game-section{
  padding-top: 64px;
}

.game-section-head{
  margin-bottom: 6px;
}

.game-desc{
  margin: 0 0 22px;
}

.game-frame{
  height: 430px;
}

.game-controls{
  display: flex;
  justify-content:flex-start;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  flex-wrap: nowrap;
}

.game-controls img{
  display: block;
  height: 56px;
  width: auto;
  opacity: .92;
  transition: transform .2s ease, opacity .2s ease, filter .2s ease;
  will-change: transform;
}

.game-controls img:hover{
  opacity: 1;
  transform: translateY(-2px);
  filter: brightness(1.03);
}

@media (max-width: 900px){
  .game-controls{
    gap: 12px;
    margin-top: 14px;
  }

  .game-controls img{
    height: 48px;
  }
}

@media (max-width: 768px){
  .game-frame{
    display: none;
  }

  .game-controls{
    display: none;
  }

  .mobile-game-note{
    display: block;
    margin-top: 8px;
  }
}


/* ===== v29.5 game section final polish ===== */
.game-desc{
  margin: 0 0 20px;
}

.game-frame{
  margin-bottom: 8px;
}

.game-controls{
  display: none !important;
}

.game-controls-image{
  display: flex;
  justify-content:flex-start;
  margin-top: 18px;
}

.game-controls-image img{
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  image-rendering: auto;
}

@media (max-width: 900px){
  .game-controls-image{
    margin-top: 14px;
  }

  .game-controls-image img{
    max-width: 640px;
  }
}

@media (max-width: 768px){
  .game-controls-image{
    display: none;
  }
}


/* ===== v29.6 game iframe no scrollbar ===== */
.game-frame{
  height: 402px !important;
  overflow: hidden;
}
/* v30.4 Layout System Clean: Skills uses same grid as Services */

/* v30.5 Container System Fix */
.skills .container{
  max-width:1200px;
  margin-left:auto;
  margin-right:auto;
}

/* v31 Skills Typography Polish */

.info-card h3{
  font-size:18px;
  font-weight:600;
  margin-bottom:4px;
  letter-spacing:0.02em;
}

.skill-sub{
  font-size:14px;
  color:#888;
  margin-top:2px;
  letter-spacing:0.04em;
  line-height:1.4;
}

.info-card{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  min-height:120px;
}

/* ===== v32 Portfolio Polish ===== */

/* Card hover animation */
.info-card,
.service-card{
  transition: transform .25s ease, box-shadow .25s ease;
}

.info-card:hover,
.service-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.06);
}

/* Section spacing polish */
.section{
  padding: 60px 0;
}

/* Skill subtitle typography */
.skill-sub{
  font-size:14px;
  color:#8a8a8a;
  margin-top:4px;
  letter-spacing:0.05em;
}

/* Game section spacing */
.game-frame{
  margin-top:24px;
}

/* Mobile card padding */
@media (max-width:768px){
  .info-card,
  .service-card{
    padding:24px;
  }
}

/* ===== v33 Skills Card Design Upgrade ===== */

/* align icon + title to top */
.info-card{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  gap:14px;
}

/* icon spacing */
.info-card .icon,
.info-card svg,
.info-card img{
  margin-bottom:6px;
}

/* list spacing polish */
.info-card ul{
  margin-top:6px;
  line-height:1.8;
}


/* ===== v33.2 game ui polish ===== */
.game-controls,
.controls-guide{
  display:flex;
  justify-content:center;
  align-items:center !important;
  gap:20px;
  margin-top:20px;
}

.game-controls img,
.controls-guide img{
  display:block;
  height:48px;
  width:auto;
  object-fit:contain;
  vertical-align:middle;
}

@media (max-width:768px){
  .game-controls,
  .controls-guide{
    display:none;
  }
}


/* ===== v33.3 cleanup and center ===== */
.game-controls-image{
  width: 100%;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 20px auto 0 !important;
  text-align: center;
}

.game-controls-image img{
  display: block;
  width: min(100%, 720px);
  max-width: 720px;
  height: auto;
  margin: 0 auto !important;
}

@media (max-width: 768px){
  .game-controls-image{
    display: none !important;
  }
}



/* Skills header horizontal layout */
.skill-head{
  display:flex;
  align-items:center;
  gap:10px;
}

.skill-head img{
  width:24px;
  height:24px;
  flex-shrink:0;
}

.skill-title{
  font-size:18px;
  font-weight:600;
  margin:0;
  color:#333;
}

/* Skills spacing refine */
.skill-head{
  margin-bottom:6px;
}

.skill-card ul,
.info-card ul{
  margin-top:8px;
  padding-left:18px;
}

.skill-card li,
.info-card li{
  margin-bottom:8px;
  line-height:1.6;
}

/* Modal layout upgrade */
.gallery-modal .modal-shell{
  width:min(1320px, calc(100vw - 48px));
  display:grid;
  grid-template-columns:60px minmax(0, 1fr) 60px;
  align-items:center;
  gap:18px;
}

.gallery-modal-content{
  background:#f4f4f4;
  border-radius:34px;
  padding:26px;
  position:relative;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  gap:18px;
  min-width:0;
}

.gallery-stage{
  width:100%;
  height:min(68vh, 720px);
  border-radius:26px;
  overflow:hidden;
  background:#9aabbd;
  display:flex;
  align-items:center;
  justify-content:center;
}

.gallery-stage-image{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  object-position:center center;
}

.gallery-meta{
  display:grid;
  grid-template-columns:minmax(280px, 1fr) auto;
  gap:24px;
  align-items:start;
}

.gallery-copy{
  min-width:0;
  align-self:start;
}

#modal-title{
  margin:0 0 10px;
  font-size:32px;
  line-height:1.05;
  font-weight:700;
  color:#4a4a4a;
  letter-spacing:-0.02em;
}

#modal-description{
  margin:0;
  font-size:14px;
  line-height:1.55;
  color:#737373;
  max-width:52ch;
}

.gallery-thumbs{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:14px;
  width:462px;
  max-width:100%;
}

.gallery-thumb{
  width:140px;
  height:92px;
  padding:0;
  border:0;
  background:#9aabbd;
  border-radius:16px;
  overflow:hidden;
  cursor:pointer;
  opacity:.84;
  transition:opacity .2s ease, transform .2s ease, outline-color .2s ease;
}

.gallery-thumb:hover{
  opacity:1;
  transform:translateY(-1px);
}

.gallery-thumb.active{
  opacity:1;
  outline:3px solid #8d9caf;
}

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

.gallery-modal .modal-nav{
  width:54px;
  height:54px;
  border-radius:999px;
  border:0;
  background:rgba(255,255,255,.92);
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  font-size:42px;
  line-height:1;
  cursor:pointer;
}

.gallery-modal .modal-close{
  position:absolute;
  top:16px;
  right:18px;
  z-index:2;
  border:0;
  background:transparent;
  font-size:34px;
  line-height:1;
  cursor:pointer;
}

@media (max-width: 980px){
  .gallery-modal .modal-shell{
    width:min(100vw - 24px, 840px);
    grid-template-columns:1fr;
    gap:12px;
  }

  .gallery-modal .modal-prev,
  .gallery-modal .modal-next{
    display:none;
  }

  .gallery-modal-content{
    padding:18px;
    border-radius:24px;
  }

  .gallery-stage{
    height:min(52vh, 480px);
    border-radius:20px;
  }

  .gallery-meta{
    grid-template-columns:1fr;
    gap:16px;
  }

  .gallery-thumbs{
    width:100%;
    justify-content:flex-start;
    flex-wrap:nowrap;
    overflow-x:auto;
    padding-bottom:2px;
  }

  .gallery-thumb{
    width:112px;
    min-width:112px;
    height:76px;
  }

  #modal-title{
    font-size:26px;
  }
}

/* Gallery interaction polish */
.gallery-stage{
  cursor:grab;
  touch-action:pan-y;
  user-select:none;
}

.gallery-stage.is-dragging{
  cursor:grabbing;
}

.gallery-stage-image{
  opacity:1;
  transition:opacity 0.5s ease;
}

.gallery-stage-image.is-fading{
  opacity:0;
}

/* v36 modal polish */
.gallery-stage{
  position:relative;
  cursor:grab;
  touch-action:pan-y;
  user-select:none;
}

.gallery-stage.is-dragging{
  cursor:grabbing;
}

.gallery-stage::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  opacity:0;
  transition:opacity .35s ease;
}

.gallery-stage.is-loading::after{
  opacity:1;
}

.gallery-stage-image{
  opacity:1;
  transition:opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
  transform:translateX(0);
  filter:blur(0);
  will-change:opacity, transform, filter;
}

.gallery-stage-image.is-fading{
  opacity:0;
  transform:scale(0.985);
  filter:blur(4px);
}

.gallery-thumb.active{
  outline:2px solid #333;
  transform:scale(1.03);
}

@media (max-width: 768px){
  .gallery-thumbs{
    width:100%;
    display:flex;
    gap:8px;
    overflow-x:auto;
    overflow-y:hidden;
    padding-bottom:4px;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x mandatory;
  }

  .gallery-thumb{
    flex:0 0 calc((100% - 16px) / 3);
    min-width:0;
    aspect-ratio:16 / 9;
    scroll-snap-align:start;
  }
}


/* v36.3 modal content + close */
.gallery-details{
  margin-top:18px;
  display:grid;
  gap:8px;
}

.gallery-detail{
  display:grid;
  grid-template-columns:92px 1fr;
  gap:10px;
  align-items:start;
}

.gallery-detail-label{
  font-size:12px;
  line-height:1.4;
  font-weight:700;
  letter-spacing:0.04em;
  text-transform:uppercase;
  color:#8a8a8a;
}

.gallery-detail-value{
  font-size:14px;
  line-height:1.5;
  color:#575757;
}

.gallery-modal .modal-close{
  position:absolute;
  top:14px;
  right:14px;
  z-index:5;
  width:34px;
  height:34px;
  padding:0;
  border:0;
  background:none;
  cursor:pointer;
}

.gallery-modal .modal-close img{
  width:100%;
  height:100%;
  display:block;
  opacity:.82;
  transition:transform .25s ease, opacity .25s ease;
}

.gallery-modal .modal-close:hover img{
  opacity:1;
  transform:scale(1.08);
}

@media (max-width: 768px){
  .gallery-details{
    margin-top:14px;
    gap:6px;
  }

  .gallery-detail{
    grid-template-columns:72px 1fr;
    gap:8px;
  }

  .gallery-detail-label{
    font-size:11px;
  }

  .gallery-detail-value{
    font-size:13px;
  }

  .gallery-modal .modal-close{
    width:30px;
    height:30px;
    top:12px;
    right:12px;
  }
}


.contact-icon-link.is-disabled{
  opacity:.42;
  cursor:default;
  pointer-events:none;
}


/* Final polish */
.works-grid .work-card img{
  object-fit: cover;
  object-position: center center;
}

.gallery-stage-image{
  object-fit: contain;
}

.contact-icon-link.is-disabled img{
  opacity: .7;
}

/* Hide Game nav item and section on mobile only */
@media (max-width: 768px){
  #nav-game,
  #game.game-section{
    display: none !important;
  }
}
