/* ===== Base ===== */

* {
  box-sizing: border-box;
}

:root {
  --bg: #02070b;
  --card: #0b1319;
  --line: #1b2830;
  --text: #f5f5f7;
  --muted: #7d8c93;
  --dim: #33424a;
  --blue: #6aa6b6;
  --f: -apple-system,BlinkMacSystemFont,"SF Pro Display",Inter,"Noto Sans JP","Hiragino Sans",sans-serif;
  padding-top: env(safe-area-inset-top,0px);
  padding-bottom: env(safe-area-inset-bottom,0px);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  background: var(--bg);
}

html[lang=ja] [data-l=en],
html[lang=en] [data-l=ja] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ===== Header / language switch ===== */

.nav {
  position: sticky;
  top: env(safe-area-inset-top,0px);
  z-index: 10;
  height: 56px;
  padding: 0 max(4vw,20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2,7,11,.62);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand {
  font-weight: 600;
  letter-spacing: -.02em;
  font-size: 1.05rem;
}

.nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .8rem;
  color: #c7c7cc;
}

.nav a:hover {
  color: #fff;
}

.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px;
  font-size: .72rem;
}

.lang button {
  all: unset;
  cursor: pointer;
  padding: 4px 11px;
  border-radius: 99px;
  color: var(--muted);
  font-weight: 600;
}

html[lang=ja] .lang [data-set=ja],
html[lang=en] .lang [data-set=en] {
  background: #f5f5f7;
  color: #000;
}

/* ===== Layout & Hero ===== */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(4vw,20px);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10vh 20px 14vh;
  margin-top: -56px;
}

.glow {
  position: absolute;
  top: -10vh;
  left: 50%;
  width: 140vw;
  height: 90vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 45% 55% at 50% 0%,rgba(70,130,150,.24),transparent 70%),radial-gradient(ellipse 30% 40% at 25% 5%,rgba(255,255,255,.07),transparent 70%);
  animation: drift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero>* {
  position: relative;
}

.hero>.glow {
  position: absolute;
}

.eyebrow {
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .06em;
  margin: 0 0 26px;
}

h1 {
  font-size: clamp(3.4rem,11vw,9.5rem);
  line-height: 1.04;
  letter-spacing: -.05em;
  font-weight: 700;
  margin: 0;
}

.ln {
  display: block;
  overflow: hidden;
  padding-bottom: .1em;
}

.ln span {
  display: inline-block;
  background: linear-gradient(180deg,#fff 35%,#8a8a90);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  max-width: 620px;
  color: #a1a1a6;
  font-size: clamp(1.05rem,2vw,1.35rem);
  line-height: 1.75;
  margin: 34px auto 38px;
}

.cta {
  display: inline-block;
  background: #f5f5f7;
  color: #000;
  border-radius: 99px;
  padding: 14px 30px;
  font-weight: 600;
  font-size: .95rem;
  transition: .25s;
}

.cta:hover {
  background: #fff;
  transform: scale(1.04);
}

.more {
  color: var(--blue);
  margin-left: 24px;
  font-size: .95rem;
}

.cue {
  position: absolute !important;
  bottom: 5vh;
  left: 50%;
  width: 1px;
  height: 56px;
  background: linear-gradient(#fff,transparent);
  opacity: .5;
  animation: cue 2.2s ease-in-out infinite;
}

/* ===== Shared section styles ===== */

section.s {
  padding: 150px 0;
  border-top: 1px solid #0f1a21;
}

.label {
  color: var(--blue);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0 0 18px;
}

h2 {
  font-size: clamp(2.1rem,5.2vw,4.4rem);
  line-height: 1.12;
  letter-spacing: -.04em;
  font-weight: 700;
  margin: 0 0 30px;
}

.txt {
  color: #a1a1a6;
  font-size: 1.1rem;
  line-height: 1.9;
  max-width: 680px;
  margin: 0 0 18px;
}

/* ===== About: scroll-lit text ===== */

.scrub {
  font-size: clamp(1.6rem,4vw,3.3rem);
  line-height: 1.45;
  letter-spacing: -.03em;
  font-weight: 600;
  max-width: 980px;
  margin: 60px 0 0;
}

.js .scrub span {
  color: var(--dim);
  transition: color .35s;
}

.js .scrub span.on {
  color: var(--text);
}

/* ===== Model: cards & timeline ===== */

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 60px;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 42px;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%),rgba(255,255,255,.09),transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  letter-spacing: -.025em;
}

.card .m {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: .9rem;
}

.card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 1.2rem;
  font-weight: 500;
}

.tl {
  position: relative;
  margin-top: 90px;
  padding-left: 48px;
}

.tl::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.tl>i {
  position: absolute;
  left: 11px;
  top: 0;
  width: 2px;
  height: var(--p,0%);
  background: linear-gradient(#f5f5f7,var(--blue));
}

.st {
  position: relative;
  padding: 30px 0 34px;
}

.js .st {
  opacity: .25;
  transition: opacity .6s;
}

.js .st.on {
  opacity: 1;
}

.st::before {
  content: "";
  position: absolute;
  left: -44px;
  top: 42px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid #555;
  transition: .5s;
}

.st.on::before {
  background: #fff;
  border-color: #fff;
}

.st.h.on::before {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 7px rgba(106,166,182,.25);
}

.st .n {
  color: var(--muted);
  font-size: .8rem;
}

.st b {
  display: block;
  font-size: clamp(1.7rem,3.6vw,2.8rem);
  letter-spacing: -.035em;
  line-height: 1.2;
  margin: 4px 0 8px;
}

.st.h b::after {
  content: "HUMAN";
  font-size: .65rem;
  letter-spacing: .12em;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 99px;
  padding: 3px 10px;
  margin-left: 14px;
  vertical-align: .45em;
  font-weight: 600;
}

.st p {
  margin: 0;
  color: #a1a1a6;
  font-size: 1.05rem;
}

.note {
  color: var(--muted);
  margin: 30px 0 0 48px;
}

/* ===== Now: three cards ===== */

.three {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
  margin-top: 60px;
}

.three .card {
  min-height: 290px;
  padding: 38px;
}

.three .n {
  color: var(--muted);
  font-size: .8rem;
  display: block;
  margin-bottom: 76px;
}

.three p {
  color: #a1a1a6;
  margin: 14px 0 0;
}

/* ===== Philosophy ===== */

.phil {
  overflow: hidden;
  text-align: center;
  padding: 170px 0;
}

.row {
  display: block;
  font-size: clamp(3.4rem,14vw,12rem);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1.02;
  white-space: nowrap;
  will-change: transform;
}

.row.o {
  color: transparent;
  -webkit-text-stroke: 1.5px #6e6e73;
}

.phil .txt {
  margin: 56px auto 0;
  padding: 0 20px;
  text-align: center;
}

/* ===== Contact & footer ===== */

.contact {
  text-align: center;
}

.contact .txt {
  margin: 0 auto 44px;
}

.mail {
  display: inline-block;
  font-size: clamp(1.4rem,3.6vw,2.4rem);
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--blue);
  border-bottom: 2px solid transparent;
  transition: .25s;
}

.mail:hover {
  border-color: var(--blue);
}

footer {
  border-top: 1px solid #0f1a21;
  padding: 28px max(4vw,20px) 40px;
  color: var(--muted);
  font-size: .78rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Animations (JS adds .js to <html>) ===== */

.js .rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s ease,transform 1s cubic-bezier(.2,.8,.2,1);
}

.js .rv.in {
  opacity: 1;
  transform: none;
}

.js .ln span {
  transform: translateY(112%);
  animation: up 1.15s cubic-bezier(.2,.8,.2,1) forwards;
}

.js .ln:nth-of-type(2) span {
  animation-delay: .12s;
}

.js .fd {
  opacity: 0;
  animation: fd 1.1s .55s ease forwards;
}

@keyframes up {
  to {
    transform: none;
  }
}

@keyframes fd {
  to {
    opacity: 1;
  }
}

@keyframes drift {
  to {
    transform: translateX(-50%) translateY(6%) scale(1.08);
  }
}

@keyframes cue {
  0%,100% {
    transform: scaleY(.4);
    transform-origin: top;
  }

  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
}

/* ===== Award layer: opening, swarm, cursor, progress ===== */

::selection {
  background: var(--blue);
  color: #fff;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--blue);
  transform: scaleX(var(--sp, 0));
  transform-origin: left;
  z-index: 60;
}

.loader {
  display: none;
}

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 1.1s cubic-bezier(.7, 0, .2, 1);
}

.loader.done {
  transform: translateY(-100%);
}

.count {
  font-size: clamp(4rem, 14vw, 10rem);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lname {
  margin-top: 14px;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .4em;
  text-transform: uppercase;
}

/* hero text waits for the opening to finish */
.js .ln span,
.js .fd {
  animation-play-state: paused;
}

.js.ready .ln span,
.js.ready .fd {
  animation-play-state: running;
}

.hero > #swarm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hint {
  position: absolute !important;
  bottom: 5vh;
  left: max(4vw, 20px);
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .04em;
  text-align: left;
}

.cur-dot,
.cur-ring {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .js .cur-dot,
  .js .cur-ring {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 90;
    pointer-events: none;
    border-radius: 50%;
    mix-blend-mode: difference;
  }

  .cur-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    background: #fff;
  }

  .cur-ring {
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border: 1px solid #fff;
    transition: width .35s, height .35s, margin .35s;
  }

  .cur-ring.big {
    width: 78px;
    height: 78px;
    margin: -39px 0 0 -39px;
  }

  .js,
  .js a,
  .js button {
    cursor: none !important;
  }
}

@media (hover: none) {
  .hint {
    display: none !important;
  }
}

/* sea at the hero */
.hero {
  background: radial-gradient(ellipse 90% 70% at 50% 0%, #0b2230, var(--bg) 75%);
}

/* ===== Mobile ===== */

@media (max-width: 760px) {
  .nav ul {
    display: none;
  }

  section.s {
    padding: 96px 0;
  }

  .phil {
    padding: 110px 0;
  }

  .two,
  .three {
    grid-template-columns: 1fr;
  }

  .card,
  .three .card {
    padding: 30px 26px;
  }

  .three .card {
    min-height: 0;
  }

  .three .n {
    margin-bottom: 38px;
  }

  .more {
    display: block;
    margin: 22px 0 0;
  }

  .tl {
    padding-left: 40px;
  }

  .st::before {
    left: -36px;
  }

  .note {
    margin-left: 0;
  }
}

/* ===== Reduced motion (accessibility) ===== */

@media (prefers-reduced-motion: reduce) {
  .js .rv,
  .js .fd {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  .js .ln span {
    transform: none;
    animation: none;
  }

  .glow,
  .cue {
    animation: none;
  }

  .js .scrub span,
  .js .st {
    color: var(--text);
    opacity: 1;
  }

  html {
    scroll-behavior: auto;
  }
}


/* ===== Current Prototype ===== */
.proto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 52px;
}
.proto {
  border-top: 1px solid var(--line);
  padding: 24px 0 28px;
}
.proto span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  margin-bottom: 30px;
}
.proto b {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.proto p {
  margin: 0;
  color: #a1a1a6;
  line-height: 1.75;
  max-width: 300px;
}

@media (max-width: 760px) {
  .proto-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .proto {
    padding: 20px 0 24px;
  }
  .proto span {
    margin-bottom: 18px;
  }

  /* Keep the visual identity, but avoid continuous canvas work on mobile. */
  .hero > #swarm {
    opacity: .35;
  }
}


/* ===== Mobile hero stabilization ===== */
@media (max-width: 760px), (hover: none) {
  .hero > #swarm {
    opacity: .22;
  }

  .hero .glow {
    opacity: .72;
  }

  .hero {
    background:
      radial-gradient(ellipse 100% 55% at 50% 0%, #0b2230 0%, #02070b 72%);
  }

  .hint {
    display: none !important;
  }
}
