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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    "Inter", "Yu Mincho", "游明朝", "YuMincho", "Noto Sans JP",
    "Hiragino Sans", "ヒラギノ角ゴ ProN", "Meiryo", sans-serif;
  color: #1a1a1a;
  background-color: #ffffff;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

/* ==============================
   Initial hidden state (prevent flash)
============================== */

html.js-loading body {
  opacity: 0;
}

/* ------------------------------
   Organic Flow Background
   （淡墨在和紙上擴散）
------------------------------ */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

/* 和紙底紋＋淡墨暈染 */
.site-bg::before {
  content: "";
  position: absolute;
  inset: -80px;
  background:
    radial-gradient(circle at 15% 20%, rgba(0,0,0,0.03), transparent 60%),
    radial-gradient(circle at 70% 10%, rgba(0,0,0,0.025), transparent 65%),
    radial-gradient(circle at 30% 80%, rgba(0,0,0,0.03), transparent 60%),
    radial-gradient(circle at 85% 70%, rgba(0,0,0,0.02), transparent 65%);
  filter: blur(1.2px);
  animation: bgDrift 50s ease-in-out infinite alternate;
  opacity: 0.75;
}

/* 中央墨斑，緩慢擴散 */
.site-bg-ink {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  left: 10%;
  top: 25%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(0,0,0,0.06), transparent 65%),
    radial-gradient(circle at 60% 60%, rgba(0,0,0,0.03), transparent 70%);
  filter: blur(4px);
  mix-blend-mode: multiply;
  opacity: 0.4;
  transform-origin: center;
  animation: inkSpread 70s ease-in-out infinite alternate;
}

/* 和紙纖維線條 */
.site-bg::after {
  content: "";
  position: absolute;
  inset: -60px;
  background-image:
    linear-gradient(120deg, rgba(0,0,0,0.028) 0.5px, transparent 0.5px),
    linear-gradient(210deg, rgba(0,0,0,0.02) 0.5px, transparent 0.5px);
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
  opacity: 0.5;
  animation: fiberShift 35s linear infinite alternate;
}

@keyframes bgDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-20px, 14px, 0) scale(1.03); }
}

@keyframes inkSpread {
  0% {
    transform: translate3d(0, 0, 0) scale(0.9);
    opacity: 0.28;
  }
  40% {
    transform: translate3d(-14px, 10px, 0) scale(1.05);
    opacity: 0.4;
  }
  100% {
    transform: translate3d(18px, -12px, 0) scale(1.18);
    opacity: 0.33;
  }
}

@keyframes fiberShift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(22px, -18px, 0); }
}

/* ------------------------------
   Layout
------------------------------ */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 80px;
}

@media (min-width: 768px) {
  .page {
    padding: 60px 60px 100px;
  }
}

.logo {
  position: fixed;
  top: 18px;
  left: 20px;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #6f6f6f;
  pointer-events: none;
}

.logo span {
  display: inline-block;
  margin-right: 0.6em;
}

/* ------------------------------
   Language Switch
------------------------------ */
.lang-switch {
  position: fixed;
  top: 18px;
  right: 20px;
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 8px 18px rgba(0,0,0,0.04);
  z-index: 10;

  /* 暫時隱藏 */
  /* opacity: 0;
  pointer-events: none; */
}

.lang-switch button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  color: #666;
  border-radius: 999px;
}

.lang-switch button:nth-child(2),
.lang-switch button:nth-child(3) {
  text-transform: none;
}

.lang-switch button.active {
  background: #1a1a1a;
  color: #ffffff;
}

/* ------------------------------
   Hero
------------------------------ */
.hero {
  max-width: 960px;
  text-align: center;
}

.hero-title-name {
  font-family: "Yu Mincho", "游明朝", serif;
  font-size: 28px;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.hero-title-role {
  font-size: 12px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #6f6f6f;
  margin-bottom: 10px;
}

.hero-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 26px;
}

.hero-copy {
  font-size: 14px;
  line-height: 2;
  color: #3b3b3b;
  max-width: 620px;
  margin: 0 auto;
}

.hero-kicker {
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

/* ------------------------------
   Gold Line
------------------------------ */
.gold-line-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  height: 1px;
  margin: 40px 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.gold-line-wrapper.visible {
  opacity: 1;
}

.gold-line {
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(217,183,119,0),
    rgba(217,183,119,0.9),
    rgba(232,201,138,0.6),
    rgba(217,183,119,0)
  );
  box-shadow: 0 0 10px rgba(232,201,138,0.65);
  filter: blur(0.2px);
}

.gold-line.animate {
  animation: goldSweep 8s linear forwards;
}

@keyframes goldSweep {
  0%   { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ------------------------------
   Main Nav
------------------------------ */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
}

.main-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.main-nav button {
  background: none;
  border: none;
  padding: 4px 0;
  color: #1a1a1a;
  cursor: pointer;
  position: relative;
}

.main-nav button::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: rgba(217,183,119,0.9);
  transition: width 0.4s ease;
}

.main-nav button:hover::after {
  width: 100%;
}

/* ------------------------------
   Sections
------------------------------ */
section {
  min-height: 100vh;
  padding: 100px 20px 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  section {
    padding: 140px 80px 100px;
  }
}

.section-inner {
  max-width: 960px;
  width: 100%;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #6f6f6f;
  margin-bottom: 28px;
}

.section-title {
  font-family: "Yu Mincho", "游明朝", serif;
  font-size: 22px;
  letter-spacing: 0.25em;
  margin-bottom: 24px;
}

.section-body {
  font-size: 14px;
  line-height: 2;
  color: #3b3b3b;
  max-width: 720px;
}

.section-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

@media (max-width: 768px) {
  .section-flex {
    flex-direction: column;
  }
}

/* ABOUT */
.about-block {
  flex: 1 1 320px;
}

.about-block-primary p + p {
  margin-top: 18px;
}

.about-block-secondary p + p {
  margin-top: 16px;
}

.about-tags {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a7a7a;
}

/* EXPERIENCE */
.experience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media (min-width: 900px) {
  .experience-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.exp-card {
  border-radius: 24px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 24px 22px 22px;
  background: rgba(255,255,255,0.92);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.04),
    0 0 0 1px rgba(255,255,255,0.9) inset;
  font-size: 13px;
  line-height: 1.9;
}

.exp-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 8px;
}

.exp-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.exp-card ul {
  margin-top: 12px;
  padding-left: 16px;
}

.exp-card li {
  margin-bottom: 4px;
}

/* WORK */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
  font-size: 13px;
  line-height: 2;
}

.work-item {
  padding: 18px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.work-item:last-child {
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.work-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 8px;
}

.work-tag {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 999px;
  padding: 2px 10px;
}

.work-year {
  opacity: 0.8;
}

.work-title {
  margin-bottom: 6px;
}

/* 補強 heading 結構：左側文字群＋右側 + 按鈕 */
.work-heading {
  justify-content: space-between;
}

.work-heading-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
}

/* ROLE 行 */
.work-role {
  margin: 6px 0 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a8a8a;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-role-label {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.1);
}

.work-role-text {
  color: #3b3b3b;
  letter-spacing: 0.05em;
  padding: 1px 0;
}

/* External project link (YouTube) */
.work-links {
  margin: 6px 0 10px;
}

.work-link {
  display: inline-flex;
  margin-top: 10px;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f6f6f;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding-bottom: 1px;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.work-link:hover {
  color: #1a1a1a;
  border-color: rgba(217,183,119,0.9);
  transform: translateY(-1px);
}

.work-link-icon {
  font-size: 10px;
  opacity: 0.7;
}

/* + 按鈕 */
.work-plus {
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.work-plus:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

/* AI */
.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  font-size: 13px;
  line-height: 2;
}

@media (min-width: 960px) {
  .ai-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ai-block h3 {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.ai-block ul {
  margin-top: 12px;
  padding-left: 16px;
}

.ai-block li {
  margin-bottom: 4px;
}

/* CONTACT */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 40px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.contact-copy {
  font-size: 14px;
  line-height: 2;
  color: #3b3b3b;
}

.contact-copy p + p {
  margin-top: 18px;
}

.contact-card {
  border-radius: 24px;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 22px 22px 18px;
  background: rgba(255,255,255,0.95);
  box-shadow:
    0 16px 34px rgba(0,0,0,0.05),
    0 0 0 1px rgba(255,255,255,0.9) inset;
  font-size: 13px;
}

.contact-line {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.contact-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 4px;
}

.contact-card a {
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.contact-card a:hover {
  border-color: rgba(217,183,119,0.8);
}

.contact-note {
  margin-top: 10px;
  font-size: 12px;
  color: #6f6f6f;
}


/* ==============================
   Language Switch Mist Transition
   （切換語言時：整個畫面像霧氣散開再聚集）
============================== */

/* 會參與霧化動畫的元素 */
.mist-fade {
  transition:
    opacity 0.5s ease,
    transform 1s ease,
    filter 1s ease;
}

/* 整個畫面散開成霧：變淡、微微下沉、模糊 */
body.lang-transition-out .mist-fade {
  opacity: 0;
  transform: translateY(1px);
  filter: blur(10px);
}

/* 新畫面聚回：從下方回到原位、變清晰 */
body.lang-transition-in .mist-fade {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ==============================
   Work Image Modal
============================== */

.work-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.work-modal.is-open {
  display: flex;
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.26);
  backdrop-filter: blur(4px);
}

.work-modal-dialog {
  position: relative;
  max-width: 960px;
  width: 90%;
  max-height: 80vh;
  padding: 20px 20px 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.work-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.work-modal-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f5f5f5;
}

.work-modal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}