:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1a1a1d;
  --text-muted: #6d6d72;
  --border: #ececea;
  --habit: #3a63e0;
  --habit-ink: #1f3d94;
  --habit-tint: #eaf0fd;
  --goal: #e0722f;
  --goal-ink: #a64d18;
  --goal-tint: #fdefe4;
  --focus: #3a63e0;
  --shadow: 0 24px 48px -24px rgba(20, 20, 30, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }

:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 249, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.logo .mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--habit), var(--goal));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}
.site-header nav a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
}
.site-header nav a:hover { color: var(--text); }

/* Hero (short) */
.hero {
  position: relative;
  padding: 40px 0 36px;
  text-align: center;
  overflow: hidden;
}
.hero .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}
.hero .blob--a { width: 320px; height: 320px; background: var(--habit); top: -140px; left: -120px; }
.hero .blob--b { width: 300px; height: 300px; background: var(--goal); top: -120px; right: -140px; }
.hero .content { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.hero .lead {
  font-size: clamp(14px, 2vw, 16px);
  color: var(--text-muted);
  margin: 0;
}

/* Section headings */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 4px;
  padding-bottom: 20px;
}
.section-heading h2 { font-size: 20px; font-weight: 900; margin: 0; }

/* App grid (top page) */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-bottom: 12px;
}
@media (min-width: 640px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .app-grid { grid-template-columns: repeat(3, 1fr); }
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.app-card-body {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.app-card-main {
  flex: 1 1 165px;
  min-width: 165px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-card-shot {
  flex: 0 0 auto;
  display: block;
  width: clamp(76px, 20vw, 130px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  line-height: 0;
}
.app-card-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.app-card-shot:hover { border-color: var(--text-muted); }

.app-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.app-card-top a.icon-link { flex-shrink: 0; border-radius: 14px; }
.app-card-top img.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.app-card-name-wrap { min-width: 0; }
.app-card-name-wrap a.name-link {
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.app-card-name-wrap a.name-link:hover { text-decoration: underline; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 6px;
}
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.accent-habit .status-pill { color: var(--habit-ink); background: var(--habit-tint); }
.accent-goal .status-pill { color: var(--goal-ink); background: var(--goal-tint); }

.app-card p.short-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  flex-grow: 1;
}

.app-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn:hover { border-color: var(--text-muted); }
.btn-primary.accent-habit { background: var(--habit); color: #fff; border-color: var(--habit); }
.btn-primary.accent-goal { background: var(--goal); color: #fff; border-color: var(--goal); }
.link-arrow {
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.accent-habit .link-arrow { color: var(--habit-ink); }
.accent-goal .link-arrow { color: var(--goal-ink); }

/* Developer section */
.developer {
  padding-top: 12px;
  padding-bottom: 8px;
}
.developer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.developer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--habit), var(--goal));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.developer-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.developer-card p { margin: 0; font-size: 14px; color: var(--text-muted); }

hr.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* Footer */
footer {
  padding: 48px 0 56px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}
footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
footer a { text-decoration: none; color: var(--text-muted); font-weight: 700; }
footer a:hover { color: var(--text); }

/* ---- Detail page ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  padding: 20px 0 0;
}
.back-link:hover { color: var(--text); }

.detail-overview {
  padding: 28px 0 40px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.detail-overview img.app-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
}
.detail-overview h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 900; margin: 4px 0 8px; }
.detail-overview .tagline { font-size: 15px; color: var(--text-muted); margin: 0 0 14px; max-width: 520px; }
.detail-overview .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.detail-section { padding-top: 40px; padding-bottom: 40px; }
.detail-section h2 { font-size: 19px; font-weight: 900; margin: 0 0 20px; }

.feature-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 10px; }
.feature-list li { font-size: 14.5px; padding-left: 22px; position: relative; }
.feature-list li::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
}
.accent-habit .feature-list li::before { background: var(--habit); }
.accent-goal .feature-list li::before { background: var(--goal); }

.shot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 640px) {
  .shot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .shot-grid { grid-template-columns: repeat(3, 1fr); }
}
.shot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shot-frame {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.shot-frame .screen {
  aspect-ratio: 9 / 19.5;
  display: block;
}
.shot-frame .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
button.shot-trigger {
  border: none;
  background: none;
  padding: 0;
  cursor: zoom-in;
  display: block;
  width: 100%;
}
.shot p.shot-caption { font-size: 13.5px; color: var(--text-muted); margin: 0; text-align: center; }

.shot-frame.placeholder {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  cursor: default;
}
.shot-frame.placeholder .screen {
  background: #f4f4f3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  text-align: center;
}
.shot-frame.placeholder .screen .ph-icon { font-size: 26px; opacity: 0.35; }
.shot-frame.placeholder .screen .ph-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.shot-frame.placeholder .screen .ph-sub { font-size: 11.5px; color: var(--text-muted); opacity: 0.8; }

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .pricing-grid { grid-template-columns: 1fr 1fr; }
}
.pricing-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  background: var(--surface);
}
.pricing-card h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 800; }
.pricing-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.pricing-card li { font-size: 13.5px; padding-left: 20px; position: relative; }
.pricing-card li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  font-size: 12px; font-weight: 800; color: var(--text-muted);
}
.pricing-plans { margin-top: 14px; font-size: 12.5px; color: var(--text-muted); }
.pricing-note {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: #f4f4f3;
  border-radius: 12px;
  padding: 12px 16px;
}

.support-links { display: flex; flex-direction: column; gap: 10px; }
.support-links a {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.support-links a:hover { text-decoration: underline; }

.other-apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .other-apps-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 10, 12, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(420px, 90vw);
  max-height: 84vh;
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.lightbox-caption {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  opacity: 0.85;
  max-width: 90vw;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --surface: #1a1a1d;
    --text: #f5f5f7;
    --text-muted: #a2a2a8;
    --border: #2a2a2e;
    --habit-tint: #1c2544;
    --goal-tint: #3a2313;
  }
  header.site-header { background: rgba(14, 14, 16, 0.82); }
  .shot-frame.placeholder .screen { background: #232326; }
  .pricing-note { background: #1f1f22; }
}
