/* Progressive refinements kept separate so the primary stylesheet stays easy to audit. */

@supports (text-wrap: balance) {
  .hero h1,
  .page-intro h1,
  .section-heading h2,
  .split-feature h2,
  .info-layout h2,
  .reading-layout h2,
  .desktop-preview h2,
  .faq-layout h2,
  .comparison-layout h2,
  .keyboard-layout h2,
  .next-step h2 {
    text-wrap: balance;
  }

  .hero__lead,
  .page-intro__lead,
  .section-heading > p {
    text-wrap: pretty;
  }
}

@supports (background: color-mix(in srgb, white, black)) {
  .site-header {
    background: color-mix(in srgb, var(--paper) 91%, transparent);
  }

  .badge {
    border-color: color-mix(in srgb, var(--berry) 24%, transparent);
    background: color-mix(in srgb, var(--berry) 9%, transparent);
  }

  .path-card:hover,
  .work-card:hover {
    border-color: color-mix(in srgb, var(--berry) 36%, transparent);
  }
}

.brand,
.site-nav a,
.button,
.path-card,
.text-link,
.work-card,
.index-row,
.filter-links a,
.faq-list summary,
.footer-brand,
.site-footer a {
  -webkit-tap-highlight-color: transparent;
}

.brand:active,
.site-nav a:active,
.button:active,
.path-card:active,
.text-link:active,
.filter-links a:active {
  transform: translateY(1px);
}

.work-card__body,
.path-card,
.note-card,
.desktop-guide-card,
.story-guide-card,
.scenario-row {
  min-width: 0;
}

.work-card h3,
.path-card h3,
.note-card h3,
.desktop-guide-card h3,
.story-guide-card h3,
.scenario-row h3 {
  overflow-wrap: anywhere;
}

.hero__copy,
.split-feature__copy,
.info-layout__intro,
.comparison-layout__intro,
.keyboard-layout > div,
.next-step > div {
  min-width: 0;
}

.section-heading .eyebrow,
.hero .eyebrow,
.page-intro .eyebrow {
  width: fit-content;
}

.section-heading .eyebrow::after,
.hero .eyebrow::after,
.page-intro .eyebrow::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  margin-left: 10px;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.48;
}

.hero__copy .badges {
  max-width: 620px;
}

.hero__visual > img,
.split-feature__media img,
.desktop-preview img,
.page-intro__grid > img,
.work-card__media img {
  background: var(--soft);
}

.hero__visual > img[alt=""],
.split-feature__media img[alt=""],
.desktop-preview img[alt=""],
.page-intro__grid > img[alt=""] {
  opacity: 0.96;
}

.site-header__inner,
.site-footer__bottom,
.work-card__meta,
.work-card__footer,
.next-step {
  container-type: inline-size;
}

@container (max-width: 420px) {
  .work-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.breadcrumbs > * {
  flex: 0 0 auto;
}

.breadcrumbs a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.breadcrumbs a:hover {
  text-decoration-line: underline;
}

.filter-links a[aria-current="page"] {
  box-shadow: 0 8px 20px rgba(217, 63, 99, 0.18);
}

.filter-links a:not([aria-current="page"]):hover {
  box-shadow: 0 7px 16px rgba(47, 37, 48, 0.08);
}

.path-card:focus-visible,
.work-card:focus-within,
.note-card:focus-within,
.desktop-guide-card:focus-within,
.story-guide-card:focus-within {
  outline: 3px solid rgba(242, 166, 90, 0.8);
  outline-offset: 3px;
}

.work-card__media:focus-visible,
.work-card h3 a:focus-visible,
.work-card__footer a:focus-visible {
  outline-offset: 2px;
}

.index-row:focus-visible {
  border-radius: 12px;
}

.index-row__main strong,
.work-card h3,
.path-card h3,
.desktop-guide-card h3,
.story-guide-card h3 {
  text-wrap: balance;
}

.index-row__meta,
.work-card__meta,
.badge,
.filter-links a,
.key,
.desktop-guide-card > span,
.scenario-row > span {
  font-variant-numeric: tabular-nums;
}

.section--panel .eyebrow::after {
  background: currentColor;
}

.section--panel .note-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.075);
}

.note-card,
.desktop-guide-card,
.story-guide-card {
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.desktop-guide-card:hover,
.story-guide-card:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 93, 117, 0.28);
  box-shadow: 0 16px 36px rgba(47, 37, 48, 0.08);
}

.desktop-guide-card > span,
.scenario-row > span {
  letter-spacing: 0.04em;
}

.faq-list details[open] {
  border-color: rgba(232, 93, 117, 0.25);
  background: var(--white);
  box-shadow: 0 12px 28px rgba(47, 37, 48, 0.055);
}

.faq-list details[open] summary {
  color: var(--berry-deep);
}

.faq-list details p {
  max-width: 900px;
}

.comparison-table tbody tr {
  transition: background 140ms ease;
}

.comparison-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.key-demo .key + span {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer__grid a {
  text-underline-offset: 4px;
}

.site-footer__grid a:focus-visible {
  outline-color: #ffc2cd;
}

.site-footer__bottom span:last-child {
  font-variant-numeric: tabular-nums;
}

.not-found .hero__actions {
  max-width: 620px;
}

.page--watch .story-guide-card:nth-child(3n + 1) h3::before {
  content: "偏好";
  display: block;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--berry-deep);
  background: rgba(232, 93, 117, 0.08);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.page--watch .story-guide-card:nth-child(3n + 2) h3::before {
  content: "选择";
  display: block;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #8b5623;
  background: rgba(242, 166, 90, 0.12);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.page--watch .story-guide-card:nth-child(3n) h3::before {
  content: "节奏";
  display: block;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #65525f;
  background: rgba(47, 37, 48, 0.07);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.page--desktop .scenario-row {
  position: relative;
}

.page--desktop .scenario-row::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: var(--berry-deep);
  transition: width 220ms ease;
}

.page--desktop .scenario-row:hover::before {
  width: 100%;
}

.page--desktop .comparison-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.page--desktop .comparison-table-wrap::-webkit-scrollbar {
  height: 9px;
}

.page--desktop .comparison-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid var(--deep);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.page--desktop .comparison-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.page--home .path-card:nth-child(1) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 246, 0.88));
}

.page--home .path-card:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 238, 0.9));
}

.page--home .path-card:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 238, 240, 0.76));
}

.page--home .index-row:hover .index-row__num {
  transform: translateX(3px);
}

.page--home .index-row__num {
  transition: transform 160ms ease;
}

.page--home .desktop-preview img,
.page--desktop .page-intro__grid > img {
  outline: 1px solid rgba(47, 37, 48, 0.06);
  outline-offset: -1px;
}

@media (hover: none) {
  .path-card:hover,
  .work-card:hover,
  .desktop-guide-card:hover,
  .story-guide-card:hover,
  .button:hover,
  .site-nav a:hover {
    transform: none;
  }

  .work-card:hover .work-card__media img {
    transform: none;
  }

  .page--desktop .scenario-row:hover::before {
    width: 0;
  }
}

@media (pointer: coarse) {
  .site-nav a,
  .filter-links a,
  .button,
  .faq-list summary,
  .work-card__footer a,
  .text-link {
    min-height: 44px;
  }

  .text-link,
  .work-card__footer a {
    display: inline-flex;
    align-items: center;
  }

  .filter-links {
    gap: 8px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(47, 37, 48, 0.3);
    --line-strong: rgba(47, 37, 48, 0.5);
    --muted: #5d535b;
  }

  .site-nav a[aria-current="page"],
  .button--primary,
  .filter-links a[aria-current="page"] {
    box-shadow: none;
  }

  .badge,
  .path-card,
  .work-card,
  .desktop-guide-card,
  .story-guide-card,
  .faq-list details {
    border-width: 2px;
  }

  :focus-visible {
    outline-width: 4px;
  }

  .section--panel .note-card,
  .comparison-table-wrap {
    border-color: rgba(255, 255, 255, 0.38);
  }

  .section--panel .split-feature__copy > p,
  .section--panel .info-layout__intro > p,
  .section--panel .comparison-layout__intro > p,
  .note-card p,
  .comparison-table td {
    color: rgba(255, 255, 255, 0.9);
  }
}

@media (max-width: 1120px) and (min-width: 821px) {
  .page--watch .story-guide-card {
    min-height: 330px;
  }

  .page--desktop .scenario-row {
    gap: 18px;
  }
}

@media (max-width: 960px) {
  .page-intro__grid,
  .page-intro__grid--desktop {
    align-items: start;
  }

  .page-intro__grid > div {
    max-width: 780px;
  }

  .split-feature__copy {
    max-width: 780px;
  }

  .comparison-layout__intro,
  .info-layout__intro {
    max-width: 760px;
  }

  .site-footer__grid > div:first-child p {
    max-width: 700px;
  }
}

@media (max-width: 820px) {
  .section-heading--split .text-link {
    justify-self: start;
  }

  .story-guide-card strong {
    font-size: 0.9rem;
  }

  .page--desktop .scenario-row p {
    font-size: 0.9rem;
  }
}

@media (max-width: 760px) {
  .site-header__inner {
    gap: 12px;
  }

  .site-nav a {
    width: 100%;
  }

  .hero__copy .badges {
    gap: 7px;
  }

  .badge {
    padding: 6px 9px;
  }

  .section-heading .eyebrow::after,
  .hero .eyebrow::after,
  .page-intro .eyebrow::after {
    width: 16px;
  }

  .faq-list summary {
    padding-right: 48px;
  }

  .next-step .button {
    align-self: stretch;
  }
}

@media (max-width: 560px) {
  .hero h1,
  .page-intro h1 {
    letter-spacing: -0.035em;
  }

  .section-heading h2,
  .split-feature h2,
  .info-layout h2,
  .reading-layout h2,
  .desktop-preview h2,
  .faq-layout h2,
  .comparison-layout h2,
  .keyboard-layout h2,
  .next-step h2 {
    letter-spacing: -0.025em;
  }

  .page-intro__lead,
  .hero__lead {
    line-height: 1.76;
  }

  .work-card__body,
  .story-guide-card,
  .desktop-guide-card,
  .note-card {
    padding: 20px;
  }

  .story-guide-card p,
  .desktop-guide-card p,
  .note-card p {
    line-height: 1.72;
  }

  .scenario-row {
    padding: 22px 0;
  }

  .scenario-row h3 {
    font-size: 0.96rem;
  }

  .scenario-row p {
    line-height: 1.72;
  }
}

@media (max-width: 390px) {
  .shell {
    width: min(calc(100% - 22px), var(--shell));
  }

  .brand__text strong {
    font-size: 1rem;
  }

  .hero,
  .section,
  .page-intro {
    padding-block: 50px;
  }

  .work-card__body,
  .path-card,
  .story-guide-card,
  .desktop-guide-card,
  .note-card {
    padding-inline: 18px;
  }

  .faq-list summary,
  .faq-list details p {
    padding-left: 18px;
  }

  .faq-list details p {
    padding-right: 18px;
  }

  .site-footer__bottom {
    font-size: 0.78rem;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 960px) {
  .site-header {
    position: relative;
  }

  .site-nav {
    max-height: calc(100vh - 86px);
    overflow-y: auto;
  }

  .hero {
    padding-top: 36px;
  }
}

@media print {
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-break: break-all;
  }

  .brand img,
  .hero__visual,
  .split-feature__media,
  .desktop-preview img,
  .page-intro__grid > img,
  .work-card__media {
    display: none !important;
  }

  .works-grid--featured,
  .works-grid--compact,
  .story-guide-grid,
  .desktop-guide-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section--panel {
    color: #000;
    background: #fff;
  }

  .section--panel h2,
  .section--panel h3,
  .section--panel .feature-list strong,
  .section--panel .split-feature__copy > p,
  .section--panel .info-layout__intro > p,
  .section--panel .comparison-layout__intro > p,
  .note-card p,
  .comparison-table td,
  .comparison-table tbody th,
  .comparison-table thead th {
    color: #000;
  }
}
