/* ===== First Shutter — ミニマル写真ギャラリー (黒系・余白重視) ===== */

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Accessibility — フォーカスリング (keyboard navigation のみ表示) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid rgba(245, 245, 245, 0.6);
  outline-offset: 4px;
}
html, body { overflow-x: clip; }
body {
  background: #0a0a0a;
  color: #f5f5f5;
  font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.6; }
button { background: none; border: none; color: inherit; cursor: pointer; font: inherit; }

/* ===== Typography ===== */
.serif { font-family: 'Noto Serif JP', 'Times New Roman', serif; }
.en { font-family: 'Inter', sans-serif; letter-spacing: 0.15em; }

h1, h2, h3, h4 { font-weight: 300; letter-spacing: 0.05em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.2; }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.3; }
h3 { font-size: 1.25rem; line-height: 1.4; }

p { margin-bottom: 1.2em; }

/* ===== Layout ===== */
.container { max-width: 1400px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 32px; }
.section { padding: 120px 0; }
.section-sm { padding: 80px 0; }

@media (max-width: 768px) {
  .container, .container-narrow { padding: 0 20px; }
  .section { padding: 80px 0; }
  .section-sm { padding: 60px 0; }
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: 1400px;
  margin: 0 auto;
}
.brand {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  font-weight: 400;
  text-transform: uppercase;
}
.brand small {
  display: block;
  font-size: 0.65rem;
  opacity: 0.5;
  letter-spacing: 0.3em;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  gap: 36px;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.nav-toggle { display: none; }

@media (max-width: 768px) {
  .nav { padding: 14px 20px; }
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: calc(100vh - 60px);
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 40px 20px;
    transform: translateY(-110%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle {
    display: block;
    font-size: 1.5rem;
  }
}

/* ===== Hero (cinematic centered — 写真を画面に必ず収める + テキストを写真の下に独立配置) ===== */
.hero {
  position: relative;
  min-height: 100vh;
  background: #050505;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 100px 24px 80px;
  gap: 32px;
}
.hero-stage {
  position: relative;
  aspect-ratio: 2 / 3;
  /* Cinema item と同サイズに統一: 画面高さの 65% 上限 + 横幅 480px 上限 */
  max-height: 65vh;
  max-width: min(480px, 90vw);
  height: 65vh;
  width: auto;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.hero-text {
  text-align: center;
  pointer-events: none;
}
.hero-title {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  letter-spacing: 0.4em;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  opacity: 0.6;
  text-transform: uppercase;
}
.hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  opacity: 0.5;
  text-transform: uppercase;
  animation: fade-bounce 2.5s infinite;
}
@keyframes fade-bounce {
  0%, 100% { opacity: 0.3; transform: translate(-50%, 0); }
  50% { opacity: 0.7; transform: translate(-50%, 6px); }
}

@media (max-width: 768px) {
  .hero {
    padding: 90px 16px 70px;
    gap: 24px;
  }
  .hero-stage {
    max-height: 60vh;
    height: 60vh;
  }
}

/* ===== Cinema selected (縦型写真を 1 枚ずつ大判で見せる) ===== */
.cinema-section { padding: 0; background: #050505; }
.cinema-item {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 80px 24px;
  gap: 32px;
}
.cinema-image {
  max-width: min(480px, 90vw);
  width: auto;
  height: 65vh;
  max-height: 65vh;
  aspect-ratio: 2 / 3;
}
.cinema-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.cinema-caption {
  text-align: center;
  max-width: 540px;
}
.cinema-caption h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}
.cinema-caption .year {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  opacity: 0.5;
  display: block;
  margin-bottom: 12px;
}
.cinema-caption .note {
  font-size: 0.85rem;
  opacity: 0.65;
  letter-spacing: 0.02em;
}

/* ===== Page Hero (Portfolio/About/Contact) ===== */
.page-hero {
  padding: 180px 32px 80px;
  text-align: center;
}
.page-hero .en-label {
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  opacity: 0.5;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.page-hero h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== Section heading ===== */
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  opacity: 0.5;
  text-transform: uppercase;
  margin-bottom: 16px;
  text-align: center;
}
.section-title {
  text-align: center;
  margin-bottom: 60px;
  font-family: 'Inter', sans-serif;
  font-weight: 200;
}

/* ===== Gallery (縦型優先・写真を切らないアスペクト比) ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 2 / 3;
  background: #050505;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.8s ease, opacity 0.3s ease;
}
.gallery-item:hover img {
  transform: scale(1.04);
  opacity: 0.9;
}
.gallery-item.wide { aspect-ratio: 3 / 2; }
.gallery-item.square { aspect-ratio: 1 / 1; }

/* ===== Filter tabs (Portfolio) ===== */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 60px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.filter-tab {
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}
.filter-tab.active {
  opacity: 1;
  border-bottom-color: #f5f5f5;
}
.filter-tab:hover { opacity: 0.8; }

/* ===== About page ===== */
.about-section {
  max-width: 720px;
  margin: 0 auto;
}
.about-section h2 {
  margin-bottom: 32px;
  font-family: 'Inter', sans-serif;
  font-weight: 200;
}
.about-section p {
  font-size: 1rem;
  margin-bottom: 1.5em;
  opacity: 0.85;
}
.about-divider {
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 60px auto;
}

/* awards/credits リスト */
.credits-list {
  list-style: none;
  padding: 0;
  font-size: 0.95rem;
  opacity: 0.85;
}
.credits-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.credits-list li:last-child { border-bottom: none; }

/* services 一覧 */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin: 40px 0;
}
.service-item {
  text-align: center;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.service-item h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0.6;
}
.service-item p { font-size: 0.95rem; margin: 0; }

/* ===== Contact form ===== */
.contact-form {
  max-width: 560px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 32px;
}
.form-group label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 8px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: #f5f5f5;
  padding: 12px 0;
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}
.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: 2px solid rgba(245, 245, 245, 0.6);
  outline-offset: 2px;
  border-bottom-color: #f5f5f5;
}
.form-group textarea {
  min-height: 120px;
  resize: vertical;
}
.btn-submit {
  display: inline-block;
  background: #f5f5f5;
  color: #0a0a0a;
  padding: 16px 48px;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  cursor: pointer;
  transition: opacity 0.2s ease;
  margin-top: 16px;
}
.btn-submit:hover { opacity: 0.85; }

.contact-info {
  text-align: center;
  margin-top: 80px;
  font-size: 0.9rem;
  opacity: 0.7;
}
.contact-info a {
  display: inline-block;
  margin: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 2px;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 2rem;
  background: none;
  border: none;
  color: #f5f5f5;
  cursor: pointer;
  opacity: 0.7;
  padding: 8px 16px;
  line-height: 1;
  transition: opacity 0.2s ease;
}
.lightbox-close:hover { opacity: 1; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 60px 32px 40px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}
.site-footer p { margin-bottom: 8px; }
.site-footer a {
  display: inline-block;
  margin: 0 8px;
}
.footer-meta {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  margin-top: 20px;
  opacity: 0.5;
}

/* ===== Loading overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease 0.3s, visibility 1s ease 0.3s;
}
.loading-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-text {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.4em;
  color: #f5f5f5;
  overflow: hidden;
  display: flex;
}
.loading-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: loading-letter 0.6s ease forwards;
}
@keyframes loading-letter {
  to { opacity: 1; transform: translateY(0); }
}

/* (legacy hero-slides 削除済・上の Hero cinema centered に移行) */

/* ===== Fade-in on scroll ===== */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
  transition-delay: 0.1s;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Custom cursor (desktop only) ===== */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(245, 245, 245, 0.0);
  border: 1px solid rgba(245, 245, 245, 0.6);
  pointer-events: none;
  z-index: 999;
  mix-blend-mode: difference;
  margin: -8px 0 0 -8px;
  transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, background 0.2s ease;
}
.cursor.hover {
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  background: rgba(245, 245, 245, 0.95);
  border-color: transparent;
}
@media (pointer: coarse) {
  .cursor { display: none; }
}
body.has-custom-cursor,
body.has-custom-cursor * { cursor: none !important; }

/* ===== Gallery hover caption ===== */
.gallery-item {
  position: relative;
}
.gallery-item .caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.75) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #f5f5f5;
  text-transform: uppercase;
}
.gallery-item:hover .caption {
  opacity: 1;
}

/* ===== Stats / Counter ===== */
.stats-section {
  padding: 100px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 40px;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
}
.stat {
  text-align: center;
}
.stat-number {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 12px;
}
.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ===== Grain noise overlay ===== */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Page transition (View Transitions API + fallback) ===== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-fade-out 0.4s ease forwards; }
::view-transition-new(root) { animation: page-fade-in 0.5s ease forwards; }
@keyframes page-fade-out { to { opacity: 0; } }
@keyframes page-fade-in { from { opacity: 0; } }

/* ===== Cards / CTA ===== */
.cta-link {
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}
.cta-link:hover {
  background: #f5f5f5;
  color: #0a0a0a;
  opacity: 1;
}
.text-center { text-align: center; }
.mt-lg { margin-top: 60px; }
