/* ============================================================
   Cybertical, Inc. — corporate site
   tokens: ink #0B0B0E / paper #F7F6F2 / cobalt #2742F5
           gray #86868E / mist #ECEBE6
   type:   Shippori Mincho (display) / Noto Sans JP (body)
           IBM Plex Mono (utility)
   signature: 縦書きタイポグラフィ × 9:16縦型フィード
   ============================================================ */

:root {
  --ink: #0B0B0E;
  --paper: #F7F6F2;
  --cobalt: #2742F5;
  --cobalt-soft: #DDE2FF;
  --gray: #86868E;
  --mist: #ECEBE6;
  --line: rgba(11, 11, 14, 0.12);
  --line-invert: rgba(247, 246, 242, 0.18);
  --font-display: "Shippori Mincho", serif;
  --font-body: "Noto Sans JP", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); letter-spacing: 0.08em; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.pc-only { display: inline; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 14px; height: 24px;              /* 9:16 の縦比率マーク */
  background: var(--cobalt);
  border-radius: 3px;
}

.brand-word {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.22em;
}

.global-nav { display: flex; align-items: center; gap: 28px; }
.global-nav a {
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.global-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--cobalt);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.global-nav a:not(.nav-cta):hover::after,
.global-nav a:not(.nav-cta):focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 22px !important;
  border-radius: 999px;
  transition: background 0.25s ease;
}
.nav-cta:hover, .nav-cta:focus-visible { background: var(--cobalt); }

.nav-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 34px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--cobalt); border-color: var(--cobalt); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; text-align: center; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 24px 40px;
  overflow: hidden;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  width: 100%;
}

.eyebrow {
  font-size: 12px;
  color: var(--cobalt);
  margin-bottom: 20px;
}

.hero-main {
  display: flex;
  flex-direction: row-reverse;   /* 縦書きの読み順(右→左)に合わせ、タイトルを右へ */
  justify-content: flex-end;
  align-items: stretch;
  gap: 48px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.7;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;          /* signature: 縦書き */
  margin: 0;
}
.hero-title .v-line { display: block; white-space: nowrap; }
.hero-title em {
  font-style: normal;
  color: var(--cobalt);
}

.hero-sub {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-lead {
  font-size: 15.5px;
  color: #3C3C43;
  margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* 縦型フィード (signature) */
.hero-feed {
  display: flex;
  gap: 18px;
  height: min(78vh, 640px);
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.feed-col { display: flex; flex-direction: column; gap: 18px; }
.feed-up   { animation: feed-up 26s linear infinite; }
.feed-down { animation: feed-down 30s linear infinite; margin-top: -120px; }

@keyframes feed-up   { to { transform: translateY(-50%); } }
@keyframes feed-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.v-card {
  width: 168px;
  aspect-ratio: 9 / 16;                 /* 縦型動画フレーム */
  border-radius: 18px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  color: var(--paper);
  flex-shrink: 0;
}
.v-card p {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}
.v-tag { font-size: 10px; opacity: 0.85; }

.v-card-a { background: linear-gradient(160deg, #2742F5, #0B0B0E 85%); }
.v-card-b { background: linear-gradient(160deg, #3C3C43, #0B0B0E 80%); }
.v-card-c { background: linear-gradient(160deg, #6E7BDA, #1A1A22 80%); }
.v-card-d { background: linear-gradient(200deg, #0B0B0E, #2742F5 160%); }
.v-card-e { background: linear-gradient(160deg, #23232B, #4B5AE0 170%); }
.v-card-f { background: linear-gradient(160deg, #4053D6, #0B0B0E 85%); }

/* ---------- sections (base) ---------- */
.section { padding: 110px 0; }
.section-dark { background: var(--ink); color: var(--paper); }
.section-dark .eyebrow { color: #8E9BFF; }
.section-mist { background: var(--mist); }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: 0.1em;
  line-height: 1.4;
  margin-bottom: 28px;
}

.section-lead { color: var(--gray); margin-bottom: 56px; }
.section-dark .section-lead { color: #B9B9C2; }

/* 縦書き見出し(about / company) */
.tate {
  writing-mode: vertical-rl;
  margin-bottom: 0;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 64px;
  align-items: start;
}
.about-body { max-width: 640px; }
.about-copy {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 600;
  line-height: 2.1;
  letter-spacing: 0.06em;
  margin-bottom: 28px;
}
.about-body p + p { margin-top: 18px; }

/* ---------- services ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.service-card {
  aspect-ratio: 9 / 16;                 /* サービスカードも縦型比率 */
  border: 1px solid var(--line-invert);
  border-radius: 20px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}
.service-card:hover {
  border-color: var(--cobalt);
  background: rgba(39, 66, 245, 0.08);
  transform: translateY(-6px);
}

.service-tag {
  font-size: 10.5px;
  color: #8E9BFF;
  margin-bottom: auto;
}
.service-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.5;
  margin-bottom: 14px;
}
.service-desc {
  font-size: 13.5px;
  line-height: 1.85;
  color: #B9B9C2;
}

/* ---------- market ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
  margin-bottom: 20px;
}
.stat {
  border-top: 2px solid var(--ink);
  padding-top: 22px;
}
.stat-value {
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 8px;
}
.stat-value .num { color: var(--cobalt); }
.stat-unit {
  font-family: var(--font-body);
  font-size: 0.38em;
  font-weight: 700;
  margin-left: 6px;
}
.stat-label { font-size: 14px; color: var(--gray); }
.stat-note { font-size: 11px; color: var(--gray); }

/* ---------- company ---------- */
.company-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 64px;
  align-items: start;
}

.company-table { max-width: 680px; }
.company-table > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line);
}
.company-table > div:first-child { border-top: 1px solid var(--line); }
.company-table dt { font-weight: 700; font-size: 14px; }
.company-table dd { font-size: 14.5px; }

/* ---------- news ---------- */
.news-list { list-style: none; max-width: 840px; }
.news-list a {
  display: grid;
  grid-template-columns: 110px 84px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease;
}
.news-list li:first-child a { border-top: 1px solid var(--line); }
.news-list a:hover .news-title { color: var(--cobalt); }
.news-list time { font-size: 13px; color: var(--gray); }
.news-cat {
  font-size: 10px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 0;
  color: var(--gray);
}
.news-title { font-size: 14.5px; transition: color 0.2s ease; }

/* ---------- contact ---------- */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 72px;
  align-items: start;
}

.contact-form .field { margin-bottom: 22px; }
.contact-form label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
.req {
  font-size: 10px;
  color: var(--paper);
  background: var(--cobalt);
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: 1px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--paper);
  background: rgba(247, 246, 242, 0.06);
  border: 1px solid var(--line-invert);
  border-radius: 10px;
  padding: 13px 16px;
  transition: border-color 0.2s ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #6E6E78; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--cobalt);
}
.form-note { font-size: 12px; color: #8A8A93; margin-top: 14px; text-align: center; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--line-invert);
  padding: 56px 0 28px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 44px;
}
.footer-brand .brand-word { font-size: 19px; }
.footer-copy { font-size: 10.5px; color: #8A8A93; margin-top: 10px; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-nav a { font-size: 13px; color: #B9B9C2; }
.footer-nav a:hover { color: var(--paper); }
.copyright { text-align: center; font-size: 11px; color: #6E6E78; }

/* ---------- reveal (v2: blur + rise) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(38px) scale(0.985);
  filter: blur(7px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.9s ease;
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* ================= v2: dynamic layer ================= */

/* ---------- intro (page-load sequence) ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.intro-panel {
  position: absolute;
  top: 0; bottom: 0;
  width: 50.5%;               /* 中央の縦スリットが開く */
  background: var(--ink);
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1) 0.75s;
}
.intro-panel-l { left: 0; transform-origin: left; }
.intro-panel-r { right: 0; transform-origin: right; }
.intro-word {
  position: relative;
  color: var(--paper);
  font-size: clamp(18px, 2.6vw, 26px);
  letter-spacing: 0.42em;
  padding-left: 0.42em;       /* letter-spacing分の視覚センター補正 */
  opacity: 0;
  animation: intro-word-in 0.7s ease 0.12s forwards;
  transition: opacity 0.35s ease 0.6s;
}
@keyframes intro-word-in {
  from { opacity: 0; transform: translateY(14px); letter-spacing: 0.6em; }
  to   { opacity: 1; transform: none; letter-spacing: 0.42em; }
}
.intro.is-leaving .intro-panel-l { transform: translateX(-101%); }
.intro.is-leaving .intro-panel-r { transform: translateX(101%); }
.intro.is-leaving .intro-word { opacity: 0; }
.intro.is-done { display: none; }
.intro.is-skipped { display: none; }

/* イントロ中はヒーロー要素を待機させ、開幕とともに立ち上げる */
body.intro-pending .hero-text > *,
body.intro-pending .hero-feed { opacity: 0; }
body.intro-play .hero-text > * {
  animation: hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
body.intro-play .hero-text > *:nth-child(1) { animation-delay: 0.15s; }
body.intro-play .hero-text > *:nth-child(2) { animation-delay: 0.3s; }
body.intro-play .hero-feed {
  animation: hero-rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(44px); }
  to   { opacity: 1; transform: none; }
}

/* ヒーロー縦書きタイトルの文字ごとリビール */
.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--char-delay, 0s);
}
.hero-title.chars-in .char { opacity: 1; transform: none; }

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--cobalt);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 200;
}

/* ---------- header hide/show ---------- */
.site-header {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.3s ease;
}
.site-header.is-hidden { transform: translateY(-100%); }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  background: var(--paper);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-flow 36s linear infinite;
}
.marquee-track span {
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}
@keyframes marquee-flow {
  to { transform: translateX(-50%); }
}

/* ---------- ghost text (section backdrop, scroll-driven) ---------- */
.services, .market { position: relative; overflow: hidden; }
.ghost-text {
  position: absolute;
  top: 34px;
  left: 0;
  font-size: clamp(90px, 15vw, 210px);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(247, 246, 242, 0.12);
  user-select: none;
  pointer-events: none;
  will-change: transform;
}
.ghost-text-dark { -webkit-text-stroke: 1px rgba(11, 11, 14, 0.1); }
.services .container, .market .container { position: relative; }

/* ---------- hero feed: 3D tilt ---------- */
.hero-feed { perspective: 900px; }
.feed-tilt {
  display: flex;
  gap: 18px;
  transform-style: preserve-3d;
  transition: transform 0.35s ease-out;
  will-change: transform;
}

/* ---------- service card: 3D tilt ---------- */
.service-card {
  transform-style: preserve-3d;
  will-change: transform;
}
.service-card .service-tag,
.service-card h3 { transform: translateZ(24px); }

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  body.intro-pending .hero-text > *,
  body.intro-pending .hero-feed { opacity: 1; }
  .hero-title .char { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  .ghost-text { transform: none !important; }
  .feed-tilt, .service-card { transform: none !important; }
}

/* ---------- a11y ---------- */
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .feed-up, .feed-down { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card { aspect-ratio: auto; min-height: 300px; }
  .contact-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-feed .feed-down { display: none; }
}

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

  .global-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
    display: none;
  }
  .global-nav.is-open { display: flex; }
  .global-nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .global-nav a:last-child { border-bottom: none; }
  .nav-cta { border-radius: 12px; text-align: center; margin-top: 12px; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px; height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    align-items: center;
  }
  .nav-toggle span {
    width: 22px; height: 2px;
    background: var(--ink);
    transition: transform 0.25s ease;
  }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .hero { padding-top: calc(var(--header-h) + 24px); }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-main { flex-direction: column; gap: 28px; }
  .hero-main .hero-title { align-self: flex-end; }  /* 縦書きの自然な位置(右)へ */
  .hero-title { font-size: clamp(26px, 7vw, 34px); }
  .hero-feed { height: 300px; justify-content: center; }

  .section { padding: 72px 0; }

  .about-grid, .company-grid { grid-template-columns: 1fr; gap: 36px; }
  .tate { writing-mode: horizontal-tb; }

  .service-grid { grid-template-columns: 1fr; }
  .service-card { min-height: auto; }
  .service-tag { margin-bottom: 14px; }

  .stat-row { grid-template-columns: 1fr; gap: 24px; }

  .news-list a { grid-template-columns: 96px 1fr; }
  .news-cat { display: none; }
  .news-title { grid-column: 1 / -1; }

  .footer-inner { flex-direction: column; }
}
