/* Crayon Study — the website. Its sisters' paper (crayonplants-lp/site/static/site.css, crayonpets-lp),
   in the app's colours (packages/study_core/lib/src/app/theme/app_theme.dart): cream paper, indigo for
   what can be tapped, the red pencil's vermilion and the gold of ochre for the little marks. Sides are
   logical (inline-start, inline-end) so that the Arabic pages (dir="rtl") turn round; the pictures are
   never mirrored. No script. */

:root {
  --paper: #EFE8DA;
  --paper-light: #F7F2E7;
  --paper-shade: #DCD2BD;
  --ink: #2A2A30;
  --ink-soft: #4E4A47;
  --muted: #6B6A72;
  --indigo: #3B4F7A;
  --indigo-deep: #283757;
  --vermilion: #C8553D;
  --vermilion-deep: #9C3E2A;
  --ochre: #D6A85C;
  --ochre-deep: #94661F;
  --faint: rgba(42, 42, 48, .14);
  --sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --latin: "CS Josefin", "Josefin Sans", system-ui, sans-serif;
  --tracking: .04em;
}
:lang(ja), :lang(zh-Hans), :lang(zh-Hant), :lang(ko) { --tracking: .1em; }
/* Thai, Devanagari and Arabic letters join up; spacing them out would pull them apart. */
:lang(th), :lang(hi), :lang(ar) { --tracking: 0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* The tooth of the paper. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .29 0 0 0 0 .2 0 0 0 .16 -.02'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  font: 16px/1.75 var(--sans);
  overflow-wrap: break-word;
}
a { color: var(--indigo); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { max-width: 100%; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3, :lang(ko) p, :lang(ko) li { word-break: keep-all; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) .tagline, :lang(ja) .line, :lang(ja) .lead { word-break: auto-phrase; }

/* The bar along the top: the name, and the languages. */
.bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.mark { font: 600 12px/1 var(--latin); letter-spacing: .34em; color: var(--indigo); text-decoration: none; padding: 10px 0; }
.langs { position: relative; }
.langs summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font-size: 13px; color: var(--muted);
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { background: rgba(59, 79, 122, .09); color: var(--indigo); }
.langs svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.langs ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); margin: 0; padding: 8px; list-style: none;
  display: grid; grid-template-columns: repeat(2, minmax(9em, 1fr)); gap: 2px;
  background: var(--paper-light); border-radius: 14px; box-shadow: 0 12px 34px rgba(60, 48, 30, .16);
  max-height: min(70vh, 560px); overflow: auto; width: max-content; max-width: calc(100vw - 32px);
}
.langs li a { display: block; padding: 7px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.langs li a:hover { background: rgba(59, 79, 122, .09); }
.langs li a[aria-current] { color: var(--indigo); background: rgba(59, 79, 122, .12); }

/* The little marks: a stroke of vermilion crayon. */
.rule { display: block; width: 24px; height: 3px; margin: 0 auto 16px; border-radius: 2px; background: var(--vermilion); }
.arrow { display: inline-block; color: var(--vermilion); }
[dir="rtl"] .arrow { transform: scaleX(-1); }

/* The top of a page: the icon, the name, the line from the store, and the stores. */
.hero { max-width: 40em; margin: 0 auto; padding: 84px 16px 30px; text-align: center; }
.hero.hub { padding-top: max(110px, 14vh); padding-bottom: 20px; }
.icon { display: block; width: 112px; height: 112px; margin: 0 auto 22px; border-radius: 25px; box-shadow: 0 1px 0 rgba(42, 42, 48, .08), 0 10px 26px rgba(80, 60, 30, .16); }
.hero h1 { margin: 0; font-weight: normal; }
.name {
  display: block; font-family: var(--serif); font-weight: var(--serif-weight);
  font-size: clamp(32px, 1.2rem + 2.6vw, 52px); line-height: 1.25; letter-spacing: .05em; color: var(--ink);
  text-wrap: balance;
}
:lang(th) .name, :lang(hi) .name, :lang(ar) .name { letter-spacing: 0; }
.latin { display: block; margin-top: 12px; font: 600 12px/1 var(--latin); letter-spacing: .42em; text-indent: .42em; color: var(--indigo); }
.self { display: block; margin-top: 12px; font-size: 15px; letter-spacing: .12em; color: var(--ochre-deep); }
.tagline {
  margin: 16px 0 0; font-family: var(--serif); font-weight: var(--serif-weight);
  font-size: clamp(17px, 1rem + .5vw, 21px); line-height: 1.7; letter-spacing: var(--tracking); color: var(--indigo-deep);
  text-wrap: balance;
}
.lead { max-width: 32em; margin: 16px auto 26px; color: var(--ink-soft); line-height: 1.9; text-wrap: pretty; }
.landing .lead { font-size: 17px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 5px 14px 5px 6px;
  border-radius: 999px; background: rgba(59, 79, 122, .07); color: var(--indigo-deep); text-decoration: none; font-size: 14px;
}
.kicker:hover { background: rgba(59, 79, 122, .12); }
.kicker img { width: 28px; height: 28px; border-radius: 7px; }

/* The stores: their badges, or "Coming soon". */
.stores { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; position: relative; z-index: 1; }
.badge { display: inline-block; border-radius: 9px; }
.badge img { display: block; height: 48px; width: auto; }
.badge.play img { height: 70px; margin: -11px -10px; }
.soon {
  position: relative; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px;
  margin: 0; padding: 9px 20px; border-radius: 999px; color: var(--indigo-deep); font-size: 15px;
}
/* Drawn round in crayon. */
.soon::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--ochre); border-radius: 999px; filter: url(#crayon); }
.soon strong { font-weight: 650; letter-spacing: var(--tracking); }
.soon .where { font-size: 13px; color: var(--muted); letter-spacing: .02em; }

/* The headings over a part of a page, small. */
.label {
  margin: 0 0 16px; text-align: center; font-family: var(--serif); font-weight: var(--serif-weight);
  font-size: clamp(18px, 1rem + .4vw, 22px); letter-spacing: var(--tracking); color: var(--indigo-deep);
}
.label::after { content: ""; display: block; width: 24px; height: 3px; margin: 10px auto 0; border-radius: 2px; background: var(--vermilion); }

/* The top page's apps: one card each. */
.apps { max-width: 44em; margin: 0 auto; padding: 18px 16px 48px; }
.appcard { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: start; padding: 24px; }
.appcard .icon.small { width: 88px; height: 88px; margin: 0; border-radius: 20px; }
.appcard h3 { margin: 2px 0 0; font-family: var(--serif); font-weight: var(--serif-weight); font-size: clamp(20px, 1rem + .6vw, 25px); line-height: 1.35; letter-spacing: .03em; }
.appcard h3 a { color: var(--ink); text-decoration: none; }
.appcard h3 a:hover { color: var(--indigo); }
.appcard .sub { margin: 4px 0 12px; color: var(--indigo-deep); font-size: 15px; }
.appcard .go { margin: 14px 0 0; font-weight: 600; }
.appcard .stores { grid-column: 1 / -1; justify-content: flex-start; margin-top: 12px; }
@media (max-width: 520px) {
  .appcard { grid-template-columns: 1fr; text-align: center; }
  .appcard .icon.small { margin: 0 auto 8px; }
  .appcard .chips { justify-content: center; }
  .appcard .stores { justify-content: center; }
}

/* The languages, as little crayon-edged labels. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li > span, .chips li > a { display: inline-block; padding: 4px 13px; border-radius: 999px; font-size: 14px; line-height: 1.6; text-decoration: none; }
.chips li > span { color: var(--ink-soft); background: rgba(214, 168, 92, .18); }
.chips li > a { color: var(--indigo-deep); background: rgba(59, 79, 122, .08); }
.chips li > a:hover { background: rgba(59, 79, 122, .15); }
.others { margin: 38px auto 0; max-width: 40em; }
.others .chips { justify-content: center; }

/* The app's page: the languages it teaches, a tile each. */
.learn { max-width: 1080px; margin: 0 auto; padding: 14px 16px 10px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 860px; margin: 0 auto; padding: 0; list-style: none; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 86px; padding: 14px 10px; border-radius: 18px; background: var(--paper-light); text-decoration: none; text-align: center;
}
.tile::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--paper-shade); border-radius: 18px; filter: url(#crayon); pointer-events: none; }
.tile:hover::before { border-color: var(--indigo); }
.tname { font-family: var(--serif); font-weight: var(--serif-weight); font-size: 18px; line-height: 1.35; color: var(--ink); letter-spacing: var(--tracking); }
.tself { font-size: 13px; color: var(--ochre-deep); letter-spacing: .06em; }

/* The screenshots: a strip to scroll through, all in a row on a wide screen. */
.shots { padding: 10px 0 18px; }
.strip {
  display: flex; gap: 14px; margin: 0 auto; padding: 8px 16px 18px; list-style: none; max-width: 1240px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--paper-shade) transparent;
}
.strip li { flex: none; scroll-snap-align: start; }
.strip img { display: block; width: min(64vw, 250px); height: auto; border-radius: 16px; background: var(--paper-shade); box-shadow: 0 8px 22px rgba(80, 60, 30, .14); }
@media (min-width: 1100px) {
  .strip { justify-content: center; overflow: visible; }
  .strip li { flex: 1 1 0; min-width: 0; }
  .strip img { width: 100%; }
}

/* What the app does: the description from the store, a section a card. */
.about { max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; }
.intro { max-width: 36em; margin: 18px auto 34px; text-align: center; }
.line {
  margin: 0; font-family: var(--serif); font-weight: var(--serif-weight);
  font-size: clamp(20px, 1rem + 1vw, 27px); line-height: 1.6; letter-spacing: var(--tracking); color: var(--ink); text-wrap: balance;
}
.intro p:not(.line) { margin: 16px 0 0; color: var(--ink-soft); text-wrap: pretty; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 18px; align-items: start; }
.cards.pair { max-width: 860px; margin: 0 auto; }
.card { position: relative; padding: 22px 22px 18px; border-radius: 20px; background: var(--paper-light); }
/* Its edge drawn in crayon (the filter is in each page, #crayon). */
.card::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--paper-shade); border-radius: 20px; filter: url(#crayon); pointer-events: none; }
.card.wide { grid-column: 1 / -1; }
.card.plans::before { border-color: var(--ochre); }
.card.plans p { max-width: 46em; }
.card h2 {
  margin: 0 0 10px; font-family: var(--serif); font-weight: var(--serif-weight);
  font-size: clamp(18px, 1rem + .35vw, 21px); line-height: 1.5; letter-spacing: var(--tracking); color: var(--indigo-deep);
}
.card.plans h2 { color: var(--ochre-deep); }
.card p, .card li { margin: 0; font-size: 15px; line-height: 1.85; color: var(--ink-soft); }
.card p + p { margin-top: 8px; }
.card ul:not(.chips) { margin: 0; padding: 0; list-style: none; }
.card ul:not(.chips) li { position: relative; padding-inline-start: 20px; }
.card ul:not(.chips) li + li { margin-top: 8px; }
.card ul:not(.chips) li::before {
  content: ""; position: absolute; inset-inline-start: 3px; top: .78em; width: 8px; height: 3px;
  border-radius: 2px; background: var(--vermilion); opacity: .85;
}
.card .more { margin-top: 12px; font-weight: 600; }
.note { max-width: 40em; margin: 26px auto 0; text-align: center; font-size: 14px; color: var(--muted); }
.closing { max-width: 34em; margin: 30px auto 0; text-align: center; color: var(--ink-soft); font-size: 14px; }
.about > .stores { margin-top: 30px; }

/* The pages in English and Japanese: support, the privacy policy, safety, the terms. */
.doc { max-width: 46em; margin: 0 auto; padding: max(92px, 12vh) 16px 40px; }
.doc > .rule { margin-bottom: 18px; }
.doc h1 {
  margin: 0; text-align: center; font-family: var(--serif); font-weight: var(--serif-weight);
  font-size: clamp(26px, 1.1rem + 1.4vw, 36px); line-height: 1.35; letter-spacing: .05em;
}
.doc .of { margin: 8px 0 0; text-align: center; font-size: 14px; }
.doc .of a { color: var(--muted); }
.doc .updated { margin: 6px 0 28px; text-align: center; font-size: 13px; color: var(--muted); }
.doc .of + .lead, .doc .of + h2, .doc .of + p { margin-top: 28px; }
.doc h2 { margin: 2.1em 0 .5em; font: 650 17px/1.5 var(--sans); color: var(--ink); }
.doc h3 { margin: 1.5em 0 .3em; font: 650 15px/1.5 var(--sans); color: var(--indigo-deep); }
.doc p, .doc li, .doc td, .doc th { font-size: 15px; line-height: 1.95; color: var(--ink-soft); }
.doc ul, .doc ol { padding-inline-start: 1.3em; }
.doc li { margin: 4px 0; }
.doc a { word-break: break-word; }
.doc .lead { margin: 18px auto 8px; text-align: center; font-size: 16px; }
.doc .mail { font-size: clamp(18px, 1rem + .6vw, 22px); }
.doc .box { position: relative; margin: 22px 0; padding: 16px 20px; border-radius: 16px; background: var(--paper-light); }
.doc .box::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--ochre); border-radius: 16px; filter: url(#crayon); pointer-events: none; }
.doc .box p { margin: 0; }
.doc .box p + p { margin-top: 8px; }
.doc .box h2 { margin-top: 0; }
.doc .box h3 { margin-top: 1.2em; }
.doc .box ol { margin: 4px 0 10px; }
.doc .table { overflow-x: auto; margin: 12px 0; }
.doc table { border-collapse: collapse; width: 100%; min-width: 30em; }
.doc th, .doc td { padding: 6px 10px; border-bottom: 1px solid var(--faint); text-align: start; vertical-align: top; line-height: 1.7; }
.doc th { font-weight: 650; color: var(--ink); font-size: 14px; }
.doc td { font-size: 14px; }
.doc code { font-size: .92em; }
/* On a phone, a table's rows are stacked, each cell under its heading. */
@media (max-width: 640px) {
  .doc table { min-width: 0; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc tbody, .doc tr, .doc td { display: block; }
  .doc tr { padding: 10px 0; border-bottom: 1px solid var(--faint); }
  .doc td { padding: 2px 0; border: 0; }
  .doc td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 650; color: var(--muted); }
  .doc td:first-child { color: var(--ink); }
  .doc td:first-child::before { display: none; }
}

/* The page that is not there. */
.lost { max-width: 34em; margin: 0 auto; padding: max(110px, 16vh) 16px 60px; text-align: center; }
.lost .icon { width: 96px; height: 96px; border-radius: 22px; filter: saturate(.7); transform: rotate(-4deg); }
.lost .line + .line { margin-top: 6px; }
.lost .links { margin-top: 28px; }

/* The foot of each page. */
.foot { padding: 34px 16px max(42px, env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--faint); margin-top: 20px; }
.foot nav { line-height: 2.1; }
.foot a { color: var(--ink-soft); white-space: nowrap; }
.foot .sister { margin: 14px 0 0; }
.foot .sister a { color: var(--indigo); }
.foot .copy { margin: 14px 0 0; font-size: 12px; }

a:focus-visible, summary:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }
