/*
 * Everything in this file is scoped to the honyomu page only — base.css and
 * portal.css (and therefore the app.sakumori.com entrance page) are never
 * touched here.
 *
 * Sizing pass (see docs/app-portal/INVESTIGATION_AND_VALIDATION.md, round
 * 6): fixes inconsistent image sizes, uneven section spacing, and a page
 * background that looked the same everywhere. Every screenshot width and
 * section spacing value below is a named custom property, not a one-off
 * number per image.
 */

:root {
  --content-max: 1120px;
  --shots-max: 1040px;
  --text-max: 560px;

  --page-pad: 20px;

  --section-space-mobile: 72px;
  --section-space-desktop: 112px;

  --watch-hero-width-mobile: 176px;
  --watch-hero-width-desktop: 240px;
  --watch-step-width-mobile: 160px;
  --watch-step-width-desktop: 200px;
  --iphone-primary-width-mobile: 256px;
  --iphone-primary-width-desktop: 340px;
  --iphone-secondary-width-mobile: 220px;
  --iphone-secondary-width-desktop: 275px;

  --shot-radius: 22px;
  --shot-shadow: 0 18px 40px rgba(43, 32, 19, 0.14);

  /* Honyomu-only tints for the section backgrounds and paper shapes. */
  --paper-cream: #f6f1e2;
  --paper-sage: #e9f0e6;
  --paper-teal: #e3f0ee;
  --paper-gold: #f3e9d1;
  --paper-lime: #eef3d6;
  --wash-cream: #faf6ec;
  --wash-teal: #eef6f4;
}

@media (min-width: 700px) {
  :root {
    --page-pad: 24px;
  }
}

@media (min-width: 1024px) {
  :root {
    --page-pad: 32px;
  }
}

body {
  background-color: #ffffff;
}

/* ------------------------------------------------------------------------
   Layout primitives
   ---------------------------------------------------------------------- */
.block {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--section-space-mobile) var(--page-pad);
}

@media (min-width: 860px) {
  .block {
    padding-block: var(--section-space-desktop);
  }
}

.block__inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
}

.block__inner--shots {
  max-width: var(--shots-max);
}

/* Decorative paper shapes: a dog-eared page corner and a ribbon bookmark,
   built from plain CSS clip-path, no photography. aria-hidden, always
   behind .block__inner (z-index 0 vs 1, both inside the block's own
   stacking context via isolation:isolate). Static, no motion. */
.paper-shape {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.paper-shape--page {
  clip-path: polygon(0 0, 100% 0, 100% 82%, 82% 100%, 0 100%);
}

.paper-shape--page::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22%;
  height: 22%;
  background: rgba(43, 32, 19, 0.06);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.paper-shape--bookmark {
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
}

.section-heading {
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  color: var(--green);
  margin: 0 0 16px;
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.section-heading--center {
  text-align: center;
  margin: 0 auto 32px;
  max-width: var(--text-max);
}

.section-text {
  color: var(--ink);
  line-height: 1.85;
  margin: 0 0 20px;
  max-width: var(--text-max);
}

.device-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
}

/* Shared screenshot treatment: size comes from width custom properties
   only (never transform:scale), aspect ratio is whatever the source PNG
   is, so nothing gets stretched or cropped. */
.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--shot-radius);
  box-shadow: var(--shot-shadow);
}

.shot--watch-hero {
  width: var(--watch-hero-width-mobile);
}

@media (min-width: 860px) {
  .shot--watch-hero {
    width: var(--watch-hero-width-desktop);
  }
}

.shot--watch-step {
  width: var(--watch-step-width-mobile);
}

@media (min-width: 860px) {
  .shot--watch-step {
    width: var(--watch-step-width-desktop);
  }
}

.shot--iphone-primary {
  width: var(--iphone-primary-width-mobile);
}

@media (min-width: 860px) {
  .shot--iphone-primary {
    width: var(--iphone-primary-width-desktop);
  }
}

.shot--iphone-secondary {
  width: var(--iphone-secondary-width-mobile);
}

@media (min-width: 860px) {
  .shot--iphone-secondary {
    width: var(--iphone-secondary-width-desktop);
  }
}

/* ------------------------------------------------------------------------
   A. hero
   ---------------------------------------------------------------------- */
.hero {
  background: #ffffff;
  padding-top: calc(var(--section-space-mobile) - 16px);
}

@media (min-width: 860px) {
  .hero {
    min-height: 700px;
    display: flex;
    align-items: center;
    padding-top: var(--section-space-desktop);
  }
}

.hero__shape {
  width: 34rem;
  height: 34rem;
  top: -8rem;
  right: -10rem;
  background: linear-gradient(160deg, #eef2ea 0%, var(--paper-teal) 65%);
  transform: rotate(6deg);
}

.hero__lime {
  position: absolute;
  z-index: 0;
  width: 9rem;
  height: 9rem;
  left: 6%;
  bottom: 8%;
  border-radius: 9999px;
  background: var(--paper-lime);
  pointer-events: none;
}

.hero .block__inner {
  display: grid;
  gap: 40px;
  align-items: center;
  width: 100%;
}

@media (min-width: 860px) {
  .hero .block__inner {
    grid-template-columns: 45% 1fr;
    gap: 48px;
    max-width: var(--shots-max);
  }
}

@media (min-width: 1100px) {
  .hero .block__inner {
    gap: 72px;
  }
}

.hero__text {
  text-align: center;
}

@media (min-width: 860px) {
  .hero__text {
    text-align: left;
  }
}

.hero__intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

@media (min-width: 860px) {
  .hero__intro {
    justify-content: flex-start;
  }
}

.hero__icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  box-shadow: 0 4px 10px rgba(43, 32, 19, 0.15);
}

.hero__intro-text {
  text-align: left;
}

.hero__appname {
  margin: 0;
  font-weight: 700;
  color: var(--green);
  font-size: 1.05rem;
}

.hero__badge {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--gold);
  font-weight: 600;
}

.hero__title {
  font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  color: var(--green);
  line-height: 1.4;
  margin: 0 auto 14px;
  max-width: 500px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

@media (min-width: 860px) {
  .hero__title {
    margin-left: 0;
  }
}

.hero__subtitle {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--ink-soft);
  margin: 0 auto 10px;
  max-width: var(--text-max);
}

.hero__lead {
  color: var(--ink);
  max-width: var(--text-max);
  margin: 0 auto 28px;
  line-height: 1.85;
}

@media (min-width: 860px) {
  .hero__subtitle,
  .hero__lead {
    margin-left: 0;
  }
}

.hero__cta {
  margin-bottom: 12px;
}

.hero__shot {
  position: relative;
  display: flex;
  justify-content: center;
}

/* ------------------------------------------------------------------------
   B. bookstore (本屋で確認する ＋ ①②)
   ---------------------------------------------------------------------- */
.bookstore {
  background: var(--wash-cream);
}

.bookstore::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: -1px;
  height: 64px;
  background: #ffffff;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.bookstore__shape {
  width: 20rem;
  height: 20rem;
  left: -6rem;
  bottom: -4rem;
  background: var(--paper-sage);
  transform: rotate(-10deg);
}

.bookstore .block__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}

@media (min-width: 860px) {
  .bookstore .block__inner {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 48px;
    align-items: start;
    max-width: var(--shots-max);
  }
}

.bookstore__intro {
  max-width: var(--text-max);
}

.watch-steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: center;
}

@media (min-width: 620px) {
  .watch-steps {
    flex-direction: row;
    align-items: flex-start;
  }
}

.watch-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
}

.watch-step__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  color: var(--green);
  font-size: 0.95rem;
}

.watch-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.field-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.field-chips li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
  background: #fff;
}

.field-chips__note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: var(--text-max);
}

/* ------------------------------------------------------------------------
   C. register (iPhoneで登録して同期する)
   ---------------------------------------------------------------------- */
.register {
  background: #ffffff;
}

.register__shape {
  width: 24rem;
  height: 30rem;
  left: -8rem;
  top: -6rem;
  background: var(--paper-gold);
  clip-path: polygon(0 18%, 100% 0, 100% 82%, 0 100%);
}

.register .block__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}

@media (min-width: 860px) {
  .register .block__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    max-width: var(--shots-max);
  }

  /* Alternates left/right against the hero and bookstore blocks above:
     text stays first in DOM order (reading order, screen readers), but
     visually the screenshots move to the left here. */
  .register__shots {
    order: -1;
  }
}

.register__copy {
  max-width: var(--text-max);
}

.register__shots {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.register__secondary-caption {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ------------------------------------------------------------------------
   C2. ipad (本棚と詳細を並べて見る)
   ---------------------------------------------------------------------- */
.ipad {
  background: var(--paper-sage);
}

.ipad__shape {
  width: 20rem;
  height: 22rem;
  right: -7rem;
  bottom: -6rem;
  background: var(--wash-teal);
}

.ipad .block__inner {
  position: relative;
  z-index: 1;
}

.ipad__copy {
  max-width: var(--text-max);
}

/* ------------------------------------------------------------------------
   D. elsewhere (図書館・スマホを出しにくい場面)
   ---------------------------------------------------------------------- */
.elsewhere {
  background: var(--wash-teal);
}

.elsewhere::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 56px;
  background: #ffffff;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.elsewhere__grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 700px) {
  .elsewhere__grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.elsewhere__item {
  display: flex;
  gap: 14px;
}

.elsewhere__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.elsewhere__icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--green);
}

.elsewhere__item h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--green);
}

.elsewhere__item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* ------------------------------------------------------------------------
   E. basic features (between elsewhere/teal and the final CTA/green — a
   deliberate return to a bright neutral so the two saturated sections on
   either side both read as a clear change, not a continuation)
   ---------------------------------------------------------------------- */
.features {
  background: var(--wash-cream);
}

.features::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: -1px;
  height: 48px;
  background: var(--wash-teal);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 100%);
}

.features__lead {
  text-align: center;
  color: var(--ink-soft);
  max-width: var(--text-max);
  margin: 0 auto 40px;
  line-height: 1.85;
}

.features__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 32px 28px;
}

@media (min-width: 620px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .features__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--green);
  margin-bottom: 12px;
}

.feature__icon svg {
  width: 18px;
  height: 18px;
}

.feature__title {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--green);
}

.feature__text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.75;
}

/* ------------------------------------------------------------------------
   E2. faq (よくある質問)
   ---------------------------------------------------------------------- */
.faq {
  background: #ffffff;
}

.faq__list {
  max-width: var(--shots-max);
  margin: 0 auto;
  display: grid;
  gap: 0;
}

.faq__item {
  border-top: 1px solid rgba(43, 32, 19, 0.12);
  padding: 20px 0;
}

.faq__item:last-child {
  border-bottom: 1px solid rgba(43, 32, 19, 0.12);
}

.faq__item dt {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
}

.faq__item dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.8;
}

/* ------------------------------------------------------------------------
   F. final CTA
   ---------------------------------------------------------------------- */
.final-cta {
  background: var(--green);
  color: #fff;
  min-height: 420px;
  display: flex;
  align-items: center;
}

.final-cta__shape {
  width: 26rem;
  height: 26rem;
  left: -8rem;
  bottom: -10rem;
  background: rgba(255, 255, 255, 0.06);
  transform: rotate(-6deg);
}

.final-cta .block__inner {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.final-cta__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.final-cta__title {
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  color: #fff;
  margin: 0 0 14px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* #register-heading / #final-cta-heading: on-device Safari rendered these
   two headings' last wrapped line flush with zero margin against the
   container edge (see docs/app-portal/before-after/honyomu-mobile-heading-fix).
   min-width:0 keeps them shrinkable inside their grid/flex parents and
   max-width:100% stops them from ever measuring wider than the parent,
   regardless of engine-specific CJK line-break metrics. Scoped to these
   two ids only; no other heading is affected. */
#register-heading,
#final-cta-heading {
  min-width: 0;
  max-width: 100%;
}

.final-cta__lead {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.82);
  max-width: var(--text-max);
}

.final-cta__shot {
  margin: 0 0 28px;
}

.final-cta__shot img {
  width: var(--watch-step-width-mobile);
  height: auto;
  border-radius: var(--shot-radius);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

.final-cta .device-note {
  color: rgba(255, 255, 255, 0.75);
  margin-top: 14px;
}

.final-cta__links {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.final-cta__links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.final-cta__links a:hover,
.final-cta__links a:focus-visible {
  color: #fff;
  border-color: #fff;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.final-cta a:focus-visible {
  outline-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .paper-shape {
    transition: none !important;
  }
}
