/* Trading Stacks: page-local styles using the shared dark/light palette. */
.ts-page {
  color: var(--hk-text);
}

.ts-page :is(h1, h2, h3, p) {
  margin-top: 0;
}

.ts-page :is(h1, h2, h3) {
  color: var(--hk-text);
  letter-spacing: -.025em;
}

.ts-page :is(a, article, section)[id] {
  scroll-margin-top: calc(var(--header-height, 76px) + 28px);
}

.ts-page a:focus-visible {
  outline: 2px solid var(--hk-accent);
  outline-offset: 5px;
}

.ts-hero {
  padding: 82px 0 72px;
  border-bottom: 1px solid var(--hk-border);
  background: linear-gradient(135deg, var(--hk-accent-subtle), transparent 66%), var(--hk-bg);
}

.ts-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
}

.ts-eyebrow,
.ts-step-number,
.ts-status,
.ts-license-tag,
.ts-license-list > li > div > span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.ts-eyebrow {
  margin-bottom: 16px;
  color: var(--hk-accent);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.ts-hero h1 {
  max-width: 14ch;
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 760;
  line-height: 1.08;
}

.ts-lead {
  max-width: 51ch;
  margin-bottom: 26px;
  color: var(--hk-text-secondary);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.65;
}

.ts-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ts-hero-note {
  max-width: 57ch;
  margin: 20px 0 0;
  color: var(--hk-text-muted);
  font-size: .83rem;
  line-height: 1.65;
}

.ts-workflow {
  padding: 29px 30px 12px;
  border: 1px solid var(--hk-border);
  border-radius: var(--radius, 18px);
  background: var(--hk-surface);
}

.ts-workflow > .ts-eyebrow {
  margin-bottom: 8px;
}

.ts-workflow h2 {
  margin-bottom: 20px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.ts-workflow-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ts-workflow-list li {
  display: flex;
  gap: 18px;
  padding: 17px 0;
  border-top: 1px solid var(--hk-border);
}

.ts-step-number {
  flex: 0 0 auto;
  color: var(--hk-accent);
  font-size: .78rem;
  font-weight: 600;
}

.ts-workflow-list strong {
  display: block;
  margin-bottom: 3px;
  font-size: .92rem;
  font-weight: 650;
}

.ts-workflow-list p {
  margin-bottom: 0;
  color: var(--hk-text-muted);
  font-size: .83rem;
  line-height: 1.55;
}

.ts-section {
  padding: 72px 0;
}

.ts-section-heading {
  max-width: 740px;
  margin-bottom: 30px;
}

.ts-section-heading .ts-eyebrow {
  margin-bottom: 10px;
}

.ts-section-heading h2,
.ts-licensing h2,
.ts-cta h2 {
  margin-bottom: 16px;
  font-size: clamp(1.7rem, 2.7vw, 2.4rem);
  line-height: 1.18;
}

.ts-section-heading > p:last-child,
.ts-cta p:last-child {
  margin-bottom: 0;
  color: var(--hk-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.ts-system-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--hk-border-strong);
  border-radius: 12px;
  list-style: none;
  background: var(--hk-surface);
}

.ts-system-list > li + li {
  border-top: 1px solid var(--hk-border);
}

.ts-system-link {
  display: grid;
  grid-template-columns: minmax(170px, .9fr) minmax(0, 2fr) minmax(150px, .8fr) 16px;
  align-items: center;
  gap: 12px 20px;
  min-width: 0;
  min-height: 64px;
  padding: 14px 18px;
  color: var(--hk-text);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.ts-system-list > li:first-child .ts-system-link { border-radius: 11px 11px 0 0; }
.ts-system-list > li:last-child .ts-system-link { border-radius: 0 0 11px 11px; }

.ts-system-link:hover,
.ts-system-link:focus-visible {
  background: var(--hk-surface-hover);
}

.ts-system-name {
  min-width: 0;
  color: var(--hk-text);
  font-size: .97rem;
  font-weight: 650;
  line-height: 1.4;
}

.ts-system-purpose {
  min-width: 0;
  color: var(--hk-text-secondary);
  font-size: .88rem;
  line-height: 1.5;
}

.ts-system-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 10px;
  color: var(--hk-text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .75rem;
  line-height: 1.5;
}

.ts-system-meta > span { white-space: nowrap; }
.ts-system-meta .ts-system-preview { color: var(--hk-warning); }
.ts-system-arrow { color: var(--hk-accent); font-size: 1rem; text-align: center; }

.ts-own-system {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  margin: 12px 0 32px;
  padding: 0 2px;
}

.ts-own-system p {
  margin: 0;
  color: var(--hk-text-secondary);
  font-size: .85rem;
  line-height: 1.5;
}

.ts-own-system a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--hk-accent);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ts-own-system a:hover { color: var(--hk-accent-hover); }

@media (max-width: 760px) {
  .ts-system-link { grid-template-columns: minmax(0, 1fr) 16px; gap: 6px 12px; padding: 15px 16px; }
  .ts-system-name { grid-column: 1; grid-row: 1; }
  .ts-system-purpose { grid-column: 1 / -1; grid-row: 2; }
  .ts-system-meta { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
  .ts-system-arrow { grid-column: 2; grid-row: 1; }
  .ts-own-system { gap: 4px; margin-bottom: 26px; padding-inline: 2px; }
}

.ts-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.ts-profile {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--hk-border);
  border-radius: var(--radius, 18px);
  background: var(--hk-surface);
}

.ts-profile:target {
  border-color: var(--hk-border-active);
  box-shadow: 0 0 0 3px var(--hk-focus-ring);
}

.ts-profile-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 18px;
}

.ts-profile-topline > .ts-eyebrow {
  flex: 1 1 120px;
  margin-bottom: 0;
  font-size: .64rem;
  line-height: 1.65;
  letter-spacing: .08em;
}

.ts-status {
  display: inline-block;
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--hk-border);
  border-radius: 4px;
  color: var(--hk-text-muted);
  background: var(--hk-bg-alt);
  font-size: .65rem;
  line-height: 1.5;
  white-space: nowrap;
}

.ts-status--preview {
  color: var(--hk-warning);
  border-color: var(--hk-warning);
}

.ts-profile h3 {
  margin-bottom: 16px;
  font-size: 1.65rem;
  line-height: 1.2;
}

.ts-profile p:not(.ts-eyebrow) {
  color: var(--hk-text-secondary);
  font-size: .94rem;
  line-height: 1.7;
}

.ts-profile-list {
  display: grid;
  gap: 10px;
  margin: 0 0 26px;
  padding-left: 18px;
  color: var(--hk-text-secondary);
  font-size: .88rem;
  line-height: 1.6;
}

.ts-profile-list li::marker {
  color: var(--hk-accent-muted);
}

.ts-profile-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--hk-border);
}

.ts-license-tag {
  color: var(--hk-text-muted);
  font-size: .71rem;
}

.ts-text-link {
  color: var(--hk-accent);
  font-size: .84rem;
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-color: var(--hk-border-strong);
  text-underline-offset: 4px;
}

.ts-text-link:hover {
  color: var(--hk-accent-hover);
  text-decoration-color: currentColor;
}

.ts-text-link > span {
  display: inline-block;
  margin-left: 3px;
}

.ts-profile--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 36px;
  padding: 36px;
  border-color: var(--hk-border-strong);
  background: linear-gradient(120deg, var(--hk-accent-subtle), transparent 60%), var(--hk-surface);
}

.ts-profile--featured .ts-profile-topline {
  align-items: center;
  justify-content: flex-start;
}

.ts-profile--featured .ts-profile-topline > .ts-eyebrow {
  flex: 0 1 auto;
  font-size: .69rem;
}

.ts-profile--featured h3 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.ts-version {
  color: var(--hk-accent);
  white-space: nowrap;
}

.ts-profile .ts-profile-intro {
  color: var(--hk-text);
  font-size: 1.05rem;
}

.ts-featured-copy > .ts-text-link {
  display: inline-block;
  margin-top: 4px;
}

.ts-evaluation {
  align-self: stretch;
  padding-left: 32px;
  border-left: 1px solid var(--hk-border);
}

.ts-evaluation > .ts-eyebrow {
  margin-bottom: 12px;
  font-size: .68rem;
}

.ts-scope-list {
  display: grid;
  gap: 19px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ts-scope-list strong,
.ts-scope-list span {
  display: block;
}

.ts-scope-list strong {
  margin-bottom: 5px;
  color: var(--hk-text);
  font-size: .93rem;
}

.ts-scope-list span {
  color: var(--hk-text-muted);
  font-size: .86rem;
  line-height: 1.65;
}

.ts-profile--custom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 36px;
  padding: 32px 36px;
}

.ts-profile--custom .ts-profile-topline {
  align-items: center;
  justify-content: flex-start;
}

.ts-profile--custom .ts-profile-topline > .ts-eyebrow {
  flex: 0 1 auto;
}

.ts-profile--custom h3 {
  font-size: 1.45rem;
}

.ts-profile--custom > div > p:last-child {
  margin-bottom: 0;
}

.ts-custom-scope {
  align-self: center;
  padding-left: 32px;
  border-left: 1px solid var(--hk-border);
}

.ts-section--band {
  border-top: 1px solid var(--hk-border);
  border-bottom: 1px solid var(--hk-border);
  background: var(--hk-bg-alt);
}

.ts-delivery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.ts-delivery-item {
  padding-top: 22px;
  border-top: 1px solid var(--hk-border-strong);
}

.ts-delivery-item h3 {
  margin: 15px 0 12px;
  font-size: 1.2rem;
}

.ts-delivery-item p {
  margin-bottom: 0;
  color: var(--hk-text-secondary);
  font-size: .93rem;
  line-height: 1.7;
}

.ts-licensing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
}

.ts-licensing .ts-eyebrow {
  margin-bottom: 10px;
}

.ts-licensing h2 {
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
}

.ts-licensing p:not(.ts-eyebrow) {
  margin-bottom: 14px;
  color: var(--hk-text-secondary);
  font-size: .88rem;
  line-height: 1.75;
}

.ts-license-list {
  align-self: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ts-license-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid var(--hk-border);
}

.ts-license-list > li:first-child {
  padding-top: 0;
}

.ts-license-list > li > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-license-list strong {
  font-size: .9rem;
  font-weight: 600;
}

.ts-license-list > li > div > span {
  color: var(--hk-text-muted);
  font-size: .73rem;
}

.ts-license-list .ts-text-link {
  flex-shrink: 0;
  font-size: .78rem;
}

.ts-cta-section {
  padding-top: 0;
  padding-bottom: 40px;
}

.ts-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 38px 40px;
  border: 1px solid var(--hk-border-strong);
  border-radius: var(--radius, 18px);
  background: var(--hk-surface);
}

.ts-cta > div {
  max-width: 700px;
}

.ts-cta .ts-eyebrow {
  margin-bottom: 10px;
}

.ts-cta h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
}

.ts-cta .btn {
  flex: 0 0 auto;
}

.ts-page-note {
  padding: 0 0 35px;
}

.ts-page-note p {
  max-width: 950px;
  margin-bottom: 0;
  color: var(--hk-text-muted);
  font-size: .76rem;
  line-height: 1.75;
}

@media (max-width: 1050px) {
  .ts-profile-grid { gap: 16px; }
  .ts-profile { padding: 24px; }
  .ts-profile-topline { min-height: 52px; }
  .ts-profile--featured .ts-profile-topline,
  .ts-profile--custom .ts-profile-topline { min-height: 0; }
  .ts-hero-grid { gap: 36px; }
  .ts-workflow { padding: 24px 24px 10px; }
  .ts-cta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 800px) {
  .ts-hero { padding: 60px 0; }
  .ts-hero-grid { grid-template-columns: 1fr; }
  .ts-hero h1 { max-width: 18ch; }
  .ts-workflow-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .ts-workflow-list li { gap: 12px; }
  .ts-section { padding: 52px 0; }
  .ts-profile-grid { grid-template-columns: 1fr; }
  .ts-profile-topline { min-height: 0; }
  .ts-profile--featured,
  .ts-profile--custom { grid-template-columns: 1fr; gap: 26px; padding: 28px; }
  .ts-evaluation,
  .ts-custom-scope { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--hk-border); }
  .ts-scope-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  .ts-profile-bottom { margin-top: 0; }
  .ts-delivery-grid { gap: 24px; }
  .ts-licensing-grid { grid-template-columns: 1fr; gap: 32px; }
  .ts-cta-section { padding-top: 0; padding-bottom: 32px; }
  .ts-cta { padding: 30px; }
}

@media (max-width: 560px) {
  .ts-hero { padding: 42px 0; }
  .ts-hero h1 { font-size: clamp(2.25rem, 9.5vw, 3rem); }
  .ts-actions { align-items: stretch; flex-direction: column; }
  .ts-actions .btn { width: 100%; justify-content: center; }
  .ts-workflow-list,
  .ts-scope-list,
  .ts-delivery-grid { grid-template-columns: 1fr; }
  .ts-workflow { padding: 24px 22px 8px; }
  .ts-workflow-list li { gap: 16px; }
  .ts-section { padding: 42px 0; }
  .ts-section-heading { margin-bottom: 24px; }
  .ts-profile,
  .ts-profile--featured,
  .ts-profile--custom { padding: 24px; }
  .ts-profile h3 { font-size: 1.6rem; }
  .ts-profile--featured h3 { font-size: 1.95rem; }
  .ts-evaluation { padding-top: 21px; }
  .ts-scope-list { gap: 16px; }
  .ts-delivery-grid { gap: 28px; }
  .ts-license-list > li { gap: 10px; }
  .ts-cta-section { padding-top: 0; padding-bottom: 28px; }
  .ts-cta { gap: 24px; padding: 26px 24px; }
  .ts-cta .btn { width: 100%; justify-content: center; }
  .ts-page-note { padding-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .ts-page a { transition: none; }
}

@media (forced-colors: active) {
  .ts-profile,
  .ts-workflow,
  .ts-status,
  .ts-cta,
  .ts-system-list,
  .ts-system-list > li + li { border-color: CanvasText; }
  .ts-profile:target { outline: 2px solid Highlight; box-shadow: none; }
}
