:root {
  --paper: #f6f6f2;
  --ink: #111522;
  --muted: #5a6270;
  --line: #d4d8e0;
  --lime: #e4ff59;
  --blue: #2848f5;
  --blue-dark: #1b32b8;
  --lavender: #d9d4eb;
  --peach: #f2d5c3;
  --ice: #eef2fa;
  --gutter: 48px;
  --max: 1320px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Helvetica, Arial, sans-serif;
  --font-display: CruxBlack, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  letter-spacing: 0.008em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html[lang^="zh"] body {
  letter-spacing: 0.02em;
  line-height: 1.72;
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

button {
  font: inherit;
  color: inherit;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: none;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
}

button:disabled {
  cursor: default;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, p {
  margin: 0;
}

em {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.wrap {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--max);
  margin-inline: auto;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out-expo);
}

.skip {
  position: fixed;
  left: 16px;
  top: -70px;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
  border-radius: 6px;
}

.skip:focus {
  top: 12px;
}

.skip:not(:focus) {
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  padding: 0;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--blue) 0%, #00d4ff 50%, var(--lime) 100%);
  z-index: 90;
  transition: width 0.08s linear;
}

/* Sprite System (collection.webp 3x2 grid) */
.sprite {
  background-image: url('assets/collection.webp');
  background-size: 300% 200%;
  background-repeat: no-repeat;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
}

.tile-automation { background-position: 0% 0%; }
.tile-solo       { background-position: 50% 0%; }
.tile-content    { background-position: 100% 0%; }
.tile-desk       { background-position: 0% 100%; }
.tile-rings      { background-position: 50% 100%; }
.tile-folders    { background-position: 100% 100%; }

/* General Button inside Dialogs */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.015em;
  padding: 15px 24px;
  border-radius: 8px;
  min-height: 50px;
  line-height: 1.25;
  transition: background 0.25s var(--ease-out-expo), color 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}

.button:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(40, 72, 245, 0.24);
}

.button:hover .icon {
  transform: translate(3px, -1px);
}

.button.button-lime {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
}

.button.button-lime:hover {
  background: #d6f63c;
  box-shadow: 0 10px 24px rgba(228, 255, 89, 0.45);
}

.button.button-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.button-ghost:hover {
  border-color: var(--ink);
  background: #f2f4f8;
  box-shadow: none;
}

/* Dialog / Modal System with Spring Animation */
@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

dialog {
  border: 1px solid rgba(17, 21, 34, 0.1);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  width: min(940px, calc(100% - 36px));
  max-height: 88dvh;
  padding: 0;
  box-shadow: 0 36px 120px rgba(14, 19, 34, 0.34);
}

dialog[open] {
  animation: dialogIn 0.38s var(--ease-out-expo) both;
}

dialog::backdrop {
  background: rgba(14, 18, 32, 0.68);
  backdrop-filter: blur(8px);
  animation: backdropFade 0.28s ease both;
}

.dialog-close {
  position: sticky;
  float: right;
  right: 18px;
  top: 18px;
  margin: 18px 18px 0 0;
  background: #ffffff;
  border: 1px solid var(--line);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 10;
  transition: background 0.2s, transform 0.25s var(--ease-spring), border-color 0.2s;
}

.dialog-close:hover {
  background: var(--lime);
  border-color: var(--ink);
  transform: rotate(90deg) scale(1.06);
}

.dialog-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.dialog-product {
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  clear: both;
  margin-top: -42px;
}

.dialog-art-wrap {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--lime);
  padding: 36px 28px;
  gap: 24px;
}

.dialog-art-wrap.solo {
  background: var(--lavender);
}

.dialog-art-wrap.content {
  background: var(--peach);
}

.dialog-art-wrap.routine {
  background: #dbe6ff;
}

.dialog-art-wrap .sprite {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(17, 21, 34, 0.14);
  transition: transform 0.4s var(--ease-out-expo);
}

.dialog-art-wrap:hover .sprite {
  transform: scale(1.03) rotate(-1deg);
}

.dialog-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialog-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  backdrop-filter: blur(4px);
}

.dialog-copy {
  padding: 48px 40px 40px;
}

.category {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
}

.dialog-copy h2, .article-dialog h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 36px);
  letter-spacing: -0.01em;
  line-height: 1.18;
}

html[lang^="zh"] .dialog-copy h2,
html[lang^="zh"] .article-dialog h2 {
  letter-spacing: 0.02em;
  line-height: 1.28;
}

.dialog-lead {
  font-size: 16px;
  line-height: 1.68;
  letter-spacing: 0.01em;
  color: #464e5e;
  margin-top: 14px;
}

.dialog-copy ul {
  list-style: none;
  padding: 0;
  margin: 22px 0;
  font-size: 14.5px;
  line-height: 1.6;
}

.dialog-copy li {
  padding: 11px 0;
  border-bottom: 1px solid #e5e8ef;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.dialog-copy li::before {
  content: '✓';
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.dialog-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.dialog-status {
  font-size: 12.5px;
  line-height: 1.62;
  color: #646c7a;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.article-dialog {
  max-width: 740px;
  padding: 44px 48px 46px;
  margin: auto;
  clear: both;
  margin-top: -30px;
}

.article-dialog h3 {
  font-size: 21px;
  letter-spacing: 0.005em;
  line-height: 1.35;
  margin: 26px 0 10px;
  color: var(--ink);
}

html[lang^="zh"] .article-dialog h3 {
  letter-spacing: 0.02em;
}

.article-dialog p {
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  margin: 14px 0;
  color: #444c5c;
}

.article-dialog blockquote {
  margin: 26px 0;
  padding: 20px 26px;
  border-left: 4px solid var(--blue);
  background: #f2f5fc;
  border-radius: 0 12px 12px 0;
  font: italic 21px/1.5 Georgia, "Songti SC", serif;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.sample-box {
  background: #111522;
  color: #f4f6fa;
  border-radius: 12px;
  padding: 20px 22px;
  margin: 20px 0;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.68;
  letter-spacing: 0.01em;
  position: relative;
}

.sample-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lime);
}

.copy-chip {
  background: rgba(228, 255, 89, 0.16);
  color: var(--lime);
  border: 1px solid rgba(228, 255, 89, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 700;
}

.copy-chip:hover {
  background: var(--lime);
  color: var(--ink);
}

/* Interactive Checklist inside Free Starter Kit */
.checklist-meter {
  height: 8px;
  background: #e6e9f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0 8px;
}

.checklist-meter-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #16c784);
  border-radius: 999px;
  transition: width 0.35s var(--ease-out-expo);
}

.checklist {
  margin: 18px 0 22px;
  display: grid;
  gap: 10px;
}

.checklist label {
  padding: 15px 18px;
  background: #f3f5fa;
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  gap: 14px;
  font-size: 15px;
  line-height: 1.58;
  cursor: pointer;
  align-items: flex-start;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.checklist label:hover {
  background: #e8eef9;
  border-color: #c5d0ea;
  transform: translateX(3px);
}

.checklist input {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--blue);
}

.checklist label:has(input:checked) {
  background: #eef9e8;
  border-color: #a9df96;
  color: #51614c;
}

.checklist label:has(input:checked) span {
  text-decoration: line-through;
}

.checklist-progress {
  font-size: 13px !important;
  font-weight: 700;
  color: var(--blue) !important;
  margin: 6px 0 18px !important;
}

.small-note {
  font-size: 12px !important;
  color: #6e7685 !important;
}

/* Dialog Comparison Table */
.dialog-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dialog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.55;
  text-align: left;
}

.dialog-table th {
  background: #f3f5fa;
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.dialog-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eaedf3;
}

@media (max-width: 800px) {
  .dialog-product {
    grid-template-columns: 1fr;
    margin-top: 0;
  }
  .dialog-art-wrap {
    padding: 28px 36px;
  }
  .dialog-copy {
    padding: 28px 24px 32px;
  }
  .article-dialog {
    padding: 36px 24px 32px;
    margin-top: 0;
  }
  .dialog-copy h2, .article-dialog h2 {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
