/* ==========================================================================
   James Dev — design tokens
   Palette: ink navy + warm paper + terminal amber, git-diff green/red as
   functional accents (not decoration). Type: Space Grotesk (display) +
   JetBrains Mono (labels/code) + Inter (body).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=JetBrains+Mono:wght@400;500&family=Inter:wght@400;500&display=swap');

:root {
	--ink: #12141A;
	--ink-soft: #1B1E27;
	--paper: #E9E6DD;
	--paper-dim: #DEDACD;
	--amber: #E8A33D;
	--green: #4FAE72;
	--red: #D96C6C;
	--slate: #6B7280;
	--purple: #A78BFA;
	--blue: #6EC6FF;
	--pink: #F0789C;

	--font-display: 'Space Grotesk', system-ui, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, monospace;
	--font-body: 'Inter', system-ui, sans-serif;

	--wrap: 1080px;
	--radius: 10px;
}

/* Base */
body {
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 0.4em; line-height: 1.1; }
.eyebrow {
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--slate);
	margin: 0 0 12px;
	letter-spacing: 0.02em;
}

/* Focus visibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
	* { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid rgba(18,20,26,0.1); }
.site-header::before {
	content: ''; display: block; height: 3px;
	background: linear-gradient(90deg, var(--green), var(--green) 48%, var(--red) 52%, var(--red));
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; }
.site-header__logo { font-family: var(--font-mono); font-weight: 500; font-size: 16px; }
.site-header__logo .prompt { color: var(--green); }
.site-header__logo .cursor { color: var(--red); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.site-header__nav { display: flex; gap: 28px; font-family: var(--font-mono); font-size: 14px; }
.site-header__nav a { color: var(--slate); position: relative; padding-bottom: 2px; }
.site-header__nav a::after {
	content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
	background: var(--green); transform: scaleX(0); transition: transform 0.15s ease;
}
.site-header__nav a:nth-child(2)::after { background: var(--red); }
.site-header__nav a:hover { color: var(--ink); }
.site-header__nav a:hover::after { transform: scaleX(1); }

/* Hero */
.hero, .store-hero { padding: 72px 24px 64px; }
.hero__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero__title { font-size: clamp(32px, 4.6vw, 52px); }
.hero__sub { max-width: 46ch; color: var(--slate); font-size: 18px; margin: 0 0 32px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--red { background: var(--red); }
.dot--yellow { background: var(--amber); }
.dot--green { background: var(--green); }
/* Hire-me card — replaces the old hero widget with something that actually
   pitches for client work, echoing the profile section's dark-glow style. */
.hire-card {
	background: var(--ink); color: var(--paper); border-radius: 12px; padding: 28px;
	box-shadow: 0 20px 60px -20px rgba(18,20,26,0.35);
	background-image: radial-gradient(circle at 100% 0%, rgba(79,174,114,0.2), transparent 55%),
		radial-gradient(circle at 0% 100%, rgba(217,108,108,0.16), transparent 55%);
}
.hire-card__status {
	display: inline-flex; align-items: center; gap: 7px;
	font-family: var(--font-mono); font-size: 12px; color: var(--green);
	background: rgba(79,174,114,0.12); border-radius: 20px; padding: 5px 12px; margin-bottom: 16px;
}
.hire-card__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 1.6s ease-in-out infinite; }
.hire-card__title { font-size: 22px; margin: 0 0 8px; }
.hire-card__sub { color: #C7C5BD; font-size: 14px; margin: 0 0 22px; max-width: 34ch; }
.hire-card__stats { list-style: none; display: flex; gap: 22px; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.hire-card__stats li { display: flex; flex-direction: column; gap: 2px; }
.hire-card__stats strong { font-family: var(--font-mono); font-size: 20px; color: var(--amber); }
.hire-card__stats span { font-size: 11px; color: #9A98A0; max-width: 12ch; }
.hire-card__cta { width: 100%; justify-content: center; display: flex; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; gap: 6px;
	font-family: var(--font-mono); font-size: 14px; font-weight: 500;
	padding: 12px 20px; border-radius: var(--radius); border: 1px solid transparent;
	transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--amber); color: var(--ink); }
.btn--ghost { border-color: rgba(18,20,26,0.25); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--green { background: var(--green); color: #0E2818; }
.btn--green:hover { background: #3F9860; }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: #C24D4D; }
.btn--sm { padding: 8px 14px; font-size: 13px; }

/* Section title */
.section-title { display: flex; align-items: baseline; gap: 10px; font-size: 24px; margin: 0 0 32px; }
.section-title__num { font-family: var(--font-mono); color: var(--amber); }

/* Portfolio grid */
.work { padding: 40px 24px 96px; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.project-card {
	background: #fff; border-radius: var(--radius); overflow: hidden;
	border: 1px solid rgba(18,20,26,0.08);
	box-shadow: 0 1px 2px rgba(18,20,26,0.04);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -16px rgba(18,20,26,0.25); }
.project-card__preview { display: block; aspect-ratio: 16/10; background: var(--paper-dim); position: relative; }
.project-card__preview img { width: 100%; height: 100%; object-fit: cover; }
.project-card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-card__meta { display: flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--slate); }
.project-card__hash { color: var(--green); }
.project-card__title { font-size: 19px; margin: 0; }
.project-card__title a:hover { color: var(--amber); }
.project-card__excerpt { color: var(--slate); font-size: 14px; margin: 0; }
.project-card__stat { margin-top: auto; padding-top: 8px; }
.commit__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 0; }
.commit__tags li { font-family: var(--font-mono); font-size: 12px; padding: 3px 9px; border-radius: 20px; background: rgba(18,20,26,0.06); }
.commit__tags li:nth-child(4n+1) { background: color-mix(in srgb, var(--purple) 16%, transparent); color: #6D4FC4; }
.commit__tags li:nth-child(4n+2) { background: color-mix(in srgb, var(--blue) 18%, transparent); color: #1C7DB8; }
.commit__tags li:nth-child(4n+3) { background: color-mix(in srgb, var(--green) 18%, transparent); color: #2F8552; }
.commit__tags li:nth-child(4n+4) { background: color-mix(in srgb, var(--pink) 18%, transparent); color: #C24D71; }
.commit__stat-value { display: block; font-family: var(--font-mono); font-size: 20px; font-weight: 500; color: var(--green); }
.commit__stat-label { display: block; font-size: 12px; color: var(--slate); }

/* Browser-chrome live preview (used when no featured image is set) */
.browser-frame { display: block; width: 100%; height: 100%; }
.browser-frame__bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--ink-soft); }
.browser-frame__bar .dot { width: 7px; height: 7px; }
.browser-frame__url { margin-left: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-frame__viewport { position: relative; width: 100%; height: calc(100% - 27px); overflow: hidden; background: var(--paper-dim); }
.browser-frame__viewport img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.project-card__noimg {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	width: 100%; height: 100%; text-align: center; padding: 16px;
	font-family: var(--font-mono); color: var(--slate);
	background: repeating-linear-gradient(135deg, rgba(18,20,26,0.03) 0 10px, transparent 10px 20px);
}
.project-card__noimg-host { font-size: 13px; color: var(--ink); }
.project-card__noimg-hint { font-size: 12px; }

/* Store — marketplace toolbar */
.store { padding: 32px 24px 96px; }
.market-toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.market-search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.market-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate); font-size: 16px; }
.market-search input {
	width: 100%; padding: 10px 14px 10px 34px; border-radius: 8px; border: 1px solid rgba(18,20,26,0.15);
	background: #fff; font-size: 14px; font-family: var(--font-body);
}
.market-sort { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--slate); }
.market-sort select { padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(18,20,26,0.15); background: #fff; font-family: var(--font-body); font-size: 13px; color: var(--ink); }
.market-empty-result { text-align: center; color: var(--slate); font-family: var(--font-mono); font-size: 14px; padding: 40px 0; }

/* Store — marketplace grid (Jumia/Jiji-style) */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.market-card {
	background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid rgba(18,20,26,0.08);
	display: flex; flex-direction: column; transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.market-card:hover { box-shadow: 0 14px 28px -18px rgba(18,20,26,0.3); transform: translateY(-2px); }
.market-card__thumb { position: relative; display: block; aspect-ratio: 1/1; background: var(--paper-dim); }
.market-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.market-card__badge {
	position: absolute; top: 8px; left: 8px; z-index: 1;
	background: var(--red); color: #fff; font-family: var(--font-mono); font-size: 10px;
	padding: 2px 8px; border-radius: 4px;
}
.market-card__noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-family: var(--font-mono); font-size: 12px; color: var(--slate); }
.market-card__body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.market-card__title { font-size: 14px; font-weight: 500; margin: 0; line-height: 1.3; min-height: 2.5em; }
.market-card__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.market-card__title a:hover { color: var(--green); }
.market-card__excerpt { display: none; }
.market-card__price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.market-card__price { font-size: 16px; font-weight: 700; color: var(--ink); }
.market-card__price-alt { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }
.market-card__body .btn, .market-card__cta { margin-top: auto; width: 100%; justify-content: center; }

.install-cmd {
	display: flex; align-items: center; gap: 8px; width: 100%;
	background: var(--ink-soft); border: 1px solid rgba(233,230,221,0.15); border-radius: 8px;
	padding: 10px 12px; font-family: var(--font-mono); font-size: 13px; color: var(--paper);
	cursor: pointer; text-align: left;
}
.install-cmd__prompt { color: var(--green); }
.install-cmd code { flex: 1; overflow-x: auto; white-space: nowrap; background: none; }
.install-cmd__copy { color: var(--slate); font-size: 11px; }
.install-cmd:hover .install-cmd__copy { color: var(--amber); }

/* Single product page — Jumia/Jiji-style: image left, buy box right */
.product-page { padding: 48px 24px 96px; max-width: 1040px; }
.product-page__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 24px 0 48px; align-items: start; }
.product-page__image { border-radius: 12px; overflow: hidden; border: 1px solid rgba(18,20,26,0.08); aspect-ratio: 1/1; background: var(--paper-dim); }
.product-page__image img { width: 100%; height: 100%; object-fit: cover; }
.product-page__image--empty { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); color: var(--slate); font-size: 13px; }
.product-page__buybox { background: #fff; border: 1px solid rgba(18,20,26,0.08); border-radius: 12px; padding: 28px; }
.product-page__title { font-size: 26px; margin: 0 0 8px; }
.product-page__badge { position: static; display: inline-block; margin-bottom: 14px; }
.product-page__price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.product-page__price { font-size: 28px; font-weight: 700; }
.product-page__price-alt { font-family: var(--font-mono); font-size: 14px; color: var(--slate); }
.product-page__excerpt { color: var(--slate); font-size: 15px; margin-bottom: 20px; }
.product-page__actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.product-page__actions .btn { width: 100%; justify-content: center; display: flex; }
.product-page__trust { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid rgba(18,20,26,0.08); font-size: 13px; color: var(--slate); display: flex; flex-direction: column; gap: 6px; }
.product-page__details { border-top: 1px solid rgba(18,20,26,0.1); padding-top: 32px; }
.product-page__details h2 { font-size: 20px; margin-bottom: 14px; }
.product-page__body { font-size: 16px; margin-bottom: 20px; }
.product-page .install-cmd { max-width: 480px; }

/* Case study */
.case-study { padding: 96px 24px; max-width: 780px; }
.case-study__thumb { border-radius: var(--radius); overflow: hidden; margin: 32px 0; }
.case-study__body { font-size: 17px; }
.case-study__meta { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; margin-top: 40px; padding-top: 32px; border-top: 1px solid rgba(18,20,26,0.1); }
.case-study__meta h3 { font-family: var(--font-mono); font-size: 13px; color: var(--slate); text-transform: uppercase; margin-bottom: 8px; }

.empty-state { color: var(--slate); font-family: var(--font-mono); font-size: 14px; }


/* Profile ("About Me") — animated: drifting glow, spinning ring, scroll-reveal */
.profile { padding: 24px 24px 8px; }
.profile__inner {
	position: relative; overflow: hidden;
	display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
	background: var(--ink); color: var(--paper); border-radius: 16px; padding: 40px;
}
.profile__inner::before {
	content: ''; position: absolute; inset: -20%; z-index: 0; pointer-events: none;
	background-image: radial-gradient(circle at 100% 0%, rgba(167,139,250,0.22), transparent 55%),
		radial-gradient(circle at 0% 100%, rgba(79,174,114,0.2), transparent 55%);
	animation: profileGlowDrift 16s ease-in-out infinite alternate;
}
@keyframes profileGlowDrift {
	from { transform: translate(0, 0); }
	to { transform: translate(-4%, 4%); }
}

.profile__photo-ring {
	position: relative; z-index: 1; flex: 0 0 120px; width: 120px; height: 120px; border-radius: 50%; padding: 3px;
	background: conic-gradient(from 0deg, var(--green), var(--amber), var(--red), var(--purple), var(--green));
	animation: profileRingSpin 6s linear infinite;
}
@keyframes profileRingSpin { to { transform: rotate(360deg); } }
.profile__photo, .profile__photo--placeholder {
	width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 3px solid var(--ink);
}
.profile__photo img { width: 100%; height: 100%; object-fit: cover; }
.profile__photo--placeholder {
	display: flex; align-items: center; justify-content: center;
	background: var(--ink-soft); font-family: var(--font-display); font-size: 40px; color: var(--amber);
}
.profile__content { position: relative; z-index: 1; flex: 1; min-width: 240px; }
.profile__content .eyebrow { color: #9A98A0; }
.profile__name { font-size: 24px; margin-bottom: 10px; }
.profile__role { font-family: var(--font-mono); font-size: 14px; color: var(--blue); font-weight: 400; }
.profile__bio { color: #C7C5BD; font-size: 15px; max-width: 60ch; margin: 0 0 14px; }
.profile__links { list-style: none; display: flex; gap: 16px; padding: 0; margin: 0; font-family: var(--font-mono); font-size: 13px; }
.profile__links a { position: relative; color: var(--green); padding-bottom: 2px; }
.profile__links a::after {
	content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
	background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease;
}
.profile__links a:hover { color: var(--amber); }
.profile__links a:hover::after { transform: scaleX(1); }

/* Scroll-triggered staggered reveal */
.profile__photo-ring, .profile__content > * {
	opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease;
}
.profile.is-inview .profile__photo-ring { opacity: 1; transform: translateY(0); transition-delay: 0.05s; }
.profile.is-inview .profile__content > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.profile.is-inview .profile__content > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.25s; }
.profile.is-inview .profile__content > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.35s; }
.profile.is-inview .profile__content > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }

@media (prefers-reduced-motion: reduce) {
	.profile__inner::before { animation: none; }
	.profile__photo-ring { animation: none; }
	.profile__photo-ring, .profile__content > * { opacity: 1; transform: none; transition: none; }
}

/* Footer */
.site-footer { border-top: 1px solid rgba(18,20,26,0.1); padding: 40px 24px; margin-top: 40px; }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.site-footer__eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--slate); margin: 0 0 4px; }
.site-footer__copy { margin: 0; font-size: 14px; color: var(--slate); }

@media (max-width: 780px) {
	.hero__grid { grid-template-columns: 1fr; }
	.product-page__grid { grid-template-columns: 1fr; }
	.hire-card { max-width: 420px; margin: 0 auto; }
}

@media (max-width: 640px) {
	.portfolio-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.project-card__body { padding: 10px; gap: 4px; }
	.project-card__title { font-size: 14px; line-height: 1.25; }
	.project-card__excerpt { font-size: 11px; line-height: 1.4; }
	.project-card__meta { font-size: 10px; gap: 6px; }
	.commit__tags li { font-size: 10px; padding: 2px 7px; }
	.commit__stat-value { font-size: 15px; }
	.commit__stat-label { font-size: 10px; }
	.browser-frame__bar { padding: 5px 7px; }
	.browser-frame__bar .dot { width: 5px; height: 5px; }
	.browser-frame__url { font-size: 9px; }
	.market-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.market-card__body { padding: 9px; gap: 4px; }
	.market-card__title { font-size: 12px; min-height: 2.2em; }
	.market-card__price { font-size: 14px; }
	.install-cmd { padding: 7px 9px; font-size: 11px; }
	.btn--sm { padding: 6px 10px; font-size: 11px; }
	.profile__inner { padding: 28px; text-align: center; justify-content: center; }
	.profile__links { justify-content: center; }
}

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