/* Tam Works Apps Page */

:root {
  --bg: #fffaf4;
  --bg-soft: #f7efe4;
  --card: #ffffff;
  --text: #3d3228;
  --muted: #75695e;
  --line: #eadccf;
  --accent: #d98b72;
  --accent-dark: #ad6652;
  --blue: #8fb8b2;
  --shadow: 0 18px 45px rgba(75, 52, 36, 0.10);
  --radius-lg: 28px;
  --radius-md: 18px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(217, 139, 114, 0.15), transparent 26rem),
    radial-gradient(circle at 90% 10%, rgba(143, 184, 178, 0.18), transparent 24rem),
    var(--bg);
  font-family:
    "Hiragino Sans",
    "Yu Gothic",
    "YuGothic",
    "Noto Sans JP",
    system-ui,
    sans-serif;
  line-height: 1.75;
}

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

a {
  color: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(255, 250, 244, 0.78);
  border-bottom: 1px solid rgba(234, 220, 207, 0.75);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-logo {
      height: 56px;
      width: auto;
      object-fit: contain;
}


.brand-name {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.header-nav a {
  text-decoration: none;
}

.header-nav a:hover,
.header-nav a[aria-current="page"] {
  color: var(--text);
}

.hero {
  padding: 88px 0 54px;
}

.hero-inner {
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.3rem);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-stats {
  width: min(100%, 560px);
  margin: 38px auto 0;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.hero-stats div {
  min-width: 0;
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.78rem;
}

.apps-section {
  padding: 34px 0 90px;
}

.section-heading {
  margin-bottom: 26px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.apps-grid {
  display: grid;
  gap: 28px;
}

.app-card {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: 34px;
  align-items: center;
  padding: clamp(20px, 4vw, 36px);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 120px;
}

.app-visual {
  display: grid;
  gap: 18px;
}

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

.app-icon {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(75, 52, 36, 0.18);
}

.app-title-wrap h3 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.app-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 4px 12px;
  scrollbar-width: thin;
}

.screenshot {
  width: 128px;
  aspect-ratio: 9 / 19.5;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(234, 220, 207, 0.9);
  background: var(--bg-soft);
  box-shadow: 0 10px 24px rgba(75, 52, 36, 0.12);
}

.app-content {
  min-width: 0;
}

.app-tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  padding: 6px 12px;
  color: var(--accent-dark);
  background: rgba(217, 139, 114, 0.12);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.app-description {
  margin: 0;
  font-size: 1.03rem;
}

.use-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.use-cases li {
  padding: 5px 10px;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 999px;
  font-size: 0.82rem;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(75, 52, 36, 0.12);
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-secondary {
  color: #fff;
  background: var(--blue);
}

.button-ghost {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.button.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.45);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  text-decoration: none;
}

@media (max-width: 820px) {
  .header-inner {
    min-height: 64px;
  }

  .header-nav {
    gap: 12px;
    font-size: 0.86rem;
  }

  .brand-name {
    display: none;
  }

  .hero {
    padding: 62px 0 38px;
  }

  .hero-stats {
    border-radius: 26px;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 6px;
  }

  .app-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .screenshots {
    margin-inline: -4px;
  }

  .screenshot {
    width: 118px;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .header-nav a:first-child {
    display: none;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .hero-stats div {
    padding: 4px 0;
  }

  .app-main {
    align-items: flex-start;
  }

  .app-icon {
    width: 72px;
    height: 72px;
    border-radius: 19px;
  }

  .store-buttons {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .footer-inner {
    display: block;
  }

  .footer-links {
    margin-top: 10px;
  }
}

.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.image-modal.active {
  display: flex;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 24px;
}


/* Screenshot gallery modal */

body.modal-open {
  overflow: hidden;
}

.screenshot {
  cursor: zoom-in;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(34, 27, 22, 0.86);
  backdrop-filter: blur(8px);
}

.image-modal.active {
  display: flex;
}

.image-modal-panel {
  position: relative;
  width: min(100%, 720px);
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.gallery-image {
  max-width: min(88vw, 420px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  background: #fffaf4;
}

.gallery-counter {
  position: absolute;
  left: 50%;
  bottom: -46px;
  transform: translateX(-50%);
  min-width: 86px;
  padding: 6px 14px;
  color: #fff;
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.image-modal-close,
.gallery-nav {
  border: none;
  cursor: pointer;
  color: #3d3228;
  background: rgba(255, 250, 244, 0.94);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.image-modal-close:hover,
.gallery-nav:hover {
  transform: translateY(-2px);
}

.image-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  transform: translateY(-50%);
  font-size: 42px;
  line-height: 0;
}

.gallery-nav:hover {
  transform: translateY(calc(-50% - 2px));
}

.gallery-prev {
  left: 0;
}

.gallery-next {
  right: 0;
}

@media (max-width: 640px) {
  .image-modal {
    padding: 14px;
  }

  .image-modal-panel {
    width: 100%;
    min-height: 78vh;
  }

  .gallery-image {
    max-width: 82vw;
    max-height: 76vh;
    border-radius: 20px;
  }

  .image-modal-close {
    top: 4px;
    right: 4px;
  }

  .gallery-nav {
    width: 44px;
    height: 44px;
    font-size: 34px;
  }

  .gallery-prev {
    left: -4px;
  }

  .gallery-next {
    right: -4px;
  }
}

#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;

  width: 52px;
  height: 52px;
  border-radius: 50%;

  background: #c99178;
  color: white;
  border: none;

  font-size: 18px;
  cursor: pointer;

  /* 最初は見えない */
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;

  /* アニメーション */
  transition: all 0.4s ease;

  box-shadow: 0 10px 25px rgba(110, 70, 56, 0.2);
  z-index: 999;
}

/* 表示状態 */
#scrollTopBtn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ホバーでふわっと */
#scrollTopBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(110, 70, 56, 0.25);
}
