:root {
  --bg: lab(37.4616% -36.7971 22.9692);
  --card: #fff;
  --accent: lab(37.4616% -36.7971 22.9692);
  --text: #000;
  --muted: #676767;
  --fg: #fff;
}
body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: var(--fg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}
.card {
  background: var(--card);
  border-radius: 24px;
  padding: 48px;
  width: calc(67vw - 24px);
  max-width: 600px;
  text-align: center;
}

.wide-card {
  width: calc(100vw - 24px);
  max-width: 100vw;
}

h1 {
  font-size: 32px;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h2 {
  font-size: 24px;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--text);
}
p {
  margin: 10px 0 28px 0;
  color: var(--muted);
  line-height: 1.6;
}
a { color: var(--accent); display: inline-block; transition: background 0.2s, color 0.2s, text-decoration-color 0.2s; cursor: pointer; }
a:hover { background: var(--accent); color: #fff; text-decoration-color: var(--accent); }
a.button {
  display: inline-block;
  padding: 14px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  border: none;
  text-decoration: none;
  font-weight: 700;
  opacity: 1;
  transition: background 0.15s, opacity 0.15s;
  cursor: pointer;
}
a.button:hover {
  background: color-mix(in srgb, var(--accent) 85%, #000);
  color: #fff;
}
a.button.disabled {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

/* No hover states on home and terms pages */
body.home-body a:hover,
body.home-body a.button:hover,
body.no-hover-body a:hover,
body.no-hover-body a.button:hover {
  background: none;
  color: var(--accent);
  text-decoration-color: var(--accent);
}
body.home-body a.button:hover,
body.no-hover-body a.button:hover {
  background: var(--accent);
  color: #fff;
}
.note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
ul {
  text-align: left;
  list-style: disc;
  padding-left: 1.5rem;
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}

/* ── Home page layout ──────────────────────────────────────────────── */
body.home-body {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
}

body.home-body.no-hover-body {
  align-items: center;
  justify-content: flex-start;
}

.home-wrap {
  padding: clamp(40px, 8vw, 80px) clamp(32px, 8vw, 80px);
  max-width: 760px;
  margin: 0 auto;
}

.iosapp .home-wrap {
  padding-top: calc(clamp(40px, 8vw, 80px) + 3rem);
}

.home-title {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: clamp(52px, 9vw, 88px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 16px 0;
}

.home-sub {
  font-size: clamp(17px, 2.5vw, 22px);
  font-weight: 400;
  color: var(--text);
  margin: 0 0 40px 0;
  letter-spacing: -0.01em;
}

.home-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
}

.home-btn-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.22);
  transition: width 0.7s ease;
  pointer-events: none;
}

.home-btn-label {
  position: relative;
  z-index: 1;
}

.home-status {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--text);
  margin: 20px 0 0 0;
  line-height: 1.5;
}

.home-status .hl {
  color: #c47c0a;
  font-weight: 700;
}

.home-hint {
  color: var(--muted) !important;
  margin-top: 10px !important;
}

.terms-wrap {
  padding: clamp(80px, 10vw, 100px) clamp(32px, 8vw, 80px) clamp(40px, 8vw, 80px);
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.terms-title {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 10px 0;
}

.terms-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 48px 0;
  letter-spacing: 0.01em;
}

.terms-wrap h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bg);
  margin: 40px 0 12px 0;
}

.terms-wrap p {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 16px 0;
  line-height: 1.7;
}

.terms-wrap ul {
  text-align: left;
  list-style: disc;
  padding-left: 1.25rem;
  width: 100%;
  margin: 0 0 16px 0;
}

.terms-wrap li {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 6px;
}

.terms-wrap a {
  color: var(--accent);
}

.terms-back {
  position: fixed;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  background: none;
  text-decoration: none;
  transition: background 0.15s;
  z-index: 10;
}

.terms-back:hover {
  background: rgba(0, 0, 0, 0.07) !important;
  color: var(--text) !important;
}

.credits-built {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 0 0 48px 0;
  flex-wrap: wrap;
}

.credits-person {
  text-align: center;
  flex: 1;
  min-width: 140px;
}

.credits-name {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.credits-role {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.credits-members {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 16px 0;
}

.credits-thanks-item {
  margin: 0 0 28px 0;
}

.credits-thanks-item strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.credits-thanks-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.credits-oss {
  font-size: 13px !important;
  color: var(--muted) !important;
  line-height: 2 !important;
}

.home-footer {
  font-size: 17px;
  color: var(--text);
  margin: 32px 0 0 0;
  line-height: 1.6;
  text-align: center;
}

.home-footer a {
  color: var(--accent);
  text-decoration: underline;
}

.home-meta {
  font-size: 13px;
  color: var(--muted);
  margin: 20px 0 0 0;
  line-height: 1.6;
}

.home-meta a { color: var(--accent); }

.home-error {
  margin: 16px 0 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-size: 14px;
  line-height: 1.5;
  max-width: 320px;
  text-align: center;
}

.home-terms {
  margin: 16px 0 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-terms label {
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
}

.home-photos {
  margin-top: 36px;
  font-size: 14px;
  display: flex;
  justify-content: center;
}

#intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.25s ease;
  padding: 24px;
  box-sizing: border-box;
}

#intro-modal {
  background: var(--fg);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#intro-body h1 {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

#intro-body h2 {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 4px 0;
}

#intro-body p {
  margin: 0 0 4px 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

#intro-body a {
  color: #2a7a3b;
  text-decoration: underline;
}

#intro-dismiss {
  align-self: flex-end;
  background: var(--text);
  color: var(--fg);
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}

@media (max-width: 600px) {
  #intro-overlay {
    padding: 0;
    align-items: flex-end;
  }
  #intro-modal {
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    padding: 28px 24px 40px;
  }
}

.photo-grid {
  display: inline-block;
  text-decoration: none;
  width: 100%;
  max-width: 320px;
}

#photo-grid-cells {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border-radius: 12px;
  overflow: hidden;
}

.photo-grid-cell {
  aspect-ratio: 1;
  overflow: hidden;
  background: #eee;
}

.photo-grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-grid-cell-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  opacity: 0.45;
  background: transparent;
}

.photo-grid-cell-more span {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 13px;
}

.photo-grid-more {
  display: none;
}

.photo-fan {
  position: relative;
  display: inline-block;
  width: 220px;
  padding-bottom: 10px;
  cursor: pointer;
  text-decoration: none;
}

.photo-fan-card {
  position: absolute;
  width: 200px;
  height: 200px;
  bottom: 0;
  left: 50%;
  transform-origin: bottom center;
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  border: 4px solid #fff;
  border-radius: 3px;
  overflow: hidden;
  background: #eee;
}

.photo-fan-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-fan-card.fan-left {
  transform: translateX(-50%) rotate(-8deg);
  z-index: 1;
}

.photo-fan-card.fan-center {
  transform: translateX(-50%) rotate(0deg);
  z-index: 3;
}

.photo-fan-card.fan-right {
  transform: translateX(-50%) rotate(8deg);
  z-index: 2;
}

.photo-fan:hover .photo-fan-card.fan-left {
  transform: translateX(-50%) rotate(-22deg) translateY(-8px);
}

.photo-fan:hover .photo-fan-card.fan-center {
  transform: translateX(-50%) rotate(0deg) translateY(-10px);
}

.photo-fan:hover .photo-fan-card.fan-right {
  transform: translateX(-50%) rotate(22deg) translateY(-8px);
}

.photo-fan-caption {
  text-align: center;
  margin-top: 10px;
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 17px;
  color: var(--text);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.photo-fan:hover .photo-fan-caption {
  opacity: 1;
}