/* ==========================================================
   Vahid Mashmooli — personal card
   Themes: [data-theme="dark"] (default) / [data-theme="light"]
   ========================================================== */

:root {
	--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Space Grotesk", var(--font-sans);
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--radius-lg: 20px;
	--radius-md: 12px;
	--radius-sm: 8px;
	--ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Dark (default) ---------- */
:root,
[data-theme="dark"] {
	--bg: #000;
	--pattern-opacity: .45;          /* original bg.png, toned down */
	--pattern-filter: none;
	--surface: rgba(8, 8, 8, .82);
	--surface-2: rgba(255, 255, 255, .03);
	--surface-hover: rgba(255, 255, 255, .07);
	--border: rgba(255, 255, 255, .08);
	--border-strong: rgba(255, 255, 255, .18);
	--text: #e4e4e4;
	--text-muted: #8c8c8c;
	--text-faint: #555;
	--primary-bg: #e4e4e4;
	--primary-fg: #0a0a0a;
	--shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
	color-scheme: dark;
}

/* ---------- Light ---------- */
[data-theme="light"] {
	--bg: #f2f2f2;
	--pattern-opacity: .35;
	--pattern-filter: invert(1);     /* same pattern, dark lines on light */
	--surface: rgba(255, 255, 255, .88);
	--surface-2: rgba(0, 0, 0, .025);
	--surface-hover: rgba(0, 0, 0, .06);
	--border: rgba(0, 0, 0, .08);
	--border-strong: rgba(0, 0, 0, .18);
	--text: #111;
	--text-muted: #555;
	--text-faint: #999;
	--primary-bg: #111;
	--primary-fg: #f5f5f5;
	--shadow: 0 24px 50px -24px rgba(0, 0, 0, .25);
	color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	transition: background-color .4s var(--ease), color .4s var(--ease);
	overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.icon {
	width: 20px;
	height: 20px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

:focus-visible {
	outline: 2px solid var(--text-muted);
	outline-offset: 3px;
	border-radius: 8px;
}

/* ---------- Background: original pattern ---------- */
.bg {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: url(../bg.png) repeat;
	opacity: var(--pattern-opacity);
	filter: var(--pattern-filter);
	transition: opacity .4s var(--ease);
}

/* ---------- Top bar ---------- */
.topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px clamp(16px, 4vw, 36px);
	z-index: 10;
}

.topbar__brand {
	font-family: var(--font-mono);
	font-weight: 500;
	font-size: 18px;
	color: var(--text-faint);
}

.theme-toggle {
	position: relative;
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-muted);
	cursor: pointer;
	transition: color .3s, border-color .3s, background .3s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .icon { position: absolute; transition: transform .4s var(--ease), opacity .3s; }

[data-theme="dark"] .icon--sun  { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme="dark"] .icon--moon { opacity: 1; transform: none; }
[data-theme="light"] .icon--sun  { opacity: 1; transform: none; }
[data-theme="light"] .icon--moon { opacity: 0; transform: rotate(90deg) scale(.5); }

/* ---------- Layout ---------- */
.wrap {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 96px 16px 32px;
}

/* ---------- Card ---------- */
.card {
	width: 100%;
	max-width: 440px;
	padding: 40px clamp(20px, 6vw, 36px) 32px;
	text-align: center;
	border-radius: var(--radius-lg);
	border: 1px solid var(--border);
	background: var(--surface);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	box-shadow: var(--shadow);
	transition: background .4s var(--ease), border-color .4s var(--ease);
	animation: rise .6s var(--ease) backwards;
}

@keyframes rise {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Avatar ---------- */
.avatar {
	display: grid;
	place-items: center;
	width: 84px;
	height: 84px;
	margin: 0 auto 20px;
	border-radius: 50%;
	border: 1px solid var(--border-strong);
	background: var(--surface-2);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 26px;
	color: var(--text-muted);
}

/* ---------- Text ---------- */
.name {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(28px, 7vw, 34px);
	line-height: 1.15;
	letter-spacing: -.02em;
}

.role {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0 0;
	min-height: 24px;
	font-family: var(--font-mono);
	font-size: 15px;
	color: var(--text-muted);
}
.role__prompt { color: var(--text-faint); }
.role__caret {
	width: 7px;
	height: 17px;
	margin-left: -4px;
	background: var(--text-muted);
	animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Chips ---------- */
.chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}
.chip {
	padding: 4px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	font-family: var(--font-mono);
	font-size: 12.5px;
	color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 28px;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 46px;
	padding: 0 16px;
	border-radius: var(--radius-md);
	border: 1px solid var(--border);
	font-weight: 500;
	font-size: 15px;
	cursor: pointer;
	white-space: nowrap;
	transition: background .2s, border-color .2s, color .2s, opacity .2s;
}
.btn:active { opacity: .85; }

.btn--primary {
	color: var(--primary-fg);
	background: var(--primary-bg);
	border-color: var(--primary-bg);
}
.btn--primary:hover { opacity: .88; }

.btn--ghost { background: var(--surface-2); }
.btn--ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn--ghost.is-done { border-color: #3fa66b; color: #3fa66b; }

/* ---------- Divider ---------- */
.divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 28px 0 16px;
	font-family: var(--font-mono);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .14em;
	color: var(--text-faint);
}
.divider::before,
.divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

/* ---------- Socials ---------- */
.socials {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.social {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 12px;
	align-items: center;
	padding: 11px 14px;
	text-align: left;
	border-radius: var(--radius-md);
	border: 1px solid var(--border);
	background: var(--surface-2);
	transition: background .2s, border-color .2s;
}

.social .icon {
	grid-row: span 2;
	width: 34px;
	height: 34px;
	padding: 7px;
	border-radius: var(--radius-sm);
	color: var(--text-muted);
	background: var(--surface-hover);
	transition: color .2s;
}
.social__label { font-weight: 600; font-size: 14px; line-height: 1.2; }
.social__handle {
	font-size: 12px;
	color: var(--text-faint);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.social:hover {
	background: var(--surface-hover);
	border-color: var(--border-strong);
}
.social:hover .icon { color: var(--text); }

/* ---------- Footer ---------- */
.footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	font-size: 13px;
	color: var(--text-faint);
}
kbd {
	font-family: var(--font-mono);
	font-size: 11px;
	padding: 1px 6px;
	border-radius: 5px;
	border: 1px solid var(--border-strong);
}

/* ---------- Toast ---------- */
.toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	z-index: 20;
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	color: var(--primary-fg);
	background: var(--primary-bg);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 16px);
	transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 420px) {
	.actions,
	.socials { grid-template-columns: 1fr; }
}

@media (max-width: 420px), (hover: none) {
	.footer__sep,
	.footer__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
