/* readbun.com: same paper, ink and sticker look as the app */
[hidden] { display: none !important; }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url(/fonts/fredoka-600.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(/fonts/nunito-600.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url(/fonts/nunito-800.woff2) format('woff2'); }

:root {
  --ink: #3b2f2a;
  --ink-2: #5c4f47;
  --paper: #fbf5ea;
  --dot: #e6d8c3;
  --card: #fffdf8;
  --sand: #f1e8da;
  --green: #6e9e6b;
  --green-bg: #e3eedc;
  --rust: #a9481f;
  --display: 'Fredoka', 'Nunito', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --body: 'Nunito', -apple-system, system-ui, 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
}

/* only the chosen language shows */
html:not([lang="id"]) [data-l="id"], html:not([lang="en"]) [data-l="en"], html:not([lang="ja"]) [data-l="ja"], html:not([lang="nl"]) [data-l="nl"] { display: none; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.4px);
  background-size: 18px 18px;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 16px; }
h2 { font-size: 28px; margin: 0 0 20px; }
h3 { font-size: 20px; margin: 0 0 8px; }
a { color: #3f6b3d; }
img { max-width: 100%; height: auto; }

.sticker { background: var(--card); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 0 4px 0 var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 24px; border-radius: 16px;
  background: var(--green); color: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 18px; text-decoration: none; cursor: pointer;
}
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn .spin, .btn .busy { display: none; }
.sending .btn .idle { display: none; }
.sending .btn .busy { display: inline; }
.sending .btn .spin {
  display: inline-block; width: 18px; height: 18px; margin-right: 10px;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sending .btn .spin { animation-duration: 2.4s; } }
.btn.ghost { background: var(--card); color: var(--ink); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 18px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 24px; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 10px; }
.top nav { display: flex; align-items: center; gap: 18px; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.lang { font: inherit; font-family: var(--display); background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 10px; cursor: pointer; }

main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
section { margin: 72px 0; }

.notice { margin: 8px 0 0; padding: 14px 18px; border: 2px solid var(--ink); border-radius: 16px; background: var(--green-bg); }

/* hero tagline: typed by main.js; the plain first line stays for screen readers and when scripts are off */
.tagline { min-height: 2.4em; }
.tl-typed { display: none; }
.typing .tl-static { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.typing .tl-typed { display: inline; }
.tl-caret { display: inline-block; width: .08em; height: 1em; margin-left: .06em; vertical-align: -.12em; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tl-caret { display: none; } }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; margin-top: 40px; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 36em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-art { display: flex; justify-content: center; gap: 8px; }
.hero-art img { width: 46%; max-width: 200px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { padding: 22px; }
.card p { margin: 0; color: var(--ink-2); }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { padding: 22px; text-align: center; }
.plan p { margin: 4px 0; }
.price { font-family: var(--display); font-size: 26px; }
.price small { font-family: var(--body); font-size: 15px; color: var(--ink-2); }
.note { color: var(--ink-2); max-width: 46em; }

.waitlist { position: relative; max-width: 620px; margin-left: auto; margin-right: auto; padding: 28px; }
.peek { position: absolute; top: -70px; right: 18px; width: 110px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; }
input[type="email"], input[type="text"], select {
  font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px;
  box-shadow: inset 0 2px 0 var(--sand);
}
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--green); }
input.invalid, select.invalid { border-color: var(--rust); box-shadow: inset 0 2px 0 #f6dcd0; }
input.valid, select.valid { border-color: var(--green); }
input:focus-visible, select:focus-visible { outline: 3px solid var(--green-bg); outline-offset: 1px; }
input.invalid:focus-visible, select.invalid:focus-visible { outline-color: #f6dcd0; }
.check.invalid input { outline: 2px solid var(--rust); outline-offset: 2px; }
.field-err { display: none; color: var(--rust); font-size: 14px; font-weight: 600; }
.field-err.show { display: block; }
.field-err::before { content: '! '; font-weight: 800; }
.hint { font-size: 14px; }
.hint-btn { font: inherit; font-weight: 700; color: var(--green); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
input::placeholder { color: #b8aa98; }
input:disabled, select:disabled { color: #8a8a8a; background: #eeeeee; box-shadow: none; cursor: not-allowed; }
.sending .check { color: #8a8a8a; }
.hp { position: absolute; left: -9999px; }
.msg { margin: 0; min-height: 1.5em; }
.done { text-align: center; display: grid; gap: 10px; justify-items: center; outline: none; }
.done h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 24px; }
.done p { margin: 0; }
.resend { font-size: 15px; color: var(--ink-2); }
.resend .sep { margin: 0 6px; }
.share { margin-top: 14px; padding-top: 16px; border-top: 2px dashed var(--dot); width: 100%; }
.share-title { font-weight: 800; margin: 0 0 10px; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.share-row .btn { height: 44px; padding: 0 18px; font-size: 16px; }
.copy-ok { display: none; }
.copied .copy-idle { display: none; }
.copied .copy-ok { display: inline; }
.link-btn { font: inherit; font-weight: 800; color: var(--green); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.link-btn:disabled { color: #a99d90; cursor: default; text-decoration: none; }
.notice.warn { background: #f6e3cf; }
.msg.err { color: var(--rust); }

#faq details { padding: 16px 20px; margin-bottom: 12px; }
#faq summary { cursor: pointer; font-family: var(--display); font-size: 18px; }
#faq details p { margin: 10px 0 0; color: var(--ink-2); }

.foot { text-align: center; padding: 40px 20px 60px; color: var(--ink-2); }
.foot p { margin: 6px 0; }

/* buddies and game cards */
.buddies { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.buddy { display: flex; gap: 18px; align-items: center; padding: 20px; }
.buddy img { width: 140px; flex: none; }
.buddy p { margin: 0; color: var(--ink-2); }
.moods { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.moods img { width: 72px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
/* feature mockups: small pieces of the app ui inside each card */
.mock { height: 150px; margin: 0 0 14px; padding: 12px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); font-size: 13px; display: flex; flex-direction: column; justify-content: center; gap: 8px; overflow: hidden; }
.mock img { display: inline-block; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-sub { color: var(--ink-2); font-size: 12px; }
.m-big { display: flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 30px; line-height: 1; }
.flame { width: 1em; height: 1em; fill: var(--orange, #e9875b); stroke: var(--ink); stroke-width: 1.5; }
.m-week { display: flex; gap: 5px; }
.m-week i { flex: 1; text-align: center; font-style: normal; font-size: 11px; padding: 4px 0; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); }
.m-week i.on { background: var(--green); color: #fff; }
.m-week i.frz { background: #dceaf0; }
.m-week i.today { background: var(--card); border-style: dashed; }
.m-bar { height: 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); overflow: hidden; }
.m-bar b { display: block; height: 100%; background: #e9875b; }
.m-cap { font-size: 12px; color: var(--ink-2); text-align: right; margin-top: -4px; }

.m-badges { display: flex; gap: 8px; justify-content: center; }
.m-badges span { width: 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font-size: 18px; box-shadow: 0 2px 0 var(--ink); }
.m-badges .b1 { background: #2f5d73; color: #fff; }
.m-badges .b2 { background: #f6e7b8; }
.m-badges .b3 { background: var(--green-bg); }
.m-badges .lock { background: var(--sand); color: var(--ink-2); border-style: dashed; box-shadow: none; }
.m-rank { display: flex; justify-content: space-between; font-family: var(--display); }
.m-toast { align-self: center; font-family: var(--display); font-size: 12px; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; background: #f6e7b8; }

.m-story { align-items: center; background: var(--sand); }
.m-phone { width: 84px; height: 136px; border: 2px solid var(--ink); border-radius: 14px; background: linear-gradient(#fbe3d6, var(--card)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 3px 0 var(--ink); }
.m-phone img { width: 40px; }
.m-num { font-family: var(--display); font-size: 24px; line-height: 1; }
.m-phone .m-sub { font-size: 9px; }
.m-chips { display: flex; gap: 3px; }
.m-chips span { font-size: 8px; padding: 1px 4px; border: 1px solid var(--ink); border-radius: 6px; background: #fff; }
.m-brand { font-family: var(--display); font-size: 9px; margin-top: 2px; }

.m-washi p { margin: 0; font-size: 13px; line-height: 1.9; color: var(--ink); }
.wt { position: relative; padding: 1px 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.wt::after { content: ""; position: absolute; inset: 0; background-size: 32px; opacity: .35; mix-blend-mode: multiply; pointer-events: none; }
.w1 { background: #f6e07a; }
.w1::after { background-image: url(/assets/washi-korokke.webp); }
.w2 { background: #bfe0b4; }
.w2::after { background-image: url(/assets/washi-circles.webp); }
.m-legend { font-size: 11px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.m-legend .d { width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--ink); }
.m-legend .d1 { background: #f6e07a; }
.m-legend .d2 { background: #bfe0b4; margin-left: 6px; }

.m-friends { gap: 6px; }
.m-f { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); }
.m-f img { width: 26px; height: 26px; }
.m-f span:nth-child(2) { flex: 1; }
.m-s { display: flex; align-items: center; gap: 2px; font-family: var(--display); }
.m-ok, .m-nudge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 2px solid var(--ink); }
.m-ok { background: var(--green-bg); }
.m-nudge { background: #e9875b; color: #fff; box-shadow: 0 2px 0 var(--ink); }

.m-code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; padding: 2px 8px; border: 2px dashed var(--ink); border-radius: 8px; background: var(--card); }
.m-avatars { display: flex; align-items: center; }
.m-avatars img { width: 34px; height: 34px; margin-right: -6px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); }
.m-avatars span { margin-left: 12px; font-family: var(--display); color: var(--ink-2); }
.m-react { display: flex; gap: 6px; flex-wrap: wrap; }
.m-react span { padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); font-size: 12px; }
.ticks { list-style: none; margin: 0; padding: 22px 26px; display: grid; gap: 10px; }
.ticks li { padding-left: 30px; position: relative; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 5px; background: var(--green); border: 2px solid var(--ink); }

/* legal pages */
.doc { max-width: 820px; margin: 24px auto 0; padding: 32px; }
.doc h1 { font-size: 34px; }
.doc h2 { font-size: 22px; margin-top: 32px; }
.doc table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; }
.doc th, .doc td { border: 1px solid var(--dot); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--sand); }
.doc code { background: var(--sand); padding: 1px 5px; border-radius: 6px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .grid, .plans, .buddies { grid-template-columns: 1fr; }
  .buddy img { width: 96px; }
  .top nav a:not(.lang) { display: none; }
  .doc { padding: 20px; }
}

/* language picker in the header */
select.lang { width: auto; padding: 4px 26px 4px 10px; border-radius: 10px; box-shadow: none; font-family: var(--display); font-size: 15px; appearance: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233b2f2a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 9px center; }

/* motion, all of it skipped when the reader asks for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease var(--d, 0ms), transform .7s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .moods img.reveal { transform: scale(.4); }
  .js .moods img.reveal.in { transform: none; transition-timing-function: ease, cubic-bezier(.3, 1.6, .5, 1); }

  .hero h1, .hero .lead, .hero .cta { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
  .hero .lead { animation-delay: .12s; }
  .hero .cta { animation-delay: .24s; }
  .hero-art img { animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) both, bob 4s ease-in-out .7s infinite; }
  .hero-art img + img { animation-delay: .15s, 1.6s; }

  .buddy img { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
  .buddy:hover img { transform: rotate(-6deg) scale(1.05); }
  .moods img { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .moods img:hover { transform: translateY(-8px) rotate(4deg); }

  .card, .buddy, #faq details { transition: transform .2s ease, box-shadow .2s ease; }
  .card.in:hover, .buddy.in:hover { transform: translateY(-4px); box-shadow: 0 8px 0 var(--ink); }
  .btn { transition: transform .15s ease, box-shadow .15s ease; }
  .btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }

  .flame { transform-origin: 50% 90%; animation: flicker 1.6s ease-in-out infinite; }
  .in .m-toast { animation: toast .6s cubic-bezier(.3, 1.6, .5, 1) .5s both; }
  .in .m-nudge { animation: nudge 2.4s ease-in-out 1s infinite; }
  .in .m-react span { display: inline-block; animation: hop 1.8s ease-in-out infinite; }
  .in .m-react span:nth-child(2) { animation-delay: .3s; }
  .in .m-react span:nth-child(3) { animation-delay: .6s; }
  .waitlist.in .peek { animation: peek .7s cubic-bezier(.3, 1.6, .5, 1) .3s both; }
  .done:not([hidden]) img { animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) both, bob 3s ease-in-out .6s infinite; }
  .notice:not([hidden]) { animation: rise .5s ease both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08, .95) rotate(-3deg); } 60% { transform: scale(.96, 1.06) rotate(3deg); } }
@keyframes toast { from { opacity: 0; transform: translateY(14px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-8deg); } 80% { transform: rotate(8deg); } 85% { transform: rotate(-5deg); } 90% { transform: rotate(4deg); } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes peek { from { opacity: 0; transform: translateY(40px) rotate(8deg); } to { opacity: 1; transform: none; } }

/* dev blog */
.posts { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 18px; }
.post { border-top: 2px dashed var(--ink-2); padding-top: 14px; }
.post h2 { margin: 4px 0 6px; }
.post h2 a { color: var(--ink); }
.meta { margin: 0; color: var(--ink-2); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.tag { font-family: var(--display); font-size: 13px; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; background: var(--green-bg); color: var(--ink); }
.tag.maintenance { background: #fde3c8; }
.window { padding: 10px 14px; border: 2px solid var(--ink); border-radius: 14px; background: #fde3c8; }
.window.past { opacity: .6; }
.window.past::after { content: ' (done)'; }
.window.now::after { content: ' (happening now)'; font-weight: 800; }
.notice.planned { background: #fde3c8; }
