/* ==========================================================
   Tonali / Kojiro Tanaka — Portfolio
   白練（#f3f3f2）基調。余白を広く、文字は細く小さく、動きはゆっくり
   Webフォントは使わず端末の標準フォントを使う
   ========================================================== */

:root {
  --bg: #f3f3f2;       /* 白練（しろねり） */
  --surface: #e9e9e7;
  --line: #e2e2e0;
  --text: #2b2b2b;
  --muted: #5e5e5e;
  --faint: #6b6b6b;

  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 12px;   /* 写真・動画の角丸 */

  /* 余白。ここを変えるとサイト全体の余白が変わる */
  --gutter: clamp(20px, 6vw, 88px);            /* 画面の左右 */
  --space-top: clamp(40px, 9vw, 112px);        /* ページの上 */
  --space-section: clamp(64px, 9vw, 128px);    /* まとまりどうしの間 */

  --sidebar: clamp(200px, 20vw, 280px);
  --max: 1040px;

  /* 動きの速さ */
  --slow: 0.6s;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color var(--slow) var(--ease), color var(--slow) var(--ease);
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 小さな等幅ラベル（日付・見出し） */
.label,
.row > h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--faint);
}

/* 画面には出さず、検索エンジンや読み上げにだけ伝える */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ページを開いたとき、本文がゆっくり浮かび上がる */
@media (prefers-reduced-motion: no-preference) {
  main {
    animation: fade-in 1.2s var(--ease) both;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Layout / Sidebar ---------- */

/* PC: 左にメニュー、右にページ本文 */
@media (min-width: 800px) {
  body {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
  }

  .site-header {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    padding: var(--space-top) 24px 24px var(--gutter);
  }

  .nav {
    margin-top: 72px;
  }
}

.logo {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* サイト名の下の肩書き（全ページ共通。スマホでは出さない） */
.tagline {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.nav a {
  color: var(--faint);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.menu-button {
  display: none;
}

/* スマホ: 上部にサイト名とハンバーガー、メニューは開いたときだけ表示 */
@media (max-width: 799px) {
  .site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 12px var(--gutter);
  }

  /* スマホでは肩書きを出さない */
  .tagline {
    display: none;
  }

  .nav {
    flex-basis: 100%;
    gap: 0;
    padding-block: 16px 32px;
    font-size: 14px;
  }

  .nav a {
    padding-block: 12px;
  }

  /* JS が動くときだけ閉じておく（JS なしでもメニューは使える） */
  .js .nav {
    display: none;
  }

  .js .site-header.is-open .nav {
    display: flex;
  }

  .js .menu-button {
    display: block;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    cursor: pointer;
  }
}

/* 三本線 → × に変わるアイコン */
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 22px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}

.menu-icon {
  position: relative;
  margin: auto;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-icon::before {
  top: -7px;
}

.menu-icon::after {
  top: 7px;
}

.menu-button[aria-expanded="true"] .menu-icon {
  background-color: transparent;
}

.menu-button[aria-expanded="true"] .menu-icon::before {
  transform: translateY(7px) rotate(45deg);
}

.menu-button[aria-expanded="true"] .menu-icon::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--space-section);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 40px 64px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer a {
  color: var(--faint);
  text-decoration: none;
}

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

/* ---------- Top ---------- */

.hero-photo {
  padding-top: var(--space-top);
}

.hero-photo video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface);
}

/* ---------- Works: 代表作（Selected） ---------- */

/* 年の列を使わず横幅いっぱいに大きく並べる */
.selected {
  padding-block: var(--space-top) var(--space-section);
}

.selected-title {
  margin-bottom: 32px;
}

.year,
.selected-title {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px 20px;
}

@media (min-width: 600px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 64px 24px;
  }
}

@media (min-width: 1200px) {
  .work-grid {
    gap: 72px 32px;
  }
}

.work-card {
  display: block;
  text-decoration: none;
}

.work-card img,
.work-card video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface);
  transition: opacity var(--slow) var(--ease);
}

.work-title {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.work-desc {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.work-card:hover img,
.work-card:hover video,
.work-item:hover img {
  opacity: 0.7;
}

.work-card:hover .work-title,
.work-item:hover .work-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

/* ---------- Works: 年ごとの一覧（目次のようなリスト） ---------- */

.year-row {
  display: grid;
  gap: 20px;
  padding-block: 32px 40px;
  border-top: 1px solid var(--line);
}

/* PC: 左に年、右にその年の作品。年はその行を見ている間、上に残る */
@media (min-width: 1000px) {
  .year-row {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 48px;
  }

  .year-row .year {
    position: sticky;
    top: 48px;
    align-self: start;
  }
}

.work-list {
  display: grid;
  gap: 20px;
}

/* 1作品1行: 左に小さな写真、右にタイトルと説明 */
.work-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  text-decoration: none;
}

@media (min-width: 600px) {
  .work-item {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 32px;
  }
}

.work-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  transition: opacity var(--slow) var(--ease);
}

.work-item .work-title {
  margin-top: 0;
}

/* ---------- News ---------- */

.news-list li {
  display: grid;
  grid-template-columns: 8em 1fr;
  gap: 4px 32px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.news-list li:first-child {
  padding-top: 0;
}

.news-list time {
  padding-top: 0.25em;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

@media (max-width: 600px) {
  .news-list li {
    grid-template-columns: 1fr;
  }
}

/* ---------- Sub pages ---------- */

.page-head {
  padding-block: var(--space-top) clamp(48px, 7vw, 88px);
}

.page-head h1 {
  margin-top: 16px;
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

/* 見出しの上に小さなラベルがないときは、上の余白をそろえる */
.page-head h1:first-child {
  margin-top: 0;
}

.page-head .lead {
  max-width: 40em;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

/* 一行説明の英語と日本語は2行でひとまとまり */
.page-head .lead + .lead {
  margin-top: 4px;
}

.back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
  text-decoration: none;
}

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

.back + .label {
  margin-top: 48px;
}

/* 左に見出し、右に本文を置く行 */
.row {
  display: grid;
  gap: 16px;
  padding-block: 56px;
  border-top: 1px solid var(--line);
}

@media (min-width: 1000px) {
  .row {
    grid-template-columns: 200px 1fr;
    gap: 48px;
  }
}

/* ページ見出しを置かないページの最初の行。上の余白をメニュー側とそろえる */
.row-first {
  padding-top: var(--space-top);
  border-top: 0;
}

.prose {
  max-width: 40em;
  line-height: 2;
}

.prose p + p {
  margin-top: 1.6em;
}

/* 英語の段落が終わって日本語が始まるところは、少し広めにあける */
.prose p[lang="en"] + p:not([lang]) {
  margin-top: 2.8em;
}

.refs li {
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
}

.refs li + li {
  margin-top: 20px;
}

/* 自分の名前。周りの文字をグレーにして、名前だけ濃く太く、下線付きにする */
.refs b {
  font-weight: 700;
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

/* ---------- Video（クリックするまで YouTube を読み込まない） ---------- */

.video {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  margin-bottom: 24px;
  background: #000;
}

.video a,
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity var(--slow) var(--ease);
}

.video a:hover img {
  opacity: 1;
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
}

.play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -6px;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}

/* 動画がない作品の画像（動画と同じ 16:9） */
.cover {
  margin-bottom: 24px;
}

.cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface);
}

/* 制作メンバー（左に役割、右に名前） */
.credits {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 32px;
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}

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

.credits dd {
  margin: 0;
}

@media (max-width: 599px) {
  .credits {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .credits dd + dt {
    margin-top: 12px;
  }
}

/* ---------- Contact ---------- */

.contact-main {
  font-size: 16px;
  letter-spacing: 0.03em;
}

/* リンクに添える一言（英語と日本語） */
.note {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.contact-main + .note {
  margin-top: 12px;
}

/* 左にサービス名、右にリンク */
.links li {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr);
  gap: 20px;
}

.links li + li {
  margin-top: 20px;
}

.links .label {
  padding-top: 0.25em;
}

@media (max-width: 599px) {
  .links li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ---------- Profile ---------- */

.profile {
  display: grid;
  gap: 40px;
  padding-bottom: clamp(56px, 8vw, 104px);
}

@media (min-width: 1000px) {
  .profile {
    grid-template-columns: 3fr 2fr;
    align-items: end;
    gap: 56px;
  }
}

.profile img {
  border-radius: var(--radius);
}

.profile-name {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.profile-meta {
  margin-top: 28px;
  font-size: 14px;
}

.profile-meta p + p {
  margin-top: 10px;
}

/* 英語のプロフィールの下に置く日本語版。大きく間をあけて線で区切る */
.profile-ja {
  margin-top: var(--space-section);
  padding-top: var(--space-section);
  border-top: 1px solid var(--line);
}

.profile-ja-head {
  padding-bottom: clamp(56px, 8vw, 104px);
}

.timeline li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 20px;
}

.timeline li {
  line-height: 1.8;
}

.timeline li + li {
  margin-top: 4px;
}

.timeline .label {
  padding-top: 0.25em;
}

/* スマホでは年を本文の上に置き、本文の幅を確保する */
@media (max-width: 599px) {
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .timeline li + li {
    margin-top: 12px;
  }
}
