/* ==========================================================
   Aegis株式会社 コーポレートサイト 共通CSS（DESIGN.md のトークンに準拠）
   ========================================================== */
:root {
  --color-primary: #9b003f;
  --color-primary-hover: #7a0031;
  --color-primary-soft: #e0527f;
  --color-ink: #0a0a0b;
  --color-surface: #16161a;
  --color-paper: #f4f3f1;
  --color-white: #ffffff;
  --color-muted-light: #5c5c63;
  --color-muted-dark: #a3a3ab;
  --color-line-light: #dad8d4;
  --color-line-dark: #2a2a30;

  --font-jp-head: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-jp-body: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-en: "Barlow Condensed", "Barlow", sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 32px;
  --space-4: 64px;
  --space-section: 140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
  --p: 0;
}

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

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

body {
  background: var(--color-ink);
  color: var(--color-white);
  font-family: var(--font-jp-body);
  font-size: 0.9375rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

ul {
  list-style: none;
}

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

[data-theme="light"] :focus-visible {
  outline-color: var(--color-primary);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.container {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}

/* ---------- ラベル ---------- */
.label {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.4;
}

[data-theme="light"] .label,
[data-theme="white"] .label {
  color: var(--color-primary);
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--header-h);
  color: var(--color-white);
  transition: color 0.4s var(--ease);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(10, 10, 11, 0.97);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.site-header.is-light::before {
  background: rgba(244, 243, 241, 0.98);
}

.site-header.is-solid::before {
  opacity: 1;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: block;
}

.logo img {
  height: 28px;
  width: auto;
}

.logo__b {
  display: none;
}

.site-header.is-light {
  color: var(--color-ink);
}

.site-header.is-light .logo__w {
  display: none;
}

.site-header.is-light .logo__b {
  display: block;
}

.gnav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.gnav a {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gnav a:not(.gnav__contact) {
  position: relative;
  padding-block: 4px;
}

.gnav a:not(.gnav__contact)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.gnav a:not(.gnav__contact):hover::after,
.gnav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.gnav__contact {
  padding: 8px 20px;
  border: 1px solid currentColor;
  border-radius: 2px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.gnav__contact:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.menu-btn {
  display: none;
}

/* ---------- ボタン・リンク ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.2;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn::after {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease);
}

.btn:hover::after {
  width: 40px;
}

.btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn--line:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.text-link::after {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease);
}

.text-link:hover::after {
  width: 52px;
}

/* ---------- 明るいセクション ---------- */
[data-theme="light"] {
  position: relative;
  background: var(--color-paper);
  color: var(--color-ink);
}

[data-theme="white"] {
  background: var(--color-white);
  color: var(--color-ink);
}

[data-theme="dark"] {
  background: var(--color-ink);
  color: var(--color-white);
}

/* ---------- スクロールで現れる ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 0.1s);
}

.js .reveal.is-in,
.reveal.is-in {
  opacity: 1;
  transform: none;
}

html:not(.js) .reveal {
  opacity: 1;
  transform: none;
}

/* ---------- フッター ---------- */
.site-footer {
  background: var(--color-ink);
  color: var(--color-white);
  padding-block: var(--space-4) var(--space-3);
  border-top: 1px solid var(--color-line-dark);
}

.site-footer__top {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-line-dark);
}

.site-footer__logo img {
  height: 32px;
  width: auto;
}

.site-footer__name {
  margin-top: var(--space-2);
  font-family: var(--font-jp-head);
  font-weight: 700;
  font-size: 1rem;
}

.site-footer__addr {
  margin-top: 4px;
  font-style: normal;
  color: var(--color-muted-dark);
  font-size: 0.875rem;
  line-height: 1.8;
}

.fnav {
  display: grid;
  gap: 4px;
  align-content: start;
}

.fnav a {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-block: 4px;
  transition: color 0.3s var(--ease);
}

.fnav a:hover {
  color: var(--color-primary-soft);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  padding-top: var(--space-3);
  font-size: 0.8125rem;
  color: var(--color-muted-dark);
}

.site-footer__bottom a:hover {
  color: var(--color-white);
}

@media (min-width: 1024px) {
  body {
    font-size: 1rem;
  }

  .container {
    width: min(1200px, 100% - 80px);
  }

  .site-footer__top {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

/* ---------- スマホ ---------- */
@media (max-width: 767px) {
  :root {
    --space-section: 88px;
  }

  .menu-btn {
    position: relative;
    z-index: 31;
    display: block;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
  }

  .menu-btn span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 1px;
    background: currentColor;
    transition: transform 0.4s var(--ease), top 0.4s var(--ease), opacity 0.2s;
  }

  .menu-btn span:nth-child(1) {
    top: 17px;
  }

  .menu-btn span:nth-child(2) {
    top: 26px;
  }

  .menu-open .menu-btn span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
  }

  .menu-open .menu-btn span:nth-child(2) {
    top: 21px;
    transform: rotate(-45deg);
  }

  .gnav {
    position: fixed;
    inset: 0;
    z-index: 30;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 96px 28px 40px;
    background: var(--color-ink);
    color: var(--color-white);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
  }

  .menu-open .gnav {
    opacity: 1;
    visibility: visible;
  }

  .menu-open .site-header {
    color: var(--color-white);
  }

  .menu-open .site-header .logo__w {
    display: block;
    position: relative;
    z-index: 31;
  }

  .menu-open .site-header .logo__b {
    display: none;
  }

  .menu-open .menu-btn {
    color: var(--color-white);
  }

  .gnav a {
    font-size: 1.75rem;
    letter-spacing: 0.1em;
  }

  .gnav__contact {
    margin-top: 16px;
    padding: 12px 28px;
    font-size: 1.125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- ページ切り替え：画面が中央の線に閉じて、上下に開く（スリット） ----------
   リンクを押すと閉じ（html.gate-out）、次のページを開いた直後に開く（html.gate-in） */
.gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

html.gate-in .gate,
html.gate-out .gate {
  visibility: visible;
}

.gate__t,
.gate__b {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.2%;
  background: #0a0a0b;
  transform: scaleY(0);
  will-change: transform;
}

.gate__t {
  top: 0;
  transform-origin: top;
}

.gate__b {
  bottom: 0;
  transform-origin: bottom;
}

/* 中央の白い線 */
.gate__ln {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  height: 2px;
  background: #fff;
  opacity: 0;
  transform: scaleX(0);
  will-change: transform, opacity;
}

html.gate-out .gate__t,
html.gate-out .gate__b {
  animation: gate-close 0.3s cubic-bezier(0.6, 0, 0.8, 0.4) both;
}

html.gate-in .gate__t,
html.gate-in .gate__b {
  animation: gate-open 0.34s cubic-bezier(0.3, 0.2, 0.2, 1) 0.2s both;
}

html.gate-in .gate__ln {
  animation: gate-line 0.54s ease-out both;
}

@keyframes gate-close {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes gate-open {
  from {
    transform: scaleY(1);
  }
  to {
    transform: scaleY(0);
  }
}

@keyframes gate-line {
  0% {
    transform: scaleX(0);
    opacity: 1;
  }
  38% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate {
    display: none !important;
  }
}

/* ---------- マウスに付いてくる、羽ばたく鷹（ワイヤーフレーム） ---------- */
.bird {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9998;
  width: 280px;
  height: 220px;
  margin: -110px 0 0 -140px;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.4s;
}

.bird.is-on {
  opacity: 1;
}
