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

/* Removed html, body { height: 100%; } entirely to prevent Lenis breaking on Mac */

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Tailwind CDN override */
:root {
  --black: #050505;
  --offwhite: #e6e6e6;
  --brand: #5170ff;
}

body {
  background: var(--black);
  color: var(--offwhite);
}

.top-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--brand);
  z-index: 9999;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.04;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MDAiIGhlaWdodD0iNTAwIj48ZmlsdGVyIGlkPSJnoiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2cpIiBvcGFjaXR5PSIxIi8+PC9zdmc+');
}

.stroke-text {
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  color: transparent;
}

/* Cursor (PC only) */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none !important;
  display: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: width .25s, height .25s, background-color .25s, border-color .25s;
}

body.hovering .cursor-outline {
  width: 80px;
  height: 80px;
  background-color: rgba(81, 112, 255, 0.10);
  border-color: var(--brand);
}

@media (hover:hover) and (pointer:fine) {
  body {
    cursor: none;
  }

  .cursor-dot,
  .cursor-outline {
    display: block;
  }
}

/* Reveal helpers */
.image-wrapper {
  overflow: hidden;
  position: relative;
}

.image-wrapper img {
  will-change: transform;
  transform: scale(1.2);
}

.char-reveal {
  overflow: hidden;
  display: block;
}

.char-reveal span {
  display: block;
  transform: translateY(110%);
}

/* Sticky title */
.work-sticky-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
  mix-blend-mode: exclusion;
  overflow: hidden;
}

.outline-title {
  font-size: 15vw;
  line-height: .8;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 2px #fff;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  letter-spacing: -0.02em;
}

/* Arcs */
.intro-arc-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.intro-arc {
  width: 200vw;
  height: 200vw;
  background: var(--offwhite);
  border-radius: 50% 50% 0 0;
  transform: translateY(100%);
  will-change: transform;
}

.transition-arc-block {
  position: relative;
  width: 100%;
  height: clamp(96px, 18vh, 280px);
  overflow: hidden;
  pointer-events: none;
}

.transition-arc-block--white {
  background: var(--black);
}

.transition-arc-block--black {
  background: var(--offwhite);
}

.transition-arc-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.transition-arc {
  width: 220vw;
  height: 220vw;
  border-radius: 50% 50% 0 0;
  transform: translateY(100%);
  will-change: transform;
}

.transition-arc--white {
  background: var(--offwhite);
}

.transition-arc--black {
  background: var(--black);
}

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

  .intro-arc,
  .transition-arc,
  .image-wrapper img,
  .char-reveal span {
    transform: none !important;
  }
}

/* =========================================
   ★SP (Mobile) レイアウト・余白・アーク調整
   ========================================= */
@media (max-width: 640px) {
  header {
    height: 100svh !important;
  }

  .hero-wrap {
    justify-content: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* 上の英語：余白を詰める */
  .hero-text {
    font-size: 10px !important;
    letter-spacing: 0.2em !important;
    margin-bottom: 6px !important;
    /* さらに短縮 */
  }

  /* タイトル：余白を詰める */
  header h1 {
    font-size: clamp(40px, 13vw, 64px) !important;
    line-height: 0.85 !important;
    margin-bottom: 6px !important;
    /* さらに短縮 */
  }

  /* リード文：余白を詰める */
  .hero-lead {
    font-size: 13px !important;
    line-height: 1.7 !important;
    width: 88% !important;
    margin-top: 10px !important;
    /* さらに短縮（文字の後ろの余白カット） */
  }

  /* アークの巨大化（真っ白にするため） */
  /* heightを140vhにすることで、0%の位置に来た時に上部40vh分が画面外に突き抜けます */
  .intro-arc {
    width: 250vw !important;
    /* 幅も広げてカーブを緩やかにし、全体を覆いやすくする */
    height: 160vh !important;
    /* transformの指定は削除（GSAPのアニメーションに任せるため） */
  }
}

/* =============================
   AIに聞いてみる Floating Widget
   ============================= */
.aiask-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  font-family: system-ui, -apple-system, "Inter", "Noto Sans JP", sans-serif;
}

.aiask-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
  background: rgba(5, 5, 5, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .35);
}

.aiask-btn:active {
  transform: translateY(1px);
}

.aiask-badge {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 2px 8px;
  border-radius: 999px;
}

.aiask-panel {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: min(340px, calc(100vw - 36px));
  background: rgba(10, 10, 10, .90);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, .45);
  display: none;
}

.aiask-panel.open {
  display: block;
}

.aiask-title {
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 4px 0 10px;
}

.aiask-desc {
  color: rgba(255, 255, 255, .70);
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 10px;
}

.aiask-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 640px) {
  .aiask-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.aiask-chip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.aiask-chip:hover {
  background: rgba(81, 112, 255, .15);
  border-color: rgba(81, 112, 255, .45);
}

.aiask-foot {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.aiask-copy,
.aiask-close {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
}

.aiask-copy:hover,
.aiask-close:hover {
  background: rgba(255, 255, 255, .10);
}

.aiask-toast {
  margin-top: 10px;
  color: rgba(255, 255, 255, .80);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}

.aiask-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .aiask-wrap {
    right: 14px;
    bottom: 14px;
  }

  .aiask-btn {
    padding: 11px 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aiask-toast {
    transition: none;
  }
}

@media (max-width: 360px) {
  .aiask-chip {
    font-size: 11px;
    padding: 0 8px;
  }
}

/* =============================
   Sidebar / Scroll Fixes
   ============================= */
.sidebar,
aside,
#right-sidebar,
#left-sidebar {
  overflow-y: auto;
  overscroll-behavior: none;
  /* Changed from contain to none for Mac bounce scroll */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  max-height: 100vh;
  /* Critical: Without height limit, overflow-y won't trigger */
}