/* ============================================
   GASHIMA Lab - 2-Column Pop Design
   おもしろそうを、やってみる。
   ============================================ */

/* Google Fonts - loaded via HTML */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  /* Colors */
  --color-primary: #00B4D8;
  --color-primary-dark: #0096C7;
  --color-accent: #FF9500;
  --color-accent-light: #FFB347;
  --color-bg: #F8F5F0;
  --color-bg-alt: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-muted: #666666;
  --color-text-light: #FFFFFF;

  /* Fonts */
  --font-jp: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-impact: 'Dela Gothic One', sans-serif;

  /* Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-jp);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   Layout - 2 Column Split
   ============================================ */
.layout {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Hero Panel (Left)
   ============================================ */
.hero-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-text-light);
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .hero-panel {
    position: relative;
    height: auto;
    min-height: 100vh;
    padding: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .hero-panel {
    padding: var(--spacing-md);
    /* パディングを少し減らして文字サイズを稼ぐ */
  }
}

/* Bubble Particles */
.bubbles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  pointer-events: none;
  animation: bubbleRise linear infinite;
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100vh) translateX(var(--drift, 0px));
    opacity: 0;
  }
}

/* Logo */
.hero-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.logo-image {
  height: 48px;
  width: auto;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

@media (max-width: 768px) {
  .logo-image {
    height: 36px;
  }
}

.logo-text {
  font-family: var(--font-en);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.flask-svg {
  width: 32px;
  height: 40px;
  color: currentColor;
}

.flask-outline {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawFlask 2s ease-out forwards;
}

.flask-bubble {
  animation: bubbleFloat 2s ease-in-out infinite;
}

.bubble-1 {
  animation-delay: 0s;
}

.bubble-2 {
  animation-delay: 0.5s;
}

.bubble-3 {
  animation-delay: 1s;
}

@keyframes drawFlask {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes bubbleFloat {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 1;
  margin: var(--spacing-xl) 0;
}

.hero-title {
  font-family: var(--font-impact);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.02em;
  text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.highlight-text {
  color: var(--color-text-light);
  /* 初期色：白 */
  animation: colorChangeOrange 2s ease-in-out forwards;
  animation-delay: 1.5s;
  /* 少し遅れて開始 */
}

@keyframes colorChangeOrange {
  to {
    color: var(--color-accent);
    /* オレンジへ変化 */
  }
}

@media (max-width: 1200px) {
  .hero-title {
    font-size: var(--text-4xl);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 11.5vw;
    /* 8文字が収まるギリギリのサイズ */
    line-height: 1.25;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    word-break: keep-all;
    /* 単語の途中での改行を防ぐ */
    overflow-wrap: normal;
  }
}

.hero-subtitle {
  font-family: var(--font-en);
  font-size: var(--text-lg);
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: var(--spacing-sm);
}

.hero-description {
  font-size: var(--text-sm);
  opacity: 0.85;
  line-height: 1.8;
}

/* Philosophy Text */
.hero-philosophy {
  position: relative;
  z-index: 1;
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 2.4;
}

.hero-philosophy p {
  margin-bottom: var(--spacing-sm);
}

.hero-philosophy-closing {
  font-size: var(--text-2xl);
  font-weight: 900;
  margin-top: var(--spacing-lg);
  letter-spacing: -0.02em;
}

/* ============================================
   Content Panel (Right)
   ============================================ */
.content-panel {
  background: var(--color-bg);
  padding: var(--spacing-xl);
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .content-panel {
    padding: var(--spacing-lg);
  }
}

/* Mobile Header */
.mobile-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

@media (max-width: 1024px) {
  .mobile-header {
    display: none;
  }
}

.mobile-logo {
  font-family: var(--font-en);
  font-size: var(--text-lg);
  font-weight: 700;
}

.mobile-menu-btn {
  width: 32px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
}

/* ============================================
   Section Styles
   ============================================ */
.section {
  margin-bottom: var(--spacing-2xl);
}

.section-title {
  font-family: var(--font-impact);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.04em;
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.section-title .highlight {
  color: var(--color-primary);
}

/* ============================================
   Service Cards - Sticker Design
   ============================================ */

/* 横一体化の水色背景バナー */
.service-banner {
  background: linear-gradient(135deg, #00B4D8 0%, #48CAE4 50%, #00B4D8 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl) var(--spacing-md);
  margin: 0 calc(-1 * var(--spacing-md));
}

.service-cards {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  padding: var(--spacing-lg) 0;
}

@media (max-width: 900px) {
  .service-banner {
    padding: var(--spacing-lg) var(--spacing-sm);
  }

  .service-cards {
    gap: 0;
  }
}

@media (max-width: 500px) {
  .service-cards {
    flex-direction: row;
    gap: 0;
  }
}

.service-card {
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 0;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), z-index 0s;
  position: relative;
}

/* トランプの手札配置 - 左カード */
.service-card:nth-child(1) {
  transform: rotate(-15deg) translateY(10px);
  margin-right: -60px;
  z-index: 1;
}

/* トランプの手札配置 - 中央カード */
.service-card:nth-child(2) {
  transform: translateY(-15px);
  z-index: 10;
  margin-bottom: 20px;
}

/* トランプの手札配置 - 右カード */
.service-card:nth-child(3) {
  transform: rotate(15deg) translateY(10px);
  margin-left: -60px;
  z-index: 2;
}

/* ホバー時 - 前面に飛び出す */
/* ホバー時 - 前面に飛び出す */
.service-card:hover {
  transform: scale(1.15) translateY(-40px) rotate(0deg) !important;
  z-index: 100;
  /* marginの変更はレイアウトシフト（ガタつき）の原因になるので削除 */
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0s;
}

/* 中央カードのホバー時は少し高さを調整 */
.service-card:nth-child(2):hover {
  transform: scale(1.15) translateY(-30px) !important;
}

/* ステッカー風アイコン */
/* ステッカー風アイコン */
.service-sticker {
  width: 240px;
  height: 240px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 白縁取り + ドロップシャドウでステッカー風 */
  filter:
    drop-shadow(0 0 0 white) drop-shadow(2px 0 0 white) drop-shadow(-2px 0 0 white) drop-shadow(0 2px 0 white) drop-shadow(0 -2px 0 white) drop-shadow(3px 3px 0 white) drop-shadow(-3px 3px 0 white) drop-shadow(3px -3px 0 white) drop-shadow(-3px -3px 0 white) drop-shadow(4px 8px 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s var(--ease-out);
}

/* ランダムな飛び跳ねアニメーション */
.service-card:nth-child(1) .service-sticker img {
  animation: stickerBounce1 4s ease-in-out infinite;
}

.service-card:nth-child(2) .service-sticker img {
  animation: stickerBounce2 5s ease-in-out infinite;
  animation-delay: 1.5s;
}

.service-card:nth-child(3) .service-sticker img {
  animation: stickerBounce3 4.5s ease-in-out infinite;
  animation-delay: 0.8s;
}

@keyframes stickerBounce1 {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  15% {
    transform: translateY(-12px) rotate(-3deg);
  }

  20% {
    transform: translateY(-8px) rotate(2deg);
  }

  25% {
    transform: translateY(-10px) rotate(-1deg);
  }

  30% {
    transform: translateY(0) rotate(0deg);
  }

  70% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  72% {
    transform: scale(1.05, 0.95);
  }

  74% {
    transform: scale(0.95, 1.05);
  }

  76% {
    transform: scale(1.02, 0.98);
  }

  78% {
    transform: scale(1);
  }
}

@keyframes stickerBounce2 {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  40% {
    transform: translateY(0) rotate(0deg);
  }

  45% {
    transform: translateY(-15px) rotate(2deg);
  }

  50% {
    transform: translateY(-10px) rotate(-2deg);
  }

  55% {
    transform: translateY(-12px) rotate(1deg);
  }

  60% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes stickerBounce3 {

  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  25% {
    transform: scale(1.08, 0.92);
  }

  27% {
    transform: scale(0.92, 1.08);
  }

  29% {
    transform: scale(1.04, 0.96);
  }

  31% {
    transform: scale(1);
  }

  60% {
    transform: translateY(0) rotate(0deg);
  }

  65% {
    transform: translateY(-10px) rotate(-2deg);
  }

  70% {
    transform: translateY(-8px) rotate(3deg);
  }

  75% {
    transform: translateY(0) rotate(0deg);
  }
}

/* 文字詰め（トラッキング） - 非表示 */
.service-name {
  display: none;
}

@media (max-width: 500px) {
  .service-sticker {
    width: 160px;
    height: 160px;
  }
}

/* ============================================
   Modal - Apple Liquid Glass Design
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* Frosted Glass Overlay */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Frosted Glass Content */
.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: var(--spacing-xl);
  max-width: 700px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
  transform: translateY(0) scale(1);
}

/* Close Button - Pill Style */
.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  font-size: var(--text-lg);
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Hero Image Container */
.modal-hero {
  width: calc(100% + var(--spacing-xl) * 2);
  margin: calc(-1 * var(--spacing-xl)) calc(-1 * var(--spacing-xl)) var(--spacing-lg);
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary) 0%, #48CAE4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  min-height: 280px;
}

.modal-hero-image {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
  animation: heroFloat 3s ease-in-out infinite;
}

/* Bounce Animation */
@keyframes heroFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  15% {
    transform: translateY(-20px) rotate(-2deg);
  }

  20% {
    transform: translateY(-18px) rotate(2deg);
  }

  25% {
    transform: translateY(-20px) rotate(-1deg);
  }

  30% {
    transform: translateY(0) rotate(0deg);
  }
}

/* Text Content */
.modal-text {
  padding: 0 var(--spacing-sm);
}

.modal-title {
  font-family: var(--font-en);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: #1a1a1a;
}

.modal-desc {
  font-size: var(--text-base);
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.8;
  margin-bottom: var(--spacing-lg);
}

/* Screenshots Gallery */
.modal-screenshots {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding: var(--spacing-xs) 0 var(--spacing-md);
  margin: 0 calc(-1 * var(--spacing-sm));
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.modal-screenshots::-webkit-scrollbar {
  height: 6px;
}

.modal-screenshots::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.modal-screenshots::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.modal-screenshot {
  flex-shrink: 0;
  height: 280px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  scroll-snap-align: start;
  transition: transform 0.3s ease;
}

.modal-screenshot:hover {
  transform: scale(1.02);
}

.modal-screenshot-wide {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

/* ============================================
   Works Section - Auto-scroll + Swipeable
   ============================================ */
.works-marquee {
  width: calc(100% + var(--spacing-xl) * 2);
  margin: 0 calc(-1 * var(--spacing-xl));
  padding: 0 var(--spacing-xl);
  overflow: hidden;
  cursor: grab;
}

.works-marquee:active {
  cursor: grabbing;
}

.works-marquee.dragging {
  cursor: grabbing;
}

.works-marquee.dragging .works-track {
  animation-play-state: paused;
}

.works-track {
  display: flex;
  gap: var(--spacing-lg);
  width: max-content;
  padding: var(--spacing-sm) 0;
  animation: marquee 25s linear infinite;
}

.works-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.work-item {
  display: block;
  flex-shrink: 0;
  width: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  /* Stronger card shadow */
  transition: all 0.3s var(--ease-out);
  position: relative;
  scroll-snap-align: start;
}

.work-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.work-thumb-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.work-item:hover .work-thumb-img {
  transform: scale(1.1);
}

/* WEB作品は横長 */
.work-item:has(.work-tag:contains('#WEB')) .work-thumb-img {
  aspect-ratio: 16/9;
}

/* WEB作品用クラス */
.work-item.work-web {
  width: 280px;
}

.work-item.work-web .work-thumb-img {
  aspect-ratio: 16/9;
}


.work-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  /* Slightly more bottom padding */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  opacity: 1;
  /* Always visible */
  transform: translateY(0);
  /* Always visible */
  z-index: 2;
}

/* No change needed on hover as it's always visible */

.work-tag {
  font-family: var(--font-en);
  font-size: var(--text-lg);
  /* Larger tag */
  font-weight: 800;
  color: var(--color-accent);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  /* Pop against background */
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.work-name {
  font-size: var(--text-base);
  /* Slightly larger name */
  font-weight: 700;
  color: var(--color-text-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
  text-align: center;
  padding: var(--spacing-2xl) 0;
}

.contact-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: var(--color-accent);
  border-radius: 50%;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 4px 20px rgba(255, 149, 0, 0.3);
}

.contact-icon-link:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 30px rgba(255, 149, 0, 0.5);
}

.contact-icon-link svg {
  width: 50px;
  height: 50px;
  color: white;
}

.contact-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--spacing-md);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: var(--spacing-lg) 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
}

.footer-content {
  font-family: var(--font-en);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-divider {
  margin: 0 var(--spacing-sm);
  opacity: 0.5;
}

.footer-link {
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--color-primary);
}

.footer-info {
  margin-bottom: var(--spacing-xs);
}

@media (max-width: 768px) {
  .footer-info {
    font-size: var(--text-xs);
    line-height: 1.5;
    word-break: break-all;
  }
}

/* ============================================
   Animations
   ============================================ */

/* Reveal Line Animation */
.reveal-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.reveal-line .text {
  opacity: 0.3;
  transition: opacity 0.5s ease;
}

.reveal-line .emoji {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 1.2em;
  opacity: 0;
  transform: scale(0) rotate(-20deg);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Floating animation */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes wiggle {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-3deg);
  }

  75% {
    transform: rotate(3deg);
  }
}

.deco-circle-2 {
  animation: float 4s ease-in-out infinite;
}

.deco-triangle-1 {
  animation: float 3s ease-in-out infinite;
  animation-delay: 0.5s;
}

.deco-triangle-2 {
  animation: float 3.5s ease-in-out infinite;
  animation-delay: 1s;
}

/* Emoji bounce when visible */
.emoji.visible {
  animation: pulse 2s ease-in-out infinite;
}

/* Service card hover glow */
.service-card:hover {
  box-shadow: 0 20px 60px rgba(0, 180, 216, 0.2);
}

/* CTA button pulse */
.cta-button {
  animation: pulse 2s ease-in-out infinite;
}

.cta-button:hover {
  animation: none;
}

/* ============================================
   Bounce & Color Animation for Philosophy
   ============================================ */
.bounce-char {
  display: inline-block;
  opacity: 0.3;
  /* Initial state same as .text */
  transition: opacity 0.5s ease;
  font-weight: inherit;
}

/* Specific delays for bounce characters staggered appearance */
#closing-line .bounce-char:nth-child(2) {
  transition-delay: 0.05s;
}

/* お */
#closing-line .bounce-char:nth-child(3) {
  transition-delay: 0.1s;
}

/* も */
#closing-line .bounce-char:nth-child(4) {
  transition-delay: 0.15s;
}

/* し */
#closing-line .bounce-char:nth-child(5) {
  transition-delay: 0.2s;
}

/* ろ */
#closing-line .bounce-char:nth-child(6) {
  transition-delay: 0.25s;
}

/* そ */
#closing-line .bounce-char:nth-child(7) {
  transition-delay: 0.3s;
}

/* う */

/* When the line is active, trigger the bounce animation */
.reveal-line.active .bounce-char {
  opacity: 1;
  animation: bounceOrange 0.8s ease-out forwards;
}

/* Stagger the animation start */
.reveal-line.active .bounce-char:nth-child(2) {
  animation-delay: 0.1s;
}

.reveal-line.active .bounce-char:nth-child(3) {
  animation-delay: 0.2s;
}

.reveal-line.active .bounce-char:nth-child(4) {
  animation-delay: 0.3s;
}

.reveal-line.active .bounce-char:nth-child(5) {
  animation-delay: 0.4s;
}

.reveal-line.active .bounce-char:nth-child(6) {
  animation-delay: 0.5s;
}

.reveal-line.active .bounce-char:nth-child(7) {
  animation-delay: 0.6s;
}

@keyframes bounceOrange {
  0% {
    transform: translateY(0);
    color: inherit;
  }

  30% {
    transform: translateY(-15px) scale(1.1);
    color: var(--color-accent);
  }

  50% {
    transform: translateY(0);
  }

  70% {
    transform: translateY(-5px);
  }

  100% {
    transform: translateY(0);
    color: var(--color-accent);
  }
}

/* ============================================
   Playfulness: Paper Plane Animation
   ============================================ */
/* Hover: Shake and lift (ready to fly) */
.contact-icon-link:hover svg {
  animation: planeShake 0.3s ease-in-out infinite;
}

@keyframes planeShake {

  0%,
  100% {
    transform: translateY(-3px) rotate(-2deg);
  }

  50% {
    transform: translateY(-5px) rotate(2deg);
  }
}

/* Click: Fly away animation */
.contact-icon-link.fly-away {
  pointer-events: none;
  /* Prevent double clicks */
}

.contact-icon-link.fly-away svg {
  animation: planeFlyAway 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes planeFlyAway {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(150px, -150px) rotate(30deg) scale(0.5);
    opacity: 0;
  }
}

/* ============================================
   Playfulness: Micro-Interactions
   ============================================ */
/* Button Click Feedback (pop effect) */
.service-card:active,
.work-item:active,
.contact-icon-link:active:not(.fly-away),
.modal-close:active,
.footer-link:active {
  transform: scale(0.95) !important;
  transition: transform 0.1s ease;
}

/* Focus Glow Effect for Links and Buttons */
.service-card:focus-visible,
.work-item:focus-visible,
.contact-icon-link:focus-visible,
.footer-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.4), 0 0 20px rgba(0, 180, 216, 0.3);
}

.contact-icon-link:focus-visible {
  box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.4), 0 0 20px rgba(255, 149, 0, 0.3);
}

/* ============================================
   Playfulness: Parallax Deco Elements
   ============================================ */
.parallax-deco {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  opacity: 0.1;
  transition: transform 0.1s ease-out;
}

.deco-bg-1 {
  top: 10%;
  right: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  border-radius: 50%;
}

.deco-bg-2 {
  top: 60%;
  left: 5%;
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, var(--color-accent) 0%, transparent 60%);
  border-radius: 50%;
}

.deco-bg-3 {
  bottom: 20%;
  right: 15%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--color-primary-dark) 0%, transparent 70%);
  border-radius: 50%;
}

/* Hide parallax on mobile for performance */
@media (max-width: 1024px) {
  .parallax-deco {
    display: none;
  }
}