:root { --tf-ease-standard: cubic-bezier(0.3, 0, 0.2, 1); --tf-ease-enter: cubic-bezier(0.1, 0.8, 0.25, 1); --tf-ease-exit: cubic-bezier(0.4, 0, 0.9, 0.6); }
body { margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 1.6; background: var(--bg); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
.tf-row { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; padding: var(--space-lg); }
.tf-col { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-lg); }
.tf-ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Button */
.tf-btn { font: inherit; font-size: 14px; font-weight: 500; line-height: 1; height: var(--control-md); padding: 0 var(--space-lg); border-radius: var(--radius-button); border: 1px solid var(--border); background: var(--input); color: var(--text-primary); box-shadow: var(--shadow-button); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); transition: background-color .12s var(--tf-ease-standard), border-color .12s var(--tf-ease-standard), box-shadow .12s var(--tf-ease-standard); white-space: nowrap; }
.tf-btn:hover { border-color: var(--border-hover); background: var(--surface); }
.tf-btn:active, .tf-btn.is-pressed { transition-duration: .06s; transform: translateY(1px); box-shadow: var(--shadow-pressed); background: var(--bg); }
.tf-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--shadow-focus); }
.tf-btn-sm { height: var(--control-sm); padding: 0 var(--space-md); font-size: 13px; }
.tf-btn-lg { height: var(--control-lg); padding: 0 20px; }
.tf-btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tf-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.tf-btn-primary:active, .tf-btn-primary.is-pressed { background: var(--primary-pressed); border-color: var(--primary-pressed); }
.tf-btn-danger { background: var(--danger-strong); border-color: var(--danger-strong); color: #ffffff; }
.tf-btn-danger:hover { filter: brightness(1.06); background: var(--danger-strong); border-color: var(--danger-strong); }
.tf-btn-text { background: transparent; border-color: transparent; box-shadow: none; color: var(--link); padding: 0 var(--space-sm); }
.tf-btn-text:hover { background: var(--primary-soft); border-color: transparent; }
.tf-btn-text:active, .tf-btn-text.is-pressed { background: var(--primary-soft); box-shadow: none; }
.tf-btn:disabled, .tf-btn:disabled:hover { cursor: not-allowed; transform: none; filter: none; box-shadow: none; background: var(--bg); border-color: var(--border-disabled); color: var(--text-tertiary); }
.tf-btn-primary:disabled, .tf-btn-primary:disabled:hover { background: var(--primary-disabled); border-color: var(--primary-disabled); color: var(--on-primary); }
.tf-btn-text:disabled, .tf-btn-text:disabled:hover { background: transparent; border-color: transparent; }

/* ArrowLink */
.tf-arrow { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--link); font-weight: 500; text-decoration: none; font-size: 14px; }
.tf-arrow .tf-ico { transition: transform .12s var(--tf-ease-standard); }
.tf-arrow:hover .tf-ico { transform: translateX(2px); }
.tf-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }
.tf-arrow:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-tag); }

/* Input */
.tf-field { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 220px; }
.tf-field-label { font-size: 12px; color: var(--text-secondary); }
.tf-input { font: inherit; font-size: 14px; height: var(--control-md); padding: 0 var(--space-md); border-radius: var(--radius-input); border: 1px solid var(--border); background: var(--input); color: var(--text-primary); box-shadow: var(--shadow-input); transition: border-color .12s var(--tf-ease-standard), box-shadow .12s var(--tf-ease-standard); box-sizing: border-box; width: 100%; }
.tf-input::placeholder { color: var(--text-tertiary); }
.tf-input:hover { border-color: var(--border-hover); }
.tf-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--shadow-input), var(--shadow-focus); }
.tf-input:disabled { background: var(--bg); border-color: var(--border-disabled); color: var(--text-tertiary); cursor: not-allowed; }
.tf-input.is-error { border-color: var(--danger); }
.tf-field-hint { font-size: 12px; color: var(--text-secondary); }
.tf-field-hint.is-error { color: var(--danger-text); }

/* Tabs */
.tf-tabs { display: flex; gap: var(--space-xs); border-bottom: 1px solid var(--border); }
.tf-tab { font: inherit; font-size: 14px; background: transparent; border: 0; color: var(--text-secondary); padding: 0 var(--space-md); height: 40px; cursor: pointer; position: relative; border-radius: var(--radius-tag) var(--radius-tag) 0 0; }
.tf-tab:hover { color: var(--text-primary); background: var(--surface); }
.tf-tab.is-active { color: var(--link); font-weight: 500; }
.tf-tab.is-active::after { content: ""; position: absolute; left: var(--space-md); right: var(--space-md); bottom: -1px; height: var(--indicator-width); background: var(--primary); }
.tf-tab:disabled { color: var(--text-tertiary); cursor: not-allowed; background: transparent; }
.tf-tab:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.tf-tabs-seg { border: 1px solid var(--border); border-radius: var(--radius-button); padding: 2px; gap: 2px; background: var(--bg); display: inline-flex; }
.tf-tabs-seg .tf-tab { height: 28px; border-radius: var(--radius-tag); }
.tf-tabs-seg .tf-tab.is-active { background: var(--input); box-shadow: var(--shadow-button); color: var(--link); }
.tf-tabs-seg .tf-tab.is-active::after { display: none; }

/* Card */
.tf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--space-lg); }
.tf-card-lg { border-radius: var(--radius-card-lg); }
.tf-card-title { margin: 0 0 var(--space-xs); font-size: 16px; line-height: 1.5; font-weight: 600; }
.tf-card-meta { margin: 0; font-size: 12px; color: var(--text-secondary); }
.tf-card.is-interactive { cursor: pointer; transition: box-shadow .12s var(--tf-ease-standard), border-color .12s var(--tf-ease-standard); }
.tf-card.is-interactive:hover { box-shadow: var(--shadow-hover); border-color: var(--border-hover); }

/* StatusTag */
.tf-tag { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: 12px; line-height: 20px; padding: 0 var(--space-sm); border-radius: var(--radius-tag); background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.tf-tag-info { background: var(--primary-soft); color: var(--link); border-color: transparent; }
.tf-tag-success { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.tf-tag-warning { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.tf-tag-danger { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }

/* Toast */
.tf-toast { display: flex; align-items: center; gap: var(--space-sm); min-width: 260px; max-width: 420px; padding: 10px var(--space-md); background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-popover); box-shadow: var(--shadow-hover); font-size: 14px; }
.tf-toast-text { flex: 1; }
.tf-toast-success .tf-toast-mark { color: var(--success); }
.tf-toast-warning .tf-toast-mark { color: var(--warning); }
.tf-toast-danger .tf-toast-mark { color: var(--danger); }
.tf-toast-info .tf-toast-mark { color: var(--primary); }
.tf-x { font: inherit; background: transparent; border: 0; color: var(--icon); cursor: pointer; width: 24px; height: 24px; border-radius: var(--radius-tag); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tf-x:hover { background: var(--bg); color: var(--text-primary); }
.tf-x:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Modal */
.tf-overlay { position: fixed; inset: 0; background: rgba(15, 18, 22, 0.40); display: flex; align-items: center; justify-content: center; padding: var(--space-lg); }
.tf-overlay.is-inline { position: relative; inset: auto; min-height: 100%; box-sizing: border-box; }
.tf-modal { width: 100%; max-width: 420px; background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-modal); box-shadow: var(--shadow-modal); overflow: hidden; }
.tf-modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border); }
.tf-modal-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; }
.tf-modal-body { padding: var(--space-lg); color: var(--text-secondary); }
.tf-modal-foot { display: flex; justify-content: flex-end; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border); background: var(--surface); }

/* Sidebar */
.tf-side { width: var(--sidebar-width); background: var(--surface); border-right: 1px solid var(--border); padding: var(--space-sm); box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; }
.tf-side-item { font: inherit; display: flex; align-items: center; gap: var(--space-sm); height: 32px; padding: 0 var(--space-sm); border-radius: var(--radius-button); border: 0; background: transparent; color: var(--text-primary); cursor: pointer; text-align: left; font-size: 14px; }
.tf-side-item .tf-ico { color: var(--icon); }
.tf-side-item:hover { background: var(--bg); }
.tf-side-item.is-active { background: var(--primary-soft); color: var(--link); font-weight: 500; }
.tf-side-item.is-active .tf-ico { color: var(--primary); }
.tf-side-item:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* SiteNav */
.tf-nav { height: var(--sitenav-height); display: flex; align-items: center; gap: var(--space-xl); padding: 0 var(--space-xl); background: var(--input); border-bottom: 1px solid var(--border-strong); }
.tf-nav-brand { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--text-primary); text-decoration: none; }
.tf-nav-links { display: flex; gap: var(--space-xs); flex: 1; height: 100%; }
.tf-nav-link { display: inline-flex; align-items: center; padding: 0 var(--space-md); color: var(--text-secondary); text-decoration: none; font-size: 14px; position: relative; }
.tf-nav-link:hover { color: var(--text-primary); }
.tf-nav-link.is-active { color: var(--text-primary); font-weight: 500; }
.tf-nav-link.is-active::after { content: ""; position: absolute; left: var(--space-md); right: var(--space-md); bottom: -1px; height: var(--indicator-width); background: var(--primary); }
.tf-nav-actions { display: flex; gap: var(--space-sm); }

/* AnnounceBar */
.tf-announce { display: flex; align-items: center; justify-content: center; gap: var(--space-md); min-height: 36px; padding: 0 var(--space-lg); background: var(--band); color: var(--on-band); font-size: 13px; }
.tf-announce-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--on-band-muted); text-transform: uppercase; }
.tf-announce .tf-arrow { color: var(--on-band); font-size: 13px; }

/* Eyebrow */
.tf-eyebrow { font-family: var(--font-mono); font-size: 12px; line-height: 1.4; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); display: inline-flex; gap: var(--space-sm); align-items: center; }
.tf-eyebrow-num { color: var(--link); }
.tf-band .tf-eyebrow, .tf-band .tf-eyebrow-num { color: var(--on-band-muted); }

/* Hero */
.tf-hero { position: relative; background: var(--input); padding: var(--space-5xl) var(--space-xxl); overflow: hidden; border-bottom: 1px solid var(--border-strong); }
.tf-hero.has-dots::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--grid-dot) 1.5px, transparent 1.6px); background-size: var(--space-xl) var(--space-xl); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%); mask-image: linear-gradient(to bottom, #000 30%, transparent 100%); pointer-events: none; }
.tf-hero-inner { position: relative; max-width: var(--container-width); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-md); align-items: flex-start; }
.tf-hero-title { margin: 0; font-family: var(--font-display); font-size: 56px; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; max-width: 16em; }
.tf-hero-lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--text-secondary); max-width: 36em; }
.tf-hero-actions { display: flex; gap: var(--space-md); margin-top: var(--space-md); }
.tf-hero.is-compact { padding: var(--space-3xl) var(--space-xl); }
.tf-hero.is-compact .tf-hero-title { font-size: 32px; line-height: 1.2; letter-spacing: -0.015em; }
.tf-hero.is-compact .tf-hero-lead { font-size: 15px; }

/* StatStrip */
.tf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--input); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.tf-stat { padding: var(--space-xl) var(--space-xxl); border-left: 1px solid var(--border-strong); }
.tf-stat:first-child { border-left: 0; }
.tf-stat-value { font-family: var(--font-mono); font-size: 40px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; color: var(--text-primary); }
.tf-stat-label { margin-top: var(--space-xs); font-size: 12px; color: var(--text-secondary); }

/* FeatureGrid */
.tf-grid { display: grid; grid-template-columns: repeat(var(--tf-cols, 3), 1fr); gap: 1px; background: var(--border-strong); border: 1px solid var(--border-strong); border-radius: var(--radius-card-lg); overflow: hidden; }
.tf-cell { background: var(--input); padding: var(--space-xxl); display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-start; transition: background-color .12s var(--tf-ease-standard); }
.tf-cell.is-wide { grid-column: span 2; }
.tf-cell:hover { background: var(--surface); }
.tf-cell-icon { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-button); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); background: var(--input); box-shadow: var(--shadow-button); margin-bottom: var(--space-xs); }
.tf-cell-icon .tf-ico { width: 20px; height: 20px; }
.tf-cell-title { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 600; }
.tf-cell-body { margin: 0; color: var(--text-secondary); font-size: 14px; flex: 1; }
.tf-grid.is-compact .tf-cell { padding: var(--space-lg); }

/* InkBand */
.tf-band { background: var(--band); color: var(--on-band); padding: var(--space-5xl) var(--space-xxl); }
.tf-band-inner { max-width: var(--container-width); margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-xl); flex-wrap: wrap; }
.tf-band-title { margin: var(--space-md) 0 0; font-family: var(--font-display); font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; color: var(--on-band); max-width: 18em; }
.tf-band-body { margin: var(--space-sm) 0 0; color: var(--on-band-muted); max-width: 36em; }
.tf-band .tf-btn:not(.tf-btn-primary) { background: transparent; color: var(--on-band); border-color: var(--on-band-muted); box-shadow: none; }
.tf-band .tf-btn:not(.tf-btn-primary):hover { background: rgba(255, 255, 255, 0.08); }
.tf-band.is-compact { padding: var(--space-3xl) var(--space-xl); }

/* Smooth corners: progressive enhancement, falls back to plain border-radius */
@supports (corner-shape: superellipse(1.5)) {
  .tf-btn, .tf-input, .tf-tabs-seg, .tf-side-item, .tf-cell-icon { corner-shape: var(--corner-smooth); border-radius: calc(var(--radius-button) * var(--corner-smooth-scale)); }
  .tf-card, .tf-toast { corner-shape: var(--corner-smooth); border-radius: calc(var(--radius-card) * var(--corner-smooth-scale)); }
  .tf-card-lg, .tf-grid { corner-shape: var(--corner-smooth); border-radius: calc(var(--radius-card-lg) * var(--corner-smooth-scale)); }
  .tf-modal { corner-shape: var(--corner-smooth); border-radius: calc(var(--radius-modal) * var(--corner-smooth-scale)); }
}
@keyframes tf-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tf-toast, .tf-modal { animation: tf-enter .16s var(--tf-ease-enter); }
@media (prefers-reduced-motion: reduce) { .tf-btn, .tf-arrow .tf-ico, .tf-card, .tf-cell { transition: none; } .tf-arrow:hover .tf-ico { transform: none; } .tf-toast, .tf-modal { animation: none; } }
