
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg: #eef1f6;
  --ink: #141820;
  --muted: #4c5568;
  --line: rgba(20, 24, 32, 0.12);
  --card: #ffffff;
  --blue: #2f6bff;
  --blue-deep: #1b3fbf;
  --header: 64px;
  --display: "Syne", "Segoe UI", "Nirmala UI", "Leelawadee UI", "Malgun Gothic", "Yu Gothic", "Microsoft JhengHei", "Microsoft YaHei", "PingFang SC", sans-serif;
  --sans: "Manrope", "Segoe UI", "Nirmala UI", "Leelawadee UI", "Malgun Gothic", "Yu Gothic", "Microsoft JhengHei", "Microsoft YaHei", "PingFang SC", "Ebrima", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(47, 107, 255, 0.16), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, summary { font: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  z-index: 40;
}
.skip:focus { top: 8px; }

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 40;
}
.progress > span { display: block; height: 100%; width: 0; background: var(--blue); }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  padding: 8px 18px;
  background: rgba(238, 241, 246, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.brand strong {
  font-family: var(--display);
  letter-spacing: 0.16em;
  font-size: 0.92rem;
}
.brand span { margin-top: 4px; color: var(--blue-deep); font-size: 0.78rem; }

.lang { position: relative; }
.lang-btn {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(280px, 82vw);
  max-height: min(70vh, 440px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(20, 24, 32, 0.16);
}
.lang-menu[hidden] { display: none; }
.lang-search {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: white;
}
.lang-menu button {
  text-align: start;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.lang-menu button[hidden] { display: none; }
.lang-menu button[aria-current="true"] { background: #e7eeff; }

.stage {
  position: relative;
  min-height: calc(100svh - var(--header));
  display: flex;
  align-items: flex-end;
  margin: 12px;
  border-radius: 28px;
  overflow: hidden;
  background: #1a2416;
}
.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 58%;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 24, 16, 0.78) 0%, rgba(18, 24, 16, 0.42) 38%, rgba(18, 24, 16, 0.08) 64%, rgba(18, 24, 16, 0) 100%);
  pointer-events: none;
}
.stage-card {
  position: relative;
  z-index: 1;
  margin: 36px 40px 32px;
  width: min(560px, calc(100% - 80px));
  padding: 0 0 8px;
  color: #f6f3ea;
}
.eyebrow { margin: 0; color: #e4d7b0; font-weight: 700; }
h1, h2, h3, .when, summary { font-family: var(--display); line-height: 1.12; }
h1 { margin: 8px 0 0; font-size: clamp(2.2rem, 6vw, 4.4rem); letter-spacing: 0; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(ja) h1, :lang(ja) h2, :lang(ja) h3,
:lang(zh) summary, :lang(ja) summary, :lang(zh) .when, :lang(ja) .when {
  letter-spacing: 0;
  line-height: 1.28;
}
.stage h1 {
  color: #f6f3ea;
  max-width: 10em;
  font-size: clamp(2.2rem, 3.5vw, 3.55rem);
}
[dir="rtl"] .stage img { object-position: 32% 58%; }
[dir="rtl"] .stage::after {
  background: linear-gradient(to left, rgba(18, 24, 16, 0.78) 0%, rgba(18, 24, 16, 0.42) 38%, rgba(18, 24, 16, 0.08) 64%, rgba(18, 24, 16, 0) 100%);
}
.lede { color: rgba(246, 243, 234, 0.88); font-size: 1.05rem; max-width: 36em; }
.go {
  display: inline-flex;
  margin-top: 6px;
  background: #f6f3ea;
  color: #1a2416;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
}
.stage-cap { color: rgba(246, 243, 234, 0.72); font-size: 0.82rem; max-width: 40em; }

.block, .ladder, .close {
  width: min(1120px, calc(100% - 28px));
  margin: 28px auto;
  scroll-margin-top: 88px;
}
.kicker {
  margin: 0;
  color: var(--blue-deep);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.block h2, .ladder h2, .close h2 {
  margin: 8px 0 8px;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  letter-spacing: 0;
  max-width: 16em;
}
:lang(zh) .block h2, :lang(zh) .ladder h2, :lang(zh) .close h2,
:lang(ja) .block h2, :lang(ja) .ladder h2, :lang(ja) .close h2 {
  letter-spacing: 0;
}
.deck { margin-top: 0; color: var(--muted); max-width: 42rem; }

.habits, .rungs, .cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.habit, .card, .rung {
  width: 100%;
  border-radius: 22px;
}
.rung {
  background: white;
  padding: 18px 18px 8px;
}
.habit, .card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  background: #142018;
}
.habit img, .card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.habit::after, .card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 12, 0.08) 0%, rgba(10, 14, 12, 0.42) 42%, rgba(10, 14, 12, 0.88) 100%);
}
.card { min-height: 620px; }
.card img { object-position: center 38%; }
.card::after {
  background: linear-gradient(180deg, rgba(10, 14, 12, 0.02) 0%, rgba(10, 14, 12, 0.12) 34%, rgba(10, 14, 12, 0.78) 62%, rgba(10, 14, 12, 0.92) 100%);
}
.habit-copy { position: relative; z-index: 1; padding: 28px 22px 16px; }
.habit h3, .habit p, .card h3, .card p { color: #f6f3ea; }
.habit-cap { margin: 12px 0 0; font-size: 0.78rem; color: rgba(246, 243, 234, 0.75); }
.habit .n, .card .n {
  font-family: var(--display);
  font-size: 2rem;
  color: #f3e2b0;
}
.habit h3, .card h3 { margin: 4px 0 8px; font-size: 1.45rem; }

.front-switch, .place-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
}
.front-switch button, .place-switch button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.front-switch button[aria-selected="true"],
.place-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.front {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
  background: white;
  border-radius: 28px;
  padding: 12px;
  margin-top: 8px;
}
.front[hidden] { display: none; }
.front-copy { padding: 16px 12px 8px; }
.front h3 { margin: 6px 0 10px; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.front img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 520px;
  object-fit: cover;
  border-radius: 18px;
}
.front figcaption, .place-figure figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 8px; }
.front figure { margin: 0; display: flex; flex-direction: column; }
.front-note {
  margin: 0;
  border-radius: 18px;
  min-height: 280px;
  background: var(--ink);
  color: white;
  display: flex;
  align-items: flex-end;
  padding: 28px;
}
.front-note p {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.2;
}

.ladder {
  background: var(--ink);
  color: #f4f6fb;
  border-radius: 28px;
  padding: 28px 18px 12px;
}
.ladder .kicker { color: #9db6ff; }
.ladder .deck { color: rgba(244, 246, 251, 0.78); }
.ladder .rung {
  background: #1d2433;
  color: #f4f6fb;
  display: block;
}
.when { color: #9db6ff; font-size: 1.35rem; }
.rung h3 { margin: 10px 0; font-size: 1.45rem; }

.questions { display: grid; gap: 10px; }
.q {
  background: white;
  border-radius: 18px;
  padding: 4px 16px 8px;
}
.q summary {
  cursor: pointer;
  font-size: 1.25rem;
  padding: 14px 0;
}
.q p { margin-top: 0; color: var(--muted); }

.place-figure {
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: end;
}
.place-figure img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 22px;
}
.place-detail {
  background: white;
  border-radius: 22px;
  padding: 8px 20px 12px;
  margin-top: 8px;
}
.place-detail h3 { margin-bottom: 6px; font-size: 1.6rem; }

.limits {
  background: white;
  border-radius: 28px;
  padding: 8px 22px 18px;
}
.practices { margin: 8px 0 0; }
.practices li { margin: 10px 0; }

.close h2 { max-width: 14em; }

.next-jump {
  position: fixed;
  z-index: 19;
  inset-inline-end: 12px;
  bottom: 12px;
  max-width: 46vw;
  background: var(--blue);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 30px rgba(47, 107, 255, 0.35);
}
body { padding-bottom: 72px; }
.next-jump[hidden] { display: none; }

.foot {
  background: var(--ink);
  color: #e7ebf5;
  padding: 36px 18px 88px;
}
.foot-inner { width: min(1120px, 100%); margin: 0 auto; }
.foot a { color: #b9cbff; }
.foot h2 { font-size: 1.5rem; }
.sources, .credits { padding-inline-start: 1.1rem; }
.top-link { display: inline-block; margin-top: 12px; color: white; }

.safari-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(20, 24, 32, 0.78);
}
.safari-gate[hidden] { display: none; }
body.safari-locked { overflow: hidden; }
.safari-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: min(360px, calc(100vw - 56px));
  height: auto;
  max-height: min(500px, calc(100svh - 80px));
  padding-top: 104px;
  overflow: hidden;
  background: #1a140c;
  color: #f6f3ea;
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(20, 24, 32, 0.28);
}
.safari-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 74% 36%;
}
.safari-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 12, 8, 0.08) 0%, rgba(18, 12, 8, 0.02) 34%, rgba(18, 12, 8, 0.72) 58%, rgba(18, 12, 8, 0.94) 100%);
}
.safari-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 16px;
}
.safari-card h2 { margin: 0 0 8px; color: #f6f3ea; font-size: 1.28rem; letter-spacing: 0; line-height: 1.25; }
.safari-card p { margin: 0 0 8px; color: #f6f3ea; font-size: 0.9rem; line-height: 1.45; }
#safariHint { font-weight: 700; }
.safari-note { color: rgba(246, 243, 234, 0.78); font-size: 0.8rem; }
.safari-go {
  display: inline-block;
  margin-top: 2px;
  background: #f6f3ea;
  color: #1a140c;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.92rem;
  font-weight: 700;
}

@media (max-width: 800px) {
  .front, .place-figure { grid-template-columns: 1fr; }
  .front img, .place-figure img { height: 220px; max-height: none; }
  .stage { min-height: 100svh; display: flex; }
  .stage img { position: absolute; height: 100%; object-position: center 62%; }
  .stage::after {
    background: linear-gradient(180deg, rgba(18, 24, 16, 0.05) 28%, rgba(18, 24, 16, 0.82) 68%);
  }
  .stage-card { width: auto; margin: 16px 16px 20px; padding-bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

