/**
 * THETA header — stacked logo + line/triangle hover + Contact button
 */

/* —— Stacked logo: THE / TA co. —— */
.tx_theta_mark {
  --theta-mark-color: currentColor;
  display: grid;
  grid-template-columns: 0.95fr 1fr 1.05fr;
  grid-template-rows: 1fr 1fr;
  align-items: end;
  column-gap: 0.06em;
  row-gap: 0;
  width: 100%;
  color: var(--theta-mark-color);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 1em;
  line-height: 0.72;
  letter-spacing: -0.04em;
  text-transform: none;
  user-select: none;
}

.tx_theta_mark_cell {
  display: block;
  color: inherit;
  line-height: 0.72;
}

.tx_theta_mark_co {
  font-size: 0.4em;
  letter-spacing: 0;
  line-height: 1;
  align-self: end;
  padding-bottom: 0.2em;
}

.tx_chrome_logo {
  width: 5.6rem;
}

.tx_chrome_logoImg {
  width: 100%;
  color: var(--color-black, #222220);
  transition: color 0.3s ease;
}

.tx_chrome_logoImg .tx_theta_mark {
  font-size: 2.35rem;
}

.tx_chrome.tx_-on .tx_chrome_logoImg,
.tx_chrome.tx_-wipeActive .tx_chrome_logoImg,
.tx_chrome.tx_-missActive .tx_chrome_logoImg {
  color: var(--color-white, #fff);
}

/* Loader: staged build mark (single, not duplicated slot) */
.tx_boot_logo {
  position: relative;
  width: 7.5rem !important;
  overflow: visible !important;
}

@media screen and (min-width: 48em) {
  .tx_boot_logo {
    width: 10.5rem !important;
  }
}

.tx_boot_logoImg[data-tx-boot="img"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.tx_boot_logo .tx_theta_mark--build {
  /* Keep full logo grid from the start so slide origins stay correct */
  grid-area: 1 / 1;
  place-self: center;
  position: relative;
  z-index: 2;
  overflow: visible;
  font-size: 3.4rem;
  color: #fafaf2;
  grid-template-columns: 0.95fr 1fr 1.05fr;
  grid-template-rows: 1fr 1fr;
}

@media screen and (min-width: 48em) {
  .tx_boot_logo .tx_theta_mark--build {
    font-size: 4.6rem;
  }
}

.tx_theta_mark--build .tx_theta_mark_cell {
  display: block;
  will-change: transform, opacity;
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Resting “from” states — overlap left T column until revealed */
.tx_theta_mark--build .tx_theta_mark_cell[data-cell="t1"] {
  opacity: 1;
  transform: none;
  z-index: 2;
}

.tx_theta_mark--build .tx_theta_mark_cell[data-cell="t2"] {
  opacity: 0;
  transform: translateY(-100%); /* stacked on upper T */
  z-index: 1;
}

.tx_theta_mark--build .tx_theta_mark_cell[data-cell="h"],
.tx_theta_mark--build .tx_theta_mark_cell[data-cell="a"] {
  opacity: 0;
  transform: translateX(-115%); /* from left T */
}

.tx_theta_mark--build .tx_theta_mark_cell[data-cell="e"],
.tx_theta_mark--build .tx_theta_mark_cell[data-cell="co"] {
  opacity: 0;
  transform: translateX(-230%); /* from left T, through H column */
}

/* Stage 1: only upper T */
.tx_theta_mark--build[data-stage="1"] .tx_theta_mark_cell[data-cell="t1"] {
  opacity: 1;
  transform: none;
}

/* Stage 2: lower T slides down from upper T + fade in */
.tx_theta_mark--build[data-stage="2"] .tx_theta_mark_cell[data-cell="t2"],
.tx_theta_mark--build[data-stage="3"] .tx_theta_mark_cell[data-cell="t2"],
.tx_theta_mark--build[data-stage="4"] .tx_theta_mark_cell[data-cell="t2"] {
  opacity: 1;
  transform: none;
}

/* Stage 3: H / E / A slide out from left T + fade in */
.tx_theta_mark--build[data-stage="3"] .tx_theta_mark_cell[data-cell="h"],
.tx_theta_mark--build[data-stage="3"] .tx_theta_mark_cell[data-cell="a"],
.tx_theta_mark--build[data-stage="4"] .tx_theta_mark_cell[data-cell="h"],
.tx_theta_mark--build[data-stage="4"] .tx_theta_mark_cell[data-cell="a"] {
  opacity: 1;
  transform: none;
  transition-delay: 0.04s;
}

.tx_theta_mark--build[data-stage="3"] .tx_theta_mark_cell[data-cell="e"],
.tx_theta_mark--build[data-stage="4"] .tx_theta_mark_cell[data-cell="e"] {
  opacity: 1;
  transform: none;
  transition-delay: 0.14s;
}

/* Stage 4: co. slides from left + fade in */
.tx_theta_mark--build[data-stage="4"] .tx_theta_mark_cell[data-cell="co"] {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}

/* —— Nav hover: fill line + tip triangle —— */
.tx_chrome .tx_chrome_linkLine {
  display: none !important;
}

.tx_chrome [data-theta-nav-hover="target"] {
  position: relative;
  overflow: visible;
}

.tx_chrome [data-theta-nav-hover="text"] {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.tx_chrome_linkTrail {
  position: absolute;
  left: 1.5rem;
  right: 1.2rem;
  bottom: 1.35rem;
  display: flex;
  align-items: center;
  height: 0;
  pointer-events: none;
}

.tx_chrome_linkTrailBar {
  display: block;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.tx_chrome_linkTrailTip {
  flex: 0 0 auto;
  margin-left: -0.15em;
  font-size: 0.45rem;
  line-height: 1;
  color: currentColor;
  opacity: 0;
  transform: translateX(-0.35rem);
  transition:
    opacity 0.25s ease,
    transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.tx_chrome [data-theta-nav-hover="target"]:hover .tx_chrome_linkTrailBar,
.tx_chrome [data-theta-nav-hover="target"]:focus-visible .tx_chrome_linkTrailBar,
.tx_chrome .tx_chrome_link.tx_-onpage .tx_chrome_linkTrailBar {
  transform: scaleX(1);
}

.tx_chrome [data-theta-nav-hover="target"]:hover .tx_chrome_linkTrailTip,
.tx_chrome [data-theta-nav-hover="target"]:focus-visible .tx_chrome_linkTrailTip,
.tx_chrome .tx_chrome_link.tx_-onpage .tx_chrome_linkTrailTip {
  opacity: 1;
  transform: translateX(0);
}

/* Submenu: short fill line + tip */
.tx_chrome .tx_chrome_subLink[data-theta-nav-hover="target"] {
  position: relative;
  padding-inline-end: 1.5rem;
}

.tx_chrome .tx_chrome_subLink .tx_chrome_linkTrail {
  left: 1rem;
  right: 0.75rem;
  bottom: 0.85rem;
}

.tx_chrome .tx_chrome_subLink .tx_chrome_linkTrailTip {
  font-size: 0.4rem;
}

/* —— Contact as button (no images / no slot) —— ~2x previous size —— */
.tx_chrome_contactLink.tx_theta_contactBtn {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 5rem;
  padding: 1.1rem 2rem 1.1rem 2.3rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease;
  pointer-events: auto;
}

.tx_chrome_contactLink.tx_theta_contactBtn .tx_theta_contactBtn_label {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.tx_chrome_contactLink.tx_theta_contactBtn .tx_theta_contactBtn_arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.tx_chrome_contactLink.tx_theta_contactBtn:hover,
.tx_chrome_contactLink.tx_theta_contactBtn:focus-visible {
  background: var(--color-black, #222220);
  border-color: var(--color-black, #222220);
  color: var(--color-white, #fff);
}

.tx_chrome.tx_-on .tx_chrome_contactLink.tx_theta_contactBtn:hover,
.tx_chrome.tx_-on .tx_chrome_contactLink.tx_theta_contactBtn:focus-visible,
.tx_chrome.tx_-wipeActive .tx_chrome_contactLink.tx_theta_contactBtn:hover,
.tx_chrome.tx_-missActive .tx_chrome_contactLink.tx_theta_contactBtn:hover {
  background: var(--color-white, #fff);
  border-color: var(--color-white, #fff);
  color: var(--color-black, #222220);
}

.tx_chrome_contactLink.tx_theta_contactBtn:hover .tx_theta_contactBtn_arrow,
.tx_chrome_contactLink.tx_theta_contactBtn:focus-visible .tx_theta_contactBtn_arrow {
  transform: translateX(0.15rem);
}

/* Hide legacy contact slot pieces if any remain */
.tx_chrome_contactLink.tx_theta_contactBtn .tx_chrome_contactText,
.tx_chrome_contactLink.tx_theta_contactBtn .tx_chrome_contactGlyph {
  display: none !important;
}

/* PC nav: center between logo and Contact */
@media screen and (min-width: 48em) {
  .tx_chrome_block {
    grid-template-columns: 1fr auto 1fr !important;
    align-items: start !important;
    gap: 1.5rem !important;
  }

  .tx_chrome_logo {
    justify-self: start;
    position: relative;
    top: 1.5rem !important;
  }

  .tx_chrome_list {
    justify-self: center;
    justify-content: center;
    align-items: center;
    gap: 0.15rem;
    /* 元デザイン同様、少し上に寄せてロゴ／Contactと揃える */
    margin-block-start: -1.5rem !important;
  }

  .tx_chrome_contact {
    justify-self: end;
    align-self: start;
  }

  .tx_chrome_list .tx_chrome_link {
    padding-block: 2.4rem !important;
  }

  /* Service: + → ∨ */
  .tx_chrome_linkGlyph.tx_-chevron {
    display: inline-grid;
    place-items: center;
    width: auto;
    min-width: 0.85em;
    margin-inline-start: 0.15em;
    line-height: 1;
  }

  .tx_chrome_linkChevron {
    display: block;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    transform-origin: center;
    transition: transform 0.3s ease, color 0.3s ease;
  }

  .tx_chrome_item[data-tx-submenu="trigger"]:hover .tx_chrome_linkChevron,
  .tx_chrome_item[data-tx-submenu="trigger"]:focus-within .tx_chrome_linkChevron {
    transform: rotate(180deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tx_chrome_linkTrailBar,
  .tx_chrome_linkTrailTip,
  .tx_chrome_contactLink.tx_theta_contactBtn,
  .tx_chrome_contactLink.tx_theta_contactBtn .tx_theta_contactBtn_arrow,
  .tx_chrome_linkChevron {
    transition: none;
  }
}
