/* ============================================
   Metamech — Global Styles
   Uses WebAwesome semantic tokens throughout.
   No hardcoded colors.
   ============================================ */

/* --- Layout --- */

.container {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: var(--wa-space-l);
}

/* --- Header --- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--wa-color-surface-base);
	border-bottom: 1px solid var(--wa-color-border-base);
	backdrop-filter: blur(8px);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: var(--wa-space-m);
	height: 4rem;
}

.logo {
	display: flex;
	align-items: center;
	gap: var(--wa-space-s);
	text-decoration: none;
	color: var(--wa-color-text-base);
	font-weight: 700;
	font-size: 1.25rem;
	margin-right: auto;
}

.logo-icon {
	width: 2rem;
	height: 2rem;
}

.desktop-nav {
	display: flex;
	align-items: center;
	gap: var(--wa-space-m);
}

.desktop-nav a {
	text-decoration: none;
	color: var(--wa-color-text-muted);
	font-size: 0.925rem;
	font-weight: 500;
	padding: var(--wa-space-xs) var(--wa-space-s);
	border-radius: var(--wa-border-radius-m);
	transition: color 0.15s ease;
}

.desktop-nav a:hover {
	color: var(--wa-color-text-base);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: var(--wa-space-2xs);
}

.mobile-only {
	display: none;
}

/* --- Mobile Nav --- */

.mobile-nav {
	display: flex;
	flex-direction: column;
	padding: var(--wa-space-m);
}

.mobile-nav a {
	display: block;
	text-decoration: none;
	color: var(--wa-color-text-base);
	font-size: 1.1rem;
	padding: var(--wa-space-s) 0;
}

@media (max-width: 768px) {
	.desktop-nav {
		display: none;
	}

	.mobile-only {
		display: inline-flex;
	}
}

/* --- Hero --- */

.hero {
	text-align: center;
	padding: var(--wa-space-4xl) var(--wa-space-l);
}

.hero h1 {
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--wa-color-text-base);
	margin-bottom: var(--wa-space-m);
}

.hero-subtitle {
	font-size: clamp(1.05rem, 2vw, 1.35rem);
	color: var(--wa-color-text-muted);
	max-width: 38rem;
	margin-inline: auto;
	line-height: 1.6;
}

.hero-sm {
	padding: var(--wa-space-2xl) var(--wa-space-l);
}

.hero-sm h1 {
	font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.hero-actions {
	margin-top: var(--wa-space-xl);
}

/* --- Sections --- */

.section {
	padding: var(--wa-space-4xl) 0;
}

.section-alt {
	background: var(--wa-color-surface-alt);
}

.section-heading {
	text-align: center;
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 700;
	margin-bottom: var(--wa-space-s);
	color: var(--wa-color-text-base);
}

.section-subheading {
	text-align: center;
	color: var(--wa-color-text-muted);
	font-size: 1.1rem;
	margin-bottom: var(--wa-space-2xl);
}

/* --- Grid --- */

.grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wa-space-l);
}

@media (min-width: 640px) {
	.grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* --- Value Cards --- */

.value-card {
	text-align: center;
	padding: var(--wa-space-l);
}

.value-icon {
	font-size: 2rem;
	color: var(--wa-color-brand-base);
	margin-bottom: var(--wa-space-m);
}

.value-card h2,
.value-card h3 {
	font-size: 1.2rem;
	font-weight: 600;
	margin-bottom: var(--wa-space-s);
	color: var(--wa-color-text-base);
}

.value-card p {
	color: var(--wa-color-text-muted);
	line-height: 1.65;
}

/* --- Product Cards --- */

.product-card-inner {
	text-align: center;
	padding: var(--wa-space-l);
}

.product-icon {
	font-size: 2.5rem;
	color: var(--wa-color-brand-base);
	margin-bottom: var(--wa-space-m);
}

.product-card-inner h3 {
	font-size: 1.2rem;
	font-weight: 600;
	margin-bottom: var(--wa-space-s);
	color: var(--wa-color-text-base);
}

.product-card-inner p {
	color: var(--wa-color-text-muted);
	line-height: 1.65;
	margin-bottom: var(--wa-space-m);
}

/* --- Newsletter --- */

.newsletter-section {
	text-align: center;
	max-width: 32rem;
}

.newsletter-icon {
	font-size: 2rem;
	color: var(--wa-color-brand-base);
	margin-bottom: var(--wa-space-m);
}

.newsletter-section h2 {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: var(--wa-space-s);
	color: var(--wa-color-text-base);
}

.newsletter-section p {
	color: var(--wa-color-text-muted);
	margin-bottom: var(--wa-space-l);
}

.newsletter-form {
	display: flex;
	gap: var(--wa-space-s);
	justify-content: center;
}

.newsletter-input {
	flex: 1;
	min-width: 0;
}

@media (max-width: 480px) {
	.newsletter-form {
		flex-direction: column;
	}
}

/* --- Footer --- */

.site-footer {
	padding: var(--wa-space-2xl) 0 var(--wa-space-l);
}

.footer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
	gap: var(--wa-space-xl);
	padding: var(--wa-space-xl) 0;
}

.footer-section h3 {
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wa-color-text-muted);
	margin-bottom: var(--wa-space-m);
}

.footer-section nav {
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-s);
}

.footer-section nav a {
	text-decoration: none;
	color: var(--wa-color-text-base);
	font-size: 0.925rem;
	transition: color 0.15s ease;
}

.footer-section nav a:hover {
	color: var(--wa-color-brand-base);
}

.social-links {
	display: flex;
	gap: var(--wa-space-m);
}

.social-links a {
	color: var(--wa-color-text-muted);
	font-size: 1.25rem;
	transition: color 0.15s ease;
}

.social-links a:hover {
	color: var(--wa-color-brand-base);
}

.copyright {
	text-align: center;
	color: var(--wa-color-text-muted);
	font-size: 0.85rem;
	padding-top: var(--wa-space-l);
}

/* --- Prose (long-form text) --- */

.prose {
	max-width: 48rem;
	margin-inline: auto;
}

.prose h1 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 800;
	margin-bottom: var(--wa-space-m);
	color: var(--wa-color-text-base);
}

.prose h2 {
	font-size: 1.4rem;
	font-weight: 700;
	margin-top: var(--wa-space-2xl);
	margin-bottom: var(--wa-space-s);
	color: var(--wa-color-text-base);
}

.prose h3 {
	font-size: 1.15rem;
	font-weight: 600;
	margin-top: var(--wa-space-xl);
	margin-bottom: var(--wa-space-xs);
	color: var(--wa-color-text-base);
}

.prose p {
	color: var(--wa-color-text-muted);
	line-height: 1.75;
	margin-bottom: var(--wa-space-m);
}

.prose ul {
	color: var(--wa-color-text-muted);
	line-height: 1.75;
	margin-bottom: var(--wa-space-m);
	padding-left: var(--wa-space-xl);
}

.prose li {
	margin-bottom: var(--wa-space-xs);
}

.prose a {
	color: var(--wa-color-brand-base);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.prose a:hover {
	text-decoration: none;
}

/* --- Utilities --- */

.text-muted {
	color: var(--wa-color-text-muted);
}

/* --- Smooth scrolling --- */

html {
	scroll-behavior: smooth;
}

/* --- Blog Cards --- */

.blog-card-inner {
	padding: var(--wa-space-l);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.blog-card-inner h2 {
	font-size: 1.2rem;
	font-weight: 600;
	margin-bottom: var(--wa-space-s);
	color: var(--wa-color-text-base);
}

.blog-card-inner h2 a {
	text-decoration: none;
	color: inherit;
	transition: color 0.15s ease;
}

.blog-card-inner h2 a:hover {
	color: var(--wa-color-brand-base);
}

.blog-card-inner > p {
	color: var(--wa-color-text-muted);
	line-height: 1.65;
	margin-bottom: var(--wa-space-m);
	flex: 1;
}

.blog-card {
	transition: transform 0.15s ease;
}

.blog-card:hover {
	transform: translateY(-2px);
}

/* --- Post Meta --- */

.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wa-space-s);
	color: var(--wa-color-text-muted);
	font-size: 0.875rem;
}

.post-meta-item {
	display: inline-flex;
	align-items: center;
	gap: var(--wa-space-2xs);
}

/* --- Post Header --- */

.post-header {
	margin-bottom: var(--wa-space-2xl);
}

.post-header h1 {
	margin-bottom: var(--wa-space-m);
}

/* --- Home Post Stream --- */

/* Overrides .prose h2 (0,1,1) — the stream title is a post title, not a subhead. */
.prose .post-stream-title {
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 800;
	line-height: 1.2;
	margin-top: 0;
	margin-bottom: var(--wa-space-m);
}

/* Overrides .prose a (0,1,1) — title links are not body links. */
.prose .post-stream-title a {
	color: var(--wa-color-text-normal);
	text-decoration: none;
	transition: color 0.15s ease;
}

.prose .post-stream-title a:hover {
	color: var(--wa-color-text-link);
}

/* Overrides .prose a (0,1,1) — the permalink is an affordance, not a body link. */
.prose .post-stream-permalink a {
	text-decoration: none;
}

/* Match the .prose measure so the rule does not span the full container. */
.post-stream-divider {
	max-width: 48rem;
	margin-block: var(--wa-space-3xl);
	margin-inline: auto;
}

.archive-link {
	text-align: center;
	margin-top: var(--wa-space-4xl);
}

/* --- Contact Form --- */

.contact-form {
	max-width: 40rem;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-m);
}

.form-field {
	display: flex;
	flex-direction: column;
}

/* --- FAQ --- */

.faq-section {
	max-width: 48rem;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-s);
}

.faq-section p {
	color: var(--wa-color-text-muted);
	line-height: 1.75;
	margin: var(--wa-space-s) 0 0;
}

.faq-section a {
	color: var(--wa-color-brand-base);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.faq-section a:hover {
	text-decoration: none;
}

/* --- Docs Grid --- */

.docs-grid {
	grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
	.docs-grid {
		grid-template-columns: 1fr;
	}
}

.docs-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
	transition: transform 0.15s ease;
}

.docs-card-link:hover {
	transform: translateY(-2px);
}

.docs-card-disabled {
	opacity: 0.6;
	cursor: default;
}

.docs-card-disabled:hover {
	transform: none;
}

.docs-card {
	height: 100%;
}

/* --- Breadcrumb --- */

.breadcrumb {
	margin-bottom: var(--wa-space-xl);
}

/* --- Read More Link --- */

.read-more {
	display: inline-flex;
	align-items: center;
	gap: var(--wa-space-2xs);
	color: var(--wa-color-brand-base);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.925rem;
	margin-top: var(--wa-space-s);
	transition: gap 0.15s ease;
}

.read-more:hover {
	gap: var(--wa-space-xs);
}

/* --- RSS Link --- */

.rss-link {
	text-align: center;
	margin-top: var(--wa-space-2xl);
}

.rss-link a {
	display: inline-flex;
	align-items: center;
	gap: var(--wa-space-2xs);
	color: var(--wa-color-text-muted);
	text-decoration: none;
	font-size: 0.925rem;
	transition: color 0.15s ease;
}

.rss-link a:hover {
	color: var(--wa-color-brand-base);
}

/* --- Prose Callout Spacing --- */

.prose wa-callout {
	margin-top: var(--wa-space-l);
	margin-bottom: var(--wa-space-l);
}

.breadcrumb-section {
	padding-bottom: 0;
}

/* --- Docs Content --- */

.docs-content {
	padding-top: var(--wa-space-l);
}

.download-options {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wa-space-s);
	margin-bottom: var(--wa-space-l);
}

.prose pre {
	background: var(--wa-color-surface-alt);
	border: 1px solid var(--wa-color-border-base);
	border-radius: var(--wa-border-radius-m);
	padding: var(--wa-space-m);
	overflow-x: auto;
	margin-bottom: var(--wa-space-m);
}

.prose code {
	font-family: var(--wa-font-mono);
	font-size: 0.9em;
}

.prose pre code {
	background: none;
	padding: 0;
}

.prose ol {
	color: var(--wa-color-text-muted);
	line-height: 1.75;
	margin-bottom: var(--wa-space-m);
	padding-left: var(--wa-space-xl);
}

/* --- Focus visible --- */

:focus-visible {
	outline: 2px solid var(--wa-color-brand-base);
	outline-offset: 2px;
}

/* --- Product Detail Hero --- */

.product-hero-icon {
	font-size: 3rem;
	color: var(--wa-color-brand-base);
	margin-bottom: var(--wa-space-m);
}

/* --- Platform Tags --- */

.platform-tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wa-space-xs);
	margin-top: var(--wa-space-m);
	margin-bottom: var(--wa-space-m);
}

.platform-tags-center {
	justify-content: center;
}

/* --- Product Card Action --- */

.product-card-action {
	margin-top: var(--wa-space-m);
}

/* --- Feature List --- */

.feature-list {
	list-style: none;
	padding: 0;
	margin: 0;
	max-width: 40rem;
}

.feature-list li {
	display: flex;
	align-items: flex-start;
	gap: var(--wa-space-m);
	padding: var(--wa-space-m) 0;
	border-bottom: 1px solid var(--wa-color-border-base);
}

.feature-list li:last-child {
	border-bottom: none;
}

.feature-check {
	color: var(--wa-color-success-base);
	font-size: 1.25rem;
	flex-shrink: 0;
	margin-top: 2px;
}

.feature-list strong {
	display: block;
	color: var(--wa-color-text-base);
	margin-bottom: var(--wa-space-2xs);
}

.feature-list p {
	color: var(--wa-color-text-muted);
	line-height: 1.6;
	margin: 0;
}

/* --- Tab Content --- */

.tab-content {
	padding: var(--wa-space-xl) 0;
}

.tab-content-center {
	text-align: center;
	padding: var(--wa-space-4xl) 0;
}

.placeholder-icon {
	font-size: 3rem;
	color: var(--wa-color-text-muted);
	margin-bottom: var(--wa-space-m);
}

/* --- Requirements List --- */

.requirements-list {
	list-style: none;
	padding: 0;
	margin: 0;
	max-width: 40rem;
}

.requirements-list li {
	padding: var(--wa-space-s) 0;
	color: var(--wa-color-text-muted);
	border-bottom: 1px solid var(--wa-color-border-base);
}

.requirements-list li:last-child {
	border-bottom: none;
}

.requirements-list strong {
	color: var(--wa-color-text-base);
}

/* --- Pricing Callout (product detail) --- */

.pricing-callout {
	text-align: center;
	max-width: 32rem;
}

.pricing-callout h2 {
	font-size: clamp(2.5rem, 5vw, 3.5rem);
	font-weight: 800;
	color: var(--wa-color-brand-base);
	margin-bottom: var(--wa-space-s);
}

.pricing-callout p {
	color: var(--wa-color-text-muted);
	font-size: 1.1rem;
	margin-bottom: var(--wa-space-xl);
}

/* --- Pricing Grid --- */

.pricing-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wa-space-l);
	align-items: start;
}

@media (min-width: 768px) {
	.pricing-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* --- Pricing Card --- */

.pricing-card-inner {
	padding: var(--wa-space-xl);
	text-align: center;
}

.pricing-card-inner h2 {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--wa-color-text-base);
	margin-bottom: var(--wa-space-m);
}

.pricing-badge-row {
	margin-bottom: var(--wa-space-s);
}

.pricing-price {
	margin-bottom: var(--wa-space-m);
}

.pricing-amount {
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 800;
	color: var(--wa-color-text-base);
}

.pricing-per {
	font-size: 1rem;
	color: var(--wa-color-text-muted);
}

.pricing-description {
	color: var(--wa-color-text-muted);
	margin-bottom: var(--wa-space-l);
	line-height: 1.6;
}

.pricing-features {
	list-style: none;
	padding: 0;
	margin: 0 0 var(--wa-space-xl);
	text-align: left;
}

.pricing-features li {
	display: flex;
	align-items: center;
	gap: var(--wa-space-s);
	padding: var(--wa-space-xs) 0;
	color: var(--wa-color-text-base);
	font-size: 0.95rem;
}

.pricing-cta {
	width: 100%;
}

/* Popular pricing card elevation */

.pricing-popular {
	--wa-card-border-color: var(--wa-color-brand-base);
}

@media (min-width: 768px) {
	.pricing-popular {
		transform: scale(1.05);
		z-index: 1;
	}
}

/* --- Comparison Table --- */

.comparison-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.comparison-table {
	width: 100%;
	max-width: 48rem;
	margin-inline: auto;
	border-collapse: collapse;
	text-align: center;
}

.comparison-table th,
.comparison-table td {
	padding: var(--wa-space-s) var(--wa-space-m);
	border-bottom: 1px solid var(--wa-color-border-base);
}

.comparison-table th {
	font-weight: 600;
	color: var(--wa-color-text-base);
	font-size: 0.95rem;
}

.comparison-table td:first-child,
.comparison-table th:first-child {
	text-align: left;
}

.comparison-table td {
	color: var(--wa-color-text-muted);
}

.faq-list {
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-s);
}

.faq-list p {
	color: var(--wa-color-text-muted);
	line-height: 1.65;
	padding: var(--wa-space-s) 0;
}

/* --- Auth Pages --- */

.auth-container {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 50vh;
}

.auth-card {
	width: 100%;
	max-width: 24rem;
}

.auth-header {
	text-align: center;
	margin-bottom: var(--wa-space-l);
}

.auth-icon {
	font-size: 2rem;
	color: var(--wa-color-brand-base);
	margin-bottom: var(--wa-space-m);
}

.auth-header h1 {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--wa-color-text-base);
	margin-bottom: var(--wa-space-xs);
}

.auth-header p {
	line-height: 1.5;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-m);
	padding: 0 var(--wa-space-l) var(--wa-space-s);
}

.auth-submit {
	width: 100%;
}

.auth-hint {
	text-align: center;
	font-size: 0.875rem;
	color: var(--wa-color-text-muted);
	padding: var(--wa-space-s) var(--wa-space-l) var(--wa-space-l);
}

.auth-hint a {
	color: var(--wa-color-brand-base);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.auth-hint a:hover {
	text-decoration: none;
}

/* --- Dashboard --- */

.dashboard-hero {
	padding-bottom: 0;
}

.dashboard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--wa-space-m);
}

.dashboard-user-info {
	display: flex;
	align-items: center;
	gap: var(--wa-space-m);
}

.dashboard-user-icon {
	font-size: 2.5rem;
	color: var(--wa-color-brand-base);
}

.dashboard-user-info h1 {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--wa-color-text-base);
	margin: 0;
}

.dashboard-user-info p {
	margin: 0;
}

/* --- License Cards --- */

.licenses-grid {
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.licenses-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.license-card-inner {
	padding: var(--wa-space-l);
}

.license-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wa-space-s);
}

.license-card-header h3 {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--wa-color-text-base);
	margin: 0;
}

.license-field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wa-space-s);
	padding: var(--wa-space-xs) 0;
}

.license-label {
	font-size: 0.875rem;
	color: var(--wa-color-text-muted);
	flex-shrink: 0;
}

.license-value {
	color: var(--wa-color-text-base);
	font-size: 0.925rem;
}

.license-key {
	display: flex;
	align-items: center;
	gap: var(--wa-space-xs);
}

.license-key code {
	font-family: var(--wa-font-mono);
	font-size: 0.85rem;
	color: var(--wa-color-text-base);
	background: var(--wa-color-surface-alt);
	padding: var(--wa-space-2xs) var(--wa-space-xs);
	border-radius: var(--wa-border-radius-s);
	word-break: break-all;
}

/* --- Account Details --- */

.account-details {
	max-width: 32rem;
}

.account-card-inner {
	padding: var(--wa-space-l);
}

.account-card-inner h2 {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--wa-color-text-base);
	margin: 0 0 var(--wa-space-s);
}

.account-field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--wa-space-s) 0;
}

.account-label {
	font-size: 0.925rem;
	color: var(--wa-color-text-muted);
}

.account-value {
	font-size: 0.925rem;
	color: var(--wa-color-text-base);
	font-weight: 500;
}

/* --- Empty State --- */

.empty-state {
	text-align: center;
	padding: var(--wa-space-4xl) var(--wa-space-l);
}

.empty-icon {
	font-size: 3rem;
	color: var(--wa-color-text-muted);
	margin-bottom: var(--wa-space-m);
}

.empty-state h2 {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--wa-color-text-base);
	margin-bottom: var(--wa-space-s);
}

.empty-state p {
	margin-bottom: var(--wa-space-l);
}

/* --- Skeleton Grid --- */

.skeleton-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wa-space-l);
}

@media (min-width: 640px) {
	.skeleton-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.skeleton-grid wa-skeleton {
	height: 1.25rem;
	margin-bottom: var(--wa-space-m);
	border-radius: var(--wa-border-radius-s);
}

.skeleton-grid wa-skeleton:last-child {
	margin-bottom: 0;
	width: 60%;
}
