/* base.css - CSS Reset & base styles */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--fg-1);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

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

ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--cal-teal);
  outline-offset: 2px;
}

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

/* ============================================================
   Back-to-top floating button (右下のフロート復帰ボタン)
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: var(--cal-teal);
  color: var(--cal-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity var(--t-base) var(--ease),
    visibility var(--t-base) var(--ease),
    transform var(--t-base) var(--ease),
    background-color var(--t-fast) var(--ease);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--cal-teal-dark);
  transform: translateY(-2px);
}
.back-to-top:active {
  transform: translateY(0);
}
.back-to-top i,
.back-to-top svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  .back-to-top i,
  .back-to-top svg {
    width: 22px;
    height: 22px;
  }
}
