/* Morph marketing site — structure aligned with Rejoy, Morph brand */

:root {
  --morph-accent: #007aff;
  --morph-accent-soft: #e8f2ff;
  --bg: #f6f6f9;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b6b6f;
  --border: #e8e6e3;
  --surface-secondary: #f9f9f9;
  --border-soft: #eeeeee;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-card: 48px;
  --max: 880px;
  --font-rounded: ui-rounded, "SF Pro Rounded", "SF Compact Rounded", -apple-system,
    BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-rounded);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--morph-accent);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 5%, 2rem) clamp(1rem, 2.5vw, 1.25rem);
}

/* Header */
.site-header {
  padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1rem, 5%, 2rem);
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
}

.site-header a.home {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.site-header a.home:hover {
  color: var(--morph-accent);
  text-decoration: none;
}

.home-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
  align-items: center;
}

.header-subtle-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.header-subtle-link:hover {
  color: var(--morph-accent);
  text-decoration: none;
}

/* Hero */
.hero {
  --hero-logo-scale: 1;
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(2.5rem, 5vw, 3.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.hero-logo {
  max-width: min(160px, 44vw);
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 48px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: scale(var(--hero-logo-scale, 1));
  transform-origin: center center;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo {
    transform: none;
    will-change: auto;
  }
}

.hero-headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  max-width: 100%;
}

.hero h1.tagline {
  margin: 0 auto;
  max-width: 22em;
  font-size: clamp(1.65rem, 3.6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #000000;
  text-wrap: balance;
}

.hero-subtitle {
  margin: 0 auto;
  max-width: 32em;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  text-wrap: balance;
}

.hero-cta {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.hero-store-badge {
  display: inline-block;
  line-height: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.hero-store-badge:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.hero-store-badge:focus-visible {
  outline: 2px solid var(--morph-accent);
  outline-offset: 4px;
}

.hero-store-badge-img {
  width: auto;
  height: 48px;
  display: block;
  border: 0;
  clip-path: inset(1px round 11px);
}

@media (min-width: 480px) {
  .hero-store-badge {
    border-radius: 14px;
  }

  .hero-store-badge-img {
    height: 54px;
    clip-path: inset(1px round 13px);
  }
}

/* Section */
section {
  margin-top: clamp(2.75rem, 6vw, 3.5rem);
}

h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* How to use — heading */
.how-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.how-heading::before,
.how-heading::after {
  content: "";
  flex: 1 1 auto;
  min-width: 2rem;
  max-width: min(220px, 32vw);
  height: 0;
  border: none;
  border-top: 1px solid var(--border);
}

@media (max-width: 420px) {
  .how-heading {
    flex-direction: column;
    gap: 0.65rem;
  }

  .how-heading::before,
  .how-heading::after {
    max-width: 140px;
    width: 55%;
  }
}

.how-section > .steps {
  margin-top: 12px;
}

/* How-to steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 3.75rem);
}

.step {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.step-visual {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

/* Last step: intro.png has black bg — use light container so dark edges blend */
.step-visual--light-bg {
  background: var(--bg);
}

.step-visual--light-bg img {
  object-fit: contain;
  background: var(--bg);
}

/* Mobile: show full image without cropping height */
.step-visual img,
.step-visual video {
  width: 100%;
  display: block;
  aspect-ratio: 800 / 600;
  object-fit: contain;
  object-position: center;
  height: auto;
}

.step-text h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.step-text p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 36rem;
}

/* Step scroll-in reveal */
@media (prefers-reduced-motion: no-preference) {
  html.step-animate-on .how-section .step .step-visual,
  html.step-animate-on .how-section .step .step-text > * {
    transition:
      opacity 0.72s cubic-bezier(0.22, 0.9, 0.34, 1),
      transform 0.72s cubic-bezier(0.22, 0.9, 0.34, 1);
  }

  html.step-animate-on .how-section .step:not(.step--in-view) .step-visual {
    opacity: 0;
    transform: translateY(1.15rem);
  }

  html.step-animate-on .how-section .step:not(.step--in-view) .step-text > * {
    opacity: 0;
    transform: translateY(0.65rem);
  }

  @media (min-width: 720px) {
    html.step-animate-on .how-section .step:not(.step--in-view):nth-child(odd) .step-visual {
      transform: translate3d(-1.15rem, 0.35rem, 0);
    }

    html.step-animate-on .how-section .step:not(.step--in-view):nth-child(odd) .step-text > * {
      transform: translate3d(1rem, 0.35rem, 0);
    }

    html.step-animate-on .how-section .step:not(.step--in-view):nth-child(even) .step-visual {
      transform: translate3d(1.15rem, 0.35rem, 0);
    }

    html.step-animate-on .how-section .step:not(.step--in-view):nth-child(even) .step-text > * {
      transform: translate3d(-1rem, 0.35rem, 0);
    }
  }

  html.step-animate-on .how-section .step.step--in-view .step-visual {
    transition-delay: 0s;
  }

  html.step-animate-on .how-section .step.step--in-view .step-text h3 {
    transition-delay: 0.08s;
  }

  html.step-animate-on .how-section .step.step--in-view .step-text p {
    transition-delay: 0.16s;
  }

  html.step-animate-on .how-section .step.step--in-view .step-visual,
  html.step-animate-on .how-section .step.step--in-view .step-text > * {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (min-width: 720px) {
  .step {
    flex-direction: row;
    align-items: stretch;
    gap: 2rem;
    padding: 1.75rem 30px;
    overflow: hidden;
    background: transparent;
    border: none;
    border-radius: var(--radius-card);
  }

  .step:nth-child(even) {
    flex-direction: row-reverse;
  }

  .step-visual {
    flex: 0 0 42%;
    max-width: 340px;
    align-self: stretch;
    min-height: 0;
    border-radius: 0;
  }

  .step-visual img,
  .step-visual video {
    width: 100%;
    height: 100%;
    min-height: 220px;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center;
  }

  .step-text {
    flex: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* Support CTA */
.support-card {
  margin-top: 40px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.support-card p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.support-card a {
  font-size: 1.05rem;
  font-weight: 600;
}

/* FAQ */
.faq-section {
  margin-top: 3rem;
}

.faq-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  text-align: center;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border-soft);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: var(--surface-secondary);
}

.faq-question:focus-visible {
  outline: 2px solid var(--morph-accent);
  outline-offset: -2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  position: relative;
  transition: transform 0.3s ease;
}

.faq-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  border-radius: 0 0 4px 0;
  transform: rotate(45deg);
}

.faq-item[data-open] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-item[data-open] .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  margin: 0;
  padding: 0 1.25rem 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--surface-secondary);
}

/* SEO text */
.seo-text {
  margin-top: 3rem;
  padding: 1.5rem 0;
}

.seo-text p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  width: 100%;
}

/* Footer */
.site-footer {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1rem, 5%, 2rem) clamp(1.25rem, 3vw, 1.5rem);
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.site-footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 12px;
}

/* Legal pages */
.wrap.legal {
  padding-top: 24px;
}

.legal h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.legal .meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.legal h2 {
  font-size: 1.15rem;
  margin-top: 28px;
}

.legal p,
.legal li {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li {
  margin-bottom: 8px;
}
