:root {
  --bg: #0a0a0c;
  --bg-2: #121216;
  --surface: #17171c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f2ee;
  --muted: #9b9aa3;
  --accent: #ff5a36;
  --accent-2: #ffb36b;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --font-latin: "Inter", system-ui, sans-serif;
  --font-jp: "Inter", "Noto Sans JP", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-jp);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

/* ---- ヘッダー ---- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(10, 10, 12, 0.85), rgba(10, 10, 12, 0));
  backdrop-filter: blur(6px);
}

.logo {
  font-family: var(--font-latin);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  font-family: var(--font-latin);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}

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

/* ---- ヒーロー ---- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px var(--gutter) 80px;
  overflow: hidden;
  /* hidden だと中でスクロールできてしまい、フォーカス移動で中身がずれるので clip にする */
  overflow: clip;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(700px) rotateX(58deg) translateY(-8%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 65%);
  animation: grid-drift 14s linear infinite;
}

.hero-glow {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  left: 55%;
  top: 30%;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(255, 90, 54, 0.28), rgba(255, 179, 107, 0.08) 40%, transparent 65%);
  filter: blur(20px);
  animation: glow-breathe 7s ease-in-out infinite alternate;
}

/* Showreel の背景ループ（動き出したら、グリッドの上にふわっと重ねる） */
.hero-media,
.hero-shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 文字が読めるように、上と下を暗くする */
.hero-shade {
  background:
    linear-gradient(to right, rgba(10, 10, 12, 0.82), rgba(10, 10, 12, 0.4) 60%, rgba(10, 10, 12, 0.3)),
    linear-gradient(to bottom, rgba(10, 10, 12, 0.5), transparent 30%, transparent 65%, var(--bg));
}

/* 縦長の画面では、横長のループを90度回して画面いっぱいに流す。
   名前などの文字は下に寄せ、下側を暗くして読みやすくする */
@media (max-aspect-ratio: 1/1) {
  .hero {
    align-items: flex-end;
    padding-bottom: 120px; /* 文字の下に「スクロール」の印の分を空ける */
  }
  .hero-media {
    container-type: size;
  }
  .hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100cqh;
    height: 100cqw;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .hero-shade {
    background:
      linear-gradient(to top, rgba(10, 10, 12, 0.85), rgba(10, 10, 12, 0.4) 45%, transparent 70%),
      linear-gradient(to bottom, transparent 75%, var(--bg));
  }
}

.hero.has-video .hero-tagline {
  color: rgba(243, 242, 238, 0.85);
}

.hero.has-video .hero-media,
.hero.has-video .hero-shade {
  opacity: 1;
}

/* ボタンを押すと、その場で本編に切り替える */
.hero-player {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 72px var(--gutter) 24px;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.hero.is-playing .hero-player {
  opacity: 1;
  visibility: visible;
}

.hero.is-playing .hero-inner,
.hero.is-playing .scroll-cue {
  visibility: hidden;
}

.hero-player-stage {
  width: min(100%, calc((100svh - 96px) * 16 / 9));
  aspect-ratio: 16 / 9;
}

.hero-player-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.hero-close {
  position: absolute;
  top: 76px;
  right: var(--gutter);
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font: 500 13px/1.4 var(--font-jp);
  cursor: pointer;
}

.hero-close:hover {
  border-color: #fff;
}

@keyframes grid-drift {
  to {
    background-position: 0 64px;
  }
}

@keyframes glow-breathe {
  from {
    opacity: 0.6;
    scale: 0.92;
  }
  to {
    opacity: 1;
    scale: 1.05;
  }
}

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

.hero-role {
  margin: 0 0 16px;
  font-family: var(--font-latin);
  font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.hero-name {
  margin: 0;
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(40px, 8.5vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent-2) 70%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  margin: 28px 0 0;
  font-size: clamp(16px, 2vw, 22px);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font: 500 15px/1 var(--font-jp);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #ff6e4d;
}

.btn-icon {
  font-size: 11px;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--text);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  translate: -50% 0;
  width: 24px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
}

.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 3px;
  height: 8px;
  translate: -50% 0;
  border-radius: 2px;
  background: var(--text);
  animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---- セクション共通 ---- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) var(--gutter) 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 32px;
}

.section-title {
  margin: 0;
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 88px);
  letter-spacing: -0.03em;
  line-height: 1;
}

.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---- フィルター ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 500 13px/1.4 var(--font-jp);
  cursor: pointer;
  transition: all 0.2s;
}

.filter:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ---- 作品カード ---- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.work-card[hidden] {
  display: none;
}

.work-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  isolation: isolate;
}

.work-card.is-vertical .work-thumb {
  aspect-ratio: 16 / 9;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.work-thumb.is-placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, hsl(var(--hue) 70% 45% / 0.55), transparent 60%),
    radial-gradient(circle at 75% 70%, hsl(calc(var(--hue) + 40) 70% 40% / 0.45), transparent 55%),
    var(--surface);
}

.placeholder-label {
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.4);
}

.work-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.work-thumb.is-previewing .work-preview {
  opacity: 1;
}

.work-thumb.is-previewing .work-play {
  opacity: 0 !important;
}

.work-play {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding-left: 4px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(6px);
  font-size: 18px;
  opacity: 0;
  scale: 0.8;
  transition: opacity 0.3s, scale 0.3s;
}

.work-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  font: 500 12px/1.6 var(--font-latin);
}

.work-card:hover .work-thumb img,
.work-card:focus-visible .work-thumb img {
  transform: scale(1.05);
}

.work-card:hover .work-play,
.work-card:focus-visible .work-play {
  opacity: 1;
  scale: 1;
}

.work-card:focus-visible {
  outline: none;
}

.work-card:focus-visible .work-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.work-body {
  padding: 16px 4px 0;
}

.work-meta {
  margin: 0;
  font: 500 12px/1.6 var(--font-latin);
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.work-title {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.work-role {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Client Work ---- */
.client-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.client-row {
  display: grid;
  grid-template-columns: 52px 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.2s, padding 0.3s;
}

a.client-row:hover,
a.client-row:focus-visible {
  background: var(--bg-2);
  padding-left: 16px;
  outline: none;
}

/* 投稿画像の窓（4:5）。埋め込み画面を縮小し、上のアカウント欄（54px）と白い縁を窓の外へ出す */
.client-thumb {
  --scale: 0.175;
  position: relative;
  width: 52px;
  height: 65px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
}

.client-thumb iframe {
  position: absolute;
  top: calc(-58px * var(--scale));
  left: calc(-12px * var(--scale));
  width: 326px;
  height: 520px;
  border: 0;
  transform: scale(var(--scale));
  transform-origin: 0 0;
  pointer-events: none;
}

.client-year {
  font: 500 13px/1.6 var(--font-latin);
  color: var(--muted);
}

.client-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.client-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.client-role {
  font-size: 13px;
  color: var(--muted);
}

.client-go {
  font: 500 13px/1 var(--font-jp);
  color: var(--accent-2);
  white-space: nowrap;
}

.client-row.is-pending .client-go {
  color: var(--muted);
}

.client-note {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---- About ---- */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}

.about-intro {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.about-intro p {
  margin: 0 0 0.6em;
  color: var(--muted);
}

.about-intro .intro-lead {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  color: var(--text);
}

.about-text p {
  margin: 0 0 1.2em;
  font-size: clamp(15px, 1.6vw, 17px);
}

.side-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 13px;
}

.chip-tool {
  font-family: var(--font-latin);
}

/* ---- Contact ---- */
.contact {
  padding-bottom: clamp(80px, 12vw, 140px);
}

.contact-lead {
  margin: 24px 0 16px;
  color: var(--muted);
}

.contact-mail {
  display: inline-block;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: clamp(22px, 4.4vw, 52px);
  letter-spacing: -0.02em;
  text-decoration: none;
  word-break: break-all;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.4s, color 0.2s;
}

.contact-mail:hover {
  color: var(--accent-2);
  background-size: 100% 2px;
}

.contact-links {
  display: flex;
  gap: 20px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-latin);
}

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

.site-footer {
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 12px/1.6 var(--font-latin);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* ---- プレイヤー ---- */
.player {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  overflow: auto;
}

.player::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
}

.player[open] {
  animation: pop 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}

.player-box {
  position: relative;
}

.player-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.player-video {
  aspect-ratio: 16 / 9;
  background: #000;
  display: grid;
  place-items: center;
}

.player-video.is-vertical {
  aspect-ratio: auto;
  height: min(78svh, 900px);
}

.player-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.player-video.is-vertical iframe {
  width: auto;
  aspect-ratio: 9 / 16;
}

.player-empty {
  margin: 0;
  color: var(--muted);
}

.player-info {
  padding: 24px clamp(20px, 3vw, 36px) 32px;
}

.player-meta {
  margin: 0;
  font: 500 12px/1.6 var(--font-latin);
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.player-title {
  margin: 4px 0 0;
  font-size: clamp(20px, 2.6vw, 28px);
}

.player-desc {
  margin: 12px 0 0;
  color: var(--muted);
}

.player-detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 20px 0 0;
  font-size: 14px;
}

.player-detail dt {
  color: var(--muted);
}

.player-detail dd {
  margin: 0;
}

/* ---- スクロール表示 ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---- スマホ ---- */
@media (max-width: 760px) {
  .about {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .logo {
    font-size: 12px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .client-row {
    grid-template-columns: 52px 1fr auto;
  }

  .client-year {
    display: none;
  }

  .work-play {
    opacity: 1;
    scale: 0.85;
  }
}

@media (max-width: 400px) {
  .site-header {
    gap: 12px;
  }

  .nav {
    gap: 9px;
    font-size: 11px;
  }

  .logo {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
