/* ================================================================
   KEYFRAMES - アニメーション定義
   ================================================================ */

@keyframes float {
  0%,
  100% {
    transform: translate3d(-50%, -50%, 0) rotate(0deg);
  }

  50% {
    transform: translate3d(-50%, -50%, 0) rotate(180deg);
  }
}

@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }

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

/* ================================================================
   ANIMATIONS - アニメーション状態
   ================================================================ */
.business-card:not(.animate-in),
.post-card:not(.animate-in),
.contact-card:not(.animate-in) {
  min-height: inherit;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  opacity: 0;
  will-change: opacity, transform;
  contain: layout style paint;
  visibility: hidden;
}

@media (width >= 769px) {
  .business-card:not(.animate-in),
  .post-card:not(.animate-in),
  .contact-card:not(.animate-in) {
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }
}

.business-card.animate-in,
.post-card.animate-in,
.contact-card.animate-in {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
  visibility: visible;
}

/* ================================================================
   RESET - リセットCSS
   ================================================================ */
html {
  background: #fff;
  color: #000;
}

a,
body,
div,
h1,
h2,
h3,
li,
p,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

h1,
h2,
h3 {
  font-size: 100%;
  font-weight: 400;
}

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

*,
::after,
::before {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

/* ================================================================
   VARIABLES - CSS変数
   ================================================================ */
:root {
  --header-height-compact: 192px;
  --header-height-medium: 124px;
  --header-height-wide: 70px;
  --hub-container-width-header: 1000px;
  --hub-container-width-content: 800px;
  --hub-container-width-posts: 700px;
  --hub-container-width-cards: 900px;
  --hub-primary: #667eea;
  --hub-secondary: #764ba2;
  --hub-accent: #38a169;
  --color-pianist: #3182ce;
  --color-studio: #38a169;
  --color-lab: #ed8936;
  --color-text-dark: #1a202c;
  --color-text-light: #fff;
  --color-text-muted: #a0aec0;
  --color-text-muted-accessible: #a0aec0;
  --color-bg-light: #fff;
  --color-focus: #667eea;
  --font-size-base: 18px;
  --font-size-large: 20px;
  --min-touch-area: 44px;
  --font-base: "Yu Gothic Medium", "Meiryo", "メイリオ", "Segoe UI", arial,
    sans-serif;
}

/* ================================================================
   BASE - 基本スタイル
   ================================================================ */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ================================================================
   UTILITY - ユーティリティクラス
   ================================================================ */
.u-sr-only.u-skip-link:focus {
  position: fixed !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 10000;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0.5rem 1rem !important;
  border-radius: 0.25rem;
  background: var(--hub-primary);
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-weight: 600;
  clip: auto !important;
  clip-path: none !important;
}

/* ================================================================
   LAYOUT - コンテナ
   ================================================================ */

/* container-header */
.l-container-header {
  width: 100%;
  margin-inline: auto;
}

@media (width >= 769px) {
  .l-container-header {
    width: min(90%, var(--hub-container-width-header, 1000px));
    max-width: 1000px;
  }
}

/* container-content */
.l-container-content {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (width >= 769px) {
  .l-container-content {
    width: min(90%, var(--hub-container-width-content, 800px));
    max-width: 800px;
    padding-inline: 0;
  }
}

/* container-posts */
.l-container-posts {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (width >= 641px) {
  .l-container-posts {
    width: min(95%, var(--hub-container-width-posts, 700px));
    max-width: 700px;
    padding-inline: 0;
  }
}

@media (width >= 769px) {
  .l-container-posts {
    width: min(90%, var(--hub-container-width-posts, 700px));
  }
}

/* container-cards */
.l-container-cards {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
  min-block-size: 130px;
}

@media (width >= 481px) {
  .l-container-cards {
    width: min(95%, 100%);
    padding-inline: 0;
  }
}

@media (width >= 769px) {
  .l-container-cards {
    width: min(90%, var(--hub-container-width-cards, 900px));
    max-width: 900px;
  }
}

/* section */
.l-section {
  padding-block: 2rem;
}

@media (width >= 769px) {
  .l-section {
    padding-block: 3rem;
  }
}

@media (width >= 1025px) {
  .l-section {
    padding-block: 4rem;
  }
}

/* ================================================================
   LAYOUT - ヘッダー
   ================================================================ */
.l-header {
  padding-block: 1.75rem;
  padding-inline: 0.5rem;
  transition: all 0.2s ease-out;
  border-bottom: 1px solid rgb(0 0 0 / 5%);
  backdrop-filter: blur(20px);
}

@media (width >= 481px) {
  .l-header {
    padding-block: 1.75rem;
    padding-inline: 1rem;
  }
}

@media (width >= 769px) {
  .l-header {
    padding-block: 0;
    padding-inline: 2rem;
  }
}

.l-header.scrolled {
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 10%);
}

/* header-nav */
.l-header__nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  height: 100%;
  margin-inline: auto;
}

@media (width >= 769px) {
  .l-header__nav {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* header-logo */
.l-header__logo {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: var(--min-touch-area);
  min-height: var(--min-touch-area);
  padding-inline: 0.5rem;
  border-radius: 0.25rem;
  color: var(--color-text-dark);
  font-size: var(--font-size-base);
  font-weight: 700;
  transition: color 0.2s ease-out;
  order: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (width >= 1025px) {
  .l-header__logo {
    font-size: 22px;
  }
}

.l-header__logo:hover {
  color: var(--hub-primary);
}

.l-header__logo-family {
  margin-inline-end: 0.25em;
}

/* header-nav-list */
.l-header__nav-list {
  display: grid;
  place-items: center center;
  gap: 0.25rem;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  order: 2;
}

@media (width >= 481px) {
  .l-header__nav-list {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    max-width: none;
  }
}

@media (width >= 769px) {
  .l-header__nav-list {
    gap: 1.5rem;
  }
}

@media (width >= 1200px) {
  .l-header__nav-list {
    gap: 2rem;
  }
}

/* header-nav-link */
.l-header__nav-link {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: var(--min-touch-area);
  min-height: var(--min-touch-area);
  padding-inline: 0.5rem;
  border-radius: 0.25rem;
  font-size: var(--font-size-base);
  font-weight: 500;
  transition: color 0.2s ease-out;
  white-space: nowrap;
}

@media (width >= 481px) {
  .l-header__nav-link {
    padding-inline: 0.75rem;
  }
}

@media (width >= 769px) {
  .l-header__nav-link {
    padding-inline: 1rem;
    font-size: 20px;
  }
}

.l-header__nav-link:hover {
  color: var(--hub-primary);
}

.l-header__nav-link::after {
  position: absolute;
  inset-block-end: 6px;
  inset-inline-start: 50%;
  inline-size: 0;
  block-size: 2px;
  background: var(--hub-primary);
  transform: translateX(-50%);
  transition: all 0.2s ease-out;
  content: "";
}

.l-header__nav-link:hover::after,
.l-header__nav-link:focus-visible::after {
  inline-size: calc(100% - 1.5rem);
}

/* ================================================================
   LAYOUT - フッター
   ================================================================ */
.l-footer {
  padding-block: 2rem;
  padding-inline: 0;
  background: var(--color-text-dark);
  color: var(--color-text-light);
  text-align: center;
}

@media (width >= 1025px) {
  .l-footer {
    padding-block: 3rem;
  }
}

/* footer-nav */
.l-footer__nav {
  display: grid;
  place-items: center center;
  gap: 0.25rem;
  width: 100%;
  max-width: 280px;
  margin-block: 0 1.5rem;
  margin-inline: auto;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

@media (width >= 481px) {
  .l-footer__nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    max-width: none;
  }
}

@media (width >= 769px) {
  .l-footer__nav {
    gap: 1.5rem;
  }
}

@media (width >= 1025px) {
  .l-footer__nav {
    gap: 2rem;
    margin-block-end: 2rem;
  }
}

/* footer-nav-link */
.l-footer__nav-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: var(--min-touch-area);
  min-height: var(--min-touch-area);
  padding-inline: 0.5rem;
  border-radius: 0.25rem;
  color: var(--color-text-light);
  font-size: var(--font-size-base);
  font-weight: 500;
  transition: color 0.2s ease-out;
  white-space: nowrap;
}

@media (width >= 481px) {
  .l-footer__nav-link {
    padding-inline: 0.75rem;
  }
}

@media (width >= 769px) {
  .l-footer__nav-link {
    padding-inline: 1rem;
    font-size: 20px;
  }
}

.l-footer__nav-link:hover {
  color: var(--hub-primary);
}

/* footer-copyright */
.l-footer__copyright {
  padding-block-start: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 10%);
  color: var(--color-text-muted-accessible);
  font-size: 0.9rem;
}

@media (width >= 1025px) {
  .l-footer__copyright {
    padding-block-start: 2rem;
  }
}

/* ================================================================
   COMPONENT - セクションヘッダー
   ================================================================ */
.c-section-header {
  margin-block-end: 2rem;
  text-align: center;
}

@media (width >= 1025px) {
  .c-section-header {
    margin-block-end: 4rem;
  }
}

.c-section-header__title {
  margin-block-end: 1rem;
  color: var(--color-text-dark);
  font-size: 1.6rem;
  font-weight: 300;
}

@media (width >= 1025px) {
  .c-section-header__title {
    margin-block-end: 1.5rem;
    font-size: 1.875rem;
  }
}

.c-section-header__description {
  color: #404851;
  font-size: var(--font-size-base);
}

/* ================================================================
   COMPONENT - カード
   ================================================================ */
.c-card {
  padding: 1.25rem;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%);
  color: var(--color-text-dark);
  contain: layout style paint;
  transform: translateZ(0);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.c-card:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 10%);
  transform: translate3d(0, -4px, 0) scale(1.01);
}

@media (width >= 769px) {
  .c-card:hover {
    transform: translate3d(0, -8px, 0) scale(1.02);
  }
}

/* card__icon */
.c-card__icon {
  border-radius: 50%;
  background: rgb(0 0 0 / 5%);
  transition: transform 0.2s ease-out, background 0.2s ease-out;
}

.c-card:hover .c-card__icon {
  background: rgb(255 255 255 / 20%);
  transform: scale(1.1);
}

/* ================================================================
   COMPONENT - ボタン
   ================================================================ */
.c-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  min-width: var(--min-touch-area);
  min-height: var(--min-touch-area);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: var(--font-size-base);
  font-weight: 600;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

@media (width >= 1025px) {
  .c-button {
    padding: 1rem 2rem;
  }
}

.c-button--pianist {
  background: linear-gradient(135deg, #3182ce 0, #2c5aa0 100%);
  color: var(--color-text-light);
}

.c-button--studio {
  background: linear-gradient(135deg, #38a169 0, #2f855a 100%);
  color: var(--color-text-light);
}

.c-button--lab {
  background: linear-gradient(135deg, #ed8936 0, #dd6b20 100%);
  color: var(--color-text-light);
}

.c-button--pianist:hover,
.c-button--studio:hover,
.c-button--lab:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%);
  transform: scale(1.05);
}

/* ================================================================
   PAGE - ヒーローセクション
   ================================================================ */
.hero {
  background: linear-gradient(
      135deg,
      rgb(102 126 234 / 15%) 0%,
      rgb(118 75 162 / 15%) 50%,
      rgb(56 161 105 / 15%) 100%
    ),
    url("/public/images/hero-image.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.hero::after {
  position: absolute;
  z-index: 2;
  inline-size: 200%;
  block-size: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="3" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="1" fill="rgba(255,255,255,0.15)"/></svg>');
  transform: translate3d(-50%, -50%, 0) rotate(0deg);
  animation: float 20s infinite linear;
  content: "";
  will-change: transform;
}

.hero .l-container-content {
  position: relative;
  z-index: 3;
  padding-block-start: 2rem;
  opacity: 0;
  animation: fade-in-up 1s ease forwards 0.5s;
}

/* hero__title */
.hero__title {
  margin-block-end: 1rem;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  text-shadow: 2px 2px 4px rgb(0 0 0 / 80%);
}

@media (width >= 1025px) {
  .hero__title {
    margin-block-end: 1.5rem;
  }
}

.hero__family-name {
  margin-inline-end: 0.5em;
}

/* hero__subtitle */
.hero__subtitle {
  margin-block-end: 1.5rem;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 300;
  text-shadow: 2px 2px 2px rgb(0 0 0 / 70%);
}

@media (width >= 1025px) {
  .hero__subtitle {
    margin-block-end: 2rem;
  }
}

/* hero__description */
.hero__description {
  margin-block-end: 3rem;
  padding: 1.5rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 1rem;
  background: rgb(0 0 0 / 20%);
  backdrop-filter: blur(10px);
  font-size: var(--font-size-base);
  line-height: 1.7;
  text-align: justify;
  text-shadow: 2px 2px 2px rgb(0 0 0 / 70%);
}

@media (width >= 1025px) {
  .hero__description {
    margin-block-end: 4rem;
    padding: 2rem;
    font-size: 1.125rem;
  }
}

/* ================================================================
   PAGE - ビジネスセクション
   ================================================================ */
.business-section {
  content-visibility: auto;
  contain-intrinsic-size: 450px;
}

@media (width >= 481px) {
  .business-section {
    contain-intrinsic-size: 420px;
  }
}

@media (width >= 769px) {
  .business-section {
    contain-intrinsic-size: 360px;
  }
}

@media (width >= 1025px) {
  .business-section {
    contain-intrinsic-size: 340px;
  }
}

/* business-card */
.business-card {
  position: relative;
  border-inline-start: 4px solid transparent;
  overflow: hidden;
}

.business-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -100%;
  inline-size: 100%;
  block-size: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(255 255 255 / 40%),
    transparent
  );
  transition: inset-inline-start 0.5s;
}

.business-card:hover::before {
  inset-inline-start: 100%;
}

.business-card--pianist {
  border-inline-start-color: var(--color-pianist);
}

.business-card--pianist:hover {
  background: linear-gradient(135deg, #4299e1 0, #3182ce 100%);
  color: var(--color-text-light);
}

.business-card--studio {
  border-inline-start-color: var(--color-studio);
}

.business-card--studio:hover {
  background: linear-gradient(135deg, #48bb78 0, #38a169 100%);
  color: var(--color-text-light);
}

.business-card--lab {
  border-inline-start-color: var(--color-lab);
}

.business-card--lab:hover {
  background: linear-gradient(135deg, #f6ad55 0, #ed8936 100%);
  color: var(--color-text-light);
}

@media (width >= 1025px) {
  .business-card .c-card__icon {
    margin-inline: auto;
  }
}

/* ================================================================
   PAGE - 注目情報セクション
   ================================================================ */
.highlight-section {
  scroll-margin-top: var(--header-height-compact);
}

@media (width >= 481px) {
  .highlight-section {
    scroll-margin-top: var(--header-height-medium);
  }
}

@media (width >= 769px) {
  .highlight-section {
    scroll-margin-top: var(--header-height-wide);
  }
}

/* posts-list */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (width >= 1025px) {
  .posts-list {
    gap: 2rem;
  }
}

.posts-list__item {
  display: contents;
}

/* post-card */
.post-card {
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-inline-start: 3px solid transparent;
  text-align: center;
}

@media (width >= 641px) {
  .post-card {
    flex-direction: row;
    gap: 1.5rem;
    padding: 2rem;
    text-align: start;
  }

  .post-card .c-card__content {
    text-align: start;
  }

  .post-meta {
    justify-content: flex-start;
  }
}

.post-card--pianist {
  border-inline-start-color: var(--color-pianist);
}

.post-card--pianist:hover {
  border-inline-start-color: #2c5aa0;
  background: rgb(49 130 206 / 10%);
}

.post-card--studio {
  border-inline-start-color: var(--color-studio);
}

.post-card--studio:hover {
  border-inline-start-color: #2f855a;
  background: rgb(56 161 105 / 10%);
}

.post-card--lab {
  border-inline-start-color: var(--color-lab);
}

.post-card--lab:hover {
  border-inline-start-color: #dd6b20;
  background: rgb(237 137 54 / 10%);
}

/* post-meta */
.post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-block-end: 0.5rem;
}

.post-category {
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card--pianist .post-category {
  background: #2c5aa0;
  color: var(--color-text-light);
}

.post-card--studio .post-category {
  background: #22543d;
  color: var(--color-text-light);
}

.post-card--lab .post-category {
  background: #c05621;
  color: var(--color-text-light);
}

.post-date {
  color: #404851;
  font-size: 0.9rem;
}

.post-card .c-card__icon {
  width: 50px;
  height: 50px;
  margin-inline: auto;
  font-size: 1.25rem;
}

/* ================================================================
   PAGE - コンタクトセクション
   ================================================================ */
.contact-section,
#contact {
  scroll-margin-top: var(--header-height-compact);
}

@media (width >= 481px) {
  .contact-section,
  #contact {
    scroll-margin-top: var(--header-height-medium);
  }
}

@media (width >= 769px) {
  .contact-section,
  #contact {
    scroll-margin-top: var(--header-height-wide);
  }
}

/* contact-grid */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (width >= 1025px) {
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.contact-grid__item {
  display: contents;
}

/* contact-card */
.contact-card {
  position: relative;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid rgb(0 0 0 / 5%);
  text-align: center;
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -100%;
  inline-size: 100%;
  block-size: 4px;
  transition: inset-inline-start 0.3s ease-out;
}

.contact-card:hover::before {
  inset-inline-start: 0;
}

.contact-card--pianist::before {
  background: linear-gradient(135deg, #3182ce 0, #2c5aa0 100%);
}

.contact-card--studio::before {
  background: linear-gradient(135deg, #38a169 0, #2f855a 100%);
}

.contact-card--lab::before {
  background: linear-gradient(135deg, #ed8936 0, #dd6b20 100%);
}

/* ================================================================
   ACCESSIBILITY - アクセシビリティ対応
   ================================================================ */
.l-header__logo:focus-visible,
.l-header__nav-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  background: rgb(102 126 234 / 10%);
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::after,
  ::before {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .c-card:hover {
    transform: none;
  }

  .c-card:hover .c-card__icon {
    transform: none;
  }

  .js-animate,
  .business-card,
  .post-card,
  .contact-card {
    opacity: 1 !important;
    transform: none !important;
    will-change: auto !important;
    visibility: visible !important;
  }

  .hero .l-container-content {
    animation: none !important;
    opacity: 1 !important;
  }
}

@media (prefers-contrast: high) {
  .l-header {
    border-bottom: 2px solid var(--color-text-dark);
  }

  .l-header__logo,
  .l-header__nav-link {
    font-weight: 600;
  }
}

@media print {
  .l-header,
  .l-footer {
    display: none;
  }

  .hero {
    background: none;
    color: black;
    page-break-after: always;
  }

  .business-card,
  .post-card,
  .contact-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
