/* ==================================================
   REPICKWOOD / 共通・ファーストビュー
   基準：PC 1440 × 900 / SP 390 × 844
   ================================================== */

:root {
  --color-paper: #f0ede9;
  --color-ink: #333;
  --hero-inset: 8px;
  --hero-edge: clamp(32px, 3.889vw, 72px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-paper);
}

body {
  margin: 0;
  color: var(--color-ink);
  font-family: "Gen Interface JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

/* オープニング */

.opening {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background: #fff;
  pointer-events: none;
}

/* Figma 4343:2816：832 × 780の年輪と中央ロゴ。素材の縦横比を保って全体を拡縮。 */

.opening__art {
  position: absolute;
  left: var(--opening-left, 0px);
  top: var(--opening-top, 0px);
  transform: scale(var(--opening-scale, 1));
  transform-origin: top left;
}

.opening__rings {
  position: relative;
  width: 832px;
  height: 780px;
  opacity: 0;
  transform-origin: center center;
}

.opening__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* 文字以外の装飾も含め、FV全体を一つの画面として配置 */

.hero {
  position: relative;
  height: 100svh;
  min-height: 640px;
  color: #fff;
  overflow: hidden;
}

.hero__visual {
  position: absolute;
  inset: var(--hero-inset);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 4px;
}

.hero__photo {
  position: relative;
  overflow: hidden;
}

.hero__photo > img {
  will-change: transform, opacity;
  backface-visibility: hidden;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 20%);
}

.hero__photo--office > img {
  --photo-flip: -1;
  transform: scaleX(-1);
}

/* KV3はFigmaの被写体位置に合わせてトリミングする。 */

.hero__photo--bar > .hero__image--3 {
  object-position: right center;
}

@media (min-width: 768px) {
  .hero__photo--office > .hero__image--3 {
    inset: 0 auto auto -6.9%;
    width: 113.77%;
    height: 122.18%;
  }
}

.header {
  position: absolute;
  inset: 56px var(--hero-edge) auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

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

.brand__divider {
  height: 20px;
  width: 1px;
  background: white;
}

.navigation {
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 24px;
  row-gap: 20px;
  font-size: 16px;
  line-height: 1;
}

.navigation a {
  display: block;
}

.menu-toggle {
  display: none;
}

.hero__heading {
  position: absolute;
  top: 41.6667%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.hero__eyebrow {
  margin: 0 0 26px;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: .02em;
}

h1 {
  margin: 0;
}

.hero__tagline {
  margin: 27px 0 0;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: .02em;
}

.hero__description {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: .02em;
}

.hero__description--desktop {
  position: absolute;
  left: var(--hero-edge);
  bottom: 56px;
}

.hero__description--mobile {
  display: none;
}

.catalog {
  position: fixed;
  z-index: 20;
  bottom: 56px;
  box-shadow: 0 2px 14px rgb(0 0 0 / 10%);
  right: var(--hero-edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 273px;
  padding: 4px 12px 4px 4px;
  background: white;
  color: #333;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  min-height: 60.5px;
  transition: background .25s;
}

.catalog:hover {
  background: white;
}

.catalog__thumbnail {
  display: flex;
  width: 80px;
  height: 52.5px;
  overflow: hidden;
  border-radius: 4px;
}

.catalog__thumbnail img {
  width: 50%;
  height: 57.26px;
  object-fit: cover;
  margin-top: -2.5px;
}

.catalog__arrow {
  transform: scaleX(-1);
}

/* 確認版の補助ダイアログ */

dialog {
  background: var(--color-paper);
  color: #333;
  border: 0;
  padding: 32px;
  max-width: calc(100% - 40px);
}

dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.notice h2 {
  font-size: 19px;
}

.notice p {
  font-size: 14px;
  line-height: 1.9;
}

.notice button,
.close-button {
  border: 1px solid #b8b0a7;
  background: transparent;
  padding: 10px 20px;
}

/* SPメニュー：Figma 4310:64 */

.mobile-menu {
  position: fixed;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100dvh - 8px);
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px;
  border-radius: 6px;
  background: #fff;
  overflow-y: auto;
}

.mobile-menu::backdrop {
  background: #f0ede9;
}

body.has-mobile-menu {
  overflow: hidden;
}

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 16px;
}

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

.mobile-menu__brand span {
  width: 1px;
  height: 12px;
  background: rgb(51 51 51 / 30%);
}

.mobile-menu__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -14px -6px;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: min(290px, 100%);
  margin: 72px auto 40px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  font-feature-settings: "halt" 1;
}

.mobile-menu__group {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mobile-menu__subitems {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 16px;
}

.mobile-menu__subitems a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.mobile-menu__subitems a::before {
  content: "";
  flex: 0 0 8px;
  height: 1px;
  background: currentColor;
  align-self: center;
}

.mobile-menu__catalog {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 16px 24px;
  background: #333;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
}

.mobile-menu__catalog img {
  transform: scaleX(-1);
}

@media (max-width: 374px) {
  .mobile-menu__subitems a {
    line-height: 1.5;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .navigation {
    font-size: 12px;
    column-gap: 16px;
  }

  .brand {
    gap: 12px;
    transform: scale(.8);
    transform-origin: left top;
  }

  .hero__description {
    font-size: 13px;
  }
}

/* SP：写真の順序、ロゴ、CTAの仕様もSPデザインへ切り替え */

@media (max-width: 767px) {
  :root {
    --hero-inset: 4px;
    --hero-edge: 24px;
  }

  .hero {
    height: 100svh;
    min-height: 640px;
  }

  .hero__visual {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    border-radius: 6px;
  }

  .hero__photo--office > img {
    --photo-flip: 1;
    transform: none;
  }

  .hero__photo::after {
    background: rgb(0 0 0 / 30%);
  }

  .header {
    top: 24px;
    align-items: center;
  }

  .brand {
    gap: 10px;
  }

  .brand__divider {
    height: 12px;
    background: rgb(255 255 255 / 30%);
  }

  .navigation {
    display: none;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -14px -6px;
    padding: 0;
    border: 0;
    color: white;
  }

  .hero__heading {
    top: calc(50% + 9px);
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: calc(100% - 32px);
  }

  .hero__eyebrow {
    margin: 0 0 16px;
  }

  h1 {
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
  }

  h1 img {
    max-width: 100%;
    height: auto;
  }

  .hero__tagline {
    margin-top: 16px;
    font-size: 13px;
  }

  .hero__description--mobile {
    display: block;
    margin-top: 16px;
    font-size: 13px;
  }

  .hero__description--desktop {
    display: none;
  }

  .catalog {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 56px;
    min-height: 0;
    padding: 16px;
    font-size: 14px;
    border-radius: 6px;
  }

  .catalog__thumbnail {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* 閉じる間もdialogを維持して、背景とメニューを一緒にフェードする。 */

.mobile-menu[open]::backdrop {
  animation: menu-backdrop-in .25s ease-out both;
}

.mobile-menu.is-closing::backdrop {
  animation: menu-backdrop-out .25s ease-out both;
}

@keyframes menu-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes menu-backdrop-out { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .mobile-menu[open]::backdrop {
    animation: none;
  }
}

/* 参考サイトと同じ、ラベルが上方向へ入れ替わるホバー */

.button-roll {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: middle;
}

.button-roll > span {
  display: block;
}

.button-roll > span + span {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  width: 100%;
}

.has-button-hover {
  overflow: hidden;
}

.button-arrow-mask {
  position: relative;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
}

/* pictureもブロック化し、複製前後で矢印の反転と移動を維持する。 */

.button-arrow-mask > picture {
  display: block;
}

.button-arrow-mask .button-arrow-copy {
  position: absolute;
  top: 0;
  max-width: none;
}

/* 枠は静止レイヤー、矢印のみ別レイヤーで横に入れ替える。 */

.button-arrow-frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.button-arrow-glyph {
  position: relative;
  z-index: 1;
}

.catalog .button-arrow-mask {
  width: 52px !important;
  height: 35px !important;
}

@media (max-width: 767px) {
  .catalog .button-arrow-mask {
    width: 18px !important;
    height: 18px !important;
  }
}
