:root {
  --bg: #fff9f2;
  --paper: #ffffff;
  --cream: #fff1dc;
  --ink: #3c2d28;
  --ink-2: #6f5a51;
  --ink-3: #a28c82;
  --line: #eeddcc;
  --peach: #ff9c54;
  --peach-hover: #f5883b;
  --pink: #ffd8e4;
  --pink-deep: #ff9bb8;
  --pink-ink: #9c3857;
  --butter: #ffefb3;
  --mint: #d8f5e6;
  --sky: #dceeff;
  --lav: #ede3ff;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 10%, rgba(255, 216, 228, 0.42), transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(255, 239, 179, 0.48), transparent 36%),
    radial-gradient(#ebd8c5 1.3px, transparent 1.3px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  color: var(--ink);
  font-family: "Nunito", "Quicksand", "Hiragino Maru Gothic ProN", "PingFang SC", "Microsoft YaHei UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
select:focus:not(:focus-visible),
summary:focus:not(:focus-visible) {
  outline: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.wrap {
  width: min(880px, calc(100% - 36px));
  margin: 0 auto;
}

/* Topbar */
.topbar {
  padding: 20px 0 10px;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.16s ease;
}

.brand:hover img {
  transform: rotate(-6deg) scale(1.05);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}

.topbar-right a:hover {
  color: var(--ink);
}

.ver-pill {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--butter);
  color: var(--ink);
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
}

/* Language Switcher */
.lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-icon {
  position: absolute;
  left: 9px;
  pointer-events: none;
  color: var(--ink);
  display: flex;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 26px 4px 28px;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 0 var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}

.lang-select:hover {
  background: var(--cream);
}

.lang-caret {
  position: absolute;
  right: 9px;
  pointer-events: none;
  font-size: 10px;
  color: var(--ink-2);
}

/* Hero — Cozy Cat Desk */
.hero {
  padding: 10px 0 54px;
  text-align: center;
}

.cat-stage {
  position: relative;
  margin: 0 auto 24px;
  max-width: 650px;
  padding: 30px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

/* Cute floating doodles around the cat */
.doodle {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  animation: float-bob 4.2s ease-in-out infinite;
}

.doodle-1 { top: 44px; left: 46px; color: var(--pink-deep); animation-delay: 0s; }
.doodle-2 { top: 122px; left: 26px; color: #f4b740; animation-delay: 1.1s; }
.doodle-3 { top: 52px; right: 48px; color: #7ac9a7; animation-delay: 0.6s; }
.doodle-4 { top: 138px; right: 30px; color: var(--pink-deep); animation-delay: 1.8s; }

@keyframes float-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(6deg); }
}

/* Cute speech bubble */
.speech-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  margin-bottom: 6px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  transition: transform 0.14s ease, background-color 0.14s ease;
  z-index: 3;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.speech-bubble.purring {
  background: var(--pink);
  color: var(--pink-ink);
  transform: scale(1.04);
}

.speech-bubble.typing {
  background: var(--butter);
  transform: translateY(-2px);
}

#cat-host {
  width: 294px;
  max-width: 84%;
  position: relative;
  z-index: 2;
  cursor: pointer;
  margin-bottom: -10px;
}

#cat-caps {
  z-index: 10;
}

/* Warm desk shelf under the cat */
.desk-shelf {
  width: 100%;
  height: 20px;
  background: linear-gradient(180deg, #fae0be 0%, #f3cca0 100%);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 #d5ad82;
  position: relative;
  z-index: 1;
}

.desk-shelf::before,
.desk-shelf::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff7eb;
  border: 1.5px solid var(--ink);
}

.desk-shelf::before { left: 16px; }
.desk-shelf::after { right: 16px; }

/* Coat & Label Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  margin: 0 auto 30px;
}

.coat-list {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.coat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s ease;
}

.coat-btn:hover {
  background: var(--cream);
  color: var(--ink);
}

.coat-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.coat-btn.active {
  background: var(--butter);
  color: var(--ink);
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--ink);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.6px solid var(--ink);
  flex-shrink: 0;
}

.toggle-btn {
  padding: 6px 13px;
  border-radius: 999px;
  border: 2px dashed var(--ink-3);
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 800;
}

.toggle-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.toggle-btn.on {
  background: var(--mint);
  border-style: solid;
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

/* Hero Copy & Download CTA */
.hero-copy {
  max-width: 580px;
  margin: 0 auto;
}

.hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.24;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero-copy p {
  margin: 0 0 26px;
  font-size: 16px;
  color: var(--ink-2);
  text-wrap: balance;
}

.download-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 18px;
}

.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 18px;
  background: var(--peach);
  color: var(--ink);
  border: 2.2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 800;
  font-size: 15.5px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s ease;
}

.btn-dl:hover {
  background: var(--peach-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--ink);
}

.btn-dl:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-dl-meta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.62);
  padding: 2px 9px;
  border-radius: 999px;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 18px;
  background: #fffdf9;
  color: var(--ink);
  border: 2.2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 800;
  font-size: 14.5px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s ease;
}

.btn-store:hover {
  background: #f3f7ff;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--ink);
}

.btn-store:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.text-link {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-2);
  border-bottom: 2px dotted var(--ink-3);
  padding-bottom: 2px;
}

.text-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Platform-specific download guidance */
.platform-notice,
.download-anyway {
  display: none;
}

:root[data-platform]:not([data-platform="windows"]) .windows-only-notice,
:root[data-wechat="true"] .wechat-notice {
  display: block;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.windows-only-notice {
  margin: 14px auto 0;
}

.wechat-notice {
  max-width: 580px;
  margin: 0 auto 12px;
}

:root[data-platform]:not([data-platform="windows"]) .download-anyway {
  display: inline-block;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.copy-pc-link {
  max-width: 100%;
  justify-content: center;
  overflow-wrap: anywhere;
}

.copy-pc-link svg {
  flex-shrink: 0;
}

.clipboard-fallback {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hero-footnote {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 700;
}

/* Squishy virtual keycaps */
.tap-keys {
  margin-top: 15px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-3);
}

.kbtn {
  min-width: 30px;
  height: 28px;
  padding: 0 9px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  transition: transform 0.05s ease, box-shadow 0.05s ease, background-color 0.08s ease;
}

.kbtn:hover {
  background: var(--cream);
}

.kbtn:active,
.kbtn.pressed {
  transform: translateY(2.5px);
  box-shadow: 0 0.5px 0 var(--ink);
  background: var(--pink);
}

/* Notebook Sections */
.block {
  padding: 42px 0;
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
}

.block-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.block-head span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
}

/* Cute Stationery Cards */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.note-card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: 4px 4px 0 var(--line);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.note-card:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: 5px 7px 0 #e6d1ba;
}

.note-card:nth-child(even):hover {
  transform: translateY(-3px) rotate(0.4deg);
}

.note-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1.6px solid var(--ink);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tag-butter { background: var(--butter); }
.tag-pink   { background: var(--pink); }
.tag-mint   { background: var(--mint); }
.tag-sky    { background: var(--sky); }
.tag-lav    { background: var(--lav); }
.tag-cream  { background: var(--cream); }

.note-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
}

.note-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.68;
}

/* Cute Cat-Eared Adoption Ticket */
.ticket-wrap {
  position: relative;
  padding-top: 14px;
}

.ticket-ears {
  position: absolute;
  top: 0;
  left: 36px;
  display: flex;
  gap: 20px;
  z-index: 0;
  pointer-events: none;
}

.ear {
  width: 28px;
  height: 22px;
  background: var(--cream);
  border: 2.2px solid var(--ink);
  border-radius: 10px 10px 0 0;
  transform: rotate(-14deg);
  position: relative;
}

.ear::after {
  content: "";
  position: absolute;
  inset: 5px 6px 2px;
  background: var(--pink);
  border-radius: 6px 6px 0 0;
}

.ear.right {
  transform: rotate(14deg);
}

.ticket {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border: 2.2px solid var(--ink);
  border-radius: 26px;
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
}

.ticket-top {
  padding: 26px 28px;
  background: var(--cream);
  border-bottom: 2px dashed var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ticket-file {
  font-family: var(--mono);
  font-size: 15.5px;
  font-weight: 800;
  margin-bottom: 4px;
}

.ticket-meta {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.ticket-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  color: var(--ink-2);
}

.ticket-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.ticket-row dt {
  font-weight: 800;
  color: var(--ink);
  font-size: 13px;
}

.ticket-row dd {
  margin: 0;
}

.tips-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Collapsed SHA-256 details */
.sha-details {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--line);
}

.sha-details summary {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.sha-details summary::-webkit-details-marker {
  display: none;
}

.sha-details summary::before {
  content: "▸";
  font-size: 11px;
  transition: transform 0.14s ease;
}

.sha-details[open] summary::before {
  transform: rotate(90deg);
}

.sha-details summary:hover {
  color: var(--ink);
}

.sha-wrap {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sha-code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  padding: 5px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.copy-btn {
  padding: 4px 12px;
  border-radius: 9px;
  border: 1.8px solid var(--ink);
  background: var(--butter);
  box-shadow: 0 2px 0 var(--ink);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.copy-btn:active {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 var(--ink);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.price-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.price-card.featured {
  background: linear-gradient(180deg, #fffdf9 0%, #fff6ea 100%);
}

.price-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.price-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.price-amount {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.price-amount small {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  margin-left: 4px;
}

.price-desc {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.price-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-note {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 700;
}

/* Legal pages */
.legal-main {
  padding: 20px 0 12px;
}

.legal-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 32px 34px;
  box-shadow: 0 5px 0 var(--ink);
}

.legal-head {
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 2px dashed var(--line);
}

.legal-head h1 {
  margin: 10px 0 6px;
  font-size: 28px;
  line-height: 1.2;
}

.legal-meta {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

.legal-card section {
  margin-bottom: 20px;
}

.legal-card section:last-child {
  margin-bottom: 0;
}

.legal-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.legal-card p,
.legal-card ul {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.legal-card ul {
  padding-left: 20px;
}

.legal-card li {
  margin-bottom: 5px;
}

.legal-card a {
  color: var(--pink-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}

.legal-card code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* Footer */
.footer {
  padding: 28px 0 46px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  padding-top: 20px;
  border-top: 2px dashed var(--line);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.footer a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .doodle { animation: none; }
}

@media (max-width: 680px) {
  .doodle { display: none; }

  .notes-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .legal-card {
    padding: 22px 20px;
  }

  .ticket-top,
  .ticket-body {
    padding: 20px;
  }

  .ticket-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
