/*
 * 数式の美術館 — サイト共通スタイル
 * 白基調・細めのサンセリフ・字間広め・角丸なし・1px 罫線。
 * 1rem = 10px(html の font-size を 62.5% にしている)。
 * 色は「R,G,B」の形の変数で持ち、rgba(var(--color-foreground), 0.5) のように使う。
 * 独自セクションの CSS(section-hero-math.css ほか)もこの約束で書かれている。
 */

/* ===== 変数 ===== */
:root {
  --color-foreground: 17, 17, 17;
  --color-background: 255, 255, 255;
  --color-surface: 247, 247, 247;
  --color-line: rgba(var(--color-foreground), 0.08);
  --page-width: 120rem;
  --gutter: 1.5rem;
  --grid-gap-x: 2rem;
  --grid-gap-y: 2rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

@media screen and (min-width: 750px) {
  :root {
    --gutter: 5rem;
    --grid-gap-x: 4rem;
    --grid-gap-y: 4rem;
  }
}

@media screen and (min-width: 990px) {
  :root {
    /* 作品グリッドの余白を広げる(展示室の壁の余白) */
    --grid-gap-x: 5.6rem;
    --grid-gap-y: 8rem;
  }
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: rgb(var(--color-foreground));
  background: rgb(var(--color-background));
  -webkit-font-smoothing: antialiased;
}

@media screen and (min-width: 750px) {
  body {
    font-size: 1.6rem;
  }
}

body.is-menu-open {
  overflow: hidden;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

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

picture {
  display: contents;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
.h0,
.h1,
.h2,
.h3,
.h4 {
  font-family: var(--font);
  font-weight: 300;
  letter-spacing: 0.14em;
  line-height: 1.4;
  margin: 0;
}

.h0 { font-size: 4rem; }
.h1 { font-size: 3rem; }
.h2 { font-size: 2rem; }
.h3 { font-size: 1.7rem; }
.h4 { font-size: 1.5rem; }

@media screen and (min-width: 750px) {
  .h0 { font-size: 5.2rem; }
  .h1 { font-size: 4rem; }
  .h2 { font-size: 2.4rem; }
  .h3 { font-size: 1.8rem; }
}

strong,
b {
  font-weight: 500;
}

small {
  font-size: 1.1rem;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgb(var(--color-background));
  border: 0.1rem solid rgb(var(--color-foreground));
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 0.1rem solid rgba(var(--color-foreground), 0.6);
  outline-offset: 0.3rem;
}

/* ===== レイアウト ===== */
/* 最大幅は左右の余白を含む(本番の Studio と同じ 1200px) */
.page-width {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page-width--narrow {
  max-width: calc(72.6rem + var(--gutter) * 2);
}

.page-width--wide {
  max-width: calc(130rem + var(--gutter) * 2);
}

.section {
  padding-top: calc(var(--pt, 0px) * 0.75);
  padding-bottom: calc(var(--pb, 0px) * 0.75);
}

@media screen and (min-width: 750px) {
  .section {
    padding-top: var(--pt, 0px);
    padding-bottom: var(--pb, 0px);
  }
}

.section-title {
  font-size: 2rem;
  letter-spacing: 0.18em;
  margin-bottom: 3rem;
}

@media screen and (min-width: 750px) {
  .section-title {
    font-size: 2.4rem;
    margin-bottom: 4.5rem;
  }
}

.caption-label {
  margin: 0 0 1rem;
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(var(--color-foreground), 0.75);
}

@media screen and (min-width: 750px) {
  .caption-label {
    font-size: 1.1rem;
  }
}

/* ===== ボタン・リンク ===== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.6rem;
  padding: 0.9rem 3.2rem;
  font: inherit;
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  color: rgb(var(--color-background));
  background: rgb(var(--color-foreground));
  border: 0.1rem solid rgb(var(--color-foreground));
  cursor: pointer;
  transition: background 0.35s, color 0.35s;
}

.button:hover {
  background: transparent;
  color: rgb(var(--color-foreground));
}

.button--secondary {
  color: rgb(var(--color-foreground));
  background: transparent;
}

.button--secondary:hover {
  color: rgb(var(--color-background));
  background: rgb(var(--color-foreground));
}

.button--full {
  display: flex;
  width: 100%;
}

.button[aria-disabled="true"] {
  cursor: not-allowed;
  color: rgba(var(--color-foreground), 0.45);
  background: transparent;
  border-color: rgba(var(--color-foreground), 0.2);
}

.link-arrow {
  display: inline-block;
  margin-top: 1.2rem;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-bottom: 0.1rem solid rgba(var(--color-foreground), 0.4);
  transition: border-color 0.3s;
}

.link-arrow::after {
  content: " →";
}

.link-arrow:hover {
  border-color: rgb(var(--color-foreground));
}

.badge {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0 0.8rem;
  font-size: 1rem;
  letter-spacing: 0.1em;
  border: 0.1rem solid rgb(var(--color-foreground));
}

/* ===== 本文(記事・規約・説明文) ===== */
.rte {
  color: rgba(var(--color-foreground), 0.78);
}

.rte > :first-child {
  margin-top: 0;
}

.rte > :last-child {
  margin-bottom: 0;
}

.rte p {
  margin: 0 0 1.4em;
}

.rte h2,
.rte h3,
.rte h4 {
  color: rgb(var(--color-foreground));
  margin: 2em 0 0.8em;
  letter-spacing: 0.12em;
}

.rte h2 { font-size: 2rem; }
.rte h3 { font-size: 1.7rem; }
.rte h4 { font-size: 1.5rem; }

@media screen and (min-width: 750px) {
  .rte h2 { font-size: 2.2rem; }
}

.rte a {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
  text-decoration-thickness: 0.1rem;
}

.rte ul,
.rte ol {
  margin: 0 0 1.4em;
  padding-left: 2em;
}

.rte li + li {
  margin-top: 0.3em;
}

.rte img,
.rte video {
  margin: 2rem 0;
}

.rte p > img:only-child,
.rte p > picture:only-child img {
  margin: 0;
}

.rte table {
  width: 100%;
  margin: 0 0 1.4em;
  border-collapse: collapse;
  font-size: 0.92em;
}

.rte th,
.rte td {
  padding: 1rem 1.2rem;
  border: 0.1rem solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

.rte th {
  width: 30%;
  font-weight: 400;
  color: rgb(var(--color-foreground));
  background: rgba(var(--color-foreground), 0.02);
}

/* ===== ヘッダー ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(var(--color-background), 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 0.1rem solid var(--color-line);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

@media screen and (min-width: 990px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    gap: 3rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}

.site-logo {
  display: inline-block;
  text-decoration: none;
  line-height: 1.3;
}

.site-logo__name {
  display: block;
  font-size: 1.8rem;
  letter-spacing: 0.18em;
}

.site-logo__sub {
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0.34em;
  color: rgba(var(--color-foreground), 0.55);
}

.site-nav {
  display: none;
  justify-self: end;
}

@media screen and (min-width: 990px) {
  .site-nav {
    display: block;
  }
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: block;
  padding: 1rem 0;
  font-size: 1.2rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(var(--color-foreground), 0.75);
  transition: color 0.3s;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: rgb(var(--color-foreground));
}

.site-nav__link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.4rem;
  text-decoration-thickness: 0.1rem;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  margin-left: -1.2rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}

.menu-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-toggle__bars span {
  display: block;
  width: 2rem;
  height: 0.1rem;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { transform: translateY(0.6rem) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { transform: translateY(-0.6rem) rotate(-45deg); }

@media screen and (min-width: 990px) {
  .menu-toggle {
    display: none;
  }

  .site-header__inner {
    grid-template-columns: auto 1fr auto;
  }
}

@media screen and (max-width: 989px) {
  .site-header__lang {
    display: none;
  }

  .site-header__inner {
    grid-template-columns: auto 1fr;
  }
}

.mobile-menu {
  position: fixed;
  inset: var(--header-height, 6.4rem) 0 0;
  z-index: 19;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4rem var(--gutter) 3rem;
  overflow-y: auto;
  background: rgba(var(--color-background), 0.97);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-menu__link {
  padding: 1rem 0;
  font-size: 1.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
}

.mobile-menu__utility {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 3rem;
}

/* ===== 言語切替 ===== */
.lang-switch {
  position: relative;
  font-size: 1.3rem;
}

.lang-switch__current {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0;
  list-style: none;
  cursor: pointer;
  letter-spacing: 0.08em;
}

.lang-switch__current::-webkit-details-marker {
  display: none;
}

.lang-switch__caret {
  width: 1rem;
  height: 0.6rem;
  transition: transform 0.2s;
}

.lang-switch[open] .lang-switch__caret {
  transform: rotate(180deg);
}

.lang-switch__list {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  min-width: 14rem;
  margin: 0.4rem 0 0;
  padding: 0.8rem 0;
  list-style: none;
  background: rgb(var(--color-background));
  border: 0.1rem solid var(--color-line);
  box-shadow: 0 0.6rem 2.5rem rgba(var(--color-foreground), 0.08);
}

.lang-switch__list a {
  display: block;
  padding: 0.6rem 1.6rem;
  text-decoration: none;
  color: rgba(var(--color-foreground), 0.75);
}

.lang-switch__list a:hover,
.lang-switch__list a[aria-current="true"] {
  color: rgb(var(--color-foreground));
}

.lang-switch__list a[aria-current="true"] {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.lang-switch--boxed .lang-switch__current {
  padding: 0.8rem 1.4rem;
  border: 0.1rem solid rgba(var(--color-foreground), 0.15);
  background: rgb(var(--color-background));
}

.lang-switch--up .lang-switch__list {
  top: auto;
  bottom: 100%;
  left: 0;
  right: auto;
  margin: 0 0 0.4rem;
}

.mobile-menu__lang .lang-switch__list {
  top: auto;
  bottom: 100%;
  left: 0;
  right: auto;
}

/* ===== SNS アイコン ===== */
.social-list {
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-list__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  color: rgb(var(--color-foreground));
  transition: opacity 0.3s;
}

.social-list__link:hover {
  opacity: 0.6;
}

.social-list .icon {
  width: 1.8rem;
  height: 1.8rem;
  fill: currentColor;
}

/* ===== フッター ===== */
.site-footer {
  margin-top: auto;
  background: rgb(var(--color-surface));
}

.site-footer__top {
  display: flex;
  justify-content: center;
  padding-top: 3.3rem;
  padding-bottom: 3.3rem;
}

.site-footer__bottom {
  border-top: 0.1rem solid var(--color-line);
  padding: 3rem 0 2.4rem;
}

@media screen and (min-width: 750px) {
  .site-footer__top {
    padding-top: 4.4rem;
    padding-bottom: 4.4rem;
  }

  .site-footer__bottom {
    padding: 4rem 0 3.2rem;
  }
}

.site-footer__label {
  margin: 0 0 1rem;
  font-size: 1.3rem;
}

.site-footer__lang {
  margin-bottom: 3rem;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 0;
  color: rgba(var(--color-foreground), 0.75);
}

.site-footer__legal a {
  text-decoration: none;
}

.site-footer__legal a:hover {
  text-decoration: underline;
}

.site-footer__policies {
  display: contents;
  list-style: none;
}

.site-footer__policies li::before {
  content: "·";
  margin: 0 1rem;
  font-size: 1.1rem;
}

/* ===== カード(シリーズ・作品) ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap-y) var(--grid-gap-x);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 作品のカードはモバイルでも2列 */
.card-grid--products {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 1.6rem;
}

@media screen and (min-width: 750px) {
  .card-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--grid-gap-y) var(--grid-gap-x);
  }
}

@media screen and (min-width: 990px) {
  .card-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card__link {
  display: block;
  text-decoration: none;
  text-align: center;
}

.card__media {
  overflow: hidden;
}

.card__media img {
  width: 100%;
  transition: transform 1.2s var(--ease);
}

.card__link:hover .card__media img {
  transform: scale(1.03);
}

.card__title {
  margin-top: 1.4rem;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

@media screen and (min-width: 750px) {
  .card__title {
    font-size: 1.7rem;
  }
}

.card__arrow {
  margin-left: 0.6rem;
  display: inline-block;
  transition: transform 0.3s;
}

.card__link:hover .card__arrow {
  transform: translateX(0.4rem);
}

.card__title--product {
  font-size: 1.3rem;
}

.card__price {
  margin: 0.4rem 0 0;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* ===== テキスト(rich-text) ===== */
.rich-text__inner {
  max-width: 78rem;
  margin: 0 auto;
  text-align: center;
}

.rich-text__heading {
  margin-bottom: 2rem;
}

.rich-text__text {
  font-size: 1.4rem;
}

@media screen and (min-width: 750px) {
  .rich-text__text {
    font-size: 1.5rem;
  }
}

.rich-text__buttons,
.image-with-text__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
}

.rich-text__buttons {
  justify-content: center;
}

/* ===== 画像とテキスト ===== */
.image-with-text__grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

@media screen and (min-width: 750px) {
  .image-with-text__grid {
    grid-template-columns: 1fr 1fr;
  }

  .image-with-text--reverse .image-with-text__media {
    order: 2;
  }
}

.image-with-text__media img {
  width: 100%;
}

.image-with-text__content {
  padding: 4rem 0 0;
}

@media screen and (min-width: 750px) {
  .image-with-text__content {
    padding: 4rem 3.5rem 4rem 7rem;
  }

  .image-with-text--reverse .image-with-text__content {
    padding: 4rem 7rem 4rem 3.5rem;
  }
}

.image-with-text__heading {
  margin-bottom: 2rem;
}

.image-with-text__content .caption-label {
  margin-bottom: 0.4rem;
}

.image-with-text__text {
  font-size: 1.4rem;
}

/* ===== 3列(multicolumn) ===== */
.multicolumn__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem var(--grid-gap-x);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media screen and (min-width: 990px) {
  .multicolumn__list--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .multicolumn__list--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.multicolumn__item {
  padding: 0 1rem;
}

.multicolumn__title {
  margin-bottom: 1.2rem;
  font-size: 1.7rem;
  letter-spacing: 0.12em;
}

@media screen and (min-width: 750px) {
  .multicolumn__title {
    font-size: 1.8rem;
  }
}

.multicolumn__text {
  font-size: 1.4rem;
}

/* ===== 動画 ===== */
.video-section__frame {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.video-section__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 固定ページ ===== */
.main-page {
  padding: 4rem 0 2rem;
}

@media screen and (min-width: 750px) {
  .main-page {
    padding: 5.6rem 0 2.8rem;
  }
}

.main-page__title {
  margin-bottom: 3rem;
}

/* ===== 問い合わせ先 ===== */
.contact-methods {
  padding: 2rem 0 6rem;
}

.contact-methods__list {
  margin: 0;
  border-top: 0.1rem solid var(--color-line);
}

.contact-methods__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  padding: 2rem 0;
  border-bottom: 0.1rem solid var(--color-line);
}

@media screen and (min-width: 750px) {
  .contact-methods__item {
    grid-template-columns: 16rem 1fr;
  }
}

.contact-methods__item dt {
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  color: rgba(var(--color-foreground), 0.6);
}

.contact-methods__item dd {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
}

.contact-methods__item dd a {
  text-decoration: underline;
  text-underline-offset: 0.4rem;
  text-decoration-thickness: 0.1rem;
  word-break: break-all;
}

.contact-methods__note {
  margin: 0.6rem 0 0;
  font-size: 1.3rem;
  color: rgba(var(--color-foreground), 0.6);
}

/* ===== News 一覧 ===== */
.main-blog {
  padding: 3.6rem 0 6rem;
}

@media screen and (min-width: 750px) {
  .main-blog {
    padding: 4.8rem 0 8rem;
  }
}

.main-blog__title {
  margin-bottom: 1.2rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem var(--grid-gap-x);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media screen and (min-width: 750px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem 2rem;
  }
}

.blog-card {
  text-align: center;
}

.blog-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.blog-card:hover .blog-card__media img {
  transform: scale(1.03);
}

.blog-card__title {
  margin-top: 1.6rem;
  font-size: 2rem;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

@media screen and (min-width: 750px) {
  .blog-card__title {
    font-size: 2.4rem;
  }
}

.blog-card__title a {
  text-decoration: none;
}

.blog-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.blog-card__date {
  margin: 0.6rem 0 0;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: rgba(var(--color-foreground), 0.75);
}

.blog-card__excerpt {
  margin: 1rem 0 0;
  font-size: 1.4rem;
  color: rgba(var(--color-foreground), 0.75);
}

/* ===== 記事 ===== */
.article__hero {
  padding-top: 1rem;
}

.article__hero img {
  width: 100%;
  max-height: 80vh;
  object-fit: cover;
}

.article__header {
  padding-top: 3.6rem;
}

@media screen and (min-width: 750px) {
  .article__header {
    padding-top: 4.8rem;
  }
}

.article__title {
  font-size: 2.8rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

@media screen and (min-width: 750px) {
  .article__title {
    font-size: 3.6rem;
  }
}

.article__date {
  margin: 1rem 0 0;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  color: rgba(var(--color-foreground), 0.75);
}

.share-button {
  margin-top: 1.6rem;
  padding: 0;
  font: inherit;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  background: none;
  border: 0;
  border-bottom: 0.1rem solid rgba(var(--color-foreground), 0.4);
  cursor: pointer;
  color: inherit;
}

.article__content {
  padding-top: 3rem;
  padding-bottom: 3rem;
  font-size: 1.5rem;
}

.article__back {
  padding-bottom: 6rem;
  text-align: center;
}

@media screen and (min-width: 750px) {
  .article__back {
    padding-bottom: 8rem;
  }
}

.link-back {
  display: inline-block;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-bottom: 0.1rem solid rgba(var(--color-foreground), 0.4);
  transition: border-color 0.3s;
}

.link-back::before {
  content: "← ";
}

.link-back:hover {
  border-color: rgb(var(--color-foreground));
}

/* ===== 規約 ===== */
.policy {
  padding: 4rem 0 7rem;
}

@media screen and (min-width: 750px) {
  .policy {
    padding: 5.6rem 0 9rem;
  }
}

.policy__title {
  margin-bottom: 3rem;
}

.policy__notice {
  margin: 0 0 3rem;
  padding: 1.2rem 1.6rem;
  font-size: 1.3rem;
  border: 0.1rem solid var(--color-line);
}

/* ===== Shop 一覧・シリーズ ===== */
.main-list-collections {
  padding: 2rem 0 8rem;
}

.collection-products {
  padding: 2rem 0 8rem;
}

/* ===== 商品 ===== */
.product {
  padding: 3rem 0 4rem;
}

@media screen and (min-width: 750px) {
  .product {
    padding: 4rem 0 6rem;
  }
}

.product__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media screen and (min-width: 990px) {
  .product__grid {
    grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
    gap: 4rem;
    align-items: start;
  }

  .product__info {
    position: sticky;
    top: calc(var(--header-height, 8rem) + 2rem);
  }
}

.gallery__track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery__track::-webkit-scrollbar {
  display: none;
}

.gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.gallery__zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}

.gallery__zoom img {
  width: 100%;
  max-height: calc(100vh - var(--header-height, 8rem) - 14rem);
  object-fit: contain;
}

.gallery__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  margin-top: 1.2rem;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: rgba(var(--color-foreground), 0.75);
}

.gallery__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}

.gallery__arrow svg {
  width: 0.8rem;
  height: 1.4rem;
}

.gallery__thumbs {
  display: none;
}

@media screen and (min-width: 750px) {
  .gallery__controls {
    display: none;
  }

  .gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
  }
}

.gallery__thumb {
  display: block;
  width: 9.6rem;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 0.1rem solid transparent;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.3s, border-color 0.3s;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumb[aria-current="true"] {
  opacity: 1;
  border-color: rgb(var(--color-foreground));
}

.product__vendor {
  margin-bottom: 1.4rem;
}

.product__vendor a {
  text-decoration: none;
}

.product__title {
  font-size: 3rem;
  letter-spacing: 0.14em;
  line-height: 1.3;
}

@media screen and (min-width: 750px) {
  .product__title {
    font-size: 4rem;
  }
}

.product__price {
  margin: 1.4rem 0 0;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.product__tax {
  margin-left: 0.6rem;
  font-size: 1.1rem;
  color: rgba(var(--color-foreground), 0.6);
}

.variant-picker {
  margin: 2.4rem 0 0;
  padding: 0;
  border: 0;
}

.variant-picker__label {
  margin-bottom: 0.8rem;
  padding: 0;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
}

.variant-picker__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.variant-picker__pills label {
  display: inline-block;
  padding: 0.8rem 2rem;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  border: 0.1rem solid rgba(var(--color-foreground), 0.55);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.variant-picker__pills input:checked + label {
  color: rgb(var(--color-background));
  background: rgb(var(--color-foreground));
  border-color: rgb(var(--color-foreground));
}

.variant-picker__pills input:focus-visible + label {
  outline: 0.1rem solid rgba(var(--color-foreground), 0.6);
  outline-offset: 0.3rem;
}

.product__buy {
  margin-top: 2.4rem;
}

.product__buy-note {
  margin: 1rem 0 0;
  font-size: 1.2rem;
  line-height: 1.7;
  color: rgba(var(--color-foreground), 0.6);
}

.product__buy-note a {
  text-underline-offset: 0.3rem;
}

.product__note {
  margin: 2.4rem 0 0;
  font-size: 1.5rem;
  color: rgba(var(--color-foreground), 0.75);
}

.product__description {
  margin-top: 2.4rem;
  font-size: 1.4rem;
}

.accordion {
  border-bottom: 0.1rem solid var(--color-line);
}

.product__description + .accordion {
  margin-top: 2.4rem;
  border-top: 0.1rem solid var(--color-line);
}

.accordion__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 0;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  list-style: none;
  cursor: pointer;
}

.accordion__summary::-webkit-details-marker {
  display: none;
}

.accordion__summary::after {
  content: "+";
  font-size: 1.6rem;
  color: rgba(var(--color-foreground), 0.5);
}

.accordion[open] .accordion__summary::after {
  content: "−";
}

.accordion__body {
  padding: 0 0 1.6rem;
  font-size: 1.3rem;
}

.related-products {
  padding: 4rem 0 6rem;
}

@media screen and (min-width: 750px) {
  .related-products {
    padding: 6rem 0 8rem;
  }
}

/* 拡大表示 */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(var(--color-background));
}

.lightbox::backdrop {
  background: rgba(var(--color-background), 0.9);
}

.lightbox__close {
  position: fixed;
  top: 1.6rem;
  right: 1.6rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  padding: 0;
  background: rgb(var(--color-background));
  border: 0.1rem solid var(--color-line);
  color: inherit;
  cursor: pointer;
}

.lightbox__close svg {
  width: 1.6rem;
  height: 1.6rem;
}

.lightbox__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 7rem var(--gutter);
  list-style: none;
}

.lightbox__list img {
  max-width: min(100%, 140rem);
}

/* ===== 404・購入完了 ===== */
.not-found,
.thanks {
  padding: 6rem 0;
}

.not-found__body {
  margin: 2rem 0 3rem;
  color: rgba(var(--color-foreground), 0.75);
}

.thanks__block + .thanks__block {
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 0.1rem solid var(--color-line);
}

.thanks__block p {
  color: rgba(var(--color-foreground), 0.75);
}

.thanks__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 4rem;
}

/* ===== 点群バックドロップ(トップ以外の主要ページの全画面背景) ===== */
.math-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

body:has(> .math-backdrop) {
  background: rgb(var(--color-background));
}

/* 独自セクションの地色を透過して、背景の点群を見せる */
body:has(> .math-backdrop) hero-math,
body:has(> .math-backdrop) math-banner {
  background: transparent;
}

/* ===== スクロール連動フェードイン(custom-motion.js が .reveal を付ける) ===== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card__link:hover .card__media img,
  .blog-card:hover .blog-card__media img {
    transform: none;
  }
}
