/* SuiteZero — Design tokens & base */
@import url("theme.css");
@import url("section-deco.css");

:root {
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --nav-h: 72px;
  --max-w: 1200px;
  --section-pad: clamp(1.25rem, 2.5vw, 2.25rem);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-in-out), color 0.5s var(--ease-in-out);
}

.mono { font-family: var(--font-mono); font-size: 0.85em; letter-spacing: -0.02em; }

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

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  z-index: 1000;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
}

.nav.is-scrolled {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav__logo-img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav__links {
  display: none;
  gap: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav__links a {
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav__links a:hover { opacity: 1; }
.nav__links a.is-active { color: var(--text); opacity: 1; }
.nav__links a::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  margin-top: 5px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.24s var(--ease-out-expo);
}
.nav__links a.is-active::after { width: 100%; }

.nav__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: flex;
  background: var(--bg-muted);
  border-radius: 8px;
  padding: 3px;
}

.lang-switch__btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s;
}

.lang-switch__btn.is-active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 4px var(--border);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s, border-color 0.2s;
}

.theme-toggle:hover { transform: scale(1.05); }

.theme-toggle svg { width: 18px; height: 18px; }

[data-theme="light"] .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }

.ui-feedback {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 10001;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(14px);
}
.ui-feedback.is-visible { opacity: 1; transform: translate(-50%, 0); }

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

@media (min-width: 900px) {
  .nav__links { display: flex; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  border-radius: 980px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s;
}

.btn--primary {
  background: var(--text);
  color: var(--bg);
}

.btn--primary:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn--ghost {
  border: 1px solid var(--border);
  background: transparent;
}

.btn--ghost:hover { background: var(--bg-muted); }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) clamp(1.25rem, 4vw, 3rem) 4rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__forest {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  width: 100%;
  height: 46%;
  pointer-events: none;
  opacity: .72;
  filter: blur(.45px);
}
.forest__ridge--far { fill: var(--forest-far); opacity: .38; }
.forest__trees--far { fill: var(--forest-far); opacity: .68; }
.forest__ridge--mid { fill: var(--forest-mid); opacity: .48; }
.forest__trees--mid { fill: var(--forest-mid); opacity: .8; }
.forest__ridge--near { fill: var(--forest-near); opacity: .72; }
.forest__trees--near { fill: var(--forest-near); opacity: .96; }
.forest__bough-detail { fill: none; stroke: var(--forest-detail); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .34; }
.forest__mist { fill: url(#forest-mist-gradient); opacity: .22; }
.forest__mist--low { opacity: .16; }
.hero__forest .forest__mist { animation: forest-mist-drift 38s ease-in-out infinite alternate; }
.hero__forest .forest__mist--low { animation-duration: 52s; animation-direction: alternate-reverse; }
@keyframes forest-mist-drift {
  from { transform: translateX(-7px); }
  to { transform: translateX(7px); }
}
[data-theme="light"] .hero__forest { opacity: .52; }
[data-theme="light"] .hero__bg #heroCanvas { opacity: .92; }
[data-theme="dark"] .hero__bg #heroCanvas { opacity: .76; }
.hero__bg:not(.is-visible) .hero__orb { animation-play-state: paused; }

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orb-float 12s ease-in-out infinite;
}

.hero__orb--1 {
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  background: var(--orb-1);
  top: -10%;
  right: -10%;
}

.hero__orb--2 {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  background: var(--orb-2);
  bottom: 10%;
  left: -15%;
  animation-delay: -4s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero__eyebrow {
  color: var(--accent);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}

.hero__title {
  margin-bottom: 1.75rem;
}

.hero__line {
  display: block;
  overflow: hidden;
}

.hero__line-inner {
  display: block;
}

.hero__line--about {
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.hero__line--about .hero__line-inner {
  font-style: italic;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.hero__line--about::after {
  content: "";
  flex: 1;
  max-width: 10rem;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  transform: translateY(-0.2em);
}

.hero__line--tagline {
  font-size: clamp(2.5rem, 7.5vw, 5.25rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.hero__line--tagline .hero__line-inner {
  white-space: nowrap;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 480px) {
  .hero__line--tagline .hero__line-inner {
    white-space: normal;
  }
}

:lang(ja) .hero__line--tagline {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
}

:lang(ja) .hero__line--about {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 567px;
  margin-bottom: 0;
  line-height: 1.7;
}

.hero__intro .hero__sub + .hero__sub {
  margin-top: 1.25rem;
  text-align: justify;
  text-justify: inter-word;
}

.hero__intro .hero__sub:last-child {
  margin-bottom: 2.5rem;
}

.hero__sub-brand {
  font-weight: 700;
  color: var(--text);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 1;
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(0.6); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Showcase (carousel) */
.showcase {
  position: relative;
  padding: var(--section-pad) clamp(1.25rem, 4vw, 3rem);
}

.showcase__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.showcase__frame {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.showcase__slides {
  position: relative;
  width: 100%;
  height: min(62vh, 500px);
}

.showcase__slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo), visibility 1s;
}

.showcase__slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (min-width: 900px) {
  .showcase__slide {
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
  }
}

.showcase__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.showcase__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.showcase__nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.08);
}

.showcase__nav-btn svg {
  width: 18px;
  height: 18px;
}

.showcase__dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.showcase__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s;
}

.showcase__dot.is-active {
  background: var(--accent);
  transform: scale(1.5);
}

.showcase__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
}

.showcase__visual img {
  display: block;
  width: min(100%, 520px);
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  filter: drop-shadow(0 14px 32px rgba(9, 147, 136, 0.08));
}

[data-theme="dark"] .showcase__visual img {
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.18));
}

.showcase__visual .showcase__image--light { display: none; }
[data-theme="light"] .showcase__visual .showcase__image--dark { display: none; }
[data-theme="light"] .showcase__visual .showcase__image--light { display: block; }

.showcase__copy h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.showcase__copy p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 420px;
}

.showcase__index {
  display: block;
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

/* Code window */
.code-window {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.code-window__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-window__bar span:nth-child(1) { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.code-window__bar span:nth-child(2) { width: 10px; height: 10px; border-radius: 50%; background: #febc2e; }
.code-window__bar span:nth-child(3) { width: 10px; height: 10px; border-radius: 50%; background: #28c840; }
.code-window__bar .mono {
  margin-left: auto;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
}

.code-window__body {
  padding: 1.5rem;
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  line-height: 1.7;
  color: #e4e4e7;
  overflow-x: auto;
}

.tok-kw { color: #c792ea; }
.tok-fn { color: #82aaff; }
.tok-str { color: #c3e88d; }
.tok-bool { color: #ffcb6b; }

/* UI mock */
.ui-mock {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4/3;
}

.ui-mock__card {
  position: absolute;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.ui-mock__card:first-child {
  inset: 0;
  z-index: 1;
}

.ui-mock__card--2 {
  width: 70%;
  height: 50%;
  top: 15%;
  right: -5%;
  z-index: 2;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
}

.ui-mock__card--3 {
  width: 45%;
  height: 35%;
  bottom: 10%;
  left: -5%;
  z-index: 3;
}

/* Mesh viz */
.mesh-viz {
  position: relative;
  width: 280px;
  height: 280px;
}

.mesh-viz__node {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.mesh-viz__node:nth-child(1) { top: 0; left: 0; }
.mesh-viz__node:nth-child(2) { top: 0; right: 0; }
.mesh-viz__node:nth-child(3) { bottom: 0; left: 0; }
.mesh-viz__node:nth-child(4) { bottom: 0; right: 0; }
.mesh-viz__node--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
}

.mesh-viz__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.4;
}

/* Statement */
.statement {
  padding: var(--section-pad) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}

.statement__text {
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  max-width: 900px;
  margin: 0 auto 2.5rem;
}

.statement__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 700px) {
  .statement__stats { grid-template-columns: repeat(4, 1fr); }
}

.stat__num {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat__suffix {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.stat__label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Services */
.services {
  padding: var(--section-pad) clamp(1.25rem, 4vw, 3rem);
}

.services__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-head__tag {
  display: block;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.services__grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
}

.service-card {
  display: block;
  width: 100%;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.service-card__icon {
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.service-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.service-card__tags li {
  padding: 4px 10px;
  background: var(--bg-muted);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
}


/* Stack atlas — editorial constellation */
.stack-atlas {
  padding: var(--section-pad) clamp(1.25rem, 4vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

.stack-atlas::before {
  display: none;
}

.stack-atlas__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.stack-atlas__head {
  max-width: 100%;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.stack-atlas__title {
  font-size: clamp(1.25rem, 3.8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 0.75rem;
  white-space: nowrap;
}

.stack-atlas__lede {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 28rem;
}
:lang(en) .stack-atlas__lede {
  max-width: 40rem;
}
:lang(ja) .stack-atlas__lede {
  max-width: 40rem;
}

.stack-atlas__field {
  position: relative;
  min-height: clamp(22rem, 52vw, 34rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stack-atlas__ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(4rem, 18vw, 11rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--border);
  text-stroke: 1px var(--border);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  transition: opacity 0.5s var(--ease-out-expo), -webkit-text-stroke-color 0.5s var(--ease-out-expo);
  z-index: 0;
}

.stack-atlas__field.is-focus .stack-atlas__ghost {
  opacity: 0.55;
  -webkit-text-stroke-color: var(--accent);
}

.stack-atlas__mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.stack-atlas__mesh line {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.4s var(--ease-out-expo), opacity 0.4s;
}

.stack-atlas__mesh-hub {
  fill: var(--accent);
  opacity: 0.6;
}

.stack-atlas__field.is-focus .stack-atlas__mesh line {
  stroke: var(--accent);
  opacity: 0.35;
}

.stack-atlas__reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  opacity: 0.4;
}

.stack-atlas__reticle::before,
.stack-atlas__reticle::after,
.stack-atlas__reticle span {
  position: absolute;
  background: var(--text-muted);
}

.stack-atlas__reticle::before {
  content: "";
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
}

.stack-atlas__reticle::after {
  content: "";
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  transform: translateY(-50%);
}

.stack-atlas__reticle span:first-child {
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.stack-atlas__nodes {
  list-style: none;
  position: absolute;
  inset: 0;
  z-index: 3;
}

.stack-atlas__node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  cursor: default;
  transition: z-index 0s;
}

.stack-atlas__node.is-active {
  z-index: 10;
}

.stack-atlas__idx {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  opacity: 0.7;
  transition: color 0.3s, opacity 0.3s;
}

.stack-atlas__label {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  letter-spacing: -0.02em;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0.35rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 6px;
  transition:
    color 0.35s var(--ease-out-expo),
    background 0.35s var(--ease-out-expo),
    border-color 0.35s var(--ease-out-expo),
    transform 0.45s var(--ease-out-expo),
    box-shadow 0.35s var(--ease-out-expo);
}

.stack-atlas__node--lg .stack-atlas__label {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.stack-atlas__node--xl .stack-atlas__label {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 500;
  color: var(--text);
}

.stack-atlas__node--accent .stack-atlas__label {
  color: var(--accent);
}

.stack-atlas__field:not(.is-dim) .stack-atlas__node:hover .stack-atlas__label,
.stack-atlas__field:not(.is-dim) .stack-atlas__node.is-active .stack-atlas__label {
  color: var(--text);
  background: var(--glass);
  border-color: var(--border);
  box-shadow: 0 8px 32px var(--accent-soft);
  transform: scale(1.06);
}

.stack-atlas__field:not(.is-dim) .stack-atlas__node:hover .stack-atlas__idx,
.stack-atlas__field:not(.is-dim) .stack-atlas__node.is-active .stack-atlas__idx {
  color: var(--accent);
  opacity: 1;
}

.stack-atlas__field.is-dim .stack-atlas__node:not(.is-active) .stack-atlas__label {
  opacity: 0.35;
}

.stack-atlas__field.is-dim .stack-atlas__node:not(.is-active) .stack-atlas__idx {
  opacity: 0.25;
}

.stack-atlas__node:focus {
  outline: none;
}

.stack-atlas__node:focus-visible .stack-atlas__label {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .stack-atlas__field {
    min-height: auto;
    padding: 1.5rem 1.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .stack-atlas__ghost {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    text-align: center;
    font-size: clamp(2.5rem, 14vw, 4rem);
    margin-bottom: 0.5rem;
    order: -1;
  }

  .stack-atlas__mesh,
  .stack-atlas__reticle {
    display: none;
  }

  .stack-atlas__nodes {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.35rem;
    justify-content: center;
  }

  .stack-atlas__node {
    position: static;
    transform: none;
  }

  .stack-atlas__idx {
    display: none;
  }

  .stack-atlas__label {
    transform: none !important;
  }
}

/* Process */
.process {
  position: relative;
  overflow: hidden;
  height: var(--process-total-h);
  min-height: var(--process-total-h);
  max-height: var(--process-total-h);
}

.process__track {
  position: relative;
  height: var(--process-total-h);
  min-height: var(--process-total-h);
  max-height: var(--process-total-h);
  width: 100%;
}

.process__pin {
  position: relative;
  height: var(--process-section-h);
  min-height: var(--process-section-h);
  max-height: var(--process-section-h);
  box-sizing: border-box;
}

.process__layout {
  height: var(--process-section-h);
  min-height: var(--process-section-h);
  max-height: var(--process-section-h);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-content: start;
  overflow: hidden;
  padding: calc(var(--nav-h) + 2rem) clamp(1.25rem, 4vw, 3rem) clamp(0.75rem, 2vw, 1.25rem);
  max-width: var(--max-w);
  margin: 0 auto;
}

@media (min-width: 900px) {
  .process__layout {
    grid-template-columns: minmax(280px, 0.95fr) minmax(420px, 1.05fr);
    column-gap: clamp(2rem, 4vw, 4rem);
    row-gap: 1.25rem;
    align-content: start;
    align-items: start;
  }

  .process__head {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .process__steps {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }
}

.process__head h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
}

.process__steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.process__step {
  opacity: 0.35;
  transform: translate3d(-20px, 0, 0);
  transition: opacity 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo);
  will-change: opacity, transform;
}

.process__num {
  color: var(--accent);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  display: block;
}

.process__step h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.process__step p {
  color: var(--text-muted);
  max-width: 400px;
}

.process__viz {
  display: none;
  position: relative;
  width: 280px;
  height: 280px;
  justify-self: center;
}

@media (min-width: 900px) {
  .process__viz {
    display: block;
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    align-self: start;
    margin-top: 0.5rem;
  }
}

.process__ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
}

.process__ring::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  animation: ring-spin 3s linear infinite;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.process__dot {
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--accent-glow);
}

.process + .trust {
  /* padding-top: 0; */
}

/* Trust */
.trust {
  padding: var(--section-pad) clamp(1.25rem, 4vw, 3rem);
  min-height: 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.trust__quote {
  max-width: 720px;
  margin: 0 auto;
}

.trust__quote p {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  /* margin-bottom: 1.5rem; */
}

.trust__quote cite {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Contact */
.contact {
  padding: var(--section-pad) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}

.contact__inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 4rem 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.contact h2 {
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.contact p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact__email {
  display: inline-block;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--accent);
  margin-bottom: 1.5rem;
  transition: opacity 0.2s;
}

.contact__email:hover { opacity: 0.8; }

.contact__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.contact__company {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: left;
}
.contact__company h3 {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.contact__company dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1.25rem;
  margin: 0;
}
.contact__company dl > div { min-width: 0; }
.contact__company dt { color: var(--text-muted); font-size: .72rem; margin-bottom: .2rem; }
.contact__company dd { margin: 0; color: var(--text); font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }
.contact__company dd a { color: inherit; text-decoration: none; }
.contact__company dd a:hover { color: var(--accent); }

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
}

.footer__brand {
  display: flex;
  align-items: center;
}

.footer__logo-img {
  display: block;
  height: 36px;
  width: auto;
  object-fit: contain;
}

.footer__copy {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Reveal utilities (initial state for GSAP) */
.reveal-up,
.reveal-text {
  will-change: transform, opacity;
}

/* Three-language switch, mobile menu and contact form */
.lang-switch { gap: 1px; }
.lang-switch__btn { font-family: var(--font-sans); font-size: 0.68rem; padding: 6px 8px; }
.nav__menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}
.nav__menu-toggle span { display:block; height:1.5px; width:17px; margin:4px auto; background:currentColor; transition:transform .2s; }
.nav__menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(2.75px) rotate(45deg); }
.nav__menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-2.75px) rotate(-45deg); }
.contact__form { display:grid; grid-template-columns:1fr 1fr; gap:1rem; text-align:left; margin-top:1.5rem; }
.contact__form label { display:grid; gap:.45rem; color:var(--text-muted); font-size:.88rem; }
.required-mark { color:var(--accent); font-weight:700; }
.contact__form input, .contact__form textarea {
  width:100%; border:1px solid var(--border); border-radius:12px; padding:.85rem 1rem;
  background:var(--bg); color:var(--text); font:inherit; outline:none; transition:border-color .2s, box-shadow .2s;
}
.contact__form input:focus, .contact__form textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.contact__form textarea { resize:vertical; min-height:120px; }
.contact__message { grid-column:1 / -1; }
.contact__form .btn { border:0; cursor:pointer; justify-self:start; }
@media (max-width: 899px) {
  .nav { gap:.5rem; }
  .nav__logo-img { height:34px; }
  .nav__controls { gap:.4rem; }
  .nav__menu-toggle { display:block; }
  .nav__links { display:none; position:absolute; top:calc(var(--nav-h) - 2px); left:0; right:0; padding:1rem 1.25rem 1.25rem; background:var(--glass); backdrop-filter:blur(20px); border-bottom:1px solid var(--border); flex-direction:column; gap:0; }
  .nav__links.is-open { display:flex; }
  .nav__links a { padding:.75rem .25rem; border-bottom:1px solid var(--border); }
  .nav__links a:last-child { border-bottom:0; }
}
@media (max-width: 520px) {
  .contact__company dl { grid-template-columns: 1fr; }
  .nav { padding-inline:.8rem; }
  .nav__logo-img { height:29px; }
  .nav__controls { gap:.3rem; }
  .lang-switch__btn { padding:6px 6px; font-size:.62rem; }
  .theme-toggle, .nav__menu-toggle { width:36px; height:36px; }
  .hero__line--tagline { font-size:clamp(2rem, 10vw, 3rem); }
  .stack-atlas__title { white-space: normal; font-size: clamp(1.4rem, 6vw, 1.75rem); }
  .hero__intro .hero__sub + .hero__sub { text-align:left; }
  .contact__inner { padding:2rem .9rem; border-radius:24px; }
  .contact h2 { font-size:clamp(.78rem, 4.35vw, 1.2rem); }
  .contact__form { grid-template-columns:1fr; }
  .contact__message { grid-column:auto; }
  .contact__form .btn { width:100%; }
}

.hero__bg #heroCanvas { z-index: 2; }

/* Keep the headline readable at every viewport width. */
.hero__line--tagline { overflow: visible; font-size: clamp(2.1rem, 6.7vw, 5.25rem); }
.hero__line--tagline .hero__line-inner { white-space: normal; max-width: 100%; }
:lang(en) .hero__line--tagline { font-size: clamp(1.75rem, 5vw, 3.5rem); }

/* The process is a compact, readable section instead of a long pinned scroll scene. */
.process, .process__track, .process__pin, .process__layout {
  height: auto; min-height: 0; max-height: none;
}
.process__layout {
  overflow: visible;
  padding: var(--section-pad) clamp(1.25rem, 4vw, 3rem);
  gap: 1.25rem;
}
.process__steps { gap: 1.1rem; }
.process__step { opacity: 1; transform: none; will-change: auto; }
.process__viz { display: none !important; }

/* Contact opens as an accessible dialog with a compact form. */
.contact__open { border: 0; cursor: pointer; }
.contact-dialog {
  width: min(680px, calc(100vw - 2rem)); max-height: min(88dvh, 820px); overflow: auto;
  margin: auto; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--border);
  border-radius: 24px; background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow);
}
.contact-dialog::backdrop { background: rgba(2, 8, 6, .72); backdrop-filter: blur(6px); }
.contact-dialog__head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }
.contact-dialog__head h2 { font-size:clamp(1.25rem, 3vw, 1.8rem); line-height:1.25; }
.contact-dialog__close { display:grid; place-items:center; flex:0 0 auto; width:46px; height:46px; border:1px solid var(--border); border-radius:50%; background:transparent; color:var(--text); font:inherit; font-size:1.45rem; line-height:1; cursor:pointer; }
.contact-dialog .contact__form { margin:0; }
.contact-dialog .contact__form input:not([type="checkbox"]), .contact-dialog .contact__form textarea, .contact-dialog .contact__form select {
  width:100%; min-width:0; border:1px solid var(--border); border-radius:12px; padding:.8rem .9rem;
  background:var(--bg); color:var(--text); font:inherit; outline:none;
}
.contact-dialog .contact__form select:invalid { color:var(--text-muted); }
.contact-dialog .contact__form input:focus, .contact-dialog .contact__form textarea:focus, .contact-dialog .contact__form select:focus {
  border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft);
}
.contact__privacy-wrap, .contact__form-actions { grid-column:1 / -1; }
.contact__privacy { display:flex !important; grid-template-columns:auto 1fr; align-items:flex-start; gap:.6rem !important; }
.contact__privacy input { width:16px !important; height:16px; flex:0 0 16px; margin:.22rem 0 0; accent-color:var(--accent); }
.privacy-policy__link { color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.privacy-policy { margin-top:.65rem; color:var(--text-muted); font-size:.82rem; }
.privacy-policy summary { cursor:pointer; color:var(--accent); }
.privacy-policy p { margin:.5rem 0 0 !important; line-height:1.55; }
.contact__form-actions { display:flex; flex-wrap:wrap; gap:.75rem; }
.contact__form-actions .btn { border:0; cursor:pointer; }
.contact__draft-note { flex:1 0 100%; margin:.15rem 0 0; color:var(--text-muted); font-size:.82rem; font-style:italic; line-height:1.55; }
.contact__form-actions .btn--ghost { color:var(--text); border:1px solid var(--border); background:var(--bg-muted); }
.contact__form-actions .btn--ghost:hover { color:var(--text); background:var(--bg-elevated); }
@media (max-width: 520px) {
  .contact-dialog .contact__form { grid-template-columns:1fr; }
  .contact-dialog .contact__message, .contact-dialog .contact__privacy-wrap,
  .contact-dialog .contact__form-actions { grid-column:auto; }
  .contact__form-actions .btn { flex:1 1 100%; }
}

/* International phone input and compact Japanese callout. */
.phone-field { display:grid; grid-template-columns:96px minmax(0,1fr); gap:.5rem; }
.contact-dialog .phone-field select { width:100%; padding-inline:.55rem; }
.contact-dialog .phone-field input { min-width:0; }
:lang(ja) .trust { padding-inline:.5rem; }
:lang(ja) .trust__quote p { white-space:nowrap; font-size:clamp(.75rem,2.8vw,1.5rem); transform:scaleX(.8); transform-origin:center; }
.process__layout { display:block; }
.process__head { margin-bottom:2.4rem; }
.process__steps {
  position:relative;
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:0;
}
.process__steps::before {
  content:"";
  position:absolute;
  z-index:0;
  top:1.1rem;
  left:9%;
  right:9%;
  height:1px;
  background:linear-gradient(90deg, transparent, var(--accent-glow) 10%, var(--accent) 50%, var(--accent-glow) 90%, transparent);
}
.process__step {
  display:flex;
  flex-direction:column;
  position:relative;
  min-width:0;
  padding:0 1.1rem 1rem;
  border:0;
  border-left:1px solid var(--border);
  border-radius:0;
  background:transparent;
  transition:transform .3s var(--ease-out-expo), color .25s;
}
.process__step:first-child { border-left:0; }
.process__step:hover { transform:translateY(-4px); }
.process__step:hover .process__num {
  color:#fff;
  border-color:var(--accent);
  background:var(--accent);
  box-shadow:0 0 20px var(--accent-glow);
}
.process__step:hover h3 { color:var(--accent); }
.process__num {
  position:relative;
  z-index:1;
  top:auto;
  left:auto;
  display:grid;
  place-items:center;
  width:2.25rem;
  height:2.25rem;
  margin:0 auto 1.25rem;
  border:1px solid var(--accent-soft);
  border-radius:50%;
  background:var(--section-deep);
  color:var(--accent);
  transition:color .25s, background .25s, border-color .25s, box-shadow .25s;
}
.process__step h3 { min-height:3rem; margin-bottom:.5rem; font-size:1.1rem; line-height:1.35; }
.process__step p { max-width:none; font-size:.88rem; line-height:1.6; }
.process__step > p:not(.process__outcome) { min-height:7.25rem; }
.process__outcome { display:flex; flex-wrap:wrap; gap:.25rem .5rem; margin-top:.85rem; padding-top:.75rem; border-top:1px solid var(--border); color:var(--text-muted); font-size:.84rem; }
.process__outcome strong { flex:0 0 100%; color:var(--accent); font-weight:600; }

@media (max-width: 1050px) {
  .process__steps { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:1.5rem 0; }
  .process__steps::before { display:none; }
  .process__step:nth-child(4) { border-left:0; }
  .process__num { margin:0 0 1rem; }
  .process__step > p:not(.process__outcome) { min-height:4.5rem; }
}
@media (max-width: 640px) {
  .process__steps { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:1.25rem 0; }
  .process__step:nth-child(4) { border-left:1px solid var(--border); }
  .process__step:nth-child(odd) { border-left:0; }
  .process__step > p:not(.process__outcome) { min-height:6rem; }
}
@media (max-width: 430px) {
  .process__steps { grid-template-columns:1fr; }
  .process__step, .process__step:nth-child(4) { border-left:0; border-top:1px solid var(--border); padding:1rem .25rem; }
  .process__step:first-child { border-top:0; }
  .process__step > p:not(.process__outcome) { min-height:0; }
  .process__step h3 { min-height:0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__forest .forest__mist { animation: none; }
}
@media (max-width:520px) { .phone-field { grid-template-columns:88px minmax(0,1fr); } }

/* Bilingual privacy policy page */
.privacy-page { min-height:100vh; }
.privacy-header { position:sticky; top:0; z-index:1000; display:flex; justify-content:space-between; align-items:center; padding:.8rem clamp(1rem,4vw,3rem); border-bottom:1px solid var(--border); background:var(--glass); backdrop-filter:blur(18px); }
.privacy-brand img { display:block; width:auto; height:34px; }
.privacy-controls { display:flex; align-items:center; gap:.75rem; }
.privacy-content { width:min(880px, calc(100% - 2rem)); margin:0 auto; padding:clamp(2rem,6vw,5rem) 0 5rem; }
.privacy-content article { color:var(--text); }
.privacy-content [hidden] { display:none !important; }
.privacy-eyebrow { color:var(--accent); font:500 .72rem var(--font-mono); letter-spacing:.12em; }
.privacy-content h1 { margin:.6rem 0 .25rem; font-size:clamp(2rem,5vw,3.5rem); line-height:1.15; letter-spacing:-.035em; }
.privacy-updated { color:var(--text-muted); font-size:.88rem; margin-bottom:1.5rem; }
.privacy-content article > p:not(.privacy-eyebrow):not(.privacy-updated) { font-size:1.04rem; color:var(--text-muted); }
.privacy-content section { margin-top:2rem; padding-top:1.4rem; border-top:1px solid var(--border); }
.privacy-content h2 { margin-bottom:.65rem; font-size:1.25rem; }
.privacy-content p, .privacy-content li { color:var(--text-muted); line-height:1.75; }
.privacy-content ul { padding-left:1.35rem; }
.privacy-content li + li { margin-top:.55rem; }
.privacy-content a { color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.footer__privacy { color:var(--text-muted); font-size:.75rem; text-decoration:underline; text-underline-offset:3px; }
@media (max-width:520px) { .privacy-brand img { height:28px; } .privacy-controls { gap:.4rem; } .privacy-content { width:min(calc(100% - 1.5rem), 880px); } }
