/*
Theme Name: GJ
Theme URI: https://ginojohn.com
Author: Gino John
Description: Dark, performance-first block theme for ginojohn.com. Tokens live in theme.json; this file holds only what theme.json cannot express.
Version: 0.1.0
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: gj
*/

/* ---------- Base ---------- */
:root {
	color-scheme: dark;
	--gj-ring: 0 0 0 2px var(--wp--preset--color--base), 0 0 0 4px var(--wp--preset--color--accent);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--wp--custom--header--height) + 1rem); }

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: "cv11", "ss01", "ss03"; /* Inter: single-storey a, open digits */
	text-rendering: optimizeLegibility;
}

::selection { background: rgba(123, 140, 255, 0.35); color: var(--wp--preset--color--contrast); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: none;
	box-shadow: var(--gj-ring);
	border-radius: var(--wp--custom--radius--sm);
}

a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease); }

.wp-element-button,
.wp-block-button__link {
	transition:
		background-color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease),
		color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease),
		transform var(--wp--custom--motion--fast) var(--wp--custom--motion--ease);
}
.wp-element-button:active,
.wp-block-button__link:active { transform: translateY(1px); }

/* ---------- Utilities used by patterns ---------- */

/* Small uppercase label above headings ("BUSINESS TRANSFORMATION & PROGRAM LEADER"). */
.gj-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--xs);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-2);
}

/* Card surface shared by bento tiles and timeline items. */
.gj-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--card);
	/* Hover lift uses `translate`, not `transform`, so it never fights the reveal animation's transform. */
	transition:
		translate var(--wp--custom--motion--base) var(--wp--custom--motion--ease),
		border-color var(--wp--custom--motion--base) var(--wp--custom--motion--ease),
		box-shadow var(--wp--custom--motion--base) var(--wp--custom--motion--ease);
}
.gj-card:hover,
.gj-card:focus-within {
	translate: 0 -2px;
	border-color: var(--wp--preset--color--border-strong);
	box-shadow: var(--wp--preset--shadow--lift);
}

/* Gradient text for one highlighted word in a heading. */
.gj-gradient-text {
	background: var(--wp--preset--gradient--accent);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* Scroll reveal: assets/js/reveal.js adds .is-visible when the element enters the viewport.
   The hidden state applies only when JS has run (html.gj-js), so content never stays invisible without JS. */
.gj-js .gj-reveal {
	opacity: 0;
	transform: translateY(12px);
	transition:
		opacity var(--wp--custom--motion--slow) var(--wp--custom--motion--ease),
		transform var(--wp--custom--motion--slow) var(--wp--custom--motion--ease),
		translate var(--wp--custom--motion--base) var(--wp--custom--motion--ease),
		border-color var(--wp--custom--motion--base) var(--wp--custom--motion--ease),
		box-shadow var(--wp--custom--motion--base) var(--wp--custom--motion--ease);
}
.gj-js .gj-reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.gj-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(7, 8, 11, 0.6);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid transparent;
	transition: border-color var(--wp--custom--motion--base) var(--wp--custom--motion--ease), background-color var(--wp--custom--motion--base) var(--wp--custom--motion--ease);
}
.admin-bar .gj-header { top: var(--wp-admin--admin-bar--height, 32px); }
.gj-scrolled .gj-header { background: rgba(7, 8, 11, 0.82); border-bottom-color: var(--wp--preset--color--border); }
.gj-header__bar { min-height: var(--wp--custom--header--height); align-items: center; }
.gj-wordmark a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.gj-header .wp-block-navigation a { color: var(--wp--preset--color--muted); text-decoration: none; }
.gj-header .wp-block-navigation a:hover,
.gj-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--contrast); }
@media (max-width: 600px) { .gj-header__cta { display: none; } }

/* ---------- Hero ---------- */
.gj-hero { position: relative; isolation: isolate; overflow: hidden; }
.gj-hero::before { /* radial glow */
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--gradient--glow);
}
.gj-hero::after { /* faint engineering grid, fading out toward the edges */
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
	mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.gj-hero h1 { text-wrap: balance; }
.gj-hero p:not(.gj-eyebrow) { text-wrap: pretty; }

/* ---------- Bento grid ---------- */
.gj-bento .gj-bento__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: minmax(190px, auto);
	grid-auto-flow: dense; /* backfill gaps left by large tiles */
	gap: var(--wp--preset--spacing--40);
	list-style: none;
	margin: 0;
	padding: 0;
}
.gj-bento .gj-bento__grid > li { display: flex; margin: 0; }
.gj-bento .gj-bento__grid > li > .gj-tile { flex: 1; }
.gj-span-wide { grid-column: span 2; }
.gj-span-tall { grid-row: span 2; }
.gj-span-lg { grid-column: span 2; grid-row: span 2; }

@media (max-width: 960px) {
	.gj-bento .gj-bento__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
	.gj-bento .gj-bento__grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
	.gj-span-wide, .gj-span-lg { grid-column: auto; }
	.gj-span-tall, .gj-span-lg { grid-row: auto; }
}

.gj-tile { position: relative; overflow: hidden; }
.gj-tile::before { /* pointer spotlight; --gj-mx/--gj-my set by gj.js */
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	background: radial-gradient(360px circle at var(--gj-mx, 50%) var(--gj-my, 0%), rgba(123, 140, 255, 0.12), transparent 60%);
	transition: opacity var(--wp--custom--motion--base) var(--wp--custom--motion--ease);
}
.gj-tile:hover::before { opacity: 1; }
.gj-tile .gj-eyebrow:empty { display: none; }
.gj-tile__title { margin: 0; }
.gj-tile__title a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.gj-tile__title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link */
.gj-tile .wp-block-post-excerpt__excerpt { margin: 0; }
.gj-span-lg .gj-tile__title { font-size: var(--wp--preset--font-size--lg); }
.gj-span-lg .gj-tile { /* large tiles get a quiet accent so their open space reads as intentional */
	background:
		radial-gradient(120% 80% at 0% 0%, rgba(123, 140, 255, 0.10), transparent 55%),
		radial-gradient(80% 60% at 100% 0%, rgba(45, 212, 238, 0.06), transparent 60%),
		var(--wp--preset--color--surface);
}

/* Inner pages reuse the hero backdrop, left-aligned and shorter. */
.gj-hero--page::before { background: radial-gradient(50% 60% at 20% 0%, rgba(123, 140, 255, 0.14) 0%, rgba(7, 8, 11, 0) 70%); }
.gj-hero--page::after { -webkit-mask-image: radial-gradient(ellipse 60% 70% at 20% 0%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse 60% 70% at 20% 0%, #000 20%, transparent 70%); }

/* ---------- Experience timeline ---------- */
.gj-timeline__list { list-style: none; margin: 0; padding: 0; position: relative; }
.gj-timeline__list::before { /* the rail */
	content: "";
	position: absolute;
	top: 0.5rem;
	bottom: 0.5rem;
	left: 11rem;
	width: 1px;
	background: linear-gradient(to bottom, var(--wp--preset--color--border-strong), var(--wp--preset--color--border) 80%, transparent);
}
.gj-timeline__list > li { margin: 0; }
.gj-xp {
	display: grid;
	grid-template-columns: 11rem minmax(0, 1fr);
	column-gap: var(--wp--preset--spacing--60);
	padding: var(--wp--preset--spacing--50) 0;
	position: relative;
}
.gj-xp::before { /* node on the rail */
	content: "";
	position: absolute;
	left: calc(11rem - 4px);
	top: calc(var(--wp--preset--spacing--50) + 0.45rem);
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	border: 2px solid var(--wp--preset--color--accent);
}
.gj-xp__period {
	margin: 0;
	padding-right: var(--wp--preset--spacing--50);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--xs);
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--subtle);
	line-height: 1.9;
}
.gj-xp__body > * { margin-block: 0; }
.gj-xp__title { color: var(--wp--preset--color--contrast); }
.gj-xp__org { color: var(--wp--preset--color--accent); font-weight: 500; margin-top: 0.15rem !important; }
.gj-xp__meta { color: var(--wp--preset--color--subtle); font-size: var(--wp--preset--font-size--sm); }
.gj-xp__meta:empty { display: none; }
.gj-xp__content { margin-top: var(--wp--preset--spacing--30) !important; font-size: var(--wp--preset--font-size--sm); }
.gj-xp__content ul { margin: 0; padding-left: 1.1rem; }
.gj-xp__content li { margin: 0.25rem 0; }
.gj-xp__content li::marker { color: var(--wp--preset--color--accent); }
.gj-xp__content h4 { font-size: var(--wp--preset--font-size--sm); color: var(--wp--preset--color--contrast); margin: var(--wp--preset--spacing--40) 0 0.25rem; }
.gj-timeline__subhead { margin-top: var(--wp--preset--spacing--70) !important; margin-bottom: var(--wp--preset--spacing--40) !important; }
.gj-concurrent__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--wp--preset--spacing--40); }
.gj-concurrent__grid > li { margin: 0; display: flex; }
.gj-concurrent { flex: 1; }
.gj-concurrent > * { margin-block: 0; }
.gj-concurrent .wp-block-post-title { margin-block: 0.25rem 0.5rem; }

@media (max-width: 720px) {
	.gj-timeline__list::before { left: 4px; }
	.gj-xp { grid-template-columns: minmax(0, 1fr); padding-left: 1.5rem; }
	.gj-xp::before { left: 0; }
	.gj-xp__period { padding: 0 0 0.25rem; }
}

/* ---------- Post cards and listings ---------- */
.gj-posts__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--wp--preset--spacing--40); } /* auto-fit: a short row stretches instead of leaving an empty column */
.gj-posts__grid > li { margin: 0; display: flex; }
.gj-posts__grid > li > .gj-tile { flex: 1; }
.gj-tile .wp-block-post-date { margin: 0; }
.wp-block-query-pagination a { text-decoration: none; }

/* ---------- Long-form reading (posts, project pages) ---------- */
.gj-lead { margin-top: var(--wp--preset--spacing--40); }
.gj-lead p { margin: 0; }
.gj-prose { font-size: var(--wp--preset--font-size--md); }
.gj-prose > * + * { margin-top: 1.1em; }
.gj-prose :where(h2, h3) { margin-top: 2em; }
.gj-prose :where(ul, ol) { padding-left: 1.25rem; }
.gj-prose li + li { margin-top: 0.35em; }
.gj-prose li::marker { color: var(--wp--preset--color--accent); }
.gj-prose :where(p, li) code {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.875em;
	padding: 0.1em 0.35em;
	border-radius: 6px;
	background: var(--wp--preset--color--surface-2);
	color: var(--wp--preset--color--contrast);
}
.gj-prose pre { overflow-x: auto; padding: var(--wp--preset--spacing--40); }
.gj-prose img { border-radius: var(--wp--custom--radius--md); }
.gj-prose blockquote { border-left: 2px solid var(--wp--preset--color--accent); margin-left: 0; padding-left: var(--wp--preset--spacing--50); color: var(--wp--preset--color--contrast); }

/* ---------- CTA band, credentials, contact ---------- */
.gj-cta {
	background:
		radial-gradient(60% 90% at 50% 0%, rgba(123, 140, 255, 0.16), transparent 70%),
		var(--wp--preset--color--surface);
}
.gj-creds ul { padding-left: 1.1rem; margin: 0; }
.gj-creds li + li { margin-top: 0.35rem; }
.gj-creds li::marker { color: var(--wp--preset--color--accent); }
.gj-contact .gj-tile__title { margin: 0; overflow-wrap: anywhere; }

/* ---------- Reduced motion ---------- */
/* TODO(human): add the @media (prefers-reduced-motion: reduce) rule for this theme. */
