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

:root {
  --bg: #fcbd00;
  --text: #1a1a1a;
  --text2: #4a4000;
  --border: rgba(0,0,0,0.12);
  --radius: 16px;
  --legal-heading: #ffffff;
  --legal-body: #1a1a1a;
}

html { scroll-behavior: smooth; }

/* ===== Page animations ===== */
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes heroReveal {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

@keyframes drawerOpen {
  from { opacity: 0; transform: scaleY(0.85); }
  to   { opacity: 1; transform: scaleY(1); }
}

@keyframes iconWiggle {
  0%   { transform: rotate(0deg) scale(1); }
  20%  { transform: rotate(-8deg) scale(1.08); }
  40%  { transform: rotate(7deg) scale(1.08); }
  60%  { transform: rotate(-4deg) scale(1.04); }
  80%  { transform: rotate(3deg) scale(1.02); }
  100% { transform: rotate(0deg) scale(1); }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: pageFadeIn 0.45s ease both;
}

main { flex: 1; }

a { color: var(--text); text-decoration: none; }
a:hover { opacity: 0.7; }

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
}

/* ===== Nav ===== */
.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}

.nav-toggle span:nth-child(1) { width: 22px; }
.nav-toggle span:nth-child(2) { width: 16px; }
.nav-toggle span:nth-child(3) { width: 22px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg); width: 22px;
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg); width: 22px;
}

.nav-drawer {
  position: fixed;
  top: 56px; right: 0;
  width: 220px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 0 var(--radius);
  padding: 8px 0;
  display: none;
  flex-direction: column;
  box-shadow: -4px 4px 24px rgba(0,0,0,0.1);
  z-index: 99;
  transform-origin: top right;
}

.nav-drawer.open {
  display: flex;
  animation: drawerOpen 0.2s ease both;
}

.nav-drawer a {
  padding: 14px 24px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, padding-left 0.15s;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { background: rgba(0,0,0,0.06); padding-left: 30px; opacity: 1; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 24px 64px;
}

.hero-logo {
  width: min(480px, 88vw);
  height: auto;
  display: block;
  margin: 0 auto;
  animation: heroReveal 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

/* ===== Section (LP & apps page shared) ===== */
.section {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ===== LP: Icon grid ===== */
.apps-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.app-icon-card {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.app-icon-card:hover .app-icon {
  animation: iconWiggle 0.5s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.app-icon img {
  width: 100%; height: 100%;
  border-radius: 16px;
  object-fit: cover;
}

/* ===== Apps page: List cards ===== */
.apps-page-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.apps-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.apps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-list-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(255,255,255,0.32);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 20px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.app-list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.1);
}

.app-list-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.app-list-icon img {
  width: 100%; height: 100%;
  border-radius: 16px;
  object-fit: cover;
}

.app-list-body {
  flex: 1;
  min-width: 0;
}

.app-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.app-list-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.app-list-subtitle {
  font-size: 0.78rem;
  color: var(--text2);
  margin-bottom: 7px;
}

.app-list-desc {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.72;
  margin-bottom: 12px;
}

.app-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg) !important;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}
.app-open-btn:hover { opacity: 0.8; transform: translateY(-1px); }

.app-list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.apps-page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.apps-page-lead {
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 6px;
}

/* ===== Ripple ===== */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transform: scale(0);
  animation: rippleAnim 0.55s ease-out forwards;
  pointer-events: none;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text);
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--text);
  transition: width 0.2s ease;
}
.footer-links a:hover::after { width: 100%; }
.footer-links a:hover { opacity: 1; }

.footer-copy { font-size: 0.75rem; color: var(--text2); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 24px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg);
  border-radius: 28px;
  padding: 40px 28px 36px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  transform: scale(0.88) translateY(16px);
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: rgba(0,0,0,0.1);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
}
.modal-close:hover { background: rgba(0,0,0,0.18); transform: scale(1.1); }

.modal-icon-wrap {
  width: 88px; height: 88px;
  border-radius: 20px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.8);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  overflow: hidden;
}
.modal-icon-wrap img {
  width: 100%; height: 100%;
  border-radius: 20px;
  object-fit: cover;
}

.modal-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 10px;
}
.modal-badge { margin-bottom: 12px; }

.modal-desc {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 22px;
  text-align: left;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg) !important;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}
.modal-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ===== Badge ===== */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-published   { background: rgba(0,0,0,0.14); color: var(--text); }
.badge-coming-soon { background: rgba(0,0,0,0.07); color: var(--text2); }

/* ===== Scroll-to-top ===== */
@keyframes fabIn {
  from { opacity: 0; transform: translateY(16px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.scroll-top-btn {
  position: fixed;
  bottom: 28px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #1a1a1a;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 200;
}
.scroll-top-btn.visible {
  display: flex;
  animation: fabIn 0.25s ease both;
}
.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.scroll-top-btn svg { width: 18px; height: 18px; stroke: #fcbd00; }

/* ===== Legal pages ===== */
.legal-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 100px;
}

.legal-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.legal-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--legal-heading);
}

.legal-date { font-size: 0.8rem; color: #1a1a1a; }

.legal-body { padding: 4px 0; }

.legal-body h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 28px 0 8px;
  color: #1a1a1a;
}

.legal-body p,
.legal-body li {
  font-size: 0.88rem;
  color: #1a1a1a;
  line-height: 1.8;
}

.legal-body p { margin-bottom: 10px; }

.legal-body ul, .legal-body ol {
  padding-left: 20px;
  margin: 6px 0 10px;
}

.legal-body li { margin-bottom: 2px; }
.legal-body a { color: #1a1a1a; text-decoration: underline; }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 20px;
}

.legal-table th,
.legal-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.85rem;
  border: 1px solid rgba(0,0,0,0.12);
  line-height: 1.6;
}

.legal-table th {
  background: rgba(0,0,0,0.08);
  color: #1a1a1a;
  font-weight: 600;
  white-space: nowrap;
  width: 32%;
  vertical-align: top;
}

.legal-table td { color: #1a1a1a; }
.legal-table a { color: #1a1a1a; text-decoration: underline; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #1a1a1a;
  margin-bottom: 28px;
  transition: gap 0.2s;
}
.back-link:hover { gap: 10px; opacity: 1; }

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .legal-table th { width: 40%; }
}
