:root {
  --bg: #0f0f0f;
  --bg-band: #181818;
  --fg: #fff;
  --fg-dim: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.06);
  --font-display: "Barlow", sans-serif;
  --font-body: "Noto Sans JP", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* native scroll is the input; the page chases it with inertia in JS */

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* paper-like grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ---------------- loader ---------------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-line {
  display: block;
  width: 200px;
  height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---------------- fixed grid lines ---------------- */

.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  justify-content: space-around; /* 5 lines land on 10/30/50/70/90% */
}

.grid-lines span {
  width: 1px;
  height: 100%;
  background: var(--line);
}

/* ---------------- webgl canvas ---------------- */

.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

/* ---------------- fixed chrome ---------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 36px;
}

.logo-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #0f0f0f;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  padding-bottom: 4px;
}

.logo-dot {
  position: absolute;
  right: -4px;
  bottom: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.25em;
  padding-top: 8px;
}

.header-nav i {
  font-style: normal;
  color: var(--fg-dim);
  font-size: 10px;
}

.header-nav a {
  position: relative;
}

.header-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.menu-toggle {
  position: fixed;
  top: 50%;
  right: 36px;
  z-index: 80;
  width: 30px;
  height: 22px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: #fff;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-toggle span:nth-child(1) { top: 7px; }
.menu-toggle span:nth-child(2) { top: 14px; }

.menu-toggle:hover span:nth-child(1) { transform: translateY(-3px); }
.menu-toggle:hover span:nth-child(2) { transform: translateY(3px); }

.menu-toggle.is-open span:nth-child(1) { transform: translateY(3.5px) rotate(20deg); }
.menu-toggle.is-open span:nth-child(2) { transform: translateY(-3.5px) rotate(-20deg); }

.copyright-vertical {
  position: fixed;
  left: 36px;
  bottom: 32px;
  z-index: 50;
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--fg-dim);
}

.scroll-hint {
  position: fixed;
  right: 40px;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.scroll-hint-label {
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--fg-dim);
}

.scroll-hint-line {
  position: relative;
  width: 1px;
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.scroll-hint-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -100%;
  width: 100%;
  height: 100%;
  background: #fff;
  animation: scrollLine 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes scrollLine {
  0%   { top: -100%; }
  55%  { top: 0; }
  100% { top: 100%; }
}

.page-dot {
  position: fixed;
  right: 36px;
  bottom: 32px;
  z-index: 50;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
}

.page-dot.is-visible {
  opacity: 1;
  transform: scale(1);
}

.page-dot:hover {
  transform: scale(1.35);
}

/* ---------------- menu overlay ---------------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8vh;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4vh;
}

.menu-link {
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: 0.3em;
}

.menu-link span {
  display: inline-block;
  transition: opacity 0.3s;
}

.menu-link:hover span {
  opacity: 0.4;
}

.menu-foot {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
}

/* ---------------- hero ---------------- */

.page {
  position: relative;
  z-index: 10;
}

.hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-title {
  display: flex;
  justify-content: center;
  width: 100%;
}

.title-canvas {
  display: block;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero-tagline {
  position: absolute;
  right: 12vw;
  bottom: 12vh;
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
}


/* ---------------- projects ---------------- */

.projects {
  position: relative;
  padding: 18vh 7vw 10vh;
}

.section-title {
  text-align: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  margin-bottom: 14vh;
}

.section-title span {
  display: inline-block;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.project-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.2fr 0.95fr;
  column-gap: 3.5vw;
  row-gap: 14vh;
  align-items: start;
}

.project {
  position: relative;
}

/* staggered columns like the reference: bigger center, sinking right */
.project:nth-child(3n + 1) { transform: translateY(3vh); }
.project:nth-child(3n + 3) { transform: translateY(9vh); }

.project-no {
  position: absolute;
  top: -1.4em;
  right: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.project-no::before {
  content: "#";
  font-size: 0.7em;
  vertical-align: 0.2em;
  margin-right: 1px;
  color: var(--fg-dim);
}

.project-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
}

.project-thumb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s;
  filter: saturate(0.85);
}

.project:hover .project-thumb canvas {
  transform: scale(1.06);
  filter: saturate(1.15);
}

.project-caption {
  margin-top: 14px;
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
}

/* ---------------- statements ---------------- */

/* zig-zag display type rendered into a WebGL canvas: sharp/blur texture
   pair mixed by animated noise, long lines bleed off the viewport edge */
.statement {
  position: relative;
  padding: 16vh 0;
}

.statement-canvas {
  display: block;
  pointer-events: none;
}

.statement-copy {
  margin-top: 14vh;
  margin-left: var(--copy-indent, 30vw);
  font-size: 13px;
  line-height: 3.4;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.9);
}

/* ---------------- contact ---------------- */

.contact {
  padding: 20vh 0 28vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9vh;
}

.contact-band {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70%;
  height: 18vh;
  min-height: 150px;
  background: var(--bg-band);
  overflow: hidden;
  position: relative;
}

.contact-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.05);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-band:hover::after {
  transform: scaleY(1);
}

.contact-band-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(18px, 1.8vw, 26px);
  letter-spacing: 0.55em;
  margin-right: -0.55em;
}

.contact-address {
  font-size: 13px;
  line-height: 2.6;
  letter-spacing: 0.18em;
  text-align: center;
}

.contact-map {
  font-size: 12px;
  color: var(--fg-dim);
  transition: color 0.3s;
}

.contact-map:hover {
  color: #fff;
}

/* ---------------- responsive ---------------- */

@media (max-width: 860px) {
  .project-grid {
    grid-template-columns: 1fr;
    row-gap: 10vh;
  }

  .project:nth-child(3n + 1),
  .project:nth-child(3n + 3) {
    transform: none;
  }

  .hero-tagline {
    right: 8vw;
    bottom: 9vh;
  }

  .copyright-vertical,
  .scroll-hint {
    display: none;
  }

  .statement {
    padding: 12vh 0;
  }

  .statement-copy {
    margin-left: 8vw;
    margin-right: 8vw;
  }
}
