/* ==========================================================================
   Memori — memori.study
   Warm, organic, minimalist "study garden": sage green + warm gold on
   paper-like off-white, rounded type, flat fills with crisp HARD shadows
   (no blur, no gradients), leaf motif throughout.
   ========================================================================== */

:root {
  --bg: #F7F8F5;             /* page background */
  --surface: #FFFFFF;        /* cards */
  --surface-tint: #E8EDE6;   /* soft green fill: chips, icon tiles, section alt-bg */
  --border: #E2E6DF;         /* 1.5px borders + card hard-shadow color */
  --border-strong: #CDD8CF;
  --hairline: #EEF1EC;       /* subtle dividers */
  --primary: #4F7C5C;        /* brand green: CTAs, links, accents */
  --primary-shadow: #3E6349; /* hard shadow under primary buttons */
  --on-primary: #F7F8F5;     /* text on primary */
  --ink: #26332A;            /* headings, primary text */
  --ink-secondary: #57655B;  /* body text */
  --ink-tertiary: #6D7D70;   /* metadata */
  --ink-muted: #93A096;      /* section labels, placeholders */
  --gold: #B98A4E;           /* accent: eyebrow labels, highlights */
  --gold-bg: #F1E7D4;        /* gold chip background */
  --gold-ink: #7D5C2E;       /* gold chip text */
  --danger: #A05744;

  /* pastel icon-tile pairs (bg / fg) */
  --tile-green-bg: #E8EDE6;  --tile-green-fg: #4F7C5C;
  --tile-gold-bg: #F1E7D4;   --tile-gold-fg: #B98A4E;
  --tile-blue-bg: #E3EDF0;   --tile-blue-fg: #41798A;
  --tile-purple-bg: #ECE8F0; --tile-purple-fg: #71618A;
  --tile-pink-bg: #F0E3EA;   --tile-pink-fg: #A8688A;
  --tile-teal-bg: #DFF0EC;   --tile-teal-fg: #3F8578;
  --tile-peach-bg: #F6E7DC;  --tile-peach-fg: #C07A4A;
  --tile-slate-bg: #E7EAF0;  --tile-slate-fg: #5E718A;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151915; --surface: #1E241F; --surface-tint: #263029;
    --border: #303A32; --border-strong: #3C4A3F; --hairline: #28312A;
    --primary: #7BA885; --primary-shadow: #243A2B; --on-primary: #131A15;
    --ink: #E5EBE3; --ink-secondary: #AFBCB1; --ink-tertiary: #8FA093; --ink-muted: #5F6F63;
    --gold: #CFA467; --gold-bg: #38301F; --gold-ink: #E2C98F;

    --tile-green-bg: #263029; --tile-green-fg: #7BA885;
    --tile-gold-bg: #38301F;  --tile-gold-fg: #CFA467;
    --tile-blue-bg: #203035;  --tile-blue-fg: #7FB2C2;
    --tile-purple-bg: #2C2833;--tile-purple-fg: #A79ac2;
    --tile-pink-bg: #33262d;  --tile-pink-fg: #C793AF;
    --tile-teal-bg: #1F332E;  --tile-teal-fg: #7CBAAC;
    --tile-peach-bg: #362A20; --tile-peach-fg: #D69A6E;
    --tile-slate-bg: #262B33; --tile-slate-fg: #93A4C0;
  }
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-secondary);
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Eyebrow / section label */
.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.eyebrow.gold { color: var(--gold); }

/* Brand leaf shapes:
   - leaf mark (plain fills, bullets): border-radius: 100% 0
   - leaf avatar (tiles with an icon/character inside): 50% 50% 50% 14.3% */
.leaf-mark { border-radius: 100% 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  font-weight: 800;
  box-shadow: 0 2px 0 var(--primary-shadow);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg);
  color: var(--ink-muted);
  border: 1.5px solid var(--border);
}

.btn-outline {
  background: var(--bg);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:active { transform: translateY(2px); }

/* ---------- header ---------- */

.site-header {
  background: var(--bg);
  border-bottom: 1.5px solid var(--hairline);
  padding: 14px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a {
  color: var(--ink-secondary);
  font-weight: 700;
  font-size: 0.92rem;
}
.site-nav a:hover { color: var(--primary); }
.site-nav a.btn-primary { font-size: 0.85rem; padding: 9px 18px; }
.site-nav a.btn-primary,
.site-nav a.btn-primary:hover { color: var(--on-primary); }

@media (max-width: 560px) {
  .site-nav a:not(.btn) { display: none; }
}

/* ---------- language switcher ---------- */

.lang-switch { position: relative; }
.lang-switch > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-secondary);
  background: var(--surface);
  user-select: none;
  white-space: nowrap;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary::marker { content: ""; }
.lang-switch > summary:hover { color: var(--primary); border-color: var(--border-strong); }
.lang-switch .lang-globe { width: 16px; height: 16px; flex: none; }
.lang-switch .lang-caret {
  width: 12px;
  height: 12px;
  flex: none;
  transition: transform 0.15s ease;
}
.lang-switch[open] .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 156px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 0 var(--border);
  padding: 6px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-secondary);
}
.lang-menu a:hover {
  background: var(--surface-tint);
  color: var(--primary);
  text-decoration: none;
}
.lang-menu a[aria-current="page"] {
  color: var(--primary);
  background: var(--surface-tint);
}
.lang-menu a[aria-current="page"]::after {
  content: "✓";
  font-size: 0.9rem;
  font-weight: 800;
}

/* ---------- hero ---------- */

.hero { padding: 56px 0 64px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 44px;
  align-items: center;
}
@media (max-width: 760px) {
  .hero { padding: 40px 0 48px; }
  .hero .wrap { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.1rem);
  margin-bottom: 16px;
}
.hero .one-liner {
  font-size: 1.15rem;
  font-weight: 500;
  max-width: 34ch;
  margin-bottom: 12px;
}
.hero .sub {
  max-width: 46ch;
  margin-bottom: 26px;
}

/* store badges */
.store-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.store-badges a { display: inline-flex; }
/* Apple badge (SVG, no built-in padding) at 48px; the official Google Play
   PNG carries transparent padding, so it renders larger to visually match. */
.badge-appstore { height: 48px; width: auto; }
.badge-play { height: 74px; width: auto; margin: -13px -8px; }

/* phone-shaped screenshot placeholder */
.phone-frame {
  justify-self: center;
  width: min(270px, 80vw);
  aspect-ratio: 9 / 19;
  background: var(--surface-tint);
  border: 1.5px solid var(--border-strong);
  border-radius: 28px;
  box-shadow: 0 2px 0 var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}
.phone-frame .leaf-mark {
  width: 44px;
  height: 44px;
  background: var(--primary);
}
.phone-frame p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-tertiary);
}

/* ---------- sections ---------- */

.section { padding: 56px 0; }
.section-tint { background: var(--surface-tint); }
.section-head { max-width: 620px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.section-head p { margin-bottom: 0; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 2px 0 var(--border);
  padding: 22px;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.card p {
  margin: 0;
  font-size: 0.92rem;
}

/* how-it-works: 3 steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 14.3%;
  background: var(--surface-tint);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.steps .loop-note {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 700;
  color: var(--ink-tertiary);
  font-size: 0.92rem;
  margin: 12px 0 0;
}

/* feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 880px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 50% 14.3%;
  margin-bottom: 14px;
}
.icon-tile svg { width: 22px; height: 22px; }

.tile-green  { background: var(--tile-green-bg);  color: var(--tile-green-fg); }
.tile-gold   { background: var(--tile-gold-bg);   color: var(--tile-gold-fg); }
.tile-blue   { background: var(--tile-blue-bg);   color: var(--tile-blue-fg); }
.tile-purple { background: var(--tile-purple-bg); color: var(--tile-purple-fg); }
.tile-pink   { background: var(--tile-pink-bg);   color: var(--tile-pink-fg); }
.tile-teal   { background: var(--tile-teal-bg);   color: var(--tile-teal-fg); }
.tile-peach  { background: var(--tile-peach-bg);  color: var(--tile-peach-fg); }
.tile-slate  { background: var(--tile-slate-bg);  color: var(--tile-slate-fg); }

/* ---------- pricing ---------- */

.pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  max-width: 760px;
}
@media (max-width: 680px) { .pricing { grid-template-columns: 1fr; } }

.plan { display: flex; flex-direction: column; padding: 26px; }
.plan-pro { border: 1.5px solid var(--primary); }

.plan .plan-name {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-chip {
  display: inline-block;
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--gold-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
}
.plan .price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  margin: 4px 0 2px;
}
.plan .price small {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-tertiary);
}
.plan .price-note {
  font-size: 0.82rem;
  color: var(--ink-tertiary);
  margin-bottom: 14px;
}
.plan .tagline { font-size: 0.92rem; margin-bottom: 14px; }

.plan ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 9px;
  font-size: 0.92rem;
}
.plan li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.plan li::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 100% 0;
  background: var(--primary);
  transform: translateY(-1px);
}
.plan-pro li::before { background: var(--gold); }

.plan .btn { margin-top: auto; align-self: start; }

/* ---------- final CTA ---------- */

.cta-band { text-align: center; padding: 64px 0; }
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.cta-band .store-badges { justify-content: center; margin-top: 22px; }
.cta-band .cta-sub { max-width: 44ch; margin: 0 auto; }

/* big hero-style CTA button gets the deeper shadow */
.btn-big {
  padding: 15px 30px;
  font-size: 1.05rem;
  box-shadow: 0 3px 0 var(--primary-shadow);
}
.btn-big:active { transform: translateY(2px); box-shadow: none; }

/* trust strip */
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: center;
  margin-top: 30px;
  padding: 0 20px;
}
.trust span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-tertiary);
}
.trust i {
  width: 8px;
  height: 8px;
  border-radius: 100% 0;
  background: var(--primary);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1.5px solid var(--hairline);
  padding: 34px 0 44px;
  font-size: 0.88rem;
  color: var(--ink-tertiary);
}
.site-footer .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 26px;
}
.site-footer .brand { font-size: 1rem; }
.site-footer .brand img { width: 24px; height: 24px; }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.site-footer a { color: var(--ink-tertiary); font-weight: 700; }
.site-footer a:hover { color: var(--primary); }
.site-footer .copyright { margin-left: auto; }
@media (max-width: 560px) {
  .site-footer .copyright { margin-left: 0; }
}

/* ---------- legal pages ---------- */

.legal { padding: 48px 0 72px; }
.legal .wrap { max-width: 68ch; }
.legal h1 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); margin-bottom: 4px; }
.legal .effective {
  font-weight: 700;
  color: var(--ink-tertiary);
  margin-bottom: 32px;
}
.legal h2 {
  font-size: 1.25rem;
  margin: 40px 0 12px;
}
.legal ul { padding-left: 22px; margin: 0 0 1em; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--ink); font-weight: 700; }
