/* ============================================================
   AKIYOSHI MUNEKANE — Portfolio
   ============================================================ */

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

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

:root {
  --bg:          #0d0c0e;
  --text:        #ece9e3;
  --text-muted:  rgba(236, 233, 227, 0.78);
  --text-faint:  rgba(236, 233, 227, 0.5);
  --border:      rgba(255, 255, 255, 0.1);
  --header-h:    58px;
  --easing:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
  background: #030305;
  color: var(--text);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

/* ── Animated Background Orbs ──────────────────────────────── */
.bg-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background: transparent;
}

/* 背景画像（下層） */
.bg-light::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/bg.jpg') 50% 20% / 100% auto no-repeat;
  filter: none;
  z-index: 0;
}

/* 暗さオーバーレイ（上層） */
.bg-light::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.50);
  z-index: 1;
}


/* Everything above the ambient bg */
header, main, footer {
  position: relative;
  z-index: 1;
}

/* ── Header ────────────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  transition: background 0.5s var(--easing), backdrop-filter 0.5s;
}

#header.scrolled {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 32px;
  height: 100%;
  padding: 0 clamp(24px, 4vw, 60px);
}

.nav-desktop {
  display: flex;
  gap: 32px;
}

.nav-desktop a {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--text);
  transition: color 0.3s;
}

.nav-desktop a:hover { color: var(--text); }

.header-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-social a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.3s;
}

.header-social a:hover { color: var(--text); }

/* Hamburger */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  width: 44px;
  height: 44px;
  z-index: 1100;
  position: relative;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 1px;
  background: #ffffff;
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.6);
  flex-shrink: 0;
  transition: transform 0.4s var(--easing), opacity 0.3s;
}

.menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-btn.is-open span:nth-child(2) {
  opacity: 0;
}
.menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Menu ───────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--easing);
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.mobile-link {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text);
  transition: opacity 0.3s;
}

.mobile-link:hover { opacity: 0.4; }

.mobile-social {
  display: flex;
  gap: 28px;
  margin-top: 48px;
}

.mobile-social a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.3s;
}

.mobile-social a:hover { color: var(--text); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--header-h) 24px 60px;
  overflow: hidden;
}

.hero-content {
  text-align: left;
  width: 100%;
  padding: 0 clamp(20px, 4vw, 60px);
  margin-bottom: 10vh;
}

.hero-name {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-weight: 700;
  font-size: clamp(3.2rem, 12.4vw, 14.4rem);
  line-height: 0.88;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.70);
  mix-blend-mode: overlay;
  text-shadow: none;

  /* Page-load animation */
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s var(--easing) 0.2s,
              transform 1.1s var(--easing) 0.2s;
}

.hero-sub {
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 20px;

  /* Page-load animation */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--easing) 0.15s,
              transform 0.9s var(--easing) 0.15s;
}

body.loaded .hero-name { opacity: 1; transform: translateY(0); }
body.loaded .hero-sub  { opacity: 1; transform: translateY(0); }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--text-muted);

  opacity: 0;
  transition: opacity 1s var(--easing) 1.4s;
}

body.loaded .scroll-hint { opacity: 1; }

.scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.3));
  transform-origin: top;
  animation: scrollPulse 2s var(--easing) infinite 1.6s;
}

@keyframes scrollPulse {
  0%   { transform: scaleY(0); opacity: 1; transform-origin: top; }
  49%  { transform: scaleY(1); opacity: 1; transform-origin: top; }
  50%  { transform: scaleY(1); opacity: 1; transform-origin: bottom; }
  100% { transform: scaleY(0); opacity: 0; transform-origin: bottom; }
}

/* ── Sections (shared) ──────────────────────────────────────── */
.section {
  padding: clamp(80px, 13vh, 140px) 0;
  scroll-margin-top: var(--header-h);
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px);
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.38em;
  color: var(--text);
  margin-bottom: 52px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Reveal animation (scroll-triggered) ────────────────────── */
.reveal,
.work-card {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--easing), transform 0.8s var(--easing);
}

.reveal.is-visible,
.work-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Works Grid ─────────────────────────────────────────────── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2vw, 28px);
}

.work-card {
  display: block;
  cursor: pointer;
}

.work-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #0e0e22 0%, #161630 60%, #0a0a1a 100%);
  position: relative;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--easing), opacity 0.4s;
  opacity: 0;
}

/* Show image once it loads */
.work-thumb img.loaded {
  opacity: 1;
}

.work-card:hover .work-thumb img {
  transform: scale(1.04);
}

/* Subtle overlay on hover */
.work-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.4s;
}

.work-card:hover .work-thumb::after {
  background: rgba(0, 0, 0, 0.12);
}

.work-meta {
  padding: 14px 0 0;
}

.work-cat {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--text-faint);
  margin-bottom: 5px;
}

.work-title {
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: var(--text);
  transition: opacity 0.3s;
}

.work-card:hover .work-title {
  opacity: 0.6;
}

/* ── Profile ────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr clamp(240px, 28%, 380px);
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}

.profile-photo-wrap {
  width: 100%;
  flex-shrink: 0;
  order: 2;
}

.profile-body {
  min-width: 0;
  order: 1;
}

.profile-photo-placeholder {
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #10101f 0%, #1a1a35 100%);
  overflow: hidden;
  border: 1px solid var(--border);
}

.profile-photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.5s;
}

.profile-photo-placeholder img.loaded { opacity: 1; }

.profile-role {
  font-weight: 300;
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 32px;
  color: #ffffff;
}

.profile-name {
  font-weight: 300;
  font-size: clamp(0.9rem, 1.6vw, 1.5rem);
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin-bottom: 32px;
  color: #ffffff;
}

.profile-bio {
  font-size: clamp(13px, 1vw, 14.5px);
  color: var(--text-muted);
  line-height: 1.95;
  margin-bottom: 22px;
}

.profile-career {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.career-item {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.career-year {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  min-width: 60px;
}

.career-company {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ── Contact ────────────────────────────────────────────────── */
.section--contact {
  text-align: center;
}

.contact-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.contact-email {
  font-weight: 300;
  font-size: clamp(1.3rem, 3.2vw, 2.4rem);
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  transition: color 0.3s, border-color 0.3s;
}

.contact-email:hover {
  color: rgba(255,255,255,0.55);
  border-color: transparent;
}

.contact-links {
  display: flex;
  gap: 36px;
}

.contact-links a {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--text-muted);
  transition: color 0.3s;
}

.contact-links a:hover { color: var(--text); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}

.footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px);
  display: flex;
  justify-content: center;
  align-items: center;
}


.footer-copy {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* ── Work Detail Pages ──────────────────────────────────────── */
.work-page {
  padding-top: var(--header-h);
}

.work-hero {
  padding: clamp(60px, 10vh, 100px) clamp(24px, 5vw, 80px) clamp(80px, 14vh, 140px);
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(48px, 6vw, 100px);
}

.work-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin-bottom: 56px;
  transition: color 0.3s;
  grid-column: 1 / -1;
}

.work-back:hover { color: var(--text); }

.work-back::before {
  content: '←';
  font-size: 14px;
}

.work-type-label {
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--text-faint);
  margin-bottom: 18px;
  grid-column: 1;
}

.work-heading {
  font-weight: 300;
  font-size: clamp(1.1rem, 3.2vw, 2.8rem);
  letter-spacing: 0;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 0;
  grid-column: 1;
  align-self: start;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.work-sub-heading {
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  color: var(--text-muted);
  margin-bottom: 40px;
}

.work-description-text {
  font-size: clamp(13px, 1vw, 15px);
  color: var(--text-muted);
  line-height: 2;
  max-width: none;
  grid-column: 2;
  grid-row: 3;
  align-self: start;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}

/* Media block */
.work-media {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px) clamp(80px, 12vh, 120px);
}

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0d0d1e;
  overflow: hidden;
  margin-bottom: 24px;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0e0e22 0%, #161630 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

/* Main visual — large hero image */
.work-main-visual {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 16px;
  background: #0e0e22;
}

.work-main-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s;
}

.work-main-visual img.loaded { opacity: 1; }

.work-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 0;
}

.work-images img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0e0e22;
}

/* Video section */
.work-video {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px) clamp(60px, 10vh, 100px);
}

.work-video .video-wrap {
  max-width: 74%;
  margin-left: auto;
  margin-right: auto;
}

/* Work nav (prev / next) */
.work-nav {
  max-width: 1380px;
  margin: 0 auto;
  padding: 40px clamp(24px, 5vw, 80px) 60px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

.work-nav-link {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  transition: color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-nav-link:hover { color: var(--text); }

.work-nav-label {
  font-size: 9px;
  letter-spacing: 0.35em;
  color: var(--text-faint);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-desktop   { display: none; }
  .header-social { display: none; }
  .menu-btn      { display: flex; }

  .hero-name { line-height: 1; }

  .works-grid { gap: 12px; }

  .work-images { grid-template-columns: repeat(2, 1fr); }

  .work-hero {
    grid-template-columns: 1fr;
  }
  .work-description-text {
    grid-column: 1;
    grid-row: auto;
    margin-top: 24px;
  }
}

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

  .footer-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .contact-links { flex-direction: column; gap: 18px; }
}

/* ── Video Password Gate ────────────────────────────────────── */
.video-gate {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.video-gate p {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
}

.video-gate-form {
  display: flex;
  gap: 0;
}

.video-gate-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.2);
  border-right: none;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  outline: none;
  width: 160px;
  font-family: inherit;
}

.video-gate-input::placeholder {
  color: var(--text-faint);
}

.video-gate-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 10px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.video-gate-btn:hover {
  background: rgba(255,255,255,0.18);
}

.video-gate-error {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(255, 100, 100, 0.8);
  min-height: 14px;
}
