/* Color Bloom website — matches the app's pastel, light-only theme (ui/theme/Color.kt). */
:root {
  --bg: #FFF8F6;
  --card: #FFFFFF;
  --ink: #4A4458;
  --ink-soft: #8A8399;
  --line: #EFE3E6;
  --outline: #6B5E6E;
  --pink: #FFB5BA;
  --pink-deep: #FF8FA3;
  --blue: #BAE1FF;
  --blue-deep: #8EC9F5;
  --green: #E2F0CB;
  --green-deep: #A8D672;
  --peach: #FFD6A5;
  --cream: #FFF4E8;
  --lilac: #D9D1F5;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 10px 30px rgba(74, 68, 88, 0.08);
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--pink-deep); text-underline-offset: 3px; }
a:hover { color: var(--pink-deep); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.lead { color: var(--ink-soft); font-size: 1.1rem; max-width: var(--measure); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--card); padding: 8px 12px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }

/* Header -------------------------------------------------------------------------------- */
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; max-width: 1120px; margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a, .lang { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; color: var(--ink); }
.nav a:hover, .lang:hover { background: var(--card); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; font-weight: 700;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu ul {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; min-width: 190px; margin: 0; padding: 8px; list-style: none;
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.lang-menu li a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.lang-menu li a:hover { background: var(--bg); }
.lang-menu li a[aria-current="true"] { color: var(--pink-deep); }

main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 56px; }
section { margin: 40px 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 0; }
.btn {
  display: inline-block; padding: 14px 24px; border-radius: 999px; font-weight: 800; text-decoration: none;
  background: var(--pink-deep); color: #fff; box-shadow: var(--shadow); transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); color: #fff; }
.btn-soft { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-soft:hover { color: var(--pink-deep); }
.badge-link img { height: 60px; width: auto; }

/* Hero ---------------------------------------------------------------------------------- */
.hero { display: grid; gap: 32px; align-items: center; grid-template-columns: 1fr; margin-top: 24px; }
.hero-icon { width: 72px; height: 72px; margin-bottom: 12px; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.facts li { background: var(--green); color: #4E6B2B; font-weight: 700; padding: 6px 12px; border-radius: 999px; font-size: .9rem; }
.hero-shot { margin: 0; justify-self: center; }
.shot {
  width: min(300px, 70vw); aspect-ratio: 9 / 16; border-radius: var(--radius-lg); box-shadow: var(--shadow);
  border: 1px solid var(--line); background: var(--card); object-fit: cover;
}
.shot.placeholder { display: grid; place-items: center; padding: 24px; text-align: center; color: var(--ink-soft); background: var(--cream); }
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.3fr 1fr; }
  .lang-menu ul { left: auto; right: 0; }
}

/* Features ------------------------------------------------------------------------------ */
.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature { background: var(--card); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); border-top: 6px solid var(--pink); }
.feature:nth-child(2n) { border-top-color: var(--blue); }
.feature:nth-child(3n) { border-top-color: var(--green-deep); }
.feature:nth-child(5n) { border-top-color: var(--peach); }
.feature p { margin: 0; color: var(--ink-soft); }

/* Cards and the gallery ------------------------------------------------------------------ */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-teaser { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.card {
  background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
  content-visibility: auto; contain-intrinsic-size: 260px 400px;
}
.card[hidden] { display: none; }
.art { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.pic { width: 100%; height: auto; }
.card h3 { margin: 12px 4px 4px; }
.badge {
  position: absolute; top: 10px; left: 10px; background: #FFF1A8; color: #6B5E6E; font-size: .75rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; box-shadow: var(--shadow);
}
.swatches { display: flex; align-items: center; gap: 4px; margin: 0 4px 6px; color: var(--ink-soft); font-size: .85rem; }
.swatches i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(107, 94, 110, .35); }
.swatches span { margin-left: 6px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 4px; }
.tag, .chip { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--cream); color: var(--outline); }

.gallery-head { margin-top: 24px; }
.toolbar { display: flex; gap: 16px 24px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; user-select: none; }
.toggle .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--outline); background: var(--card); position: relative; }
#numbers:checked ~ .gallery-head .toggle .box { background: var(--pink-deep); border-color: var(--pink-deep); }
#numbers:checked ~ .gallery-head .toggle .box::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
#numbers:focus-visible ~ .gallery-head .toggle .box { outline: 3px solid var(--blue-deep); outline-offset: 2px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters-label { color: var(--ink-soft); font-size: .9rem; margin-right: 4px; }
.chip { border: 0; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; }
.chip.is-active { background: var(--pink-deep); color: #fff; }

/* Numbered view: fills go white and the numbers appear; living motion stops. */
.labels { display: none; font: 700 15px/1 system-ui, sans-serif; fill: var(--outline); text-anchor: middle; dominant-baseline: central; }
#numbers:checked ~ .grid .region { fill: #FFFFFF !important; animation: none; }
#numbers:checked ~ .grid .labels { display: block; }

/* Living pictures (docs/PICTURE_FORMAT.md): gentle, periodic, off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .anim-sway, .anim-float, .anim-twinkle, .anim-blink, .anim-glow, .anim-bob { transform-box: fill-box; transform-origin: 50% 50%; }
  .anim-sway { transform-origin: 50% 100%; animation: sway 3.2s ease-in-out infinite alternate; }
  .anim-float { animation: float 4.5s ease-in-out infinite alternate; }
  .anim-twinkle { animation: twinkle 1.6s ease-in-out infinite alternate; }
  .anim-blink { animation: blink 5s step-end infinite; }
  .anim-glow { animation: glow 2.4s ease-in-out infinite alternate; }
  .anim-bob { animation: bob 2s ease-in-out infinite alternate; }
}
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes float { from { transform: translate(-1.5px, 3px); } to { transform: translate(1.5px, -3px); } }
@keyframes twinkle { from { transform: scale(.85); opacity: .7; } to { transform: scale(1.1); opacity: 1; } }
@keyframes blink { 0%, 96% { transform: scaleY(1); } 97%, 99% { transform: scaleY(.1); } 100% { transform: scaleY(1); } }
@keyframes glow { from { filter: brightness(1); } to { filter: brightness(1.08); } }
@keyframes bob { from { transform: translateY(1.5px); } to { transform: translateY(-1.5px); } }

/* Screenshots ----------------------------------------------------------------------------- */
.shot-strip { display: flex; gap: 16px; overflow-x: auto; padding: 8px 0 16px; scroll-snap-type: x mandatory; }
.shot-strip .shot { flex: 0 0 auto; width: min(240px, 60vw); scroll-snap-align: start; }

/* Privacy summary and prose pages --------------------------------------------------------- */
.privacy-summary { background: var(--card); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.privacy-summary ul { margin: 0; padding-left: 1.2em; }
.privacy-summary li { margin-bottom: .4em; }

.prose { max-width: var(--measure); margin: 24px auto 0; }
.prose .updated { color: var(--ink-soft); margin-top: -8px; }
.prose h2 { margin-top: 1.8em; font-size: 1.35rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0 1.5em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--cream); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose code { background: var(--cream); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose dt { font-weight: 700; margin-top: 1em; }
.prose dd { margin: .3em 0 0; color: var(--ink-soft); }
.notfound { text-align: center; }

/* Footer ---------------------------------------------------------------------------------- */
.foot { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: .9rem; }
.foot p { margin: 0 0 .4em; }
