@charset "UTF-8";

/* ==========================================================================
   kyata-two Official Website Custom Styles
   Theme: シンプル × モダン × 脱力ポップ
   ========================================================================== */

:root {
  --bg-base: #FAFAFA;
  --bg-surface: #FFFFFF;
  --color-miku: #58C9B9;
  --color-miku-light: #E6F7F5;
  --color-miku-dark: #3DA898;
  --color-teto: #F472B6;
  --color-teto-light: #FDF2F8;
  --color-teto-dark: #DB2777;
  --color-text: #333333;
  --color-text-muted: #667085;
  --font-jp: 'Zen Maru Gothic', 'M PLUS Rounded 1c', sans-serif;
  --font-en: 'Outfit', 'Quicksand', 'Zen Maru Gothic', sans-serif;
  --spring-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth-easing: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  background-color: var(--bg-base);
  color: var(--color-text);
  font-family: var(--font-jp);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-base);
  color: var(--color-text);
  overflow-x: hidden;

}

::selection {
  background-color: rgba(88, 201, 185, 0.25);
  color: #1f2937;
}

.font-en {
  font-family: var(--font-en);
}

.font-jp {
  font-family: var(--font-jp);
}

/* ==========================================================================
   1. Fixed Background Illustration & Zero-Gravity Floating Animation
   ========================================================================== */

.bg-character-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Ambient soft pastel blobs in the background */
.ambient-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(70px);
  opacity: 0.38;
  pointer-events: none;
}

.ambient-blob-miku {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(88, 201, 185, 0.32) 0%, rgba(88, 201, 185, 0) 70%);
  top: -80px;
  right: -60px;
  animation: floatSlow 14s ease-in-out infinite alternate;
}

.ambient-blob-teto {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.24) 0%, rgba(244, 114, 182, 0) 70%);
  bottom: -100px;
  left: -80px;
  animation: floatSlow 18s ease-in-out infinite alternate-reverse;
}

/* Main Character Wrapper (Fixed Right on Desktop, Bottom-Center on Mobile) */
.bg-character-wrapper {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  /* Desktop placement: right side, large & cozy */
  right: 2vw;
  top: 52%;
  transform: translateY(-50%);
  width: min(46vw, 540px);
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.20; /* Spec: 0.15 ~ 0.25 */
  transition: opacity 0.5s var(--smooth-easing), transform 0.5s var(--smooth-easing), filter 0.5s var(--smooth-easing);
}

/* Peek mode when user toggles clear view of the illustration */
body.character-peek-active .bg-character-wrapper {
  opacity: 0.92;
  z-index: 35;
  filter: drop-shadow(0 20px 40px rgba(88, 201, 185, 0.28));
}

.bg-character-img {
  width: 100%;
  height: auto;
  max-height: 84vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  animation: zeroGravityFloat 7.5s ease-in-out infinite;
  transform-origin: center center;
}

/* Floating decorative doodles around the background */
.floating-doodle {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.doodle-1 {
  top: 14%;
  left: 8%;
  animation: zeroGravityDoodleA 6.5s ease-in-out infinite;
}

.doodle-2 {
  top: 68%;
  left: 5%;
  animation: zeroGravityDoodleB 8.2s ease-in-out infinite 1.2s;
}

.doodle-3 {
  top: 22%;
  right: 38%;
  animation: zeroGravityDoodleA 9s ease-in-out infinite 2.5s;
}

.doodle-4 {
  bottom: 14%;
  right: 42%;
  animation: zeroGravityDoodleB 7.2s ease-in-out infinite 0.7s;
}

/* Mobile & Tablet Responsive Placement for Background Character */
@media (max-width: 1024px) {
  .bg-character-wrapper {
    right: -2vw;
    width: min(58vw, 440px);
    opacity: 0.18;
  }
}

@media (max-width: 767px) {
  .bg-character-wrapper {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -24px;
    transform: translateX(-50%);
    width: min(82vw, 350px);
    max-height: 56vh;
    opacity: 0.17; /* Spec: 0.15 ~ 0.25, unobtrusive at bottom center on mobile */
  }
}

/* Keyframes: Zero-Gravity Relaxed Floating */
@keyframes zeroGravityFloat {
  0% {
    transform: translate3d(0, 0px, 0) rotate(-1.2deg);
  }
  50% {
    transform: translate3d(0, -20px, 0) rotate(1.8deg);
  }
  100% {
    transform: translate3d(0, 0px, 0) rotate(-1.2deg);
  }
}

@keyframes zeroGravityDoodleA {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    transform: translate3d(6px, -16px, 0) rotate(10deg) scale(1.06);
  }
}

@keyframes zeroGravityDoodleB {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-8px, -14px, 0) rotate(-12deg);
  }
}

@keyframes floatSlow {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(24px, -24px, 0) scale(1.08);
  }
}

/* ==========================================================================
   2. Spring Bounce Micro-interactions ("ぽよん" Hover Effect)
   ========================================================================== */

.btn-poyon {
  transition:
    transform 0.42s var(--spring-easing),
    box-shadow 0.3s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
  will-change: transform;
}

.btn-poyon:hover {
  transform: translateY(-4px) scale(1.045);
}

.btn-poyon:active {
  transform: translateY(1px) scale(0.96);
  transition-duration: 0.12s;
}

/* Card Bounce Effect */
.card-poyon {
  transition:
    transform 0.48s var(--spring-easing),
    box-shadow 0.35s var(--smooth-easing),
    border-color 0.3s ease;
  will-change: transform;
}

.card-poyon:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 38px -12px rgba(88, 201, 185, 0.22), 0 8px 16px -6px rgba(51, 51, 51, 0.05);
}

.card-poyon:active {
  transform: translateY(-2px) scale(0.99);
}

/* Thumbnail zoom & bounce inside work card */
.work-thumb-img {
  transition: transform 0.55s var(--spring-easing);
}

.card-poyon:hover .work-thumb-img {
  transform: scale(1.06) rotate(0.6deg);
}

.play-badge-poyon {
  transition: transform 0.45s var(--spring-easing), background-color 0.25s ease;
}

.card-poyon:hover .play-badge-poyon {
  transform: scale(1.16);
}

/* Avatar squishy hover */
.avatar-poyon {
  transition: transform 0.55s var(--spring-easing), box-shadow 0.35s ease;
}

.avatar-poyon:hover {
  animation: jellySquish 0.75s ease;
}

@keyframes jellySquish {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.09, 0.92) rotate(-2deg); }
  50% { transform: scale(0.94, 1.07) rotate(2deg); }
  75% { transform: scale(1.03, 0.98) rotate(-1deg); }
  100% { transform: scale(1, 1) rotate(0deg); }
}

/* ==========================================================================
   3. Scroll-Linked Reveal Animation (下からふわっとフェードイン)
   ========================================================================== */

.reveal-up {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition:
    opacity 0.75s var(--smooth-easing),
    transform 0.75s var(--smooth-easing);
  will-change: opacity, transform;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* Explicit OFF stops all decorative background motion. */
html[data-background-motion="off"] .bg-character-img,
html[data-background-motion="off"] .floating-doodle,
html[data-background-motion="off"] .ambient-blob {
  animation: none !important;
}

/* Auto follows the OS; explicit ON opts in to background motion only. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html:not([data-background-motion="on"]) .bg-character-img,
  html:not([data-background-motion="on"]) .floating-doodle,
  html:not([data-background-motion="on"]) .ambient-blob {
    animation: none !important;
  }
  .reveal-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Background preferences: native radios support keyboard navigation. */
.background-controls {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.background-motion-controls {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 8px 12px 10px;
  border: 1px solid rgba(88, 201, 185, 0.35);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(51, 51, 51, 0.06);
  font-size: 12px;
  line-height: 1.5;
}

.background-motion-controls[hidden] {
  display: none;
}

.background-motion-controls legend {
  padding: 0 4px;
  font-weight: 700;
}

.background-motion-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.background-motion-option {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.background-motion-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.background-motion-option span {
  display: block;
  min-width: 48px;
  padding: 7px 10px;
  border: 1px solid #ccd8d6;
  border-radius: 9999px;
  text-align: center;
  font-weight: 700;
}

.background-motion-option input:checked + span {
  border-color: #287f73;
  background: #e6f7f5;
  color: #236b62;
}

.background-motion-option input:focus-visible + span {
  outline: 3px solid #287f73;
  outline-offset: 2px;
}

#background-motion-status {
  margin: 6px 0 0;
  color: var(--color-text-muted);
}

/* ==========================================================================
   4. Component Polish (Header, Filter Pills, Accordion, Modal)
   ========================================================================== */

.glass-header {
  background: rgba(250, 250, 250, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(88, 201, 185, 0.16);
}

.glass-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-miku), var(--color-teto));
  transform: translateX(-50%);
  transition: width 0.3s var(--spring-easing);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 75%;
}

/* Accordion Smooth Transition */
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s var(--smooth-easing);
}

.accordion-item.is-open .accordion-content {
  grid-template-rows: 1fr;
}

.accordion-inner {
  overflow: hidden;
}

.accordion-icon {
  transition: transform 0.38s var(--spring-easing);
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
}

/* Work Card Filter Entry Animation */
@keyframes cardPopIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.work-card-enter {
  animation: cardPopIn 0.42s var(--spring-easing) both;
}

/* Modal Backdrop & Box */
.modal-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-box {
  transform: translateY(20px) scale(0.94);
  transition: transform 0.4s var(--spring-easing);
}

.modal-backdrop.is-open .modal-box {
  transform: translateY(0) scale(1);
}

/* Visible keyboard focus on interactive cards and links. */
:where(a, button, [role="button"]):focus-visible {
  outline: 3px solid #287f73;
  outline-offset: 3px;
}

/* Prevent page-level horizontal overflow, including animated decorations.
   Keep normal vertical scrolling and the browser's pinch-to-zoom behavior. */
html,
body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

/* clip also prevents programmatic horizontal scrolling; hidden is the fallback. */
@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

/* Allow long URLs to shrink and wrap inside the flex item instead of
   expanding its min-content width. CSS wrapping does not alter copied text. */
#credit-template-box,
#credit-template-content {
  min-width: 0;
  max-width: 100%;
}

#credit-template-content {
  flex: 1 1 auto;
}

#credit-template-text {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: normal;
}

#copy-credit-btn {
  max-width: 100%;
}
