/* Layout: the app's painted look (Nov 2026): brown ink on cream paper, a storybook serif (the app's
   own Iowan Old Style on Apple devices), painted characters standing on painted grass. */
:root {
  --bg: #FBF5E9; --ink: #4A2E1C; --muted: #7A6250; --red: #B0611E; --line: #EADFC8; --leaf: #7E9A4B;
  --display: "Iowan Old Style", "Crimson Pro", Georgia, serif;
  --body: "Iowan Old Style", "Crimson Pro", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1B2238; --ink: #F3E9D6; --muted: #B9AE9D; --red: #E9A55B; --line: #2C3550; --leaf: #8FAE5A; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #1B2238; --ink: #F3E9D6; --muted: #B9AE9D; --red: #E9A55B; --line: #2C3550; --leaf: #8FAE5A; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.65; }
img { max-width: 100%; }
.hero { display: block; width: 100%; height: max(240px, calc(100vw * 700 / 2440)); object-fit: cover; object-position: 50% 0; }
.hero.short { height: max(150px, calc(100vw * 380 / 2440)); object-position: 50% 30%; }
.col { max-width: 640px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
nav { display: flex; align-items: center; gap: 22px; padding-block: 18px; border-bottom: 1px solid var(--line); }
nav .home { white-space: nowrap; display: flex; align-items: center; gap: 10px; margin-right: auto; font-family: var(--display); font-weight: 600; font-size: 18px; }
nav .home img { width: 30px; height: 30px; border-radius: 8px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 700; }
@media (max-width: 420px) { nav .home span { display: none; } }
nav a:hover, nav a[aria-current] { color: var(--red); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
a { color: var(--red); }
section { padding-block: 40px 8px; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 7vw, 52px); line-height: 1.08; margin: 0 0 14px; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.2; margin: 0 0 4px; }
.date { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
h3 { font-size: 17px; font-weight: 700; margin: 28px 0 4px; }
p { margin: 0 0 12px; }
ul { margin: 0 0 12px; padding-left: 1.1em; }
li { margin-bottom: 6px; }
.lead { font-size: 20px; color: var(--muted); max-width: 30ch; }
.badge { display: inline-block; margin: 14px 0 6px; line-height: 0; }
.badge img { height: 54px; width: auto; }
.small { font-size: 14px; color: var(--muted); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-block: 36px 8px; border-top: 1px solid var(--line); margin-top: 32px; }
.trio h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 20px; }
.trio p { color: var(--muted); font-size: 16px; margin: 0; }
@media (max-width: 600px) { .trio { grid-template-columns: 1fr; gap: 18px; } }
.mail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 16px 0 8px; }
.mail strong { font-size: 20px; color: var(--red); user-select: all; word-break: break-all; }
.mail button { font: 700 14px var(--body); color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
dl { margin: 0; }
dt { font-weight: 700; margin-top: 22px; }
dd { margin: 4px 0 0; color: var(--muted); }
footer { padding-block: 48px 40px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: var(--muted); }

/* ---- Home page (Nov 2026): calm and centred, the whole cast on one ground line ---- */
.home { background: var(--bg); }
.wide { max-width: 1040px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.home nav { border-bottom: 0; }
.home-link { white-space: nowrap; display: flex; align-items: center; gap: 10px; margin-right: auto; font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink) !important; }
.home-link img { width: 30px; height: 30px; border-radius: 8px; }
@media (max-width: 420px) { .home-link span { display: none; } }
.home header { background: radial-gradient(ellipse at 22% 0%, #FFF1CF 0%, rgba(255,241,207,0) 55%), linear-gradient(#F1E3C6, var(--bg) 82%); overflow: hidden; }
.hero { text-align: center; padding: 48px 24px 0; height: auto; }
.hero h1 { font-size: clamp(38px, 6vw, 64px); letter-spacing: -.5px; margin: 0 0 16px; }
.hero .lead { margin: 0 auto 22px; max-width: 34ch; }
.hero .small { margin-top: 4px; }
.cast { display: flex; justify-content: center; align-items: flex-end; gap: clamp(0px, 1vw, 10px); margin-top: 40px; padding: 0 12px; }
.cast img { height: var(--h); width: auto; position: relative; z-index: 1; margin-bottom: -14px; filter: drop-shadow(0 8px 8px rgba(74, 46, 28, .18)); animation: bob 5s ease-in-out infinite; }
.cast img:nth-child(even) { animation-delay: 1.3s; }
.cast img:nth-child(3n) { animation-delay: 2.4s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (max-width: 760px) { .cast img { height: calc(var(--h) * .58); } }
.ground { height: 80px; margin-top: -26px; background-image: url(ground.webp); background-repeat: no-repeat; background-position: center top; background-size: cover; }
@media (prefers-reduced-motion: reduce) { .cast img, .book { animation: none !important; transition: none !important; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home, :root:not([data-theme="light"]) .home header, :root:not([data-theme="light"]) .page-head { background: radial-gradient(ellipse at 22% 0%, rgba(255,214,140,.18) 0%, rgba(255,214,140,0) 55%), var(--bg); } :root:not([data-theme="light"]) .book h3 { background: #F5ECD8; } }

.home main section { padding-block: 56px 0; }
.home h2 { font-size: 32px; }
.muted { color: var(--muted); max-width: 62ch; }

.books { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; margin-top: 24px; }
.book { position: relative; background: var(--cloth); border: 2px solid rgba(74, 46, 28, .75); border-radius: 8px 12px 12px 8px; min-height: 210px; padding: 12px 10px 12px 16px; box-shadow: inset 8px 0 0 rgba(0, 0, 0, .16); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.book:hover { transform: translateY(-8px) rotate(-1.5deg); }
.book h3 { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.2; margin: 0; background: #F5ECD8; color: #4A2E1C; border-radius: 6px; padding: 6px 8px; box-shadow: 0 1px 2px rgba(74, 46, 28, .25); }
.book img { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); height: 52%; width: auto; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .2)); }
.book .tag { position: absolute; top: -12px; right: -8px; z-index: 1; background: #D3A24E; color: #4A2E1C; border: 1.5px solid rgba(74, 46, 28, .7); border-radius: 999px; font: 700 12px var(--body); padding: 2px 10px; }
.book.soon { background: repeating-linear-gradient(45deg, #F6EEDD, #F6EEDD 10px, #EFE4CE 10px, #EFE4CE 20px); border-style: dashed; display: flex; align-items: center; justify-content: center; text-align: center; box-shadow: none; }
.book.soon p { font: 700 16px/1.3 var(--display); color: #4A2E1C; margin: 0; }
.plank { height: 24px; background: url(plank.webp) center / 100% 100%; margin-top: -4px; filter: drop-shadow(0 6px 6px rgba(74, 46, 28, .2)); }
@media (max-width: 760px) { .books { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 12px; } .plank { display: none; } }

.features .trio { border-top: 0; margin-top: 8px; padding-top: 20px; }
.features .mini { height: 74px; width: auto; display: block; margin-bottom: 10px; filter: drop-shadow(0 4px 4px rgba(74, 46, 28, .15)); }
.safe { display: flex; align-items: center; gap: 26px; padding-bottom: 12px; }
.safe .gran { height: 130px; width: auto; flex: none; filter: drop-shadow(0 6px 6px rgba(74, 46, 28, .15)); }
@media (max-width: 600px) { .safe { flex-direction: column; align-items: flex-start; } }
.home footer { padding-block: 56px 40px; }

/* Privacy and support pages: the homepage's look, a smaller header */
.page-head { background: radial-gradient(ellipse at 22% 0%, #FFF1CF 0%, rgba(255,241,207,0) 55%), linear-gradient(#F1E3C6, var(--bg) 85%); }
.page-head nav a[aria-current] { color: var(--red); }
.mini-cast { display: flex; justify-content: center; align-items: flex-end; gap: 6px; padding-top: 10px; }
.mini-cast img { height: 92px; width: auto; position: relative; z-index: 1; margin-bottom: -10px; filter: drop-shadow(0 6px 6px rgba(74, 46, 28, .18)); animation: bob 5s ease-in-out infinite; }
.mini-cast img:nth-child(2) { animation-delay: 1.4s; }
.ground.thin { height: 30px; }
.page { max-width: 760px; padding-top: 40px; }
.page h2 { font-size: 36px; }
.page h3 { font-family: var(--display); font-weight: 600; font-size: 20px; margin-top: 30px; }
.page p, .page li, .page dd { color: var(--muted); }
.page dt { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink); }

/* The app inside the devices it's made for */
.devices h2, .devices > p { text-align: center; margin-left: auto; margin-right: auto; }
.device-row { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 28px; align-items: end; margin-top: 30px; }
.device { margin: 0; text-align: center; }
.device figcaption { font: 700 16px var(--display); color: var(--muted); margin-top: 12px; }
.device .screen { background: #2a211b; padding: 10px; border-radius: 26px; box-shadow: 0 18px 40px rgba(74, 46, 28, .22); }
.device .screen img { display: block; width: 100%; height: auto; border-radius: 17px; }
.device.ipad .screen { padding: 14px; border-radius: 30px; }
.device.iphone .screen { border-radius: 30px; padding: 9px 12px; }
.device.iphone .screen img { border-radius: 22px; }
/* iPhone Duo: an open book of a phone, with its hinge down the middle */
.device.duo .screen { position: relative; }
.device.duo .screen::after { content: ""; position: absolute; top: 10px; bottom: 10px; left: 50%; width: 3px; transform: translateX(-50%); background: linear-gradient(rgba(0,0,0,.25), rgba(255,255,255,.35), rgba(0,0,0,.25)); }
@media (max-width: 760px) { .device-row { grid-template-columns: 1fr; gap: 26px; } }

/* Social links: small, quiet icons that light up on hover */
.social { display: inline-flex; align-items: center; gap: 14px; }
nav .social { margin-left: 6px; padding-left: 16px; border-left: 1px solid var(--line); }
.social a { display: inline-flex; color: var(--muted) !important; opacity: .75; transition: opacity .2s, color .2s, transform .2s; }
.social a:hover { opacity: 1; color: var(--red) !important; transform: translateY(-1px); }
.social svg { width: 19px; height: 19px; }
footer .social { margin-left: auto; }
@media (max-width: 520px) { nav .social { display: none; } }

/* A quiet menu button (three short lines) that opens a small paper card */
.menu { position: relative; margin-left: auto; }
.menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; opacity: .7; transition: opacity .2s, background .2s; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { opacity: 1; background: rgba(74, 46, 28, .06); }
.menu summary span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.menu[open] summary span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu[open] summary span:nth-child(2) { opacity: 0; }
.menu[open] summary span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-panel { position: absolute; right: 0; top: 48px; z-index: 10; min-width: 190px; display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 36px rgba(74, 46, 28, .14); }
.menu-panel > a { padding: 8px 10px; border-radius: 10px; font-weight: 700; }
.menu-panel > a:hover { background: rgba(74, 46, 28, .05); }
.menu-panel .social { padding: 10px 10px 4px; margin: 6px 0 0; border-top: 1px solid var(--line); border-left: 0; gap: 18px; }
nav .menu-panel .social { display: inline-flex; }

/* The five reading languages: little postage-stamp cards, like the app's language picker */
.languages h2, .languages > p { text-align: center; margin-left: auto; margin-right: auto; }
.flags { list-style: none; padding: 0; margin: 26px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.flags li { width: 132px; padding: 14px 10px 12px; text-align: center; background: #F5ECD8; border: 2px dashed rgba(74, 46, 28, .35); border-radius: 6px; box-shadow: 0 6px 14px rgba(74, 46, 28, .12); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.flags li:nth-child(odd) { transform: rotate(-1.5deg); }
.flags li:nth-child(even) { transform: rotate(1.2deg); }
.flags li:hover { transform: translateY(-4px) rotate(0); }
.flags .flag { display: block; font-size: 38px; line-height: 1.1; }
.flags strong { display: block; font-family: var(--display); font-size: 19px; color: #4A2E1C; margin-top: 4px; }
.flags li > span:last-child { display: block; font-size: 14px; color: #7A6250; }
@media (max-width: 600px) { .flags li { width: calc(50% - 10px); } }
