/* ============================================================
   DARK GALLERY — Museum-Quality Resume Design System
   ============================================================ */

/* ===== CUSTOM PROPERTIES ===== */
:root {
  --bg: #050507;
  --bg-subtle: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.025);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.065);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  --text: #ece7df;
  --text-secondary: #a09a91;
  --text-tertiary: #686259;
  --text-muted: #322e28;
  --accent: #d4a474;
  --accent-light: #deb88a;
  --accent-dim: #937353;
  --accent-glow: rgba(212, 164, 116, 0.08);
  --line-subtle: rgba(255, 255, 255, 0.055);

  --font-display: 'Cormorant Garamond', 'Shippori Mincho B1', serif;
  --font-body: 'DM Sans', 'Zen Kaku Gothic New', sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --section-gap: clamp(8rem, 15vh, 14rem);
  --content-width: min(72rem, 88vw);
}


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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

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

ul {
  list-style: none;
}

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


/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ===== SELECTION ===== */
::selection {
  background: rgba(201, 152, 107, 0.2);
  color: var(--text);
}


/* ===== GRAIN OVERLAY ===== */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.grain::before {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
}


/* ===== BACKGROUND ARCHITECTURAL LINES ===== */
.bg-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 199px,
      var(--line-subtle) 199px,
      var(--line-subtle) 200px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 199px,
      var(--line-subtle) 199px,
      var(--line-subtle) 200px
    );
  opacity: 0.5;
}


/* ===== GRADIENT ORBS ===== */
.gradient-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.08;
  will-change: transform;
}

.orb-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -300px;
  right: -200px;
  animation: orb-drift-1 28s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4a5e7a 0%, transparent 70%);
  bottom: 20%;
  left: -250px;
  animation: orb-drift-2 35s ease-in-out infinite alternate;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #7a5a4a 0%, transparent 70%);
  bottom: -150px;
  right: 30%;
  animation: orb-drift-3 22s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-120px, 80px) scale(1.15); }
}

@keyframes orb-drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, -60px) scale(1.1); }
}

@keyframes orb-drift-3 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, -100px) scale(1.2); }
}


/* ===== CURSOR GLOW ===== */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 152, 107, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-300px, -300px);
  will-change: transform;
  transition: opacity 0.4s ease;
}

body:not(:hover) .cursor-glow {
  opacity: 0;
}


/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem clamp(2rem, 5vw, 4rem);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.is-scrolled {
  background: rgba(5, 5, 7, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line-subtle);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: opacity 0.3s ease;
}

.nav-logo:hover {
  opacity: 0.7;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* 言語トグル */
.nav-lang {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: border-color 0.3s ease;
}

.nav-lang:hover {
  border-color: var(--glass-border-hover);
}

.nav-lang-option {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  transition: color 0.3s ease;
}

.nav-lang-option.is-active {
  color: var(--accent);
}

.nav-lang-divider {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  opacity: 0.4;
}


/* ===== HERO ===== */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 6rem clamp(2rem, 5vw, 4rem) 4rem;
  padding-bottom: 8rem;
}

.hero-inner {
  position: relative;
  width: var(--content-width);
  max-width: var(--content-width);
  margin: 0 auto;
}

/* 展示室番号の装飾 */
.hero-room-number {
  position: absolute;
  top: -4rem;
  right: 0;
  font-family: var(--font-display);
  font-size: clamp(8rem, 15vw, 14rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  opacity: 0.75;
}

.hero-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 9rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.hero-name-line {
  display: block;
  overflow: hidden;
}

.hero-name-indent {
  padding-left: clamp(2rem, 8vw, 8rem);
}

.hero-name .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%) scale(1.1);
  filter: blur(10px);
  animation: char-reveal 1s var(--ease-out-expo) calc(var(--i) * 0.06s + 0.4s) forwards;
}

.hero-name .char.is-space {
  width: 0.3em;
}

.hero-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim) 80%, transparent);
  margin-bottom: 2.5rem;
  animation: line-expand 1.4s var(--ease-out-expo) 1.4s forwards;
}

.hero-tagline {
  font-size: clamp(0.9rem, 1.3vw, 1.1rem);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 2.1;
  max-width: 36rem;
}

/* スクロールインジケーター */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fade-in 1s ease 2.2s forwards;
}

.scroll-indicator span {
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--text-tertiary);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scroll-pulse 3s ease-in-out infinite;
}


/* ===== SECTIONS (共通) ===== */
.section {
  position: relative;
  z-index: 2;
  padding: var(--section-gap) 0;
}

.section-inner {
  width: var(--content-width);
  max-width: var(--content-width);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 5rem;
}

.section-number {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
  max-width: 160px;
  width: 0;
  transition: width 1.2s var(--ease-out-expo);
}

.section-header.is-visible .section-divider {
  width: 100%;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}


/* ===== ABOUT ===== */
.about-stats-inline {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-bottom: 2.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--line-subtle);
}

.stat-inline {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.stat-divider-v {
  width: 1px;
  height: 2rem;
  background: var(--line-subtle);
}

.about-body {
  max-width: 52rem;
}

.about-text {
  font-size: clamp(0.95rem, 1.3vw, 1.12rem);
  line-height: 2.0;
  color: var(--text-secondary);
}

.about-text + .about-text {
  margin-top: 1.8rem;
}


/* ===== EXPERIENCE / EXHIBITS ===== */
.exhibits {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.exhibit {
  position: relative;
  border-left: 2px solid var(--accent);
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
  transition: border-color 0.4s ease;
}

.exhibit:hover {
  border-color: var(--accent);
}

.exhibit-index {
  position: absolute;
  top: -0.5rem;
  right: 0;
  font-family: var(--font-display);
  font-size: clamp(4rem, 7vw, 6rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  opacity: 0.7;
}

.exhibit-body {
  position: relative;
  z-index: 1;
}

.exhibit-period {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.exhibit-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.exhibit-company {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

.exhibit-details li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

.exhibit-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 12px;
  height: 1px;
  background: var(--accent-dim);
}

.exhibit-details a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-dim);
  transition: text-decoration-color 0.3s ease;
}

.exhibit-details a:hover {
  text-decoration-color: var(--accent);
}


/* ===== SKILLS / CATALOG ===== */
.catalog {
  display: flex;
  flex-direction: column;
}

.catalog-row {
  display: flex;
  align-items: flex-start;
  gap: clamp(2rem, 4vw, 4rem);
  padding: 2rem 0;
}

.catalog-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--accent);
  min-width: clamp(8rem, 15vw, 12rem);
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.catalog-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.catalog-item {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.4rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--text-secondary);
  background: transparent;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.catalog-item:hover {
  color: var(--text);
  border-color: var(--accent-dim);
  background: var(--surface);
  transform: translateY(-1px);
}

.catalog-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--line-subtle) 0%, transparent 100%);
}


/* ===== FOOTER / CONTACT ===== */
.footer {
  padding-bottom: 4rem;
}

.footer-message {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  margin-bottom: 3rem;
  line-height: 1.3;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 32rem;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-subtle);
  transition: border-color 0.3s ease;
}

.footer-link:hover {
  border-color: var(--accent-dim);
}

.footer-link-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  min-width: 4.5rem;
}

.footer-link-value {
  font-size: 0.92rem;
  color: var(--text-secondary);
  flex: 1;
  transition: color 0.3s ease;
}

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

.footer-link-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: color 0.3s ease, transform 0.4s var(--ease-out-expo);
}

.footer-link:hover .footer-link-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

.footer-endmark {
  margin-top: 8rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-subtle);
}

.footer-copyright {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}


/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(50px) scale(0.98);
  transition: opacity 1.1s var(--ease-out-expo),
              transform 1.1s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
}

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


/* ===== KEYFRAMES ===== */
@keyframes char-reveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes line-expand {
  to {
    width: min(600px, 80vw);
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@keyframes scroll-pulse {
  0%   { top: -100%; }
  50%  { top: 100%; }
  100% { top: 100%; }
}


/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 0.7rem;
  }

  .section-header {
    margin-bottom: 3rem;
  }

  /* Hero: モバイルでは中央寄せ */
  .hero {
    align-items: center;
    text-align: center;
    padding-bottom: 6rem;
  }

  .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-name-indent {
    padding-left: 0;
  }

  .hero-room-number {
    right: 50%;
    transform: translateX(50%);
  }

  .hero-tagline {
    text-align: center;
  }

  .hero-line {
    margin: 0 auto 2.5rem;
  }

  /* About stats */
  .about-stats-inline {
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }

  .stat-divider-v {
    display: none;
  }

  /* Exhibits */
  .exhibit-index {
    font-size: 3rem;
    opacity: 0.35;
  }

  /* Catalog */
  .catalog-row {
    flex-direction: column;
    gap: 0.8rem;
  }

  .catalog-label {
    min-width: auto;
  }

  .cursor-glow {
    display: none;
  }

  .bg-lines {
    opacity: 0.3;
  }
}

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

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.62rem;
  }

  .nav-lang {
    padding: 0.25rem 0.6rem;
  }

  .hero {
    padding: 5rem 1.25rem 3rem;
  }

  .section {
    padding: clamp(4rem, 10vh, 6rem) 0;
  }

  .about-stats-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-name .char {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .hero-line {
    width: min(600px, 80vw);
  }

  .section-divider {
    width: 100%;
  }

  .orb {
    animation: none;
  }
}
