/*
Theme Name: Made by Jimmy
Theme URI: https://example.com/made-by-jimmy
Author: Jimmy
Description: Jimmy's portfolio. A block theme modelled on Apple's website: full-width product tiles, SF typography, a typed introduction and a quiet grey footer.
Version: 3.8.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: made-by-jimmy
Tags: portfolio, full-site-editing, block-patterns, one-column
*/

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "kern"; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
img { height: auto; }
.mbj-card, .mbj-tile { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- Masthead: centred wordmark, no navigation ---------- */
.mbj-header { position: relative; z-index: 2; background: transparent; }
.mbj-masthead { padding: 22px 22px 0; text-align: center; }

/* ---------- Pill buttons ---------- */
.wp-block-button__link { border-radius: 980px !important; font-size: 17px !important; padding: 11px 21px !important; letter-spacing: -0.022em; min-width: 28px; }
.wp-block-button__link:hover { background-color: #0077ed !important; text-decoration: none !important; }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent !important;
	color: var(--wp--preset--color--accent) !important;
	border: 1px solid var(--wp--preset--color--accent) !important;
	padding: 10px 20px !important;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--accent) !important; color: #fff !important; }

/* ---------- Intro ---------- */
.mbj-intro { padding: clamp(64px, 9vw, 112px) 22px clamp(56px, 7vw, 88px); text-align: center; }
.mbj-intro__title { font-size: clamp(48px, 6vw, 64px) !important; line-height: 1.0625 !important; font-weight: 600 !important; letter-spacing: -0.009em !important; margin-top: 0 !important; margin-bottom: 0 !important; }
.mbj-intro__text { font-size: clamp(21px, 2.4vw, 28px); line-height: 1.14; letter-spacing: 0.007em; color: var(--wp--preset--color--contrast); margin-top: 10px !important; margin-bottom: 0 !important; }

/* ---------- Section heading ---------- */
.mbj-projects__head { padding: 0 22px 32px; }
.mbj-section-title { font-size: clamp(32px, 4vw, 48px) !important; line-height: 1.08 !important; font-weight: 600 !important; letter-spacing: -0.003em !important; margin-top: 0 !important; margin-bottom: 0 !important; }

/* ---------- Tiles ---------- */
.mbj-projects > * + * { margin-top: 12px !important; }
.mbj-tile {
	position: relative;
	padding: 56px 22px 0;
	min-height: 580px;
	text-align: center;
	overflow: hidden;
	display: flex; flex-direction: column; align-items: center;
}
.mbj-tile > * { margin-left: auto !important; margin-right: auto !important; }
.mbj-tile__kicker { font-size: 17px; font-weight: 600; color: #bf4800; margin-top: 0 !important; margin-bottom: 6px !important; letter-spacing: -0.022em; }
.mbj-tile__title { font-size: clamp(40px, 5vw, 56px) !important; line-height: 1.07 !important; font-weight: 600 !important; letter-spacing: -0.005em !important; margin-top: 0 !important; margin-bottom: 0 !important; }
.mbj-tile__tagline { font-size: clamp(21px, 2.2vw, 28px); line-height: 1.14; letter-spacing: 0.007em; margin-top: 6px !important; margin-bottom: 0 !important; max-width: 640px; }
.mbj-tile__buttons { margin-top: 20px !important; justify-content: center; gap: 14px; }

/* Royalists — black tile */
.mbj-tile--royal { background: var(--wp--preset--color--black); color: #f5f5f7; min-height: 0; }
.mbj-tile--royal .wp-block-button.is-style-outline .wp-block-button__link { color: var(--wp--preset--color--link-dark) !important; border-color: var(--wp--preset--color--link-dark) !important; }
.mbj-tile--royal .wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--link-dark) !important; color: #000 !important; }
/* Rejoiners — light grey tile */


/* Pair grid */
.mbj-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-inline: 12px; }
.mbj-pair .mbj-tile { margin: 0 !important; min-height: 580px; background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); }
.mbj-pair .mbj-tile__title { font-size: clamp(36px, 3.6vw, 48px) !important; }
.mbj-pair .mbj-tile__tagline { font-size: clamp(19px, 1.8vw, 24px); max-width: 420px; }
.mbj-pair .wp-block-button__link { font-size: 14px !important; padding: 8px 16px !important; }
.mbj-pair .mbj-tile__buttons { margin-bottom: 48px !important; }

/* Quorum visual — membership card */
.mbj-card {
	margin: auto auto 64px !important;
	width: min(340px, 100%);
	aspect-ratio: 1.586;
	border-radius: 18px;
	background: #ffffff;
	color: #1d1d1f;
	padding: 22px;
	display: flex; flex-direction: column; justify-content: space-between;
	text-align: left;
	box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 20px 40px -12px rgba(0,0,0,.18);
}
.mbj-card__top { display: flex; justify-content: space-between; font-size: 12px; color: #6e6e73; }
.mbj-card__top span:first-child { color: #1d1d1f; font-size: 15px; font-weight: 600; }
.mbj-card__bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.mbj-card__label { display: block; font-size: 12px; color: #6e6e73; }
.mbj-card__name { display: block; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.mbj-card__valid { display: block; font-size: 12px; color: #6e6e73; margin-top: 2px; }
.mbj-qr { width: 72px; height: 72px; color: #1d1d1f; }

/* ---------- Project page ---------- */
.mbj-project-hero { padding: clamp(64px, 9vw, 112px) 22px clamp(40px, 5vw, 56px); text-align: center; }
.mbj-project-kicker { font-size: 17px; font-weight: 600; color: var(--wp--preset--color--muted); margin-top: 0 !important; margin-bottom: 8px !important; }
.mbj-project-kicker a { color: inherit; }
.mbj-project-title { font-size: clamp(48px, 7vw, 80px) !important; line-height: 1.05 !important; font-weight: 600 !important; letter-spacing: -0.015em !important; margin-top: 0 !important; margin-bottom: 0 !important; }
.mbj-project-hero .wp-block-post-excerpt { margin-top: 16px; }
.mbj-project-hero .wp-block-post-excerpt__excerpt { font-size: clamp(21px, 2.2vw, 28px); line-height: 1.2; letter-spacing: 0.004em; color: var(--wp--preset--color--contrast); margin: 0 auto; max-width: 760px; }
.mbj-tags { font-size: 14px; color: var(--wp--preset--color--muted); margin-top: 20px !important; }
.mbj-tags a { color: inherit; }
.mbj-project-image { padding-inline: 22px; }
.mbj-project-image img { border-radius: 18px; }
.mbj-prose { padding: 32px 22px clamp(48px, 6vw, 80px); font-size: 19px; line-height: 1.53; letter-spacing: 0.012em; }
.mbj-prose .wp-block-buttons { margin-top: 32px; }
.mbj-back { padding: 0 22px clamp(72px, 9vw, 112px); }
.mbj-back a::after { content: " ›"; }
.mbj-back a:first-child::before { content: none; }

/* Archive list */
.mbj-list { padding: clamp(64px, 9vw, 112px) 22px; }
.mbj-list .wp-block-post-template { border-top: 1px solid #d2d2d7; }
.mbj-list .wp-block-post-template > li { border-bottom: 1px solid #d2d2d7; padding: 24px 0; margin: 0; }
.mbj-list .wp-block-post-title { font-size: 28px; margin: 0; }
.mbj-list .wp-block-post-title a { color: var(--wp--preset--color--contrast); }
.mbj-list .wp-block-post-excerpt { color: var(--wp--preset--color--muted); margin-top: 6px; }
.mbj-list .wp-block-post-excerpt__excerpt { margin: 0; }

/* ---------- Footer (Apple-style) ---------- */
.mbj-footer { background: var(--wp--preset--color--surface); color: #424245; font-size: 13px; line-height: 1.33; letter-spacing: -0.01em; padding: 17px 22px 21px; margin-top: 12px !important; }
.mbj-footer__contact { margin-top: 0 !important; margin-bottom: 0 !important; padding-bottom: 14px; border-bottom: 1px solid #d2d2d7; }
.mbj-footer a { color: var(--wp--preset--color--link); }
.mbj-footer__meta { padding-top: 14px; }
.mbj-footer__meta p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 833px) {
	.mbj-pair { grid-template-columns: 1fr; padding-inline: 0; }
}
@media (max-width: 734px) {
	.mbj-tile { min-height: 500px; padding-top: 48px; }
	.mbj-tile--royal { min-height: 0; }
	.mbj-pair .mbj-tile { min-height: 0; }
}

/* ---------- Wordmark: madebyjimmy.co.uk ---------- */
.mbj-logo {
	display: inline-block;
	font-size: 22px; line-height: 1; font-weight: 400; letter-spacing: -0.025em;
	color: #1d1d1f;
	text-decoration: none !important;
	transition: color .3s ease;
}
.mbj-logo:hover { color: #000; }
.mbj-logo__tld { color: var(--wp--preset--color--accent); font-weight: 400; }

/* ---------- Royalists logo ---------- */
.mbj-tile--royal { padding-bottom: 64px; }
.mbj-tile__logo { margin: 0 auto !important; }
.mbj-tile__logo img { display: block; width: auto; height: clamp(3.5rem, 6vw, 4.5rem); max-width: 80vw; object-fit: contain; }
.mbj-tile--royal .mbj-tile__tagline { margin-top: 18px !important; }

/* ---------- Plinth image ---------- */
.mbj-tile__image { margin: auto 0 0 !important; padding-top: 40px; width: 100%; max-width: 380px; }
.mbj-tile__image img { display: block; width: 100%; height: auto; border-radius: 18px 18px 0 0; }
.mbj-pair .mbj-tile--plinth .mbj-tile__buttons { margin-bottom: 0 !important; }

/* ---------- Rejoiners: coming soon ---------- */
.mbj-tile--europe {
	background: radial-gradient(120% 90% at 50% 0%, #12307f 0%, #0a1d55 55%, #07143c 100%);
	color: #ffffff;
	min-height: 0;
	padding-bottom: 72px;
	margin-top: 12px !important;
}
.mbj-tile--europe .mbj-tile__tagline { color: rgba(255,255,255,.78); }
.mbj-tile--europe .wp-block-button__link { background: #ffffff !important; color: #0a1d55 !important; }
.mbj-tile--europe .wp-block-button__link:hover { background: #ffcc00 !important; }
.mbj-soon { margin: 0 auto 20px !important; width: 128px; height: 128px; }
.mbj-soon__ring { width: 100%; height: 100%; overflow: visible; }
.mbj-soon__ring circle, .mbj-soon__ring polygon { fill: #ffcc00; transform-box: fill-box; transform-origin: center; }
/* Default (no JS / reduced motion): settled stars */
.mbj-soon__ring circle { opacity: 0; }
/* Animated sequence (JS adds .is-anim) */
.mbj-soon.is-anim .mbj-soon__dot { opacity: .14; }
.mbj-soon.is-anim circle { opacity: 1; transform: scale(var(--s, .8)); transition: opacity .5s ease, transform .6s cubic-bezier(.45,0,.2,1); }
.mbj-soon.is-anim polygon { opacity: 0; transform: scale(.35) rotate(-72deg); transition: transform 1.1s cubic-bezier(.22,1.25,.36,1), opacity .6s ease; }
.mbj-soon.is-anim.is-stars circle { opacity: 0; transform: scale(.4); }
.mbj-soon.is-anim.is-stars polygon { opacity: 1; transform: scale(1) rotate(0deg); transition-delay: calc(var(--i) * 70ms); }
.mbj-soon.is-anim.is-stars circle { transition-delay: calc(var(--i) * 70ms); }

.mbj-soon-label { color: #ffcc00 !important; }

/* ---------- Typewriter ---------- */
.mbj-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mbj-caret {
	display: inline-block;
	width: 0.07em; height: 0.95em;
	margin-left: 0.05em;
	vertical-align: -0.1em;
	background: var(--wp--preset--color--accent);
	border-radius: 1px;
	animation: mbj-blink 1s steps(1) infinite;
}
@keyframes mbj-blink { 50% { opacity: 0; } }

/* ---------- Intro: full-screen typing, then settles ---------- */
.mbj-intro {
	display: flex; flex-direction: column; justify-content: center;
	min-height: 0;
	transition: min-height 1.1s cubic-bezier(.65,0,.35,1), padding 1.1s cubic-bezier(.65,0,.35,1);
}
.mbj-intro > * { width: 100%; }
.mbj-intro__title, .mbj-intro__text, .mbj-intro__extra {
	transition: font-size 1.1s cubic-bezier(.65,0,.35,1), margin 1.1s cubic-bezier(.65,0,.35,1), opacity .4s ease;
}
.mbj-intro__extra { font-size: clamp(21px, 2.4vw, 28px); line-height: 1.2; color: #515154; margin-top: 0 !important; margin-bottom: 0 !important; min-height: 1.2em; }
.mbj-intro-anim .mbj-intro { min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); padding-block: 0; }
.mbj-intro-anim .mbj-intro__title { font-size: clamp(48px, 9vw, 136px) !important; letter-spacing: -0.03em !important; }
.mbj-intro-anim .mbj-intro__text, .mbj-intro-anim .mbj-intro__extra { font-size: clamp(24px, 3.4vw, 48px); margin-top: 0.4em !important; }
.mbj-intro-anim .mbj-type:not(.is-ready) { visibility: hidden; }
.mbj-caret.is-gone { opacity: 0; transition: opacity .4s ease; }

/* ---------- Lock the page until the intro has settled, then fade in ---------- */
.mbj-projects, footer.wp-block-template-part {
	transition: opacity 1s ease, visibility 0s linear 0s;
}
html.mbj-intro-lock, html.mbj-intro-lock body { overflow: hidden; }
html.mbj-intro-lock .mbj-projects,
html.mbj-intro-lock footer.wp-block-template-part {
	opacity: 0;
	visibility: hidden;
	transition: none;
}

/* ---------- The Royalists wordmark (per brand spec, off-white on dark) ---------- */
.mbj-wordmark {
	font-family: 'Ubuntu', sans-serif;
	font-size: clamp(0.875rem, 1.5vw, 1.0625rem);
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #f5f7fc;
	line-height: 1.2;
	margin-top: 0.125rem !important;
	margin-bottom: 0 !important;
}
.mbj-tile--royal .mbj-tile__tagline { margin-top: 22px !important; }

/* Highlight-then-delete selection */
.mbj-selected { background: #b3d7ff; color: #1d1d1f; border-radius: 2px; }

/* Subtitle always on one line */
.mbj-intro__text { white-space: nowrap; font-size: min(28px, 3.5vw) !important; }
.mbj-intro-anim .mbj-intro__text, .mbj-intro-anim .mbj-intro__extra { font-size: min(42px, 3.5vw) !important; }
.mbj-intro__extra { white-space: nowrap; }

/* Stats row (project pages) */
.mbj-stats { margin-top: 32px !important; margin-bottom: 8px !important; gap: 24px !important; text-align: left; }
.mbj-stats > .wp-block-column { border-top: 1px solid #d2d2d7; padding-top: 18px; }
.mbj-stat__value { white-space: nowrap; font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 6px !important; }
.mbj-stat__label { font-size: 15px; line-height: 1.4; color: #424245; margin: 0 !important; }

/* ---------- The Royalists tile: royal blue with faint video ---------- */
.mbj-tile--royal { background: radial-gradient(120% 90% at 50% 0%, #12307f 0%, #0a1d55 55%, #07143c 100%) !important; color: #f5f7fc; isolation: isolate; }
.mbj-tile__video {
	position: absolute; inset: 0; z-index: -1;
	width: 100%; height: 100%;
	object-fit: cover;
	object-position: 50% 70%;
	opacity: 0;
	transition: opacity 1.2s ease;
	mix-blend-mode: luminosity;
	pointer-events: none;
	margin: 0 !important; max-width: none !important;
}
.mbj-tile--royal .mbj-tile__tagline { color: rgba(245, 247, 252, 0.88); }
.mbj-tile--royal .wp-block-button:not(.is-style-outline) .wp-block-button__link { background: #f5f7fc !important; color: #0a1d55 !important; }
.mbj-tile--royal .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { background: #ffffff !important; }
.mbj-tile--royal .wp-block-button.is-style-outline .wp-block-button__link { color: #f5f7fc !important; border-color: rgba(245, 247, 252, 0.7) !important; }
.mbj-tile--royal .wp-block-button.is-style-outline .wp-block-button__link:hover { background: #f5f7fc !important; color: #223b97 !important; }
@media (prefers-reduced-motion: reduce) { .mbj-tile__video { display: none; } }

.mbj-tile__video.is-ready { opacity: 0.14; }

/* ---------- Centred section title ---------- */
.mbj-section-title { text-align: center; }

/* ---------- Slava Ukraini → flag ---------- */
.mbj-ua {
	position: relative;
	display: flex; justify-content: center; align-items: center; gap: 0.3em;
	height: 30px;
	margin: 8px auto 0 !important;
	font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
	overflow: visible;
	transition: height .8s cubic-bezier(.65,0,.35,1) .5s, margin .8s cubic-bezier(.65,0,.35,1) .5s, opacity .5s ease;
}
.mbj-ua__w { display: inline-block; transition: transform .9s cubic-bezier(.65,0,.35,1), opacity .6s ease .25s, filter .9s ease; }
.mbj-ua__w1 { color: #0057b7; }
.mbj-ua__w2 { color: #ffd700; text-shadow: 0 0 1px rgba(0, 0, 0, .35); }
.mbj-ua__flag {
	position: absolute; left: 50%; top: 50%;
	width: 42px; height: 28px;
	margin: -14px 0 0 -21px;
	border-radius: 3px; overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: 0 1px 3px rgba(0,0,0,.15);
	opacity: 0; transform: scale(.4, .1);
	transition: transform .8s cubic-bezier(.34,1.4,.64,1) .35s, opacity .4s ease .35s;
}
.mbj-ua__flag i { flex: 1; display: block; }
.mbj-ua__flag i:first-child { background: #0057b7; }
.mbj-ua__flag i:last-child { background: #ffd700; }
/* merge: Slava drops into the top stripe, Ukraini rises into the bottom one */
.mbj-ua.is-merge .mbj-ua__w1 { transform: translate(55%, -2px) scale(.35, .18); opacity: 0; filter: blur(2px); }
.mbj-ua.is-merge .mbj-ua__w2 { transform: translate(-40%, 2px) scale(.35, .18); opacity: 0; filter: blur(2px); }
.mbj-ua.is-merge .mbj-ua__flag { opacity: 1; transform: none; animation: mbj-wave 2.4s ease-in-out .9s 1; }
@keyframes mbj-wave { 0%,100% { transform: none; } 30% { transform: skewY(-3deg) scaleX(1.03); } 65% { transform: skewY(2deg); } }
/* vanish and close the gap */
.mbj-ua.is-gone { opacity: 0; height: 0; margin-top: 0 !important; }
.mbj-ua.is-gone .mbj-ua__flag { transform: scale(.2); opacity: 0; transition: transform .6s ease, opacity .5s ease; }
html.mbj-ua-seen .mbj-ua { display: none; }
@media (prefers-reduced-motion: reduce) { .mbj-ua, .mbj-ua * { transition: none !important; animation: none !important; } }
