@charset "UTF-8";
/* Rinpa IO Landing (white-base, SCSS source) */
:root {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --text: #111111;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #0a84ff;
  --accent-contrast: #ffffff;
  --maxw: 1120px;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

.landing-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6rem 1.25rem;
}

.hero {
  padding-top: 10vh;
  padding-bottom: 12vh;
  text-align: left;
}
.hero h1 {
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 1rem 0;
  /* ラテン=Inter、日本語=Zen Kaku を優先 */
  font-family: "Inter", "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
}
.hero p {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--muted);
  margin: 0 0 2rem 0;
}

/* Subcopy per-character reveal (right-to-left, slide-up + fade-in) */
.hero-subcopy {
  display: inline-block;
  white-space: pre-wrap;
  --base-delay: 1.34s;
}

.hero-subcopy .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  filter: blur(2px);
  animation: subcopy-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--base-delay, 0s) + var(--i) * 40ms);
}

@keyframes subcopy-in {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-subcopy .char {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}
/* Optional mobile line-break controller for headline */
.br-mobile {
  display: none;
}

@media (max-width: 900px) {
  /* Give tiny scrollable space at edges to avoid iOS rubber-band catching small drags */
  /* edge spacers removed */
  /* Remove global main side padding on mobile so tiles can be edge-to-edge */
  main {
    padding-left: 0;
    padding-right: 0;
  }
  .br-mobile {
    display: inline;
  }
}
/* Mobile-only headline reveal animation */
@media (hover: none) {
  .hero-headline .reveal-line {
    position: relative;
    display: inline-block;
    /* 最初は文字だけ透明にして、黒ベタは見えるようにする */
    color: transparent;
    -webkit-text-fill-color: transparent; /* iOSでの滲み防止 */
    text-shadow: none; /* うっすら見えるのを防止 */
  }
  /* 行の可視化はバー停止直後（65%付近）に行う → 1.6s * 0.65 ≒ 1.04s */
  .hero-headline .reveal-line:nth-of-type(1) {
    animation: line-appear 0.001s linear forwards;
    animation-delay: 1.04s;
  }
  .hero-headline .reveal-line:nth-of-type(2) {
    animation: line-appear 0.001s linear forwards;
    animation-delay: 1.19s;
  }
  .hero-headline .reveal-line:nth-of-type(3) {
    animation: line-appear 0.001s linear forwards;
    animation-delay: 1.34s;
  }
  .hero-headline .reveal-line::after {
    content: "";
    position: absolute;
    top: -0.15em;
    bottom: -0.15em;
    right: 0;
    left: -100vw; /* 行の上下を少し広げて完全に覆う */
    background: #000; /* 黒ベタで覆う */
    z-index: 1;
    opacity: 0; /* ディレイ中は非表示にしてフラッシュ防止（2,3 行） */
    animation: reveal-swipe 1.6s linear forwards;
    will-change: transform;
  }
  .hero-headline .reveal-line:nth-of-type(1)::after {
    animation-delay: 0s;
  }
  .hero-headline .reveal-line:nth-of-type(2)::after {
    animation-delay: 0.15s;
  }
  .hero-headline .reveal-line:nth-of-type(3)::after {
    animation-delay: 0.3s;
  }
}
/* Desktop headline reveal animation (same black swipe as mobile) */
@media (hover: hover) and (pointer: fine) {
  .hero-headline .reveal-line {
    position: relative;
    display: inline-block;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
  .hero-headline .reveal-line:nth-of-type(1) {
    animation: line-appear 0.001s linear forwards;
    animation-delay: 1.04s;
  }
  .hero-headline .reveal-line:nth-of-type(2) {
    animation: line-appear 0.001s linear forwards;
    animation-delay: 1.19s;
  }
  .hero-headline .reveal-line:nth-of-type(3) {
    animation: line-appear 0.001s linear forwards;
    animation-delay: 1.34s;
  }
  .hero-headline .reveal-line::after {
    content: "";
    position: absolute;
    top: -0.15em;
    bottom: -0.15em;
    right: 0;
    left: -100vw; /* 行の上下を少し広げて完全に覆う */
    background: #000;
    z-index: 1;
    opacity: 0;
    animation: reveal-swipe 1.6s linear forwards;
    will-change: transform;
  }
  .hero-headline .reveal-line:nth-of-type(1)::after {
    animation-delay: 0s;
  }
  .hero-headline .reveal-line:nth-of-type(2)::after {
    animation-delay: 0.15s;
  }
  .hero-headline .reveal-line:nth-of-type(3)::after {
    animation-delay: 0.3s;
  }
}
@keyframes line-appear {
  to {
    color: inherit;
    -webkit-text-fill-color: currentColor;
  }
}
@keyframes reveal-swipe {
  /* 左→右は強めの減速（ease-out cubic-bezier）、右端で停止、右→左は強めの加速（ease-in cubic-bezier） */
  0% {
    transform: translateX(-100%);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  }
  40% {
    transform: translateX(0);
    opacity: 1;
  }
  65% {
    transform: translateX(0);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0);
  }
  100% {
    transform: translateX(-100%);
    opacity: 0;
  }
}
/* Blend only subtitle with background; keep headline solid */
.hero-text p {
  mix-blend-mode: overlay; /* fallback */
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

@supports (mix-blend-mode: color-burn) {
  .hero-text p {
    mix-blend-mode: color-burn; /* richer ink-on-gold for subtitle */
  }
}
/* Headline: solid black, no blending */
.hero-text h1 {
  color: #000;
  mix-blend-mode: normal;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  letter-spacing: -0.01em; /* slightly tighter */
}

/* (removed) headline follows solid black setting above */
/* Full-bleed background for header + hero on front page */
.hero-wrap {
  width: 100%;
  /* Temporarily hide kinpaku background */
  background: none;
  /* Use dynamic viewport units on mobile to avoid Safari URL-bar resize jank */
  min-height: 100vh; /* fallback */
}
@supports (height: 100dvh) {
  .hero-wrap {
    min-height: 100dvh;
  }
}
@supports (height: 100svh) {
  .hero-wrap {
    min-height: 100svh;
  }
}
.hero-wrap {
  display: flex;
  align-items: center;
  isolation: isolate; /* confine blend to this backdrop */
  /* removed bottom padding */
}

/* Place header over hero background on front page */
header.site-header {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10;
  background: transparent;
}

/* Remove top padding from main so background reaches the very top */
main {
  padding-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.25rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  font-weight: 600;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
}

.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.section-header {
  margin-bottom: 1.5rem;
}
.section-header h2 {
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  margin: 0 0 0.5rem 0;
}
.section-header p {
  color: var(--muted);
  margin: 0;
}

.grid-showcase {
  display: grid;
  grid-template-columns: 1fr; /* stack vertically */
  gap: 3rem; /* larger gap between posts */
}

/* Alternating image/text layout for Selected work */
.work-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

/* Alternate: odd rows flip order so media block goes to the right */
#work .grid-showcase .work-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.work-media {
  width: 60%;
  flex: 0 0 60%;
}

.work-spacer {
  width: 40%;
  flex: 0 0 40%;
}

.work-item .tile {
  width: 100%;
  flex: 0 0 auto;
}

.work-item .work-copy {
  width: 100%;
  flex: 0 0 auto;
  padding: 0.75rem 0 1rem;
}

.work-item .work-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.work-item .work-excerpt {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.5rem, 4vw, 3rem); /* デフォルトは視覚的訴求のため大きく表示する. */
  line-height: 1.6;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* Card lines (PC only; JS injects an <svg> inside .work-item) */
@media (hover: hover) and (pointer: fine) {
  .work-item {
    position: relative;
  }
  #work {
    position: relative;
  }
  .work-item > svg.card-lines {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    z-index: 1;
  }
  .work-item > svg.card-lines .card-line {
    stroke: #000;
    stroke-width: 1.5;
    stroke-linecap: round;
  }
  #work > svg.overlay-lines {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    z-index: 0;
  }
  #work > svg.overlay-lines .overlay-line {
    stroke: #000;
    stroke-width: 1.5;
    stroke-linecap: round;
  }
  /* PC-only: add a solid black frame around post images */
  .work-media {
    --frame: clamp(8px, 1.1vw, 18px);
  }
  .work-media .tile {
    border: var(--frame) solid #000;
    background: #000;
  }
  /* PC-only: title/excerpt as black plate with white text */
  .reveal-title,
  .work-item .work-title {
    background: #000;
    color: #fff;
    padding: 0.4em 0.5em;
  }
  /* Try to shrink title plate to content width */
  .work-item .work-title {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
  }
  .reveal-excerpt,
  .work-item .work-excerpt {
    background: #000;
    color: #fff;
    display: inline-block;
    padding: 0.15em 0.5em;
    /* タイトル同様に行ごとの装飾を維持 */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }
  /* PC-only: make excerpt text smaller than title */
  .work-item .work-excerpt {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.5;
    padding: 0.8em 1.25em;
  }
  /* PC-only: excerpt uses sliding black cover (like title) instead of fade/slide */
  .reveal-excerpt {
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  .reveal-excerpt::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 110%;
    background: #000;
    pointer-events: none;
    transform: translateX(0);
    transition: transform 760ms cubic-bezier(0.32, 0, 0.67, 0);
  }
  .reveal-excerpt.inview::after {
    transform: translateX(110%);
  }
  .reveal-excerpt.shown::after {
    transition: none !important;
    transform: translateX(110%) !important;
  }
  /* Force-disable global fade/slide on PC */
  .reveal-excerpt.inview,
  .reveal-excerpt.reset,
  .reveal-excerpt.reset.inview,
  .reveal-excerpt.prehide,
  .reveal-excerpt.no-anim {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  /* PC-only: remove white overlay on tiles */
  .tile::after {
    opacity: 0 !important;
    transition: none !important;
  }
  .tile:hover::after {
    opacity: 0 !important;
  }
}
/* Title white overlay reveal (on in-view) */
.reveal-title {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.reveal-title::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 110%;
  background: #fff;
  transform: translateX(0);
  transition: transform 760ms cubic-bezier(0.32, 0, 0.67, 0); /* ease-in 強め */
  pointer-events: none;
}

.reveal-title.inview::after {
  transform: translateX(110%);
}

.reveal-title.reset::after {
  transition: none;
  transform: translateX(0) !important;
}

/* Instantly show end state without anim (for up-direction entries) */
.reveal-title.shown::after {
  transition: none !important;
  transform: translateX(110%) !important;
}

/* Hide before trigger to avoid flash */
.reveal-title.prehide {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
}

/* Excerpt slide-up + fade-in on in-view */
.reveal-excerpt {
  opacity: 0;
  transform: translateY(0.6em);
  filter: blur(2px);
}

.reveal-excerpt.inview {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition: opacity 600ms ease, transform 600ms ease, filter 600ms ease;
}

/* End state without anim */
.reveal-excerpt.shown {
  transition: none !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  filter: blur(0) !important;
}

.work-item .work-excerpt .work-more {
  margin-left: 0.4rem;
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.work-item .work-excerpt .work-more:hover,
.work-item .work-excerpt .work-more:focus {
  text-decoration: underline;
}

.work-item .work-excerpt .work-more .icon-arrow {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

@media (max-width: 900px) {
  .work-item {
    flex-direction: column;
    align-items: stretch;
  }
  #work .grid-showcase .work-item:nth-child(odd) {
    flex-direction: column;
  }
  .work-media,
  .work-spacer {
    width: 100%;
    flex-basis: 100%;
  }
  .work-item .tile,
  .work-item .work-copy {
    width: 100%;
    padding: 0.75rem 0;
  }
  /* Restore side paddings for text block so titles/excerpts have gutters */
  .work-item .work-copy {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  /* Make tiles fit viewport width without causing horizontal scroll. */
  #work .landing-container {
    padding-left: 0;
    padding-right: 0;
  }
  .work-item .tile {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
  /* Removed overflow-x hack to avoid double-scroll/scroll jank on iOS. */
  /* スマホでは固定ページ本文と同じ可読性を優先し、抜粋の文字サイズと行間を本文相当に揃える. */
  .work-item .work-excerpt {
    font-size: 1rem; /* 固定ページ本文に合わせる（ベースサイズ相当）. */
    line-height: 1.8; /* 固定ページ本文と同じ行間. */
  }
}
/* (reverted iOS-specific touch hints and -webkit-fill-available fallback) */
/* Reset full-bleed margins to avoid horizontal overflow */
#work .grid-showcase {
  margin-left: 0;
  margin-right: 0;
}

.tile {
  background: var(--surface);
  border: 0;
  border-radius: 0;
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  position: relative;
  z-index: 0; /* establish stacking context so ::after and title layer correctly */
  /* White overlay over thumbnails (adjust alpha as needed) */
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff; /* use opacity for smooth transition */
  opacity: 0.6; /* default ~60% black */
  z-index: 1;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.tile {
  /* On hover, lighten overlay to ~10% */
}
.tile:hover::after {
  opacity: 0.1;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  filter: grayscale(100%);
}
.tile .tile-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.75rem 1rem;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
}
.tile canvas.gl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  /* Prevent canvas from intercepting touch events so vertical scroll stays responsive */
  pointer-events: none;
}

/* Hide HTML <img> when WebGL is ready */
.tile.gl-ready img {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Mobile/touch: when tile is in viewport, remove white overlay */
@media (hover: none) {
  .tile.inview::after {
    opacity: 0;
  }
  /* B: lighten mobile rendering by disabling blend/filter */
  .hero-text p {
    mix-blend-mode: normal;
    text-shadow: none;
  }
  .tile img {
    filter: none;
  }
}
/* (reverted) iOS-specific lightweight profile removed */
@media (prefers-reduced-motion: reduce) {
  .tile canvas.gl-canvas {
    display: none;
  }
  .tile img {
    opacity: 1 !important;
  }
}
@media (max-width: 900px) {
  .grid-showcase {
    grid-template-columns: 1fr;
  }
}
/* Add minimal top padding on footer to reduce bottom-edge rubber-band catching */
/* removed footer top padding */
@media (min-width: 1024px) {
  header.site-header {
    max-width: none;
    margin: 0;
    padding-left: 2vw;
    padding-right: 2vw;
  }
  main {
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .landing-container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding-left: 2vw;
    padding-right: 2vw;
  }
}
/* Ensure edge-to-edge also on desktop breakpoints */
@media (min-width: 1024px) {
  #work .grid-showcase {
    margin-left: 0;
    margin-right: 0;
  }
}
/* Remove vertical padding for Selected work container and section */
#work {
  padding-top: 0;
  padding-bottom: 0;
}

#work .landing-container {
  padding-top: 0;
  padding-bottom: 0;
}

/* PC override footer: ensure excerpt has no fade/slide leftovers */
@media (hover: hover) and (pointer: fine) {
  .reveal-excerpt {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}
