/*
Theme Name: PersonaOS
Theme URI: https://joinpersonaos.com
Description: Warm-dark, single-theme classic WordPress theme for the PersonaOS member portal and public pages. Editorial aesthetic: Source Serif 4 display, Instrument Sans UI, amber accents, thin warm lines and panels. Ported to the finished mockups.
Author: PersonaOS
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.1
Text Domain: personaos
*/

/* ---------------------------------------------------------------------------
   Design tokens (single dark theme — no light variant by design).
   --------------------------------------------------------------------------- */
:root {
	--bg: #0E0B0A;
	--panel: #161311;
	--panel2: #1C1815;
	--line: #2A231E;
	--line2: #39302A;
	--text: #F2EBE2;
	--muted: #9A8F81;
	--dim: #6E6558;
	--accent: #E8945A;
	--accent-d: #B96A3A;
	--gold: #EAC79A;
	--warn: #EAC79A;

	--font-sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
	--font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	/* Short aliases some templates reference (page-portal / checkout). */
	--sans: var(--font-sans);
	--serif: var(--font-serif);
	--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

	--radius: 14px;
	--radius-sm: 10px;
	--gap: 20px;
	--maxw: 1080px;
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-serif);
	font-weight: 500;
	letter-spacing: -0.01em;
}

.pos-num,
.num {
	font-variant-numeric: tabular-nums lining-nums;
}

.pos-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
}

hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 2rem 0;
}

.pos-muted {
	color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------------- */
.pos-shell {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.pos-container {
	width: 100%;
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 20px;
}

.pos-main {
	flex: 1 0 auto;
	padding-top: 32px;
	padding-bottom: 64px;
}

/* Topbar / nav */
.pos-topbar {
	border-bottom: 1px solid var(--line);
	background: rgba(14, 11, 10, 0.9);
	backdrop-filter: saturate(140%) blur(6px);
	position: sticky;
	top: 0;
	z-index: 20;
}

.pos-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 60px;
}

.pos-brand-mark {
	font-family: var(--font-serif);
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--text);
}

.pos-brand:hover {
	text-decoration: none;
}

.pos-nav {
	display: flex;
	gap: 22px;
}

.pos-nav a {
	color: var(--muted);
	font-size: 14px;
	letter-spacing: 0.02em;
}

.pos-nav a:hover {
	color: var(--text);
	text-decoration: none;
}

/* Footer */
.pos-footer {
	border-top: 1px solid var(--line);
	flex-shrink: 0;
}

.pos-footer-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	height: 64px;
	color: var(--muted);
	font-size: 13px;
}

.pos-footer-nav {
	display: flex;
	gap: 18px;
	margin-left: auto;
}

.pos-footer-nav a {
	color: var(--muted);
}

.pos-footer-copy {
	color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Panels & cards
   --------------------------------------------------------------------------- */
.pos-panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 28px;
	margin-bottom: var(--gap);
}

.pos-card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
}

.pos-card:hover {
	border-color: var(--line2);
}

.pos-grid {
	display: grid;
	gap: var(--gap);
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.pos-grid-2 {
	display: grid;
	gap: var(--gap);
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pos-card-title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
}

.pos-card-meta {
	font-family: var(--font-sans);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}

/* Stat tiles (econ dashboard, three-numbers) */
.pos-stat {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 16px 18px;
}

.pos-stat-value {
	font-family: var(--font-serif);
	font-weight: 600;
	font-size: 30px;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums lining-nums;
	color: var(--text);
	line-height: 1.1;
}

.pos-stat-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
	margin-top: 6px;
}

/* ---------------------------------------------------------------------------
   Progress ring
   --------------------------------------------------------------------------- */
.pos-ring {
	position: relative;
	width: 132px;
	height: 132px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.pos-ring svg {
	transform: rotate(-90deg);
	width: 132px;
	height: 132px;
}

.pos-ring-track {
	fill: none;
	stroke: var(--line);
	stroke-width: 10;
}

.pos-ring-value {
	fill: none;
	stroke: var(--accent);
	stroke-width: 10;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.4s ease;
}

.pos-ring-label {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-family: var(--font-serif);
}

.pos-ring-pct {
	font-size: 28px;
	font-weight: 600;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums lining-nums;
	color: var(--text);
}

.pos-ring-sub {
	font-family: var(--font-sans);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.pos-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	font-family: var(--font-sans);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1;
	padding: 13px 24px;
	border-radius: 11px;
	border: 1px solid var(--accent);
	background: var(--accent);
	color: #160F0A;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.pos-btn:hover {
	background: #f0a069;
	border-color: #f0a069;
	text-decoration: none;
}

.pos-btn:active {
	transform: scale(0.98);
}

.pos-btn-big {
	font-size: 16px;
	padding: 16px 34px;
	border-radius: 13px;
}

.pos-btn-ghost {
	background: transparent;
	color: var(--text);
	border-color: var(--line2);
}

.pos-btn-ghost:hover {
	background: transparent;
	border-color: var(--accent);
}

.pos-btn[disabled],
.pos-btn.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pos-btn-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}

/* ---------------------------------------------------------------------------
   Badges / locks
   --------------------------------------------------------------------------- */
.pos-badge {
	display: inline-block;
	font-family: var(--font-sans);
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 3px 8px;
	border-radius: 999px;
	border: 1px solid var(--line);
	color: var(--muted);
}

.pos-badge-locked {
	color: var(--warn);
	border-color: var(--warn);
}

.pos-badge-done {
	color: var(--accent);
	border-color: var(--accent);
}

.pos-badge-pending {
	color: var(--warn);
	border-color: var(--warn);
}

.pos-badge-approved {
	color: var(--accent);
	border-color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
.pos-field {
	margin-bottom: 16px;
}

.pos-field label {
	display: block;
	font-size: 13px;
	color: var(--muted);
	margin-bottom: 6px;
	letter-spacing: 0.02em;
}

.pos-input,
.pos-textarea,
.pos-select,
input[type="text"].pos-input,
input[type="email"].pos-input,
input[type="password"].pos-input,
input[type="number"].pos-input {
	width: 100%;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 15px;
	padding: 11px 12px;
}

.pos-input:focus,
.pos-textarea:focus,
.pos-select:focus {
	outline: none;
	border-color: var(--accent);
}

.pos-textarea {
	min-height: 120px;
	resize: vertical;
}

input[type="number"].pos-input {
	font-family: var(--font-sans);
	font-variant-numeric: tabular-nums lining-nums;
}

.pos-form-note {
	font-size: 12px;
	color: var(--muted);
	margin-top: 4px;
}

/* Data-entry / econ table form */
.pos-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.pos-table th,
.pos-table td {
	border-bottom: 1px solid var(--line);
	padding: 10px 12px;
	text-align: left;
}

.pos-table th {
	color: var(--muted);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.pos-table td.pos-num,
.pos-table th.pos-num {
	text-align: right;
	font-variant-numeric: tabular-nums lining-nums;
}

/* ---------------------------------------------------------------------------
   Lesson layout
   --------------------------------------------------------------------------- */
.pos-lesson {
	display: grid;
	gap: 28px;
	grid-template-columns: 1fr;
}

.pos-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
}

.pos-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.pos-lesson-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.pos-lesson-title {
	margin: 0;
	font-size: 24px;
}

.pos-lesson-meta {
	font-family: var(--font-sans);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}

.pos-lesson-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	border-top: 1px solid var(--line);
	padding-top: 20px;
	margin-top: 8px;
}

.pos-lesson-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pos-lesson-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}

.pos-tick {
	color: var(--accent);
}

.pos-tick-empty {
	color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Rendered copy (Parsedown output) + COPY-SLOT markers
   --------------------------------------------------------------------------- */
.pos-copy {
	max-width: 72ch;
}

.pos-copy h1,
.pos-copy h2,
.pos-copy h3,
.pos-copy h4 {
	line-height: 1.25;
	margin: 1.8em 0 0.6em;
}

.pos-copy h1 {
	font-size: 30px;
}

.pos-copy h2 {
	font-size: 24px;
}

.pos-copy h3 {
	font-size: 19px;
}

.pos-copy p {
	margin: 0 0 1em;
}

.pos-copy ul,
.pos-copy ol {
	margin: 0 0 1em;
	padding-left: 1.4em;
}

.pos-copy li {
	margin: 0.3em 0;
}

.pos-copy blockquote {
	margin: 1.2em 0;
	padding: 0.4em 1em;
	border-left: 3px solid var(--accent);
	color: var(--muted);
	background: rgba(232, 148, 90, 0.06);
}

.pos-copy code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 1px 5px;
}

.pos-copy pre {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 14px 16px;
	overflow-x: auto;
}

.pos-copy pre code {
	border: 0;
	padding: 0;
	background: none;
}

.pos-copy table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.2em 0;
	font-size: 14px;
	display: block;
	overflow-x: auto;
}

.pos-copy th,
.pos-copy td {
	border: 1px solid var(--line);
	padding: 8px 12px;
}

.pos-copy th {
	background: var(--panel);
	color: var(--muted);
}

.pos-copy-slot {
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--warn);
	border: 1px dashed var(--warn);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	margin: 12px 0;
	background: rgba(234, 199, 154, 0.06);
}

/* ---------------------------------------------------------------------------
   Login (branded, no WP logo) + portal helpers
   --------------------------------------------------------------------------- */
.pos-login {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.pos-login-card {
	width: 100%;
	max-width: 380px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 32px;
}

.pos-login-brand {
	font-family: var(--font-serif);
	font-size: 22px;
	font-weight: 600;
	margin-bottom: 24px;
	display: block;
	text-align: center;
}

.pos-section-title {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
	margin: 0 0 14px;
}

.pos-portal-head {
	display: flex;
	gap: 28px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: var(--gap);
}

.pos-connect-slot {
	border: 1px dashed var(--line);
	border-radius: var(--radius-sm);
	padding: 14px 16px;
	color: var(--muted);
	font-size: 13px;
}

@media (max-width: 640px) {
	.pos-nav {
		gap: 14px;
	}
	.pos-panel {
		padding: 20px;
	}
}
