/* The Learning Gardener - Rosewood Estate website. Large, clear text for readers of every age. */
@font-face { font-family: "Atkinson"; src: url("/fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #1d2921; --muted: #5f6e64; --paper: #faf7f0; --card: #ffffff; --line: #e4dccb;
  --rose: #a3123a; --rose-dark: #7d0d2c; --leaf: #3c7a4c; --leaf-soft: #e7f1e7; --gold: #d6a01e; --alert: #b3261e;
  --radius: 14px; --shadow: 0 2px 0 rgba(0,0,0,.08), 0 8px 24px rgba(40,30,10,.08);
}
* { box-sizing: border-box; }
html { font-size: 19px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Atkinson", system-ui, sans-serif; line-height: 1.5; }
a { color: var(--rose); }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .6rem; }
h2 { font-size: 1.45rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 0 0 .3rem; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .85rem; }
.center { text-align: center; }
.lead { font-size: 1.15rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.2rem; background: #24462f; color: #fff; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { border-radius: 8px; }
.top nav { display: flex; align-items: center; gap: 1rem; }
.top nav a, .top nav .link { color: #fff; text-decoration: none; font: inherit; }
.top nav form { margin: 0; }
.link { background: none; border: 0; cursor: pointer; padding: 0; }

.btn { display: inline-block; background: var(--rose); color: #fff; border: 2px solid var(--rose-dark); border-radius: 12px;
  padding: .6rem 1.2rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 var(--rose-dark); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rose-dark); }
.btn.big { font-size: 1.15rem; padding: .8rem 1.5rem; }
.btn.small { padding: .3rem .8rem; font-size: .9rem; }
.btn.full { width: 100%; text-align: center; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn[disabled] { background: #ddd; color: #888; border-color: #bbb; box-shadow: none; cursor: default; }

.flash { max-width: 760px; margin: 1rem auto 0; padding: .8rem 1rem; background: var(--leaf-soft); border: 2px solid var(--leaf); border-radius: var(--radius); }
main { padding: 0 1rem 2rem; }
.panel { max-width: 960px; margin: 2rem auto; background: var(--card); padding: 2rem; border-radius: 20px; box-shadow: var(--shadow); }
.panel.narrow { max-width: 560px; }

.form label { display: block; font-weight: 700; margin: 1rem 0 .2rem; }
.form label .muted { font-weight: 400; }
.form input { display: block; width: 100%; margin-top: .3rem; font: inherit; padding: .7rem .8rem; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
.form input:focus { outline: 3px solid #f2c94c; border-color: var(--ink); }
.form .check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.form .check input { width: auto; margin: 0; }
.form .btn { margin-top: 1.4rem; }
.error { color: var(--alert); margin: .3rem 0 0; }
.code-input { font-size: 1.6rem !important; letter-spacing: .15em; text-transform: uppercase; text-align: center; }

.hero { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; padding: 2.5rem 0 1rem; }
.hero h1 { font-size: 2.6rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0 .6rem; }
.hero-art img { width: 100%; max-width: 330px; height: auto; display: block; margin: 0 auto; border-radius: 28px; box-shadow: var(--shadow); border: 8px solid #1d2921; }
/* home page picture gallery: a sideways-scrolling strip of phone screens */
.gallery { max-width: 1180px; margin: 2rem auto; text-align: center; padding: 0 1rem; }
.gallery h2 { font-size: 2rem; margin-bottom: .2rem; }
.shots { display: flex; gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1rem .5rem 1.4rem; text-align: start; }
.shots:focus-visible { outline: 3px solid #f2c94c; border-radius: var(--radius); }
.shot { flex: 0 0 220px; margin: 0; scroll-snap-align: start; }
.shot-open { display: block; padding: 0; border: 6px solid #1d2921; border-radius: 22px; overflow: hidden; background: #1d2921; cursor: zoom-in; box-shadow: var(--shadow); transition: transform .15s; width: 100%; }
.shot-open:hover, .shot-open:focus-visible { transform: translateY(-4px); outline: 3px solid #f2c94c; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { font-size: .92rem; color: var(--muted); margin-top: .6rem; line-height: 1.4; }
.shot figcaption b { display: block; color: var(--ink); font-size: 1rem; }
.shot-big { border: 0; padding: 1rem; border-radius: 20px; background: var(--paper); max-width: min(92vw, 520px); text-align: center; }
.shot-big::backdrop { background: rgba(20, 28, 22, .75); }
.shot-big form { text-align: end; margin: 0 0 .5rem; }
.shot-big img { display: block; max-height: 78vh; max-width: 100%; margin: 0 auto; border-radius: 14px; }
.shot-big-title { font-weight: 700; margin: .6rem 0 0; }
@media (max-width: 600px) { .shot { flex-basis: 70vw; } .gallery h2 { font-size: 1.6rem; } }

.features { max-width: 1080px; margin: 2rem auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.card { background: var(--card); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.anywhere, .pricing { max-width: 760px; margin: 2rem auto; text-align: center; }
.price-card { background: var(--card); border: 3px solid var(--gold); border-radius: 20px; padding: 1.5rem; margin: 1rem auto; max-width: 440px; text-align: start; }
.price { font-size: 2.6rem; font-weight: 700; margin: 0; text-align: center; }
.price span { font-size: 1rem; color: var(--muted); }
.price-card ul { padding-inline-start: 1.2rem; }

.steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: s; }
.steps li { flex: 1; padding: .5rem .6rem; border-radius: 10px; background: #f0ebe0; color: var(--muted); font-size: .85rem; counter-increment: s; }
.steps li::before { content: counter(s) ". "; font-weight: 700; }
.steps li.now { background: var(--rose); color: #fff; }
.steps li.done { background: var(--leaf-soft); color: var(--leaf); }
.howto { display: grid; gap: .9rem; margin: 1rem 0; }
.how { display: flex; gap: 1rem; align-items: flex-start; background: #fbf8f2; border-radius: var(--radius); padding: 1rem; }
.num { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; font-weight: 700; }
.how p { margin: 0; }
.row { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; align-items: center; }
.trial-card { text-align: center; background: var(--leaf-soft); border-radius: var(--radius); padding: 1.4rem; margin: 1rem 0 1.5rem; }
.big-num { font-size: 3rem; font-weight: 700; color: var(--leaf); margin: 0; line-height: 1.1; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.app-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); }

.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

/* the Rose Book */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rb { max-width: 1120px; margin: 0 auto; padding: 1.5rem 0 2rem; }
.rb-hero { text-align: center; padding: 1rem 0 .5rem; }
.rb-hero h1 { font-size: 2.6rem; color: var(--rose); margin-bottom: .4rem; }
.rb-hero .lead { max-width: 720px; margin: 0 auto 1.2rem; }
.rb-search { display: flex; gap: .6rem; max-width: 620px; margin: 1rem auto; }
.rb-search input { flex: 1; font: inherit; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.rb-search input:focus { outline: 3px solid #f2c94c; border-color: var(--ink); }
.rb-chapter { margin: 2.2rem 0 1rem; }
.rb-chapter h2 { color: var(--leaf); margin-bottom: .2rem; }
.rb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; margin-top: .8rem; }
.rb-card { display: flex; align-items: center; gap: .8rem; background: var(--card); border-radius: var(--radius); padding: .6rem .9rem; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s; }
.rb-card:hover { transform: translateY(-2px); }
.rb-card span { display: flex; flex-direction: column; line-height: 1.3; }
.rb-card small { color: var(--muted); font-size: .8rem; }
.rb-card .rb-year { color: var(--leaf); }
.rb-crumbs { font-size: .9rem; margin-bottom: 1rem; }
.rb-crumbs a { color: var(--leaf); }
.rb-top { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2rem; align-items: start; }
.rb-photo { position: relative; margin: 0; }
.rb-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; display: block; box-shadow: var(--shadow); background: #ece8dc; }
.rb-photo-wide img { aspect-ratio: 16 / 9; }
.rb-photo figcaption { font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.rb-photo-missing { aspect-ratio: 4 / 3; display: grid; place-items: center; align-content: center; background: #ece8dc; border-radius: 20px; }
.rb-badge { position: absolute; inset-inline-start: -14px; bottom: 34px; width: 128px; height: 128px; border-radius: 50%; background: rgba(250, 247, 240, .94); display: grid; place-items: center; box-shadow: var(--shadow); }
.rb-facts h1 { font-size: 2.4rem; margin-bottom: 0; }
.rb-latin { color: var(--muted); font-style: italic; margin: .1rem 0 1rem; }
.rb-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; background: var(--card); padding: 1rem 1.2rem; border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 1.2rem; }
.rb-facts dt { color: var(--leaf); font-weight: 700; }
.rb-facts dd { margin: 0; }
.rb-story { font-size: 1.1rem; }
.rb-tip { background: var(--leaf-soft); border-inline-start: 5px solid var(--leaf); padding: .8rem 1rem; border-radius: 10px; }
.rb-article { max-width: 760px; margin: 2.5rem auto 0; background: var(--card); padding: 1.5rem 2rem; border-radius: 20px; box-shadow: var(--shadow); }
.rb-article h2 { margin-top: 0; color: var(--rose); }
.rb-article h3 { color: var(--leaf); margin: 1.6rem 0 .4rem; font-size: 1.3rem; }
.rb-article h4 { margin: 1.2rem 0 .3rem; }
.rb-more { text-align: center; margin: 2rem 0; }
.rb-pager { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin: 2rem 0 1rem; }
.rb-results { list-style: none; padding: 0; display: grid; gap: .6rem; }
.rb-results li { background: var(--card); padding: .8rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.rb-results a { color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.rb-results a:hover { color: var(--rose); }

/* the drawn bloom: each ring of petals opens in turn, then the flower sways */
.bloom { flex: none; overflow: visible; }
.bloom-animate .bloom-ring { transform-origin: 0 0; animation: bloom-open 1.1s cubic-bezier(.2, .8, .3, 1.15) both; }
.bloom-animate .bloom-sway { transform-origin: 0 0; animation: bloom-sway 5s ease-in-out 2.5s infinite; }
@keyframes bloom-open { from { transform: scale(.25); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bloom-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .bloom-animate .bloom-ring, .bloom-animate .bloom-sway { animation: none; } }

/* the game page: the canvas fills the space under a slim bar */
body.play { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #14201a; }
body.play main { flex: 1; display: flex; flex-direction: column; padding: 0; min-height: 0; }
.play-bar { display: flex; flex-wrap: nowrap; align-items: center; gap: .8rem; padding: .3rem .8rem; background: #1d2921; color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; }
.home-link { display: flex; align-items: center; gap: .4rem; color: #fff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.home-link img { border-radius: 6px; flex: none; }
.fs-btn { flex: none; font: inherit; background: transparent; color: #fff; border: 1px solid #6b8a74; border-radius: 8px; padding: .15rem .7rem; cursor: pointer; }
.fs-btn:hover { background: #2c4434; }
.pill { background: #fff3d6; color: var(--ink); border-radius: 999px; padding: .15rem .8rem; text-decoration: none; }
.pill.good { background: var(--leaf); color: #fff; }
.pill .short { display: none; }
.sync { margin-inline-start: auto; color: #cfe3d4; }
.stage { flex: 1; min-height: 0; position: relative; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

/* the Rose Book window over the game: the game blurs behind it */
.rb-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(16, 26, 20, .38); -webkit-backdrop-filter: blur(10px) saturate(.9); backdrop-filter: blur(10px) saturate(.9);
  opacity: 0; transition: opacity .18s ease; }
.rb-modal[hidden] { display: none; }
.rb-modal.open { opacity: 1; }
.rb-modal-card { position: relative; width: min(820px, 100%); height: min(90dvh, 960px); background: var(--paper); border-radius: 18px;
  overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); transform: translateY(12px) scale(.98); transition: transform .18s ease; }
.rb-modal.open .rb-modal-card { transform: none; }
.rb-modal-card iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--paper); }
.rb-modal-close { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(29, 41, 33, .82); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.rb-modal-close:hover, .rb-modal-close:focus-visible { background: var(--rose); outline: none; }
body.embed main { padding-top: 1rem; }
@media (max-width: 600px) { .rb-modal { padding: 0; } .rb-modal-card { width: 100%; height: 100%; border-radius: 0; } }
@media (prefers-reduced-motion: reduce) { .rb-modal, .rb-modal-card { transition: none; } }

@media (max-width: 820px) {
  html { font-size: 18px; }
  .rb-top { grid-template-columns: 1fr; gap: 1.2rem; }
  .rb-badge { width: 96px; height: 96px; inset-inline-start: 8px; bottom: 30px; }
  .rb-badge svg { width: 84px; height: 84px; }
  .rb-article { padding: 1.2rem; }
  .rb-hero h1 { font-size: 2rem; }
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .hero h1 { font-size: 2rem; }
  .features { grid-template-columns: 1fr 1fr; }
  .panel { padding: 1.3rem; margin: 1rem auto; }
  .top { padding: .6rem 1rem; }
  .brand { font-size: 1rem; }
}
@media (max-width: 520px) {
  .sync { display: none; }
  .play-bar .pill { flex: none; }
  .pill .long { display: none; }
  .pill .short { display: inline; }
  .features { grid-template-columns: 1fr; }
  .steps li { font-size: .75rem; }
  .brand span { display: none; }
  .top { padding: .5rem .8rem; }
  .top nav { gap: .8rem; font-size: .9rem; white-space: nowrap; }
  .top nav .btn.small { padding: .25rem .6rem; }
}

/* other languages: the language picker, and fonts for alphabets Atkinson Hyperlegible does not cover
   (the browser falls back to the system's own fonts for those letters) */
.lang-form { margin: .8rem 0; }
.lang-form select { font: inherit; padding: .45rem .7rem; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%; }
.lang-form.compact { margin: .6rem auto 0; }
.lang-form.compact select { font-size: .9rem; padding: .25rem .5rem; }
html[lang="ja"] body { font-family: "Atkinson", "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", system-ui, sans-serif; }
html[lang="ko"] body { font-family: "Atkinson", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; }
html[lang="zh-Hans"] body { font-family: "Atkinson", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
html[lang="zh-Hant"] body { font-family: "Atkinson", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif; }
html[lang="ar"] body { font-family: "Atkinson", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif; line-height: 1.7; }
html[lang="th"] body { font-family: "Atkinson", "Thonburi", "Leelawadee UI", "Noto Sans Thai", system-ui, sans-serif; line-height: 1.7; }
html[lang="hi"] body { font-family: "Atkinson", "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari", system-ui, sans-serif; line-height: 1.7; }
[dir="rtl"] .rb-latin, [dir="rtl"] [lang="en"] { unicode-bidi: isolate; }
/* Questions and answers (the /faq page and the short list on the home page) */
.faq h2 { font-size: 1.2rem; margin: 1.6rem 0 .4rem; }
.faq-item p { margin: 0 0 .6rem; line-height: 1.6; }
.faq-teaser { max-width: 760px; margin: 2rem auto; padding: 0 1rem; }
.faq-teaser > h2, .faq-teaser > p { text-align: center; }
details.faq-item { border-bottom: 1px solid rgba(0, 0, 0, .12); }
details.faq-item summary { cursor: pointer; font-weight: 600; padding: .9rem 0; }
.center { text-align: center; }