/* Common */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --page-fade-duration: 450ms;
  --page-fade-easing: cubic-bezier(0.22, 0.9, 0.36, 1);
  --primary-red: #E50914;
  --secondary-red: #FFDFDF;
  --thirdly-red: #B8070F;
  --main-text-color: #414143;
  --white: #FDFDFD;
  --dark-gray: #1d1d1f;
  --light-gray: #f5f5f7;
  --border-light: #d2d2d7;
  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.12);
  --blur: blur(20px);

  /* Spacing */
  /* Font Sizes */
  --text-hero: clamp(4.5rem, 12vw, 8rem);
  /* Responsive Hero Text: Min size increased for tablets */
  /* Responsive Hero Text */
  /* Responsive Headings */
  --text-h1: clamp(var(--sp-10), 5vw, 3.5rem);
  --text-h2: clamp(1.8rem, 4vw, var(--sp-10));
  --text-h3: clamp(1.2rem, 3vw, 1.5rem);
  --text-body: 1rem;
  --text-sm: 0.9rem;
  --text-xs: 0.8rem;

  /* Radius System */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --radius-none: 0;
  /* Explicit none */

  /* Z-Index System */
  --z-negative: -1;
  --z-base: 0;
  --z-normal: 1;
  --z-elevated: 10;
  --z-sticky: 100;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-max: 9999;

  /* Typography System (additions) */
  /* Using existing vars where possible, adding standard sizes */
  /* --text-body: 1rem is already defined */
  /* --text-sm: 0.9rem is already defined */
  /* --text-xs: 0.8rem is already defined */

  /* Spacing System (4px Grid) */
  --sp-1: 0.25rem;
  /* 4px */
  --sp-2: 0.5rem;
  /* 8px */
  --sp-3: 0.75rem;
  /* 12px */
  --sp-4: 1rem;
  /* 16px */
  --sp-6: 1.5rem;
  /* 24px */
  --sp-8: 2rem;
  /* 32px */
  --sp-10: 2.5rem;
  /* 40px */
  --sp-12: 3rem;
  /* 48px */
  --sp-16: 4rem;
  /* 64px */
  --sp-20: 5rem;
  /* 80px */
  --sp-24: 6rem;
  /* 96px */
  --sp-32: 8rem;
  /* 128px */

  /* Legacy mapping (to be removed if unused, or mapped to new system) */
  --space-xs: var(--sp-2);
  --space-sm: var(--sp-4);
  --spacing-md: var(--sp-8);
  --spacing-lg: var(--sp-16);
  --spacing-xl: var(--sp-24);
}

body {
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  font-weight: 400;
  /* Regular weight for DM Sans */
  font-size: var(--text-body);
  color: var(--main-text-color);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  transition: opacity var(--page-fade-duration) var(--page-fade-easing);
}

.page-enter {
  opacity: 0;
}

.page-enter-active {
  opacity: 1;
  transition: opacity var(--page-fade-duration) var(--page-fade-easing);
}

.page-leave-active {
  opacity: 0;
  transition: opacity var(--page-fade-duration) var(--page-fade-easing);
}

.page-leaving {
  pointer-events: none;
}

/* Fonts - Refactored based on Feedback (Return to Raleway) */
h1,
h2,
h3,
.logo,
.section-title,
header,
footer,
nav,
.btn {
  font-family: 'Raleway', sans-serif;
}

/* Override for Hero */
.hero-content h1 {
  font-family: 'Playfair Display', serif;
}



.section {
  padding: var(--sp-24) 0;
}

.section-title {
  text-align: center;
  font-size: var(--text-h2);
  font-weight: 700;
  margin-bottom: var(--sp-10);
  color: var(--main-text-color);
}

h1 {
  font-size: var(--text-h1);
  line-height: 1.2;
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.3;
}

h3 {
  font-size: var(--text-h3);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--thirdly-red);
  outline-offset: 3px;
}

/* Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 56px;
  width: 200px;
  height: 56px;
  font-size: var(--text-body);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-none);
  transition: background .3s, color .3s, transform .2s;
  padding: 0 var(--sp-8);
  box-shadow: var(--shadow-subtle);
}

.btn-forward {
  background: var(--primary-red);
  color: var(--white);
}

.btn-forward:hover {
  background: var(--thirdly-red);
  transform: translateY(-4px);
  /* Unified lift */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  /* Unified shadow */
}

.btn-back {
  background: var(--white);
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
}

.btn-back:hover {
  background: var(--primary-red);
  color: var(--white);
  transform: translateY(-4px);
  /* Unified lift */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  /* Unified shadow */
}

.button-container {
  text-align: center;
  margin-top: var(--spacing-md);
}

/* Design Portfolio Button (Windows 95 Style) */
.btn-design {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #C0C0C0;
  color: #000000;
  border: none;
  box-shadow:
    inset 2px 2px #FFFFFF,
    inset -2px -2px #808080,
    1.5px 1.5px 0px 0.5px #000000;
  padding: 0.6rem 1.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-none);
  text-decoration: none;
  transition: none;
  margin-top: var(--sp-4);
  margin-bottom: 0;
  font-family: 'MS Sans Serif', 'Arial', sans-serif;
  letter-spacing: 0.5px;
}

.btn-design:active {
  box-shadow:
    inset 2px 2px #808080,
    inset -2px -2px #FFFFFF;
  transform: translate(1px, 1px);
}

.btn-design:hover {
  /* Win95 buttons don't usually have hover states, keeping it simple or maybe mostly unchanged */
  cursor: pointer;
}

.btn-design:hover .arrow {
  transform: none;
}

.btn-design .arrow {
  display: inline-block;
  font-family: sans-serif;
  font-size: 1.1em;
}

/* Header */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  z-index: var(--z-modal);
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4) var(--sp-8);
  height: 72px;
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
}

.hamburger-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--primary-red);
  border-radius: var(--radius-full);
  transition: transform .35s, opacity .25s;
}

.hamburger-bar+.hamburger-bar {
  margin-top: 6px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--main-text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--primary-red);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--sp-8);
}

.nav-links a {
  text-decoration: none;
  color: var(--main-text-color);
  font-weight: 400;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-red);
}

/* Hero */
.hero {
  padding: 0 !important;
  height: 100vh;
  height: 100dvh;
  /* background: url("img/hero.png") ... は削除し、疑似要素で設定 */
  display: flex;
  flex-direction: column;
  /* Stack content vertically */
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: var(--z-normal);
}

/* Slider Container */
.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-negative);
}

/* Hero Overlay */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-base);
  background: rgba(255, 255, 255, 0.2);
  /* Default for Red text: Subtle light */
  transition: background 1.5s ease;
  pointer-events: none;
}

/* Individual Slide */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}



.hero-content h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  margin-bottom: var(--sp-6);
  color: var(--primary-red);
  position: relative;
  display: inline-block;
  font-family: 'Playfair Display', serif;
  transition: color 1.5s ease;
  z-index: var(--z-normal);
  /* Ensure above overlay */
  /* Sync transition with slider */
}

.hero-content .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin-bottom: var(--sp-12);
  color: var(--main-text-color);
  max-width: 600px;
  margin-inline: auto;
  position: relative;
  z-index: var(--z-normal);
}

.scroll-indicator {
  display: block;
  font-size: clamp(var(--sp-10), 6vw, 3rem);
  /* Responsive Arrow Size: Min size increased */
  color: var(--primary-red);
  animation: arrowFloat 1.5s ease-in-out infinite;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1.5rem;
  transition: color 1.5s ease;
  z-index: var(--z-normal);
  /* Sync transition with slider */
}

@keyframes arrowFloat {

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

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

/* Hero Quote */
.hero-quote {
  position: absolute;
  bottom: 3rem;
  right: 3rem;
  text-align: right;
  font-family: 'Playfair Display', serif;
  color: var(--primary-red);
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: 1.2;
  z-index: 2;
  /* Higher than content to sit on top if needed, 2 is safe */
  pointer-events: none;
  transition: color 1.5s ease;
  /* Sync transition with slider */
}

/* White Text Mode (for hero2) */
.hero.hero-text-white .hero-content h1,
.hero.hero-text-white .hero-quote,
.hero.hero-text-white .scroll-indicator {
  color: var(--white);
}

.hero.hero-text-white .hero-overlay {
  background: rgba(0, 0, 0, 0.4);
  /* Dark overlay for White text */
}

/* Black Text Mode (for hero3) */
.hero.hero-text-black .hero-content h1,
.hero.hero-text-black .hero-quote,
.hero.hero-text-black .scroll-indicator {
  color: var(--dark-gray);
}

.hero.hero-text-black .hero-overlay {
  background: rgba(255, 255, 255, 0.6);
  /* Strong light overlay for Black text */
}

/* About */
.about {
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5rem;
  justify-content: center;
  align-items: center;
}

.profile-img {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.profile-img img.about-icon {
  width: 100%;
  height: auto;
}

.about-content h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  margin-bottom: var(--sp-6);
  color: var(--main-text-color);
}

.about-content p {
  margin-bottom: 1.4rem;
  line-height: 1.8;
}

.about-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
}

.tool-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tool-icon:hover {
  transform: translateY(-4px) scale(1.1);
}

/* Works */
.works {
  background: var(--secondary-red);
}

.section-intro {
  text-align: center;
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1em;
  margin-bottom: 2.2em;
  color: var(--main-text-color);
  font-family: 'DM Sans', sans-serif;
}

/* Works Filter */
.works-filter {
  display: flex;
  justify-content: flex-start;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--main-text-color);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  font-weight: 500;
  font-size: var(--text-sm);
  width: 80px;
  text-align: center;
  display: inline-block;
  white-space: nowrap;
}

.filter-btn.active {
  background: var(--primary-red);
  color: var(--white);
  border-color: var(--primary-red);
}

.filter-btn:hover {
  background: var(--thirdly-red);
  color: var(--white);
  border-color: var(--thirdly-red);
}

.filter-dropdown {
  display: none;
}

/* Works Grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
  /* More breathing room */
  align-items: stretch;
  margin-bottom: var(--sp-16);
}

.works .works-grid {
  margin-bottom: 0;
  /* Remove extra spacing to match Contact section (just button margin) */
}

/* Works Archive (List Page) overrides */
.works-grid.works-archive {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  /* Modern responsive grid */
}

/* Archive: Hide Description and Tools */
.works-grid.works-archive .work-description,
.works-grid.works-archive .work-tools {
  display: none;
}

/* Archive: Adjust card padding/height if needed */
.works-grid.works-archive .work-content {
  padding: 1rem 1.2rem;
  height: auto;
}

/* Archive: Smaller fonts for compact view */
.works-grid.works-archive .work-title {
  font-size: var(--text-body);
}

.works-grid.works-archive .work-category {
  font-size: 0.75rem;
}

/* Work Card */
.work-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  /* More rounded */
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  /* Softer shadow */
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.05);
  /* Subtle border */
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Grid内で高さを揃える */
  animation: fadeInUp 0.6s ease-out backwards;
}

.work-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(229, 9, 20, 0.15);
  /* Colored shadow on hover */
  border-color: rgba(229, 9, 20, 0.3);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered Animation for Archive */
.works-grid.works-archive .work-card:nth-child(1) {
  animation-delay: 0.05s;
}

.works-grid.works-archive .work-card:nth-child(2) {
  animation-delay: 0.1s;
}

.works-grid.works-archive .work-card:nth-child(3) {
  animation-delay: 0.15s;
}

.works-grid.works-archive .work-card:nth-child(4) {
  animation-delay: 0.2s;
}

.works-grid.works-archive .work-card:nth-child(5) {
  animation-delay: 0.25s;
}

.works-grid.works-archive .work-card:nth-child(6) {
  animation-delay: 0.3s;
}

.works-grid.works-archive .work-card:nth-child(7) {
  animation-delay: 0.35s;
}

.works-grid.works-archive .work-card:nth-child(8) {
  animation-delay: 0.4s;
}

.works-grid.works-archive .work-card:nth-child(n+9) {
  animation-delay: 0.45s;
}

/* Work Image */
/* Work Image */
.work-image {
  height: 220px;
  /* Slightly taller */
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.work-image img {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-card:hover .work-image img {
  transform: scale(1.1);
  /* Zoom effect */
}

/* Work Preview */
.work-preview {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  /* Updated to 0 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--white);
  font-size: var(--text-sm);
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
}

/* Work Content */
.work-content {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* 余った領域を埋める */
}

/* 1. Category */
.work-category {
  font-size: 0.75rem;
  /* 少し小さめに */
  color: var(--white);
  background: var(--primary-red);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
  font-family: 'DM Sans', sans-serif;
  align-self: flex-start;
  /* 幅をテキストに合わせる */
}

/* 2. Title */
.work-title {
  font-size: 1.15rem;
  /* 1.25rem -> 1.15rem */
  font-weight: 500;
  /* 700 -> 500 (Medium) に変更して太字感を軽減 */
  margin-bottom: var(--sp-4);
  color: var(--main-text-color);
  line-height: 1.3;
  font-family: 'DM Sans', sans-serif;
  /* RalewayをやめてDM Sansに変更 */
}

/* 3. Description */
.work-description {
  color: var(--medium-gray);
  font-size: var(--text-sm);
  /* 0.95rem -> 0.9rem */
  line-height: 1.6;
  margin-bottom: var(--sp-6);
  /* 複数行省略 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  /* Standard property */
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
  /* 余白を埋める */
}

/* 4. Tools (Bottom) */
.work-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: auto;
  /* 一番下に配置 */
}

.work-tag {
  background: var(--light-gray);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  color: var(--main-text-color);
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
}

/* Works Note */
.works-note {
  text-align: center;
  color: var(--medium-gray);
  font-size: var(--text-body);
  margin-top: -1rem;
  margin-bottom: var(--sp-12);
  line-height: 1.6;
}

/* Work Detail */
.work-detail-page {
  background: var(--white);
  padding: 120px 2rem 0;
  margin: 0 auto;
  max-width: 900px;
}

.work-detail-main {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: var(--sp-10);
  margin-bottom: var(--sp-10);
}

.work-detail-main-icon {
  text-align: center;
}

.work-detail-main-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

.work-detail-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--sp-2);
  color: var(--dark-gray);
  text-align: left;
}

.work-detail-section {
  margin: var(--sp-10) 0;
}

.work-detail-section:first-of-type {
  margin-top: 0;
}

.work-detail-section h2 {
  font-size: var(--text-h2);
  font-weight: 600;
  margin-bottom: var(--sp-4);
  color: var(--dark-gray);
  border-left: 6px solid var(--primary-red);
  padding-left: 0.6rem;
  text-align: left;
}

.work-detail-section .work-description,
.work-detail-section .work-detail {
  max-width: 820px;
  color: var(--main-text-color);
  line-height: 1.6;
  white-space: normal;
}

.work-detail-actions {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-12);
}

/* Blog */
.blog {
  background: var(--white);
}



.blog-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-20);
  /* アイテム間の間隔 */
  margin-bottom: var(--sp-16);
}

.blog .blog-grid {
  margin-bottom: 0;
  /* Fix excessive spacing in Blog section */
}

.blog-item {
  width: 240px;
  /* カード幅 */
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  transition: opacity 0.3s ease;
}

.blog-item:hover {
  opacity: 0.8;
}

.blog-img-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* 正方形 */
  overflow: hidden;
  margin-bottom: var(--sp-4);
  /* 角丸なし */
  border-radius: var(--radius-none);
  border-radius: var(--radius-none);
  background: transparent;
  /* var(--light-gray) -> transparent に変更して白飛び防止 */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 画像コンテナ全体を拡大・浮き上がらせる */
.blog-item:hover .blog-img-container {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.blog-info {
  text-align: left;
}

.blog-title {
  font-size: 1.1rem;
  font-weight: 500;
  /* 700 -> 500 に変更 */
  color: var(--main-text-color);
  margin-bottom: var(--sp-2);
  line-height: 1.4;
  font-family: 'DM Sans', sans-serif;
  /* RalewayをやめてDM Sansに変更 */
}

.blog-genre {
  font-size: var(--text-sm);
  color: var(--medium-gray);
  /* 薄い色 */
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 0;
  /* Ensure no extra spacing at bottom */
}

@media (max-width: 768px) {
  /* Removed flex-direction column override to allow 2-col grid */
  /* kept empty or other rules if any were here */
}

/* Contact */
.contact {
  background: var(--secondary-red);
}

.contact-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.contact-intro {
  margin-bottom: var(--sp-12);
}

.contact-intro h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: var(--sp-6);
  color: var(--main-text-color);
}

.contact-intro p {
  color: var(--medium-gray);
  font-size: var(--text-body);
  line-height: 1.7;
}

.contact-form {
  background: var(--light-gray);
  padding: var(--sp-12);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: var(--sp-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.form-group label {
  margin-bottom: var(--sp-2);
  font-weight: 500;
  color: var(--dark-gray);
  font-size: var(--text-sm);
}

.form-group input,
.form-group textarea {
  padding: 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: var(--text-body);
  background: var(--white);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Footer */
footer {
  background: var(--dark-gray);
  color: var(--white);
  padding: 4rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: var(--sp-12);
}

.footer-section h4 {
  margin-bottom: var(--sp-4);
  color: var(--white);
  font-weight: 600;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--sp-2);
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--primary-red);
}

.social-link {
  display: inline-block;
  margin: 0 8px;
}

.social-link img {
  width: 24px;
  height: 24px;
  display: block;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

.social-link:hover img,
.social-link:focus-visible img {
  transform: translateY(-4px) scale(1.1);
  /* Unified lift */
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #333;
  color: #ccc;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 900px) {

  .works-grid,
  #blogGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) and (min-width: 601px) {
  body {
    font-size: 15px;
  }

  h1,
  .hero-content h1 {
    font-size: 2rem;
  }

  h2,
  .section-title {
    font-size: var(--text-h3);
  }

  .section-intro {
    font-size: 1.1rem;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  h1,
  .hero-content h1 {
    font-size: 1.6rem;
  }

  h2,
  .section-title {
    font-size: 1.25rem;
  }

  .section-intro {
    font-size: var(--text-body);
  }

  .works-grid,
  #blogGrid {
    grid-template-columns: 1fr;
  }

  /* Works Archive Mobile: Compact List View */
  .works-grid.works-archive {
    grid-template-columns: 1fr;
    /* 1列に戻す */
    gap: 0.75rem;
    /* 隙間を詰める */
  }

  /* カードを横長（リスト形式）にする */
  .works-grid.works-archive .work-card {
    display: flex;
    flex-direction: row;
    height: 100px;
    /* コンパクトな高さ固定 */
    align-items: center;
  }

  /* 画像を左側に配置 */
  .works-grid.works-archive .work-image {
    width: 100px;
    height: 100%;
    flex-shrink: 0;
    border-right: 1px solid var(--light-gray);
    /* 境界線 */
  }

  .works-grid.works-archive .work-preview img {
    width: 60px;
    /* アイコンサイズ調整 */
    height: 60px;
  }

  /* コンテンツを右側に */
  .works-grid.works-archive .work-content {
    padding: 0 1rem;
    padding-top: 0.5rem;
    /* 上に少し余白 */
    height: 100%;
    width: 100%;
    justify-content: flex-start;
    /* 上寄せ */
    align-items: flex-start;
    /* 左寄せ */
  }

  .works-grid.works-archive .work-category {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
    padding: 0.15rem 0.5rem;
  }

  .works-grid.works-archive .work-title {
    font-size: 0.95rem;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2000;
    /* Ensure above the drawer */
  }

  /* Glassmorphism Side Drawer */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    /* Reset left */
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--white);
    /* Solid background for max readability */
    /* backdrop-filter removed */
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    /* Hidden to the right */
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    /* Smooth ease */
    max-height: none;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    /* Center items vertically */
    z-index: var(--z-modal);
  }

  .nav-links.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
    max-height: none;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
  }

  .nav-links a {
    display: block;
    font-size: 1.1rem;
    padding: 0.8rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }

  .about-content,
  .about-content h3,
  .about-content p {
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--sp-8);
  }

  /* Works filter: scrollable tabs on mobile */
  .works-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin-bottom: var(--sp-6);
    scrollbar-width: none;
  }

  .works-filter::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex: 0 0 auto;
  }

  .works-filter .filter-btn {
    display: none;
  }

  .works-filter .filter-dropdown {
    display: block;
    min-width: 100px;
    max-width: 50%;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 1rem;
  }

  .container,
  .contact-container {
    padding: 0 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .hero-content h1 {
    font-size: var(--sp-10);
  }

  .work-detail-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--sp-6);
  }

  .work-detail-actions .btn-forward {
    order: 1;
  }

  .work-detail-actions .btn-back {
    order: 2;
  }
}

/* 404 Page */
.error-404 {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.error-layout {
  display: flex;
  align-items: center;
  gap: 5rem;
  justify-content: center;
}

.error-image {
  flex: 0 0 256px;
  width: 256px;
}

.error-img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.error-text {
  flex: 1;
  text-align: left;
}

.error-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: var(--sp-8);
  font-family: 'Playfair Display', serif;
}

.error-message {
  font-size: 1.1rem;
  color: var(--main-text-color);
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}

.error-action {
  display: flex;
  justify-content: flex-start;
}

/* 404 Responsive */
@media (max-width: 768px) {

  /* Unified Mobile Section Spacing */
  .section {
    padding: var(--sp-16) 0;
  }

  /* 404 Responsive */
  .error-layout {
    flex-direction: column;
    gap: var(--sp-8);
  }

  .error-image {
    width: 200px;
  }

  .error-text {
    text-align: center;
  }

  .error-action {
    justify-content: center;
  }

  .error-title {
    font-size: var(--sp-10);
  }

  .error-message {
    font-size: var(--text-body);
  }

  /* Works & Blog Grid mobile: Revert to 1-column stack */
  .works-grid,
  .blog-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-10);
    /* Reduced from 5rem to var(--sp-10) */
    grid-template-columns: none;
  }

  .blog-item {
    width: 100%;
    max-width: 320px;
  }

  /* Ensure work-card behaves like blog-item in this view */
  .work-card {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
  }

  .work-image {
    width: 100%;
    height: 220px;
    /* Revert to default height */
  }

  .work-content {
    display: flex;
    /* Revert to default block/flex col behavior */
  }

  .work-description,
  .work-tools {
    display: -webkit-box;
    /* Re-show details */
    /* display: flex for tools */
  }

  .work-tools {
    display: flex;
  }

  /* Reset specific works archive fix if any */
  .works-grid.works-archive {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 900px) {

  /* Hide the site name as requested to reduce clutter */
  /* Show hero quote on mobile below Hello */
  .hero-quote {
    display: block;
    position: static;
    text-align: center;
    width: 100%;
    margin-top: var(--sp-4);
    font-size: var(--text-h2);
    /* Respomsive size */
  }
}

@media (max-width: 480px) {
  .error-title {
    font-size: 2rem;
  }

  .error-404 {
    min-height: 50vh;
  }

  .error-layout {
    gap: var(--sp-6);
  }

  .error-image {
    width: 150px;
  }
}

/* Utility */
.br-mobile {
  display: none;
}

@media (max-width: 600px) {
  .br-mobile {
    display: inline;
  }
}

@media (hover: none) and (pointer: coarse) {

  .work-card:hover,
  .work-card:focus {
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
}

/* =========================================
   New Work Detail Page Styles
   ========================================= */

/* --- Hero Section --- */
.work-hero {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  /* 上品なグレーグラデ */
  padding: 140px 0 80px;
  /* Header分の余白込み */
  margin-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.work-hero-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.work-hero-content {
  position: relative;
  z-index: 2;
}

.work-hero-meta {
  margin-bottom: var(--sp-6);
}

.hero-badge {
  display: inline-block;
  background: var(--primary-red);
  /* dark-gray -> primary-red */
  color: var(--white);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.work-hero-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--sp-6);
  color: var(--dark-gray);
  letter-spacing: -0.02em;
}

.work-hero-desc {
  font-size: 1.1rem;
  color: var(--medium-gray);
  line-height: 1.6;
  margin-bottom: var(--sp-10);
  max-width: 90%;
}

.work-hero-actions .btn {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-body);
  border-radius: var(--radius-full);
  /* 丸み強め */
  transition: all 0.3s ease;
  background: var(--white);
  color: var(--primary-red);
  font-weight: 700;
}

.work-hero-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hero Visual (Right Side) */
.work-hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-img-entity {
  width: 100%;
  max-width: 320px;
  /* アイコンサイズ制限 */
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  /* 浮遊感のある影 */
  transform: rotate(-3deg);
  /* 少し傾けて遊び心 */
  transition: transform 0.3s ease;
}

.hero-img-entity:hover {
  transform: rotate(0deg) scale(1.02);
}

/* --- Main Layout (Grid) --- */
.work-grid-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  /* Main : Sidebar */
  gap: 4rem;
  margin-bottom: 6rem;
}

/* Left Column */
.work-main-column {
  min-width: 0;
  /* Grid overflow防止 */
}

.work-section {
  margin-bottom: 4rem;
}

.work-h2 {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--dark-gray);
  margin-bottom: var(--sp-6);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-red);
  /* light-gray -> primary-red */
  display: inline-block;
}

.work-text {
  font-size: var(--text-body);
  line-height: 1.8;
  color: var(--main-text-color);
}

/* Footer Nav (Back link) */
.work-footer-nav {
  margin-top: var(--sp-8);
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.btn-text-back {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--medium-gray);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.btn-text-back:hover {
  color: var(--primary-red);
}

/* --- Sidebar (Right Column) --- */
.work-sidebar-column {
  position: relative;
}

.sticky-sidebar {
  position: sticky;
  top: 100px;
  /* Header分の余白 */
  background: var(--white);
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.sidebar-group {
  margin-bottom: var(--sp-8);
}

.sidebar-group:last-child {
  margin-bottom: 0;
}

.sidebar-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--medium-gray);
  margin-bottom: var(--sp-4);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sidebar-value {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--dark-gray);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.sidebar-tag {
  background: var(--light-gray);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--dark-gray);
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
  .work-hero-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .work-hero-visual {
    order: -1;
    /* 画像を上に */
    margin-bottom: var(--sp-4);
  }

  .hero-img-entity {
    max-width: 200px;
  }

  .work-hero-title {
    font-size: 2.2rem;
  }

  .work-hero-desc {
    margin: 0 auto 2rem;
  }

  .work-grid-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .work-sidebar-column {
    order: -1;
    /* サイドバー（メタ情報）を上に持ってくる */
    margin-bottom: var(--sp-8);
  }

  .sticky-sidebar {
    position: static;
    /* Sticky解除 */
    background: var(--light-gray);
    /* 背景色をつけて区別 */
    border: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 横並びに */
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .work-hero {
    padding: 100px 0 60px;
  }

  .sticky-sidebar {
    grid-template-columns: 1fr;
    /* モバイルは縦積み */
    gap: 1.5rem;
  }
}