/* ============ base ============ */
:root {
  --bg: #030204;
  --ink: #f4f0ea;
  --dim: #8f8698;
  --hair: rgba(244, 240, 234, 0.14);
  --amethyst: #c9a0ff;
  --sea: #7de8e0;
  --serif: "Instrument Serif", serif;
  --mono: "JetBrains Mono", monospace;
  --jp: "Zen Kaku Gothic New", sans-serif;
  --mincho: "Shippori Mincho", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--jp);
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0.05em;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
::selection { background: var(--amethyst); color: #0a0510; }

/* ============ atmosphere ============ */
#dust { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none; opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(2) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(2%, -1%); }
  100% { transform: translate(-1%, 2%); }
}

/* ============ top bar ============ */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 20px 4vw;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 400;
  letter-spacing: 0.28em; color: var(--ink);
  mix-blend-mode: difference;
}
.bar sup { font-size: 0.5em; letter-spacing: 0; }
.bar-mid { opacity: 0.55; }
.bar-link { position: relative; }
.bar-link::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
}
.bar-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ============ hero ============ */
.hero {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 5vw;
}
.hero-kicker {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.5em;
  color: var(--dim); margin-bottom: 4vh;
}
.hero-word {
  position: relative;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(5rem, 21vw, 19rem);
  line-height: 0.85; letter-spacing: 0.02em;
  background-image: url("assets/hero-bloom.png");
  background-size: cover; background-position: 50% 38%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: brightness(1.5) saturate(1.15);
  animation: heroPan 26s ease-in-out infinite alternate;
}
/* legibility layer: faint outline + glow so the name reads over dark image areas */
.hero-word::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: none; color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 240, 234, 0.42);
  text-shadow: 0 0 46px rgba(201, 160, 255, 0.35);
}
@keyframes heroPan {
  from { background-position: 50% 30%; }
  to   { background-position: 50% 60%; }
}
.hero-catch {
  margin-top: 5.5vh;
  font-family: var(--mincho); font-weight: 500;
  font-size: clamp(1.5rem, 3.6vw, 2.7rem);
  letter-spacing: 0.3em; text-indent: 0.3em; line-height: 1.4;
}
.hero-line {
  margin-top: 1.6vh;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  letter-spacing: 0.04em; line-height: 1.3; color: var(--dim);
}
.hero-jp { margin-top: 3vh; font-size: 0.8rem; color: var(--dim); letter-spacing: 0.22em; }
.hero-hint {
  position: absolute; bottom: 4vh; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.45em; color: var(--dim);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.hero-hint span {
  width: 1px; height: 52px; background: linear-gradient(var(--ink), transparent);
  animation: hint 2.4s ease-in-out infinite;
}
@keyframes hint {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
/* intro cascade on load */
.intro-a, .intro-b, .intro-c, .intro-d {
  opacity: 0; transform: translateY(24px); filter: blur(6px);
  animation: intro 1.3s cubic-bezier(0.2, 0.65, 0.2, 1) forwards;
}
.intro-b { animation-delay: 0.15s; }
.intro-c { animation-delay: 0.45s; }
.intro-d { animation-delay: 0.7s; }
@keyframes intro { to { opacity: 1; transform: none; filter: blur(0); } }

/* ============ pinned chapters ============ */
.pin { position: relative; height: 280vh; z-index: 2; }
.pin-vp {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; place-items: center;
}
.ghost {
  position: absolute; z-index: 3;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(6rem, 24vw, 24rem); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 240, 234, 0.35);
  pointer-events: none; white-space: nowrap;
}
.cap { position: absolute; z-index: 4; max-width: 460px; }
.cap-label, .mono-label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.45em;
  color: var(--sea); margin-bottom: 18px;
}
.cap-ja {
  font-family: var(--mincho); font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.55;
  letter-spacing: 0.16em; margin-bottom: 16px;
}
.cap-en { font-size: clamp(1rem, 1.8vw, 1.35rem); line-height: 1.4; color: var(--dim); }

/* CH.01 — bloom opens inside a growing circle */
.ch1-fig { position: absolute; inset: 0; }
.ch1-fig img {
  width: 100%; height: 100%; object-fit: cover;
  clip-path: circle(calc(6% + var(--p, 0) * 90%) at 50% 50%);
  transform: scale(calc(1.28 - var(--p, 0) * 0.28));
  filter: saturate(calc(0.7 + var(--p, 0) * 0.5));
}
.ch1 .ghost-1 {
  top: 12%;
  transform: translateY(calc(var(--p, 0) * -9vh));
  opacity: calc(1 - var(--p, 0) * 0.55);
}
.cap-1 {
  left: 6vw; bottom: 10vh;
  opacity: calc(var(--p, 0) * 3 - 1.6);
  transform: translateY(calc((1 - min(1, var(--p, 0) * 1.6)) * 30px));
}

/* CH.02 — vine grows across the void */
.ch2-fig { position: absolute; inset: 0; }
.ch2-fig img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(100deg, #000 calc(var(--p, 0) * 120% - 16%), transparent calc(var(--p, 0) * 120%));
  mask-image: linear-gradient(100deg, #000 calc(var(--p, 0) * 120% - 16%), transparent calc(var(--p, 0) * 120%));
  transform: scale(calc(1.06 + var(--p, 0) * 0.06)) rotate(calc(var(--p, 0) * -1.6deg));
  opacity: 0.9;
}
.ch2 .ghost-2 {
  bottom: 10%;
  letter-spacing: calc(0.55em - var(--p, 0) * 0.5em);
  opacity: calc(0.25 + var(--p, 0) * 0.75);
  -webkit-text-stroke: 1px rgba(125, 232, 224, 0.4);
}
.cap-2 {
  right: 6vw; top: 14vh; text-align: right;
  opacity: calc(var(--p, 0) * 3 - 1.2);
  transform: translateY(calc((1 - min(1, var(--p, 0) * 1.4)) * 30px));
}

/* CH.03 — the field surfaces from darkness */
.ch3-fig { position: absolute; inset: 0; }
.ch3-fig img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(calc(1.3 - var(--p, 0) * 0.3));
  filter: brightness(calc(0.35 + var(--p, 0) * 0.75));
}
.ch3-center {
  position: relative; z-index: 4; text-align: center;
  opacity: calc(var(--p, 0) * 2.4 - 0.7);
}
.ch3-word {
  font-size: clamp(2rem, 6vw, 4.6rem); line-height: 1.15;
  letter-spacing: calc(0.3em - var(--p, 0) * 0.28em);
  text-shadow: 0 4px 44px rgba(3, 2, 4, 0.9);
}
.ch3-ja {
  margin-top: 3vh;
  font-family: var(--mincho); font-weight: 500;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  letter-spacing: 0.34em; text-indent: 0.34em;
  text-shadow: 0 2px 30px rgba(3, 2, 4, 0.95);
}

/* ============ studio (business) ============ */
.studio { position: relative; z-index: 2; padding: 22vh 6vw; max-width: 1120px; margin: 0 auto; }
.studio-list { list-style: none; }
.studio-list li {
  display: grid; grid-template-columns: 90px 1fr; gap: 4vw; align-items: baseline;
  padding: 7vh 0; border-bottom: 1px solid var(--hair);
  transition: padding-left 0.5s cubic-bezier(0.2, 0.65, 0.2, 1);
}
.studio-list li:first-of-type { border-top: 1px solid var(--hair); }
.studio-list li:hover { padding-left: 1.2vw; }
.s-num { font-family: var(--serif); font-size: 1.3rem; color: var(--amethyst); }
.s-body h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5.4vw, 4.4rem); line-height: 1.05; margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 26px; flex-wrap: wrap;
}
.s-ja {
  font-family: var(--mincho); font-weight: 500;
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  letter-spacing: 0.28em; color: var(--sea);
}
.studio-list li:hover .s-body h2 em {
  background: linear-gradient(100deg, var(--ink) 30%, var(--amethyst) 60%, var(--sea));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.s-jp { max-width: 560px; font-size: 0.85rem; color: var(--dim); }

/* ============ company ============ */
.company { position: relative; z-index: 2; padding: 8vh 6vw 20vh; }
.company-cols {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 7vw; align-items: center;
}
.company-head { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 400; margin-bottom: 6vh; }
.ctable div {
  display: grid; grid-template-columns: 130px 1fr; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--hair); align-items: baseline;
}
.ctable div:first-of-type { border-top: 1px solid var(--hair); }
.ctable dt { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.3em; color: var(--dim); }
.ctable dd { font-size: 0.9rem; font-weight: 400; letter-spacing: 0.06em; }
.ctable a { border-bottom: 1px solid var(--amethyst); }
.ctable a:hover { color: var(--amethyst); }
.company-prism img {
  border-radius: 6px; opacity: 0.92;
  animation: prismFloat 9s ease-in-out infinite alternate;
  box-shadow: 0 30px 90px rgba(201, 160, 255, 0.14);
}
@keyframes prismFloat { from { transform: translateY(10px) rotate(-1.4deg); } to { transform: translateY(-10px) rotate(1.4deg); } }

/* ============ contact ============ */
.contact {
  position: relative; z-index: 2; text-align: center;
  padding: 24vh 5vw; border-top: 1px solid var(--hair);
  background: radial-gradient(ellipse 55% 42% at 50% 108%, rgba(201, 160, 255, 0.13), transparent);
}
.contact-jp {
  font-family: var(--mincho); font-weight: 500;
  font-size: clamp(1.3rem, 3vw, 2.2rem); letter-spacing: 0.3em; text-indent: 0.3em;
  margin-bottom: 6vh;
}
.contact-mail {
  display: inline-block;
  font-size: clamp(2.2rem, 7.5vw, 6.4rem); line-height: 1.1;
  letter-spacing: 0.01em;
  transition: letter-spacing 0.6s cubic-bezier(0.2, 0.65, 0.2, 1), color 0.4s;
  position: relative;
}
.contact-mail::after {
  content: ""; position: absolute; left: 0; bottom: 2px; width: 100%; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1);
}
.contact-mail:hover { letter-spacing: 0.06em; color: var(--amethyst); }
.contact-mail:hover::after { transform: scaleX(1); transform-origin: left; background: var(--amethyst); }

/* ============ footer ============ */
.foot {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between;
  padding: 26px 4vw; border-top: 1px solid var(--hair);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.3em; color: var(--dim);
}

/* ============ reveal ============ */
.reveal {
  opacity: 0; transform: translateY(34px); filter: blur(5px);
  transition: opacity 1.1s cubic-bezier(0.2, 0.65, 0.2, 1),
              transform 1.1s cubic-bezier(0.2, 0.65, 0.2, 1),
              filter 1.1s cubic-bezier(0.2, 0.65, 0.2, 1);
}
.reveal.is-visible { opacity: 1; transform: none; filter: blur(0); }

/* NOTE: demo site — scroll motion is the product itself, so the experience
   runs regardless of the OS prefers-reduced-motion flag (award-site convention). */

@media (max-width: 860px) {
  .bar-mid { display: none; }
  .pin { height: 220vh; }
  .cap { max-width: 74vw; }
  .cap-1 { left: 7vw; bottom: 8vh; }
  .cap-2 { right: 7vw; top: 12vh; }
  .studio-list li { grid-template-columns: 1fr; gap: 10px; }
  .company-cols { grid-template-columns: 1fr; gap: 8vh; }
  .company-prism { max-width: 300px; margin: 0 auto; }
  .contact { padding: 18vh 5vw; }
  .foot { flex-direction: column; gap: 8px; }
}
