/* Shared topic and catalog pages. Uses the landing site's theme tokens. */
body.topic-page {
  --tp-radius: 20px;
  --tp-content-width: 1080px;
  --tp-content-gutter: 22px;
  --tp-focus: var(--accent);
  background:
    radial-gradient(ellipse 680px 440px at 80% 145px, color-mix(in srgb, var(--accent2) 9%, transparent), transparent 75%),
    var(--bg);
}
.topic-page [hidden] { display: none !important; }
.topic-page h1[data-heading-accent]::highlight(mv-heading-accent) {
  color: var(--heading-accent, var(--accent));
}
.topic-page button, .topic-page summary { font: inherit; }
.topic-page button { color: inherit; }
.topic-page a, .topic-page button, .topic-page summary { -webkit-tap-highlight-color: transparent; }
.topic-page :is(a, button, summary):focus-visible {
  outline: 3px solid var(--tp-focus);
  outline-offset: 4px;
}
.topic-page .tp-container,
.topic-page #main-content {
  width: 100%;
  max-width: var(--tp-content-width);
  margin-inline: auto;
  padding-inline: var(--tp-content-gutter);
}
.topic-page #main-content { scroll-margin-top: 104px; }
.tp-skip {
  position: fixed;
  top: -120px;
  left: 22px;
  z-index: 100;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-weight: 650;
  box-shadow: 0 8px 24px #0002;
}
.tp-skip:focus { top: 12px; }

.tp-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 12px 20px; border: 1px solid transparent; border-radius: 11px;
  font-size: 15px; font-weight: 650; line-height: 1.4; text-align: center; text-decoration: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.tp-button.primary { background: linear-gradient(120deg,#5144d8,#7057e5); color: #fff; box-shadow: 0 5px 15px #5849d522; }
.tp-button.secondary { border-color: var(--line); color: var(--text); background: var(--card); }
.tp-button svg { width: 18px; height: 18px; flex: 0 0 auto; }
@media (hover:hover) {
  .tp-button.primary:hover { background: linear-gradient(120deg,#4637c6,#6048d4); color: #fff; text-decoration: none; }
  .tp-button.secondary:hover { background: var(--soft); border-color: var(--accent); text-decoration: none; }
}

.tp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr);
  align-items: center;
  gap: 54px;
  padding: 54px 0 82px;
}
.tp-hero-copy { min-width: 0; }
.tp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .075em;
  line-height: 1.5;
  text-transform: uppercase;
}
.tp-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tp-template-mark { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.topic-page h1 {
  max-width: 720px;
  margin: 0 0 22px;
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.tp-lead { max-width: 570px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 29px; }
.tp-stage {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 85% 5%, color-mix(in srgb, var(--accent2) 13%, transparent), transparent 60%),
    radial-gradient(ellipse at 5% 85%, #6ba7f018, transparent 65%),
    var(--card);
  box-shadow: 0 18px 46px #24215209;
}
.tp-stage-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.4; }
.tp-stage-top > span:first-child { font-weight: 650; color: var(--text); }
.tp-stage-label { display: inline-flex; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted); font-size: 11px; font-weight: 600; }
.tp-stage-art { display: flex; align-items: center; justify-content: center; min-height: 260px; padding: 24px 18px 10px; color: var(--accent); }
.tp-stage-art svg { display: block; width: 100%; max-width: 340px; height: auto; overflow: visible; }
.tp-stage-note { margin: 0; padding: 15px 24px 23px; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
.tp-device-picture { position:relative; isolation:isolate; display:grid; justify-items:center; align-content:center; gap:14px; min-width:0; width:100%; max-width:440px; margin:0 auto; }
.tp-device-picture::before { content:""; position:absolute; z-index:-1; inset:12% -4% 6%; border-radius:50%; background:radial-gradient(ellipse,color-mix(in srgb,var(--accent) 11%,transparent),transparent 70%); pointer-events:none; }
.tp-device-picture > img { display:block; width:100%; height:auto; max-height:450px; object-fit:contain; object-position:center; filter:drop-shadow(0 15px 18px #18122b16); }
.tp-device-credit { max-width:100%; margin:0; color:var(--muted); font-size:11px; font-weight:450; line-height:1.5; text-align:center; overflow-wrap:anywhere; }
.tp-device-credit a { color:var(--muted); text-decoration:underline; text-underline-offset:3px; }
:root[data-theme="dark"] .tp-device-picture > img { filter:drop-shadow(0 15px 22px #00000038); }
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) .tp-device-picture > img { filter:drop-shadow(0 15px 22px #00000038); } }
.tp-content, .tp-catalog, .tp-related { padding-block: 0 72px; scroll-margin-top: 104px; }
.topic-page :is(.tp-content, .tp-catalog, .tp-related) h2 { margin: 0 0 13px; font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; text-wrap: balance; }
.tp-section-intro { max-width: 680px; margin: 0 0 28px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.tp-content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tp-content-card { min-width: 0; padding: 25px; border: 1px solid var(--line); border-radius: var(--tp-radius); background: var(--card); }
.tp-content-card h3 { margin: 14px 0 10px; font-size: 19px; font-weight: 650; letter-spacing: -.025em; line-height: 1.3; }
.tp-content-card h3:first-child { margin-top: 0; }
.tp-content-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.tp-content-card p + p { margin-top: 12px; }
.tp-step { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)); border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; line-height: 1.4; }
.tp-catalog-group { margin-top: 44px; scroll-margin-top: 104px; }
.tp-catalog-group:first-child { margin-top: 0; }
.tp-catalog-group h2[data-heading-accent]::highlight(mv-heading-accent) { color: var(--accent); }
body.tp-catalog-only h1.tp-catalog-title {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap;
}
body.tp-catalog-only #topics { padding-top: clamp(26px,3vw,38px); }
.tp-collection-intro { margin-block: clamp(28px, 5vw, 56px) 12px; }
@media (min-width: 481px) {
  body:is([data-topic="png-and-mockups"],[data-topic="device-reference"]) .tp-catalog .tp-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tp-catalog-group > p { max-width: 680px; margin: 0 0 25px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.tp-link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tp-link-card {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 190px;
  padding: 23px 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.tp-link-card:hover { text-decoration: none; }
.tp-link-kicker { display: block; margin-bottom: 15px; color: var(--accent); font-size: 12px; font-weight: 650; letter-spacing: .035em; line-height: 1.5; }
.tp-link-card h3 { margin: 0 0 9px; padding-right: 15px; color: var(--text); font-size: 18px; font-weight: 650; letter-spacing: -.025em; line-height: 1.35; }
.tp-mockup-card h3 { display:flex; align-items:center; flex-wrap:wrap; gap:5px 7px; min-height:30px; }
.topic-page .tp-link-card.tp-mockup-card .ds-mark { color:var(--accent); }
.tp-link-card p { margin: 0; padding-right: 16px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.tp-link-card > svg { position: absolute; right: 19px; bottom: 23px; width: 17px; height: 17px; color: var(--accent); }
.tp-related { padding-top: 42px; border-top: 1px solid var(--line); }
.tp-related > h2 { margin-bottom: 25px !important; }

@media (hover: hover) {
  .tp-button.secondary:hover, .tp-theme:hover, .tp-toggle:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--soft); text-decoration: none; }
  .tp-link-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 35%, var(--card)); box-shadow: 0 7px 24px #24215208; }
}

/* Finished tools echo their own canvas materials in catalogs and related links. */
/* Reference symbols share their accent and placement throughout the topic catalog. */
.tp-reference-card .tp-link-kicker { padding-right: 42px; }
.tp-reference-card .tp-reference-icon { position: absolute; top: 20px; right: 22px; display: grid; place-items: center; width: 36px; height: 36px; color: var(--accent); pointer-events: none; }
.tp-reference-card .tp-reference-icon > svg { display: block; width: 36px; height: 36px; }
.tp-guide-card .tp-link-kicker { padding-right:42px; }
.tp-guide-icon { position:absolute; top:21px; right:23px; display:grid; place-items:center; width:32px; height:32px; color:var(--accent); pointer-events:none; }
.tp-guide-icon > svg { display:block; width:32px; height:32px; }
.tp-link-card.tp-tool-card {
  --tp-tool-accent: #7652b8;
  --tp-tool-edge: #c6b5e3;
  --tp-tool-from: #e9dff7;
  --tp-tool-to: #f4effb;
  --tp-tool-dot: #74589325;
  --tp-tool-glow: #ffffff78;
  --tp-tool-shadow: #65439012;
  border-color: var(--tp-tool-edge);
  background:
    radial-gradient(circle,var(--tp-tool-dot) .7px,transparent 1px) 0 0 / 19px 19px,
    radial-gradient(ellipse at 18% 4%,var(--tp-tool-glow),transparent 70%),
    linear-gradient(135deg,var(--tp-tool-from),var(--tp-tool-to));
  box-shadow: 0 4px 17px var(--tp-tool-shadow),inset 0 1px 0 #ffffff30;
  transition: border-color .2s ease,box-shadow .2s ease;
}
.tp-tool-card[data-tool-card="android"] {
  --tp-tool-accent: #197b58;
  --tp-tool-edge: #a2cbb6;
  --tp-tool-from: #ddefe4;
  --tp-tool-to: #f0f7f2;
  --tp-tool-dot: #3b6b5426;
  --tp-tool-shadow: #284d3c10;
}
.tp-tool-card[data-tool-card="iphone"] {
  --tp-tool-accent: #53647d;
  --tp-tool-edge: #bdc8d7;
  --tp-tool-from: #e1e7ef;
  --tp-tool-to: #f3f6fa;
  --tp-tool-dot: #52647d26;
  --tp-tool-shadow: #33455d10;
}
.tp-tool-card .tp-link-kicker { padding-right: 40px; color: var(--tp-tool-accent); }
.tp-tool-card .tp-tool-icon { position: absolute; top: 22px; right: 24px; display: grid; place-items: center; width: 32px; height: 32px; color: var(--tp-tool-accent); opacity: .86; pointer-events: none; }
.tp-tool-card .tp-tool-icon > svg { display: block; width: 30px; height: 30px; }
.tp-tool-card[data-tool-card="iphone"] .tp-tool-icon { grid-template: 32px / 32px; }
.tp-tool-card[data-tool-card="iphone"] .tp-tool-icon > svg { width: 34px; height: 34px; }
.tp-tool-card > svg { color: var(--tp-tool-accent); }
.tp-tool-card:focus-visible { outline-color: var(--tp-tool-accent); }
:root[data-theme="dark"] .tp-link-card.tp-tool-card {
  --tp-tool-accent: #c5a9ef; --tp-tool-edge: #594374;
  --tp-tool-from: #2e2542; --tp-tool-to: #211d32;
  --tp-tool-dot: #dcc7fb20; --tp-tool-glow: #bc9ce915; --tp-tool-shadow: #09051426;
}
:root[data-theme="dark"] .tp-tool-card[data-tool-card="android"] { --tp-tool-accent: #8ad5ad; --tp-tool-edge: #3b6854; --tp-tool-from: #203c30; --tp-tool-to: #172b23; --tp-tool-dot: #c9efdd1c; --tp-tool-glow: #a6e2bf14; --tp-tool-shadow: #07190d26; }
:root[data-theme="dark"] .tp-tool-card[data-tool-card="iphone"] { --tp-tool-accent: #bdcde2; --tp-tool-edge: #4c5d73; --tp-tool-from: #2d3848; --tp-tool-to: #202a38; --tp-tool-dot: #d4e0f01c; --tp-tool-glow: #c6d9f314; --tp-tool-shadow: #07101c26; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tp-link-card.tp-tool-card { --tp-tool-accent: #c5a9ef; --tp-tool-edge: #594374; --tp-tool-from: #2e2542; --tp-tool-to: #211d32; --tp-tool-dot: #dcc7fb20; --tp-tool-glow: #bc9ce915; --tp-tool-shadow: #09051426; }
  :root:not([data-theme="light"]) .tp-tool-card[data-tool-card="android"] { --tp-tool-accent: #8ad5ad; --tp-tool-edge: #3b6854; --tp-tool-from: #203c30; --tp-tool-to: #172b23; --tp-tool-dot: #c9efdd1c; --tp-tool-glow: #a6e2bf14; --tp-tool-shadow: #07190d26; }
  :root:not([data-theme="light"]) .tp-tool-card[data-tool-card="iphone"] { --tp-tool-accent: #bdcde2; --tp-tool-edge: #4c5d73; --tp-tool-from: #2d3848; --tp-tool-to: #202a38; --tp-tool-dot: #d4e0f01c; --tp-tool-glow: #c6d9f314; --tp-tool-shadow: #07101c26; }
}
@media (hover: hover) {
  .tp-link-card.tp-tool-card:hover {
    border-color: color-mix(in srgb,var(--tp-tool-accent) 68%,var(--tp-tool-edge));
    background:
      radial-gradient(circle,var(--tp-tool-dot) .7px,transparent 1px) 0 0 / 19px 19px,
      radial-gradient(ellipse at 18% 4%,var(--tp-tool-glow),transparent 70%),
      linear-gradient(135deg,var(--tp-tool-from),var(--tp-tool-to));
    box-shadow: 0 7px 23px color-mix(in srgb,var(--tp-tool-accent) 12%,transparent),inset 0 1px 0 #ffffff30;
  }
}
@media (max-width: 1000px) {
  .tp-hero { gap: 34px; }
}
@media (max-width: 880px) {
  .tp-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr); gap: 28px; padding-block: 44px 64px; }
  .topic-page h1 { font-size: clamp(34px, 5.2vw, 48px); }
  .tp-lead { font-size: 17px; }
  .tp-stage-top { padding: 15px; }
  .tp-stage-art { min-height: 230px; padding-inline: 10px; }
  .tp-stage-note { padding-inline: 17px; }
  .tp-device-picture > img { max-height:400px; }
  .tp-content-card { padding: 22px; }
  .tp-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .tp-hero { grid-template-columns: minmax(0, 1fr); gap: 34px; padding-block: 34px 55px; }
  .topic-page h1 { max-width: 600px; margin-bottom: 18px; font-size: clamp(34px, 7.4vw, 46px); }
  .tp-lead { max-width: 560px; font-size: 17px; }
  .tp-actions { margin-top: 25px; }
  .tp-stage { width: 100%; max-width: 480px; }
  .tp-stage-top { padding: 16px 20px; }
  .tp-stage-art { min-height: 245px; padding-top: 20px; }
  .tp-stage-art svg { max-width: 320px; }
  .tp-stage-note { padding-bottom: 20px; }
  .tp-model-hero { gap:30px; }
  .tp-device-picture { max-width:360px; }
  .tp-device-picture > img { max-height:350px; }
  .tp-content, .tp-catalog, .tp-related { padding-bottom: 52px; }
  .tp-content-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .tp-content-card { padding: 24px; }
  .tp-content-card h3 { font-size: 20px; }
  .tp-content-card p { font-size: 16px; }
  .tp-section-intro { margin-bottom: 24px; }
}
@media (max-width: 480px) {
  body.topic-page { --tp-content-gutter: 18px; }
  .tp-hero { padding-top: 29px; }
  .topic-page h1 { font-size: clamp(33px, 9vw, 42px); letter-spacing: -.04em; }
  .tp-eyebrow { font-size: 12px; }
  .tp-actions { gap: 10px; }
  .tp-button { flex: 1 1 auto; padding-inline: 16px; font-size: 14px; }
  .tp-stage-top { padding-inline: 16px; }
  .tp-stage-art { min-height: 220px; }
  .tp-link-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tp-link-card { min-height: 0; padding: 23px; }
  .tp-link-card h3 { font-size: 19px; }
  .tp-link-card p { padding-right: 20px; font-size: 15px; }
  .tp-link-kicker { margin-bottom: 12px; }
  .tp-content-card { padding: 22px; }
  .tp-catalog-group { margin-top: 35px; }
  .tp-related { padding-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .topic-page *, .topic-page *::before, .topic-page *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
