/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --color-primary: #282828;
  --color-secondary: #fff;

  --font-en: "aktiv-grotesk", "Aktiv Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-ja: "Noto Sans JP", sans-serif;

  --header-h: 66.335px;      /* 16 + 34.335 + 16 */
  --gutter: 24px;
  --overlay-gap: 160px;      /* header → content, content → footer */
  --section-gap: 80px;

  --duration: 0.4s;
}

@media (max-width: 899px) {
  :root {
    --header-h: 106.335px;   /* 16 + 34.335 + 20 + 20 + 16 */
    --gutter: 16px;
    --overlay-gap: 64px;
    --section-gap: 64px;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html.is-overlay-open {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--color-secondary);
  color: var(--color-primary);
  font-family: var(--font-ja);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

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

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

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 16px var(--gutter);
  background: var(--color-secondary);
  color: var(--color-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.header__brand {
  flex: 1 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.header__logo img {
  width: 50px;
}

.header__tagline {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 500;
  line-height: 10px;
  white-space: nowrap;
}

.header__nav {
  flex: 1 0 0;
  min-width: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav__item {
  flex: 1 0 0;
  display: flex;
  min-width: 0;
}

.nav__item--end {
  justify-content: flex-end;
}

.nav__label {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

/* 準備中の項目は取り消し線 */
.nav__label--disabled {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

/* オーバーレイ表示中のアクティブ項目に下線 */
.nav__label.is-active {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (hover: hover) {
  button.nav__label:hover,
  a.nav__label:hover {
    opacity: 0.6;
  }
}

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

@media (max-width: 899px) {
  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .nav {
    justify-content: space-between;
    gap: 0;
  }

  .nav__item {
    flex: none;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--gutter);
  font-family: var(--font-en);
  font-weight: 500;
  line-height: 10px;
  white-space: nowrap;
}

.footer__copyright {
  font-size: 15px;
}

.footer__note {
  font-size: 11px;
}

/* ==========================================================================
   TOP
   ========================================================================== */
.top {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-h);
  overflow: hidden;
}

.top__visual {
  position: absolute;
  top: 92.87px;
  left: calc(261 / 1441 * 100%);
  width: calc(1190.41 / 1441 * 100%);
}

.top__visual img {
  width: 100%;
}

.top__copy {
  position: relative;
  margin: 20px var(--gutter) 0;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-feature-settings: "palt" 1;
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
  white-space: nowrap;
}

.top .footer {
  position: relative;
  margin-top: auto;
}

@media (max-width: 899px) {
  .top {
    --visual-w: min(calc(458 / 375 * 100vw), 560px);
    /* ロゴがコピーに重ならない高さを確保（ヘッダー+コピー ≒ 250px、ロゴ下余白 64px） */
    min-height: max(100svh, calc(250px + var(--visual-w) * 314.507 / 458 + 64px));
  }

  .top__visual {
    top: auto;
    bottom: 64px;
    left: 16px;
    width: var(--visual-w);
  }

  .top__copy {
    margin-top: 8px;
    font-size: 22px;
    letter-spacing: 0;
    font-feature-settings: normal;
  }
}

/* ==========================================================================
   Overlay (Profile / Contact)
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-secondary);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) ease, visibility 0s linear var(--duration);
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--duration) ease;
}

.overlay:focus {
  outline: none;
}

.overlay__inner {
  display: flex;
  flex-direction: column;
  gap: var(--overlay-gap);
  min-height: 100%;
  padding-top: calc(var(--header-h) + var(--overlay-gap));
}

.overlay__content {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.overlay .footer {
  margin-top: auto;
}

@media (prefers-reduced-motion: reduce) {
  .overlay,
  .overlay.is-open {
    transition: none;
  }
}

/* ==========================================================================
   Section
   ========================================================================== */
.section {
  display: flex;
  align-items: flex-start;
  padding: 0 var(--gutter);
}

.section__head {
  flex: 1 0 0;
  min-width: 0;
  padding: 12px 0;
}

.section__title {
  font-family: var(--font-en), var(--font-ja);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-position: from-font;
}

.section__body {
  flex: 1 0 0;
  min-width: 0;
}

@media (max-width: 899px) {
  .section {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .section__head {
    padding: 0;
  }
}

/* ==========================================================================
   Company info
   ========================================================================== */
.info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.info__row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.info__label {
  flex-shrink: 0;
  width: 120px;
}

.info__value {
  flex: 1 0 0;
  min-width: 0;
}

@media (max-width: 899px) {
  .info__row {
    gap: 8px;
  }

  .info__label {
    width: 72px;
  }
}

/* ==========================================================================
   Members
   ========================================================================== */
.members {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.member {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Figma の CROP 設定（imageTransform）を再現 */
.member__photo {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.member__img {
  position: absolute;
  max-width: none;
}

.member__img--koen {
  top: -12.895%;
  left: -18.268%;
  width: 174.750%;
}

.member__img--fujita {
  top: -10.889%;
  left: -53.947%;
  width: 207.894%;
}

.member__heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member__role {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 500;
  line-height: 12px;
}

.member__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 19px;
  font-feature-settings: "palt" 1;
}

.member__bio {
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: justify;
  font-feature-settings: "palt" 1;
}

@media (max-width: 899px) {
  .members {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.contact__mail {
  font-family: var(--font-en), var(--font-ja);
  font-size: 20px;
  text-decoration: underline;
  text-underline-position: from-font;
  transition: opacity 0.2s ease;
}

@media (hover: hover) {
  .contact__mail:hover {
    opacity: 0.6;
  }
}

/* ==========================================================================
   Mission (Profile)
   ========================================================================== */
.mission {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.mission__heading {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-feature-settings: "palt" 1;
  text-decoration: underline;
  text-underline-position: from-font;
}

.mission__statement {
  font-size: 15px;
  font-weight: 600;
  line-height: 25px;
  letter-spacing: -0.01em;
  font-feature-settings: "palt" 1;
}

@media (max-width: 899px) {
  .mission {
    gap: 24px;
  }

  .mission__heading {
    font-size: 20px;
  }

  .mission__statement {
    font-size: 13px;
    line-height: 23px;
  }

  /* SP は画面幅で自然に折り返す (PC の改行位置だと行末に1〜2文字が残るため) */
  .mission__statement br {
    display: none;
  }
}

/* ==========================================================================
   Works summary (overlay)
   ========================================================================== */
.works-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 0 var(--gutter);
}

.works-grid__row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.work-card {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-card__media {
  overflow: hidden;
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.3s ease;
}

.work-card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 19px;
  font-feature-settings: "palt" 1;
}

.work-card__tags {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 500;
  line-height: 15px;
  color: #aaa;
}

@media (hover: hover) {
  .work-card:hover .work-card__media img {
    transform: scale(1.03);
    opacity: 0.85;
  }
}

@media (max-width: 899px) {
  .works-grid__row {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }
}

/* ==========================================================================
   Works detail
   ========================================================================== */
/* PC: header sits on the cover until the page scrolls */
.is-detail .header {
  background: transparent;
}

.is-scrolled .is-detail .header,
.is-overlay-open .is-detail .header {
  background: var(--color-secondary);
}

.detail-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

.detail-hero__cover {
  position: absolute;
  inset: 0;
}

.detail-hero__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero__title {
  position: absolute;
  z-index: 1;
  top: calc(var(--header-h) + 20px);
  left: var(--gutter);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-feature-settings: "palt" 1;
  text-decoration: underline;
  text-underline-position: from-font;
}

@media (min-width: 900px) {
  .is-hero-dark .detail-hero__title,
  :root:not(.is-scrolled):not(.is-overlay-open) .is-hero-dark .header {
    color: var(--color-secondary);
  }

  :root:not(.is-scrolled):not(.is-overlay-open) .is-hero-dark .header__logo img {
    filter: invert(1);
  }
}

.detail-articles {
  display: flex;
  flex-direction: column;
  gap: 80px;
  padding: 160px 0;
}

.detail-article__body {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.detail-article__heading {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-feature-settings: "palt" 1;
  text-decoration: underline;
  text-underline-position: from-font;
}

.detail-article__text {
  font-size: 15px;
  font-weight: 600;
  line-height: 25px;
  letter-spacing: -0.01em;
  font-feature-settings: "palt" 1;
}

.detail-article__figure {
  width: 100%;
  aspect-ratio: 696 / 550;
  object-fit: cover;
}

.detail-gallery__media {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (max-width: 899px) {
  .is-detail .header {
    background: var(--color-secondary);
  }

  .detail-hero {
    height: auto;
    min-height: 0;
    padding-top: var(--header-h);
  }

  .detail-hero__title {
    position: static;
    padding: 8px var(--gutter) 24px;
    font-size: 22px;
    letter-spacing: 0;
  }

  .detail-hero__cover {
    position: relative;
    aspect-ratio: 375 / 420;
  }

  .detail-articles {
    gap: 64px;
    padding: 64px 0;
  }

  .detail-article__body {
    gap: 24px;
  }

  .detail-article__heading {
    font-size: 20px;
    letter-spacing: 0;
  }

  .detail-article__text {
    font-size: 13px;
    line-height: 23px;
  }
}
