/* Sashiko website – linen and indigo, with running stitches as the recurring line. */
:root {
  color-scheme: light dark;
  --bg: #F4EFE6;          /* linen */
  --card: #FBF8F2;
  --ink: #1E2330;
  --muted: #5C6170;
  --line: #DDD5C6;
  --indigo: #1B4578;      /* Japan Indigo, the app's default fabric */
  --indigo-deep: #12305A;
  --oat: #E0DBCE;         /* Oat Milk, the app's default thread */
  --accent: #B8432F;      /* persimmon red, like the meanings in the app */
  --stitch: 2px dashed var(--indigo);
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Shippori Mincho", Georgia, serif;   /* SERIF in build.py */
  --comic: var(--serif);  /* comic captions and texts */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10192A;
    --card: #16233A;
    --ink: #EEE9DF;
    --muted: #A9B0BF;
    --line: #2A3A57;
    --accent: #E9876F;
    --stitch: 2px dashed var(--oat);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
section { padding: 72px 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h1 em { font-style: normal; color: var(--accent); display: block; }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.15rem; }
.stack > * + * { margin-top: 14px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 40em; margin: 0; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
[lang="ja"] { font-family: var(--serif); }

/* header */
.top { display: flex; align-items: center; gap: 12px; padding: 20px 0; flex-wrap: wrap; }
.appicon { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.top .name { font-family: var(--serif); font-size: 1.3rem; }
.top .name span { font-weight: 400; margin-left: 4px; }
.top .tag { color: var(--muted); font-size: 0.95rem; }
.langs { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px 4px; font-size: 0.8rem; }
.langs a { color: var(--muted); text-decoration: none; padding: 2px 5px; border-radius: 6px; }
.langs a[aria-current] { color: var(--ink); font-weight: 700; border: 1.5px dashed var(--indigo); }

/* hero */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; padding: 32px 0 72px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.facts span { border: var(--stitch); border-radius: 999px; padding: 4px 14px; font-size: 0.92rem; }

.demo { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 18px 18px 22px; margin: 0;
        box-shadow: 0 18px 40px rgba(20, 30, 60, 0.12); max-width: 440px; justify-self: center; width: 100%; }
.demotitle { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; text-align: center;
             padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.demohead { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.demohead .kanji { font-size: 1.25rem; }
.demohead .meaning { color: var(--accent); font-weight: 600; }
.fabric { aspect-ratio: 1; border-radius: 22px; overflow: hidden; box-shadow: 0 6px 12px rgba(0,0,0,0.2); }
.fabric img { width: 100%; height: 100%; }
.play { display: flex; justify-content: center; margin-top: 18px; }
.start { font: 600 1.02rem var(--sans); color: var(--oat); background: var(--indigo);
         border: 1.5px dashed color-mix(in srgb, var(--oat) 60%, transparent); border-radius: 999px;
         padding: 11px 26px; min-width: 190px; text-align: center; }
.options { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.speed { display: inline-flex; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 10px; padding: 2px; }
.speed span, .chalk { font: 500 0.88rem var(--sans); color: var(--muted); border-radius: 8px; padding: 6px 10px; }
.speed span.on { background: var(--indigo); color: var(--oat); }
.chalk { background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 999px; padding: 6px 14px; color: var(--ink); }
.choose { margin-top: 14px; display: grid; gap: 10px; }
.swatches { display: flex; gap: 8px; align-items: flex-start; }
.swatches .label { font-size: 0.85rem; color: var(--muted); width: 3.6em; flex: none; padding-top: 2px; }
.swatches .dots { display: flex; flex-wrap: wrap; gap: 7px; }
.swatches .dots span { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.25); }
.swatches .dots span.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.dicerow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.colorname { font-size: 0.88rem; color: var(--muted); }
.dice { --dicebg: #E9E4DA; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
        background: var(--dicebg); color: var(--ink); flex: none; }
.dice svg { width: 22px; height: 22px; }
@media (prefers-color-scheme: dark) { .dice { --dicebg: #24324D; } }
@media (prefers-color-scheme: dark) { .swatches .dots span { border-color: rgba(255,255,255,0.3); } }

/* all patterns */
.facts .hl { background: var(--indigo); color: var(--oat); border-color: transparent; font-weight: 600; }
.allhead { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
.big { font-family: var(--serif); font-weight: 700; font-size: clamp(6rem, 16vw, 11rem); line-height: 0.85;
       color: var(--accent); letter-spacing: -0.02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 36px; }
.mosaic img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; }
.fun { grid-template-columns: repeat(2, 1fr); column-gap: 32px; }

/* colors */
.band { background: var(--card); border-block: 1px solid var(--line); }
.combos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 36px; }
.combo { margin: 0; }
.combo .pic { aspect-ratio: 1; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.combo .pic img { width: 100%; height: 100%; }
.combo figcaption { margin-top: 10px; }
.combo figcaption b { font-family: var(--serif); font-size: 1.05rem; }
.combo figcaption span { color: var(--muted); margin-left: 4px; white-space: nowrap; }
.combo figcaption small { display: block; color: var(--muted); font-size: 0.88rem; }
.colorfacts { margin-top: 32px; }

/* print */
.print { align-items: center; }
.sheet { max-width: 420px; justify-self: center; width: 100%; }
.sheet img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 18px 40px rgba(20, 30, 60, 0.18); }
.checks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.checks li { padding-left: 30px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 18px; border-top: var(--stitch); }

/* steps as a comic strip: four panels in one band, laid on indigo fabric with a running stitch
   around; caption box in the corner, narration at the bottom, lettering in the serif */
.strip { margin-top: 36px; background: #1B4578; border: 3px solid #1E2330; border-radius: 8px; padding: 14px;
         outline: 2px dashed #E0DBCE; outline-offset: -8px; box-shadow: 0 14px 30px rgba(20, 30, 60, 0.18); }
.comic { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(var(--panels, 4), 1fr); gap: 10px; }
.comic li { display: flex; }
.comic figure { flex: 1; display: flex; flex-direction: column; margin: 0; background: #FFFDF7; color: #1E2330;
                border: 3px solid #1E2330; font-family: var(--comic); }
.comic figcaption { align-self: flex-start; background: #F3E3A8; border-right: 3px solid #1E2330; border-bottom: 3px solid #1E2330;
                    padding: 5px 12px 4px 8px; font-size: 1rem; line-height: 1.3; }
.comic figcaption b { font-weight: 400; margin-right: 4px; }
.comic img { width: 100%; height: auto; margin-top: -8px; }
.comic p { flex: 1; margin: 0; padding: 4px 14px 14px; font-size: 1rem; line-height: 1.4; }

/* about */
.indigo { background: var(--indigo); color: #F2EEE5; }
.indigo .eyebrow { color: #F0B3A3; }
.indigo p { color: #D9DEE8; max-width: 36em; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.narrow { max-width: 42em; }
.meanings { display: grid; gap: 18px; }
.meaning-card { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: start;
                border: 2px dashed rgba(224, 219, 206, 0.55); border-radius: 18px; padding: 16px; }
.meaning-card .pic { border-radius: 12px; overflow: hidden; background: var(--indigo-deep); }
.meaning-card .pic img { width: 100%; height: auto; }
.meaning-card h3 span { font-weight: 400; margin-left: 6px; }
.meaning-card p { font-size: 0.95rem; margin: 6px 0 0; }

/* privacy and footer */
.privacy { padding: 64px 0 40px; border-bottom: var(--stitch); }
.nolist { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.nolist span { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-weight: 500; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 28px 0 48px; color: var(--muted); font-size: 0.92rem; flex-wrap: wrap; }
footer .soon { color: var(--ink); font-weight: 600; font-size: 1rem; }

@media (max-width: 900px) {
  .hero, .grid { grid-template-columns: 1fr; gap: 32px; }
  .combos { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .allhead { grid-template-columns: 1fr; gap: 8px; }
  .fun { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
  .comic { grid-template-columns: repeat(2, 1fr); }
  .strip { padding: 12px; }
  section { padding: 56px 0; }
}
@media (max-width: 560px) {
  .comic { grid-template-columns: 1fr; }
  .strip { max-width: 380px; margin-inline: auto; }
}
@media (max-width: 420px) {
  .meaning-card { grid-template-columns: 72px 1fr; }
  .demo { padding: 14px; }
}

footer .legal a { color: var(--muted); text-underline-offset: 3px; }

/* headings and comic per language (SERIFS in build.py) */
:root:lang(ru) { --serif: Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif; }
:root:lang(uk) { --serif: Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif; }
:root:lang(pl) { --serif: Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif; }
:root:lang(tr) { --serif: Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif; }
:root:lang(ko) { --serif: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Hiragino Mincho ProN", sans-serif; }
