/* =========================================================
   ZEROTRY — Subpage framework
   全サブページ共通のデザインシステム。
   - トップページと同じタイポグラフィ / カラー / チャクラ
   - PC : full-viewport snap deck (Block-style, no free scroll)
   - Mobile : 通常の縦スクロール
   ページごとのアクセントは body の --accent で上書きする。
   ========================================================= */

:root {
  --pad-x: clamp(20px, 4.5vw, 72px);
  --header-h: 72px;

  --t-display: 'Space Grotesk', 'Zen Kaku Gothic New', sans-serif;
  --t-jp:      'Zen Kaku Gothic New', 'Space Grotesk', sans-serif;
  --t-mono:    'JetBrains Mono', ui-monospace, monospace;
  --t-body:    'Space Grotesk', 'Zen Kaku Gothic New', sans-serif;

  --c-zerotry:   #e8ff5a;
  --c-chip:      #7ab9ff;
  --c-pos:       #f5f5f5;
  --c-logistics: #ff9a3a;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg, #0a0a0a);
  color: var(--fg, #f5f5f5);
  font-family: var(--t-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'palt';
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
ul { list-style: none; }
button { background: none; border: none; color: inherit; cursor: pointer; font: inherit; }
::selection { background: var(--accent, #e8ff5a); color: #0a0a0a; }

.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  opacity: .04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* =========================================================
   HEADER — トップページと同じトーン
   ========================================================= */
.p-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 var(--pad-x);
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.p-header.scrolled {
  background: rgba(10,10,10,.72);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.p-back {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--t-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--fg);
  white-space: nowrap;
}
.p-back .arrow { color: var(--accent, #e8ff5a); transition: transform .25s; }
.p-back:hover .arrow { transform: translateX(-4px); }
.p-nav {
  display: flex; gap: clamp(16px, 2.2vw, 32px); align-items: center;
  justify-content: flex-end;
  font-family: var(--t-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .04em;
}
.p-nav a {
  position: relative;
  color: var(--fg-mute, #a1a1a1);
  padding: 6px 0;
  transition: color .25s;
}
.p-nav a::after {
  content: '';
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--accent, #e8ff5a);
  transition: width .35s cubic-bezier(.6,.1,.2,1);
}
.p-nav a:hover { color: var(--fg); }
.p-nav a:hover::after { width: 100%; }
.p-nav .home {
  border: 1px solid var(--line, #262626);
  color: var(--fg);
  padding: 10px 18px;
  border-radius: 999px;
  transition: border-color .25s, background .25s, color .25s;
}
.p-nav .home::after { content: none; }
.p-nav .home:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg, #0a0a0a);
}

/* =========================================================
   BUTTONS — トップページの btn-primary / btn-ghost と同形
   ========================================================= */
.btn-p, .btn-g {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--t-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .04em;
  transition: all .35s cubic-bezier(.6,.05,.1,1);
  white-space: nowrap;
}
.btn-p {
  background: var(--accent, #e8ff5a);
  color: #0a0a0a;
}
.btn-p:hover {
  background: var(--fg, #f5f5f5);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px color-mix(in srgb, var(--accent, #e8ff5a) 40%, transparent);
}
.btn-p svg { transition: transform .3s ease; }
.btn-p:hover svg { transform: translate(3px, -3px); }
.btn-g {
  border: 1px solid var(--line, #262626);
  color: var(--fg);
}
.btn-g:hover {
  border-color: var(--fg);
  background: rgba(255,255,255,.05);
  transform: translateY(-2px);
}

/* =========================================================
   TYPOGRAPHY PRIMITIVES
   ========================================================= */
.p-kicker {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--t-mono);
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--fg-mute, #a1a1a1);
  margin-bottom: 26px;
}
.p-kicker .line {
  display: inline-block; width: 48px; height: 1px;
  background: var(--accent, #e8ff5a);
}
.p-hero-meta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--t-mono);
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-mute, #a1a1a1);
}
.p-hero-meta .dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent, #e8ff5a);
  box-shadow: 0 0 16px var(--accent, #e8ff5a);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}

.p-name {
  font-family: var(--t-display);
  font-weight: 500;
  font-size: clamp(56px, 11vw, 168px);
  line-height: .94;
  letter-spacing: -.045em;
  margin: 0 0 26px;
}
.p-tagline {
  font-family: var(--t-jp);
  font-size: clamp(19px, 2.2vw, 30px);
  font-weight: 500;
  line-height: 1.55;
  max-width: 720px;
  color: var(--fg);
}
.p-tagline-en {
  display: block;
  margin-top: 16px;
  font-family: var(--t-mono);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.p-actions {
  margin-top: 38px;
  display: flex; gap: 14px; flex-wrap: wrap;
}

.p-sk {
  font-family: var(--t-mono);
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent, #e8ff5a);
  margin-bottom: 22px;
}
.p-h {
  font-family: var(--t-display);
  font-weight: 500;
  font-size: clamp(32px, 4.6vw, 68px);
  line-height: 1.04;
  letter-spacing: -.03em;
  margin-bottom: 30px;
  max-width: 1100px;
}
.p-h span { display: block; }
.p-h .dim { color: var(--fg-dim, #6b6b6b); }
.p-lead {
  font-family: var(--t-jp);
  font-size: clamp(14px, 1.3vw, 17px);
  font-weight: 400;
  line-height: 1.95;
  color: var(--fg-mute, #a1a1a1);
  max-width: 760px;
}

/* hero stats */
.p-hero-stats {
  display: flex; gap: clamp(28px, 5vw, 64px);
  flex-wrap: wrap;
}
.p-stat { display: flex; flex-direction: column; gap: 6px; }
.p-stat-num {
  font-family: var(--t-display);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: -.02em; line-height: 1;
}
.p-stat-num em { color: var(--accent, #e8ff5a); font-style: normal; }
.p-stat-label {
  font-family: var(--t-mono);
  font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--fg-mute);
}

/* =========================================================
   CONTENT PRIMITIVES — cards / specs
   ========================================================= */
.p-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line, #262626);
  border: 1px solid var(--line, #262626);
  margin-top: 40px;
}
.p-features.cols-4 { grid-template-columns: repeat(4, 1fr); }
.p-features.cols-5 { grid-template-columns: repeat(5, 1fr); }
.p-feature {
  background: var(--bg, #0a0a0a);
  padding: clamp(22px, 2.4vw, 34px) clamp(20px, 2.2vw, 30px);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 200px;
  transition: background .35s ease;
}
.p-feature:hover { background: var(--bg-soft, #121212); }
.p-feat-num {
  font-family: var(--t-mono);
  font-size: 11px; letter-spacing: .2em;
  color: var(--accent, #e8ff5a);
}
.p-feature h3 {
  font-family: var(--t-jp);
  font-weight: 500;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.4;
  letter-spacing: -.005em;
}
.p-feature h3.en {
  font-family: var(--t-display);
  letter-spacing: -.02em;
}
.p-feature p {
  font-family: var(--t-jp);
  font-size: 13.5px; line-height: 1.85;
  color: var(--fg-mute, #a1a1a1);
}

/* spec table */
.p-specs {
  display: grid;
  grid-template-columns: 180px 1fr;
  margin-top: 40px;
  border-top: 1px solid var(--line, #262626);
}
.p-specs.cols-2 {
  grid-template-columns: 160px 1fr 160px 1fr;
  column-gap: clamp(24px, 4vw, 64px);
}
.p-specs > div { display: contents; }
.p-specs dt, .p-specs dd {
  padding: 18px 0;
  border-bottom: 1px solid var(--line, #262626);
}
.p-specs dt {
  font-family: var(--t-mono);
  font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--fg-mute);
  align-self: center;
}
.p-specs dd {
  font-family: var(--t-jp);
  font-size: 14.5px;
  color: var(--fg);
}

/* =========================================================
   LEGACY long-form sections (chip / whitepaper が使用)
   ========================================================= */
.p-hero {
  position: relative;
  min-height: 100vh;
  padding: 140px var(--pad-x) 72px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.p-hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.p-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 80%);
}
.p-hero-content { margin-top: auto; margin-bottom: auto; max-width: 1300px; }
.p-section {
  padding: clamp(80px, 12vw, 160px) var(--pad-x);
  border-top: 1px solid var(--line, #262626);
  position: relative;
}
.p-section-num {
  position: absolute; top: 28px; right: var(--pad-x);
  font-family: var(--t-mono);
  font-size: 11px; letter-spacing: .2em;
  color: var(--fg-dim, #6b6b6b);
}
.p-cta {
  padding: clamp(80px, 12vw, 160px) var(--pad-x);
  text-align: center;
  border-top: 1px solid var(--line, #262626);
  background: radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--accent, #e8ff5a) 6%, transparent), transparent 70%), var(--bg, #0a0a0a);
}
.p-cta-h {
  font-family: var(--t-display);
  font-weight: 500;
  font-size: clamp(38px, 7vw, 92px);
  line-height: .98; letter-spacing: -.04em;
  margin-bottom: 30px;
}
.p-cta-h em {
  font-style: normal;
  color: var(--accent, #e8ff5a);
}
.p-cta-actions {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

/* =========================================================
   FOOTER
   ========================================================= */
.p-footer {
  padding: 56px var(--pad-x) 26px;
  background: rgba(6,6,6,.92);
  border-top: 1px solid var(--line, #262626);
}
.p-foot-top {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line, #262626);
}
.p-foot-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--t-display);
  font-weight: 400;
  letter-spacing: .04em;
  font-size: 15px;
}
.p-foot-mark .mk { color: var(--accent, #e8ff5a); }
.p-foot-links {
  display: flex; gap: clamp(14px, 2vw, 26px); flex-wrap: wrap;
  font-family: var(--t-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .04em;
}
.p-foot-links a { color: var(--fg-mute, #a1a1a1); transition: color .25s; }
.p-foot-links a:hover { color: var(--fg); }
.p-company-info {
  display: flex; flex-wrap: wrap;
  gap: 8px 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line, #262626);
  font-family: var(--t-jp);
  font-size: 12px;
  line-height: 1.7;
  color: var(--fg-mute, #a1a1a1);
}
.p-company-info strong { color: var(--fg, #f5f5f5); font-weight: 500; }
.p-company-info a {
  color: var(--fg, #f5f5f5);
  border-bottom: 1px solid color-mix(in srgb, var(--accent, #e8ff5a) 50%, transparent);
  transition: color .25s, border-color .25s;
}
.p-company-info a:hover {
  color: var(--accent, #e8ff5a);
  border-bottom-color: var(--accent, #e8ff5a);
}
.p-foot-bot, .p-foot-bottom {
  padding-top: 20px;
  display: flex; justify-content: space-between;
  font-family: var(--t-mono);
  font-size: 10px; letter-spacing: .15em;
  color: var(--fg-dim, #6b6b6b);
  text-transform: uppercase;
  flex-wrap: wrap; gap: 12px;
}

/* deck ページ内に埋め込むコンパクト版 */
.p-footer-deck {
  background: transparent;
  border-top: 1px solid var(--line, #262626);
  padding: 26px 0 0;
  margin-top: clamp(40px, 6vh, 72px);
}
.p-footer-deck .p-foot-top {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft, #1c1c1c);
}
.p-footer-deck .p-company-info {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft, #1c1c1c);
}
.p-footer-deck .p-foot-bot { padding-top: 16px; }

/* =========================================================
   DECK — Block-style full-viewport panels (PC only)
   ========================================================= */
.deck { position: relative; }
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 36px) var(--pad-x) 48px;
  overflow: hidden;
}
.panel-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}
.panel-bg {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
}
.panel-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 80%);
}
.panel-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 72%, color-mix(in srgb, var(--accent, #e8ff5a) 10%, transparent), transparent 65%);
  filter: blur(50px);
}
.panel-video {
  position: absolute; inset: 0;
}
.panel-video video {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.1) saturate(.85) brightness(.55);
}
.panel-video::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(10,10,10,.65) 85%),
    linear-gradient(180deg, rgba(10,10,10,.55) 0%, rgba(10,10,10,.25) 40%, rgba(10,10,10,.92) 100%);
}

/* 最終パネル: CTA + footer */
.panel-end { justify-content: flex-end; }
.panel-end .panel-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* dots nav (desktop only) */
.deck-dots {
  position: fixed;
  right: clamp(16px, 2.4vw, 36px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: none;
  flex-direction: column;
  gap: 14px;
}
.deck-dots button {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  transition: background .3s, transform .3s, box-shadow .3s;
}
.deck-dots button:hover { background: rgba(255,255,255,.55); }
.deck-dots button.on {
  background: var(--accent, #e8ff5a);
  transform: scale(1.25);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent, #e8ff5a) 60%, transparent);
}
.deck-dots button span {
  position: absolute;
  right: 20px; top: 50%;
  transform: translateY(-50%) translateX(4px);
  font-family: var(--t-mono);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg);
  background: rgba(10,10,10,.82);
  border: 1px solid var(--line, #262626);
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.deck-dots button:hover span {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* panel counter (desktop only) */
.deck-pos {
  position: fixed;
  left: var(--pad-x);
  bottom: 22px;
  z-index: 90;
  display: none;
  align-items: baseline;
  gap: 12px;
  font-family: var(--t-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-dim, #6b6b6b);
}
.deck-pos .cur { color: var(--accent, #e8ff5a); font-size: 12px; }

/* scroll hint (panel 1, desktop only) */
.deck-hint {
  position: fixed;
  right: var(--pad-x);
  bottom: 22px;
  z-index: 90;
  display: none;
  font-family: var(--t-mono);
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--fg-dim, #6b6b6b);
  animation: hintFloat 2.4s ease-in-out infinite;
  transition: opacity .4s;
}
.deck-hint.gone { opacity: 0; }
@keyframes hintFloat {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50%      { transform: translateY(5px); opacity: 1; }
}

/* reveal: パネルがアクティブになったら段差で表示 */
[data-rv] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.panel.is-on [data-rv] {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- PC: snap deck ---------- */
@media (min-width: 1025px) {
  body.deck-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body.deck-page .deck {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
  }
  body.deck-page .deck::-webkit-scrollbar { display: none; }
  body.deck-page .panel {
    min-height: 100vh;
    min-height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  body.deck-page .deck-dots { display: flex; }
  body.deck-page .deck-pos { display: inline-flex; }
  body.deck-page .deck-hint { display: block; }
}

/* ---------- Mobile / tablet: 通常スクロール ---------- */
@media (max-width: 1024px) {
  .panel {
    min-height: auto;
    padding: 88px var(--pad-x) 56px;
  }
  .panel:first-child { min-height: 92vh; min-height: 92dvh; }
  .panel + .panel { border-top: 1px solid var(--line-soft, #1c1c1c); }
  [data-rv] { transition-delay: 0ms; }
  .p-nav a:not(.home) { display: none; }
  .p-features,
  .p-features.cols-4,
  .p-features.cols-5 { grid-template-columns: 1fr; }
  .p-specs.cols-2 { grid-template-columns: 160px 1fr; }
}
@media (max-width: 600px) {
  .p-hero { padding: 120px var(--pad-x) 60px; }
  .p-name { font-size: clamp(52px, 17vw, 96px); }
  .p-foot-top { flex-direction: column; align-items: flex-start; }
  .p-foot-bot, .p-foot-bottom { flex-direction: column; }
  .p-specs, .p-specs.cols-2 { grid-template-columns: 1fr; }
  .p-specs dt { padding-bottom: 4px; border-bottom: none; }
  .p-specs dd { padding-top: 4px; }
}

/* fade-in (long-form ページ用) */
.fade-up { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.fade-up.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  [data-rv] { opacity: 1; transform: none; }
}
