:root {
  --bg: #050507;
  --fg: #f6f7f8;
  --muted: rgba(246, 247, 248, .68);

  --rule: rgba(246, 247, 248, .12);
  --accent: #8b5cff;

  --max: 1180px;

  --space-1: 10px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 44px;
  --space-5: 72px;

  --text: 16px;
  --leading: 1.85;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans JP";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.4, 0, .2, 1);

  --dur-1: 120ms;
  --dur-2: 220ms;
  --dur-3: 520ms;

  --lift: 8px;

  --shadow-1: 0 10px 28px rgba(0, 0, 0, .45);
  --shadow-2: 0 18px 60px rgba(0, 0, 0, .55);

  --glow: 0 0 0 1px rgba(139, 92, 255, .18), 0 0 32px rgba(139, 92, 255, .18);

  --grain-opacity: .06;
}

/* =========================
   Base / Reset
   ========================= */
* { box-sizing: border-box }

html, body { height: 100% }

html { scroll-behavior: smooth }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--text);
  line-height: var(--leading);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ===== Subtle animated grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grainShift 7s steps(6, end) infinite;
}

@keyframes grainShift {
  0% { transform: translate3d(0, 0, 0) }
  20% { transform: translate3d(-2%, -1%, 0) }
  40% { transform: translate3d(2%, 1%, 0) }
  60% { transform: translate3d(-1%, 2%, 0) }
  80% { transform: translate3d(1%, -2%, 0) }
  100% { transform: translate3d(0, 0, 0) }
}

.header, .container, .lightbox {
  position: relative;
  z-index: 2;
}

a { color: inherit }

.small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .10em;
}

.mono { font-family: var(--mono) }

:focus-visible {
  outline: 2px solid rgba(139, 92, 255, .85);
  outline-offset: 4px;
  border-radius: 10px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-3);
}

.main {
  padding-top: var(--space-4);
  animation: fadeUp var(--dur-3) var(--ease-out) both;
}

@media (max-width:640px) {
  .container { padding: var(--space-4) var(--space-2) }
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--space-5) 0;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 10px, 0) }
  to { opacity: 1; transform: translate3d(0, 0, 0) }
}

/* =========================
   Header (compact, readable)
   ========================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-bg {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.header-inner { position: relative }

.header .container,
.header-inner .container {
  padding-top: 16px;
  padding-bottom: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.brand-mark { display: none }

.brand-text {
  font-weight: 900;
  font-size: clamp(20px, 2.0vw, 26px);
  letter-spacing: .24em;
  line-height: 1.1;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
  transition: opacity var(--dur-2) var(--ease-inout);
}

.brand:hover .brand-text { opacity: .92 }

.nav-panel {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;

  margin-left: auto;
  justify-content: flex-end;
  padding-top: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;
  padding: 10px 0;
  text-decoration: none;

  color: rgba(246, 247, 248, .62);
  letter-spacing: .22em;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 500;

  transition:
    color var(--dur-2) var(--ease-inout),
    transform var(--dur-2) var(--ease-out);
}

.nav-links a:hover {
  color: rgba(246, 247, 248, .88);
  transform: translate3d(0, -1px, 0);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: rgba(246, 247, 248, .18);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-inout);
}

.nav-links a:hover::after {
  transform: scaleX(1);
  background: rgba(246, 247, 248, .28);
}

.nav-links a.active {
  color: var(--fg);
  padding: 10px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 255, .14);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .95;
  transform: none;
  animation: accentPulse 2.6s var(--ease-inout) infinite;
}

@keyframes accentPulse {
  0%, 100% {
    opacity: .70;
    filter: drop-shadow(0 0 0 rgba(139, 92, 255, 0));
  }
  50% {
    opacity: .98;
    filter: drop-shadow(0 0 10px rgba(139, 92, 255, .35));
  }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
}

.lang-toggle button {
  border: 0;
  background: transparent;
  color: rgba(246, 247, 248, .72);
  padding: 8px 10px;
  cursor: pointer;
  letter-spacing: .20em;
  font-size: 12px;
  text-transform: uppercase;

  transition:
    background var(--dur-2) var(--ease-inout),
    color var(--dur-2) var(--ease-inout),
    transform var(--dur-2) var(--ease-out);
}

.lang-toggle button:hover { transform: translate3d(0, -1px, 0) }

.lang-toggle button.active {
  color: var(--fg);
  background: rgba(246, 247, 248, .08);
}

/* =========================
   Mobile nav (default behavior for SP pages)
   ========================= */
.nav-toggle { display: none }
.nav-backdrop { display: none }
body.nav-open { overflow: hidden }

@media (max-width:640px) {
  .nav-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 54;
    background: rgba(0, 0, 0, 0);
  }

  body.nav-open .nav-backdrop { display: block }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    border: 0;
    background: rgba(246, 247, 248, .06);
    color: var(--fg);
    border-radius: 12px;
    padding: 10px 10px;
    cursor: pointer;

    transition:
      background var(--dur-2) var(--ease-inout),
      transform var(--dur-2) var(--ease-out);
  }

  .nav-toggle:hover {
    background: rgba(246, 247, 248, .08);
    transform: translate3d(0, -1px, 0);
  }

  .nav-toggle:active { transform: translate3d(0, 0, 0) scale(.98) }

  .nav-toggle-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
  }

  .nav-toggle-bars span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
  }

  .nav-panel {
    position: fixed;
    top: 14px;
    right: 14px;
    left: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px;

    border: 0;
    border-radius: 16px;
    background: rgba(5, 5, 7, .96);
    z-index: 55;

    animation: fadeUp var(--dur-3) var(--ease-out) both;
  }

  body.nav-open .nav-panel { display: flex }

  .nav-links {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
  }

  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    padding-left: 14px;
  }

  .nav-links a.active {
    padding: 14px 10px 14px 14px;
    background: rgba(139, 92, 255, .12);
  }

  .nav-links a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: var(--accent);
    opacity: .95;
    animation: accentPulse 2.6s var(--ease-inout) infinite;
  }

  .nav-right { justify-content: flex-end }
}

/* =========================
   Page head / typography
   ========================= */
h1, h2, h3 { margin: 0 0 12px }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-2);
}

.page-title {
  font-size: clamp(34px, 3.2vw, 56px);
  font-weight: 900;
  letter-spacing: .02em;
}

.page-sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

@media (max-width:640px) {
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================
   Controls (optional tabs)
   ========================= */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: var(--space-2) 0 var(--space-3);
}

.button {
  border: 0;
  background: rgba(246, 247, 248, .06);
  color: rgba(246, 247, 248, .76);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: .18em;
  font-size: 12px;
  text-transform: uppercase;

  transition:
    background var(--dur-2) var(--ease-inout),
    color var(--dur-2) var(--ease-inout),
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-inout);
}

.button:hover {
  background: rgba(246, 247, 248, .08);
  color: rgba(246, 247, 248, .92);
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-1);
}

.button:active { transform: translate3d(0, 0, 0) scale(.98) }

.button.active {
  background: rgba(139, 92, 255, .14);
  color: var(--fg);
  box-shadow: var(--glow);
}

/* =========================
   Cards (no window frames)
   ========================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.card-grid.two-col { grid-template-columns: repeat(2, 1fr) }

@media (max-width:960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr) }
}

@media (max-width:640px) {
  .card-grid,
  .card-grid.two-col {
    grid-template-columns: 1fr;
  }
}

.card {
  display: block;
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;

  transition:
    transform var(--dur-2) var(--ease-out),
    filter var(--dur-2) var(--ease-inout);
}

.card .thumb {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  object-fit: cover;
  background: #000;
  border-radius: 14px;
  filter: saturate(1.02) contrast(1.03);

  transition:
    transform var(--dur-3) var(--ease-out),
    filter var(--dur-2) var(--ease-inout);
}

.card .meta {
  padding: 12px 2px 0;
  border: 0;
}

.title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .02em;
  transition: color var(--dur-2) var(--ease-inout);
}

.card:hover {
  transform: translate3d(0, calc(var(--lift) * -0.5), 0);
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .45));
}

.card:hover .thumb {
  transform: scale(1.02);
  filter: saturate(1.05) contrast(1.05);
}

.card:hover .title { color: rgba(246, 247, 248, .96) }

.card:active { transform: translate3d(0, -2px, 0) scale(.99) }

.card-glow { display: none }

/* =========================
   Prose (readability first)
   ========================= */
.lang-panel { display: none }
.lang-panel.active { display: block }

.prose {
  padding: 0;
  border: 0;
  background: transparent;
}

.prose h2, .prose h3 { margin: 0 0 10px }

.prose p {
  margin: 0 0 14px;
  color: rgba(246, 247, 248, .88);
}

.prose ul {
  margin: 0 0 14px;
  padding-left: 18px;
}

.prose li {
  margin: 7px 0;
  color: rgba(246, 247, 248, .86);
}

.prose a {
  color: rgba(246, 247, 248, .92);
  text-decoration: none;

  background-image: linear-gradient(0deg, rgba(139, 92, 255, .55), rgba(139, 92, 255, .55));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  transition:
    background-size var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-inout);
}

.prose a:hover {
  background-size: 100% 2px;
  color: rgba(246, 247, 248, .98);
}

/* =========================
   Media
   ========================= */
.hero { margin: var(--space-4) 0 var(--space-4) }

.hero img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 18px;
  border: 0;
  background: #000;

  transition: transform var(--dur-3) var(--ease-out), filter var(--dur-2) var(--ease-inout);
}

.hero img:hover {
  transform: scale(1.01);
  filter: saturate(1.04) contrast(1.04);
}

.ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;
  border: 0;
  background: #000;
}

.ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
}

@media (max-width:640px) {
  .gallery { grid-template-columns: 1fr }
}

/* =========================
   Work sections
   ========================= */
.work-section { margin-top: var(--space-5) }
.work-section:first-child { margin-top: var(--space-4) }

.section-title {
  margin: 0 0 var(--space-2);
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(246, 247, 248, .78);
}

.gallery img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 18px;
  border: 0;
  background: #000;

  transition: transform var(--dur-3) var(--ease-out), filter var(--dur-2) var(--ease-inout);
}

.gallery img:hover {
  transform: scale(1.01);
  filter: saturate(1.04) contrast(1.04);
}

/* =========================
   Back link / pager
   ========================= */
.back {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .18em;
  font-size: 12px;
  text-transform: uppercase;

  transition: color var(--dur-2) var(--ease-inout), transform var(--dur-2) var(--ease-out);
}

.back:hover {
  color: rgba(246, 247, 248, .88);
  transform: translate3d(0, -1px, 0);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

@media (max-width:640px) {
  .pager { grid-template-columns: 1fr }
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: var(--muted);

  transition: color var(--dur-2) var(--ease-inout), transform var(--dur-2) var(--ease-out);
}

.pager a:hover {
  color: rgba(246, 247, 248, .88);
  transform: translate3d(0, -2px, 0);
}

.pager .label {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.pager .name {
  font-size: 14px;
  color: var(--fg);
  letter-spacing: .02em;
}

/* =========================
   Profile
   ========================= */
.profile-page {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.profile-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.profile-section {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--space-4);
  align-items: start;
}

@media (max-width:960px) {
  .profile-section { grid-template-columns: 1fr }
}

.profile-hero img {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 18px;
  border: 0;
  background: #000;

  transition: transform var(--dur-3) var(--ease-out), filter var(--dur-2) var(--ease-inout);
}

.profile-hero img:hover {
  transform: scale(1.01);
  filter: saturate(1.04) contrast(1.04);
}

@media (max-width:960px) {
  .profile-hero img { max-width: 420px }
}

.profile-name {
  font-size: clamp(28px, 2.2vw, 38px);
  letter-spacing: .02em;
  margin: 0 0 12px;
  font-weight: 900;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-2);
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 0;
  background: rgba(246, 247, 248, .06);
  color: rgba(246, 247, 248, .76);
  text-decoration: none;

  transition:
    background var(--dur-2) var(--ease-inout),
    color var(--dur-2) var(--ease-inout),
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-inout);
}

.link-pill:hover {
  background: rgba(246, 247, 248, .08);
  color: rgba(246, 247, 248, .92);
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-1);
}

.link-pill:active { transform: translate3d(0, 0, 0) scale(.99) }

.link-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBlink 3.2s var(--ease-inout) infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: .55; transform: scale(1) }
  50% { opacity: 1; transform: scale(1.12) }
}

/* =========================
   Profile: CV / details
   ========================= */
.details {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.details summary {
  cursor: pointer;
  list-style: none;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 20px 22px;
  border-radius: 999px;

  background: rgba(246, 247, 248, .07);
  border: 1px solid rgba(246, 247, 248, .18);

  color: rgba(246, 247, 248, .92);
  font-size: 15px;
  letter-spacing: .20em;
  text-transform: uppercase;

  transition:
    background var(--dur-2) var(--ease-inout),
    border-color var(--dur-2) var(--ease-inout),
    color var(--dur-2) var(--ease-inout),
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-inout);
}

.details summary:hover {
  background: rgba(246, 247, 248, .09);
  border-color: rgba(246, 247, 248, .24);
  color: var(--fg);
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-1);
}

.details summary:active { transform: translate3d(0, 0, 0) scale(.99) }

.details summary::-webkit-details-marker { display: none }

.details summary::after {
  content: "▸";
  font-size: 20px;
  line-height: 1;
  color: rgba(246, 247, 248, .66);
  transition: transform var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-inout);
}

.details[open] summary {
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  background: transparent;

  color: var(--muted);
  font-size: 15px;
  letter-spacing: .20em;
  text-transform: uppercase;

  border-bottom: 1px solid var(--rule);
  box-shadow: none;
  transform: none;
}

.details[open] summary::after {
  transform: rotate(90deg);
  color: var(--muted);
  font-size: 20px;
}

.details .details-inner { padding: 16px 0 0 }

.details .details-inner .prose {
  position: relative;
  padding: 2px 0 0 14px;
  max-width: none;
}

.details .details-inner .prose::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: rgba(139, 92, 255, .75);
}

body.cv .prose { max-width: none }
.details .prose { max-width: none }

@media (max-width:640px) {
  .details summary { padding: 18px 16px }
  .details summary::after { font-size: 20px }
  .details[open] summary { padding: 14px 0 }
}

/* =========================
   Timeline
   ========================= */
.timeline {
  margin-top: var(--space-3);
  max-width: 100%;
}

.timeline-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) 0;

  transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-inout);
}

.timeline-row:hover { transform: translate3d(0, -2px, 0) }
.timeline-row + .timeline-row { border-top: 1px solid var(--rule) }

.timeline-thumb {
  width: 260px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 14px;
  border: 0;
  background: #000;
  flex: 0 0 auto;

  transition: transform var(--dur-3) var(--ease-out), filter var(--dur-2) var(--ease-inout);
}

.timeline-row:hover .timeline-thumb {
  transform: scale(1.01);
  filter: saturate(1.04) contrast(1.04);
}

@media (max-width:640px) {
  .timeline-row { flex-direction: column }
  .timeline-thumb { width: 100% }
}

.date {
  display: inline-flex;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid rgba(246, 247, 248, .22);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* =========================
   Contact
   ========================= */
.contact-hero {
  border: 0;
  background: transparent;
  margin-top: var(--space-4);
}

.contact-hero-bg { display: none }

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-4);
  align-items: start;
  padding: 0;
}

@media (max-width:960px) {
  .contact-layout { grid-template-columns: 1fr }
}

.contact-copy .prose { max-width: 74ch }

.contact-card {
  border: 0;
  background: transparent;
  padding: 0;
}

.contact-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.contact-card-title {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(246, 247, 248, .88);
}

.contact-chip {
  font-size: 12px;
  color: var(--muted);
  border: 0;
  padding: 0;
  background: transparent;
}

.contact-card .small.mono { word-break: break-all }

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.primary, .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  letter-spacing: .18em;
  font-size: 12px;
  text-transform: uppercase;

  transition:
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-inout),
    background var(--dur-2) var(--ease-inout),
    color var(--dur-2) var(--ease-inout);
}

.primary {
  border: 0;
  color: var(--fg);
  background: rgba(139, 92, 255, .14);
  box-shadow: 0 0 0 1px rgba(139, 92, 255, .12);
}

.primary:hover {
  background: rgba(139, 92, 255, .18);
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-1), var(--glow);
}

.primary:active { transform: translate3d(0, 0, 0) scale(.99) }

.secondary {
  border: 0;
  color: rgba(246, 247, 248, .78);
  background: rgba(246, 247, 248, .06);
}

.secondary:hover {
  background: rgba(246, 247, 248, .08);
  color: rgba(246, 247, 248, .90);
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-1);
}

.secondary:active { transform: translate3d(0, 0, 0) scale(.99) }

.btn-icon {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

/* =========================
   Footer
   ========================= */
.footer {
  color: var(--muted);
  border-top: 1px solid var(--rule);
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  font-size: 12px;
  letter-spacing: .10em;
  text-align: center;
}

/* =========================
   Home / Welcome
   ========================= */
body.home { overflow: hidden }

body.home .container {
  max-width: none;
  padding: 0;
}

body.home .footer { display: none }

.welcome {
  position: relative;
  height: calc(100dvh - 74px);
  width: 100%;
  overflow: hidden;
}

@media (max-width:640px) {
  .welcome { height: calc(100dvh - 96px) }
}

.welcome-stage {
  position: absolute;
  inset: 0;
  background: #000;
}

.welcome-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 520ms ease;
  will-change: opacity;
  filter: saturate(1.02) contrast(1.03);
  transform: scale(1.02);
}

.welcome-stage img.active {
  opacity: 1;
  animation: ambientZoom 10s linear infinite alternate;
}

@keyframes ambientZoom {
  from { transform: scale(1.02) }
  to { transform: scale(1.05) }
}

.welcome-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-4);
  background: linear-gradient(180deg, rgba(0, 0, 0, .20), rgba(0, 0, 0, .70));
}

.welcome-title {
  margin-top: 0;
  font-size: clamp(34px, 6vw, 86px);
  letter-spacing: .18em;
  font-weight: 900;
  line-height: 1.05;
}

.welcome-title .sub {
  font-size: 11px;
  color: rgba(246, 247, 248, .68);
  letter-spacing: .34em;
  margin-top: var(--space-2);
  text-transform: uppercase;
}

.welcome-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
}

.hint, .copy {
  font-size: 11px;
  color: rgba(246, 247, 248, .68);
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* =========================
   Home: SP behavior
   - 上（nav-panel / hamburger）は出さない
   - 下（home-scroll-menu）のみをスクロール後に固定表示
   ========================= */
@media (max-width:640px) {
  /* SPホームはスクロール可能（下固定メニュー用の余白確保のため） */
  body.home { overflow: auto; }

  /* SPホームでは上のハンバーガー＆パネルを一切使わない */
  body.home .nav-toggle { display: none !important; }
  body.home .nav-backdrop { display: none !important; }
  body.home.nav-open { overflow: auto; }

  body.home .nav-panel { display: none !important; }
  body.home.home-menu-revealed .nav-panel { display: none !important; }
}

/* =========================
   Lightbox
   ========================= */
.lightbox[hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
  z-index: 9999;

  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-3) var(--ease-out), visibility 0s linear;
}

.lightbox-image {
  max-width: min(96vw, 1600px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;

  transform: scale(.985);
  transition: transform var(--dur-3) var(--ease-out);
}

.lightbox:not([hidden]) .lightbox-image { transform: scale(1) }
.gallery-image { cursor: zoom-in }

/* Works / Performance の作品画像は角丸にしない（詳細ページ） */
body.works .hero img,
body.performance .hero img,
body.works .gallery img,
body.performance .gallery img {
  border-radius: 0;
}

/* Works / Performance の一覧サムネも角丸にしない */
body.works .card .thumb,
body.performance .card .thumb {
  border-radius: 0;
}

/* =========================
   Reduced motion (accessibility)
   ========================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  body::before { animation: none }

  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================
   Home: scroll destination menu (SP only)
   - スクロール後に下へ固定で出しっぱなし
   - 外枠(border)なし
   ========================= */
@media (max-width:640px) {
  body.home { overflow: auto; }

  body.home .home-scroll-menu {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;

    padding: 18px 16px 26px;
    border-top: 1px solid var(--rule);
    background: rgba(5, 5, 7, .92);
  }

  body.home.home-menu-revealed .home-scroll-menu { display: block; }

  /* 下固定メニューに本文が隠れないように */
  body.home.home-menu-revealed .main { padding-bottom: 180px; }

  .home-scroll-menu-inner {
    border: 0;
    border-radius: 16px;
    background: rgba(5, 5, 7, .96);
    padding: 14px 14px;
  }

  .home-scroll-menu-title {
    font-size: 12px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(246, 247, 248, .72);
    margin-bottom: 10px;
  }

  .home-scroll-menu-links {
    display: flex;
    flex-direction: column;
  }

  .home-scroll-menu-links a {
    text-decoration: none;
    padding: 14px 12px;
    border-bottom: 1px solid var(--rule);
    color: rgba(246, 247, 248, .88);
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 12px;
  }

  .home-scroll-menu-links a:last-child { border-bottom: 0; }
}

/* PCでは必ず非表示（強制） */
@media (min-width:641px) {
  body.home .home-scroll-menu { display: none !important; }
}

/* hidden属性は常に非表示（強制） */
.home-scroll-menu[hidden] { display: none !important; }
