/*
 * 33Science t33 sitewide theme layer (handle: t33-theme)
 * Loads on EVERY front-end page.
 *
 * Contains: design tokens, shared primitives, shared card internals,
 * transparent→solid header (scoped body.t33-dark-hero), the generic
 * .t33-stars twinkle layer, and the .t33-page-hero band used by all
 * non-front templates.
 *
 * These rules were extracted from css/homepage.css (June 2026), which
 * now keeps only homepage-section styles scoped to body.t33-home.
 */

/* ---------------------------------------- */
/* Design tokens                            */
/* ---------------------------------------- */

body {
	--t33-navy-1: #070b1a;
	--t33-navy-2: #0d1530;
	--t33-navy-3: #16213f;
	--t33-cyan: #2bc8e8;
	--t33-coral: #f67280;
	--t33-ink: #1b2233;
	--t33-ink-soft: #5a6378;
	--t33-paper: #ffffff;
	--t33-paper-soft: #fff7f3;
	--t33-radius: 14px;
	--t33-shadow: 0 10px 30px rgba(7, 11, 26, 0.10);
	--t33-shadow-lift: 0 18px 44px rgba(7, 11, 26, 0.16);
}

/*
 * Outranks WP's inline custom-background style printed late in wp_head.
 * The .t33-dark-hero variant (present on every page) supplies the extra
 * specificity needed to beat WP's inline body.custom-background rule,
 * which prints after enqueued styles and would win a specificity tie.
 */
body.custom-background,
body.t33-dark-hero.custom-background,
body {
	background: var(--t33-paper);
}

/* ---------------------------------------- */
/* Shared primitives                        */
/* ---------------------------------------- */

.t33-container {
	width: 100%;
	max-width: var(--container-max-width, 1280px);
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
}

.t33-kicker {
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--t33-cyan);
	margin: 0 0 14px;
}

.t33-kicker-dark {
	color: #0e96b2;
}

.t33-section-head {
	text-align: center;
	margin-bottom: 44px;
}

.t33-section-title {
	font-size: clamp(1.9rem, 3.6vw, 2.6rem);
	font-weight: 900;
	letter-spacing: -0.02em;
	color: var(--t33-ink);
	margin: 0;
}

.t33-grad {
	background: linear-gradient(100deg, var(--t33-cyan) 10%, #7ae0f5 45%, var(--t33-coral) 95%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.t33-pill {
	display: inline-block;
	align-self: flex-start;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #073542;
	background: var(--t33-cyan);
	border-radius: 999px;
	padding: 4px 12px;
	line-height: 1.5;
}

.t33-pill-light {
	background: rgba(43, 200, 232, 0.14);
	color: #0a7e9c;
}

.t33-arrow {
	display: inline-block;
	transition: transform 0.25s ease;
}

.t33-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 0.95rem;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(120deg, #0a90ae, var(--t33-cyan));
	border-radius: 999px;
	padding: 14px 30px;
	text-decoration: none;
	box-shadow: 0 8px 22px rgba(43, 200, 232, 0.35);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.t33-btn:hover {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(43, 200, 232, 0.45);
}

.t33-btn:hover .t33-arrow {
	transform: translateX(4px);
}

.t33-btn-ghost {
	background: transparent;
	border: 1.5px solid rgba(255, 255, 255, 0.45);
	box-shadow: none;
}

.t33-btn-ghost:hover {
	border-color: var(--t33-cyan);
	background: rgba(43, 200, 232, 0.12);
	box-shadow: none;
}

.t33-readmore {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 800;
	color: var(--t33-cyan);
	margin-top: 4px;
}

/* Topic chips */
.t33-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--t33-ink);
	background: #fff;
	border: 1.5px solid #e3e7ef;
	border-radius: 999px;
	padding: 9px 18px;
	text-decoration: none;
	transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.t33-chip:hover {
	background: var(--t33-navy-3);
	border-color: var(--t33-navy-3);
	color: #fff;
	transform: translateY(-2px);
}

.t33-chip-count {
	font-size: 0.74rem;
	font-weight: 800;
	color: #0a7e9c;
	background: rgba(43, 200, 232, 0.14);
	border-radius: 999px;
	padding: 2px 9px;
	transition: background 0.25s ease, color 0.25s ease;
}

.t33-chip:hover .t33-chip-count {
	background: rgba(43, 200, 232, 0.25);
	color: #aef0ff;
}

/* Scroll reveal */
.t33-reveal {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.55s ease, transform 0.55s ease;
	transition-delay: calc(var(--i, 0) * 90ms);
}

.t33-reveal.is-in {
	opacity: 1;
	transform: none;
}

/* No-JS: never hide content (t33-theme.js removes the class) */
body.t33-no-js .t33-reveal {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.t33-reveal {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}

/* ---------------------------------------- */
/* Shared card internals                    */
/* (used by homepage cards + .t33-card)     */
/* ---------------------------------------- */

.t33-card-media {
	display: block;
	overflow: hidden;
}

.t33-card-media img {
	display: block;
	width: 100%;
	height: 170px;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.t33-card:hover .t33-card-media img {
	transform: scale(1.06);
}

.t33-card-body {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 16px 18px 18px;
	flex: 1;
}

.t33-card-title {
	font-size: 1.02rem;
	font-weight: 800;
	line-height: 1.35;
	color: var(--t33-ink);
	transition: color 0.2s ease;
}

.t33-card-excerpt {
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--t33-ink-soft);
}

.t33-card-date {
	font-size: 0.78rem;
	font-weight: 700;
	color: #9aa3b5;
	margin-top: auto;
}

/* ---------------------------------------- */
/* Transparent → solid header               */
/* (scoped body.t33-dark-hero — every page) */
/* ---------------------------------------- */

body.t33-dark-hero .site-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1200;
	max-width: 100%;
	width: 100%;
	margin: 0;
	padding: 14px 0;
	background: transparent;
	transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
}

/* Guard: parent sets .has-custom-header .site-header { background: var(...) } */
body.t33-dark-hero.has-custom-header .site-header {
	background: transparent;
}

body.t33-dark-hero .site-header .container.header-layout-wrapper {
	max-width: var(--container-max-width, 1280px);
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
}

/* Light-on-dark state (not scrolled) */
body.t33-dark-hero:not(.t33-scrolled) .site-header .primary-nav > li > a,
body.t33-dark-hero:not(.t33-scrolled) .site-header .toggle span,
body.t33-dark-hero:not(.t33-scrolled) .site-header .toggle i[class*="icon"],
body.t33-dark-hero:not(.t33-scrolled) .site-header .custom-logo-link {
	color: #fff;
}

body.t33-dark-hero:not(.t33-scrolled) .site-header .primary-nav > li:hover > a {
	color: var(--t33-cyan);
}

body.t33-dark-hero:not(.t33-scrolled) .site-header .toggle span:hover,
body.t33-dark-hero:not(.t33-scrolled) .site-header .toggle span:hover i[class*="icon"] {
	color: var(--t33-cyan);
}

/* Keep dropdown sub-menus readable (they have their own light panel) */
body.t33-dark-hero .site-header .primary-nav li ul.sub-menu {
	background: #fff;
}

/* Scrolled: fixed solid header sliding down */
body.t33-dark-hero.t33-scrolled .site-header {
	position: fixed;
	background: rgba(255, 255, 255, 0.96);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 2px 16px rgba(7, 11, 26, 0.10);
	padding: 6px 0;
	animation: t33-header-in 0.3s ease;
}

/* Guard: scrolled wins over the has-custom-header transparent guard above */
body.t33-dark-hero.has-custom-header.t33-scrolled .site-header {
	background: rgba(255, 255, 255, 0.96);
}

@keyframes t33-header-in {
	from { transform: translateY(-100%); }
	to   { transform: translateY(0); }
}

/* Mobile header inherits the same two states */
body.t33-dark-hero .site-header .mobile-header,
body.t33-dark-hero.has-custom-header .site-header .mobile-header {
	background: transparent;
}

body.t33-dark-hero:not(.t33-scrolled) .site-header .mobile-header .mobile-toggle span,
body.t33-dark-hero:not(.t33-scrolled) .site-header .mobile-header .mobile-toggle i[class*="icon"] {
	color: #fff;
}

/* ---------------------------------------- */
/* .t33-stars — CSS-only twinkle layer      */
/* (shared with homepage .t33-mission-stars;*/
/* distinct from the homepage hero canvas,  */
/* which is the ID #t33-stars and has no    */
/* class, so this rule never touches it)    */
/* ---------------------------------------- */

.t33-stars,
.t33-mission-stars {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		radial-gradient(1.5px 1.5px at 12% 25%, rgba(255, 255, 255, 0.9), transparent 100%),
		radial-gradient(1px 1px at 28% 70%, rgba(255, 255, 255, 0.7), transparent 100%),
		radial-gradient(2px 2px at 45% 15%, rgba(255, 255, 255, 0.8), transparent 100%),
		radial-gradient(1px 1px at 62% 55%, rgba(255, 255, 255, 0.6), transparent 100%),
		radial-gradient(1.5px 1.5px at 78% 30%, rgba(255, 255, 255, 0.85), transparent 100%),
		radial-gradient(1px 1px at 90% 75%, rgba(255, 255, 255, 0.7), transparent 100%),
		radial-gradient(1.5px 1.5px at 35% 85%, rgba(255, 255, 255, 0.75), transparent 100%),
		radial-gradient(1px 1px at 55% 40%, rgba(255, 255, 255, 0.65), transparent 100%);
	animation: t33-twinkle 5s ease-in-out infinite alternate;
}

@keyframes t33-twinkle {
	from { opacity: 0.45; }
	to   { opacity: 1; }
}

/* ---------------------------------------- */
/* Page hero band (.t33-page-hero)          */
/* ---------------------------------------- */

.t33-page-hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(900px 420px at 85% -10%, rgba(108, 91, 123, 0.32), transparent 60%),
		radial-gradient(700px 380px at 8% 110%, rgba(53, 92, 125, 0.45), transparent 65%),
		linear-gradient(160deg, var(--t33-navy-3) 0%, var(--t33-navy-2) 50%, var(--t33-navy-1) 100%);
	padding: 170px 0 90px;
}

.t33-page-hero--tall {
	padding: 200px 0 130px;
	min-height: 60vh;
}

/*
 * Generic single hero glow. Scoped under .t33-page-hero so it cannot
 * collide with the homepage's .t33-hero-glow-1/-2 variants, which set
 * their own geometry in homepage.css.
 */
.t33-page-hero .t33-hero-glow {
	position: absolute;
	width: 420px;
	height: 420px;
	top: -120px;
	right: -80px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(43, 200, 232, 0.18), transparent 70%);
	filter: blur(90px);
	opacity: 0.5;
	animation: t33-glow-drift 14s ease-in-out infinite alternate;
}

/* Local copy of the homepage's t33-drift so this file is self-contained */
@keyframes t33-glow-drift {
	from { transform: translate3d(0, 0, 0) scale(1); }
	to   { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

.t33-page-hero-inner {
	position: relative;
	z-index: 2;
}

.t33-page-hero--center .t33-page-hero-inner {
	text-align: center;
}

.t33-page-hero--left .t33-page-hero-inner {
	text-align: left;
}

.t33-page-hero-title {
	font-size: clamp(2rem, 4.5vw, 3.1rem);
	font-weight: 900;
	letter-spacing: -0.025em;
	line-height: 1.12;
	color: #fff;
	margin: 0 0 14px;
}

.t33-page-hero-lede {
	font-size: 1.02rem;
	line-height: 1.65;
	color: rgba(232, 238, 252, 0.75);
	max-width: 720px;
}

.t33-page-hero-meta {
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(232, 238, 252, 0.6);
	margin-top: 14px;
}

.t33-page-hero--center .t33-page-hero-lede,
.t33-page-hero--center .t33-page-hero-meta {
	margin-left: auto;
	margin-right: auto;
}

.t33-page-hero-meta a {
	color: var(--t33-cyan);
	text-decoration: none;
}

.t33-meta-dot {
	margin: 0 8px;
	opacity: 0.55;
}

.t33-hero-back {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 800;
	color: var(--t33-cyan);
	margin-bottom: 18px;
	text-decoration: none;
	transition: transform 0.25s ease;
}

.t33-hero-back:hover {
	color: var(--t33-cyan);
	transform: translateX(-3px);
}

@media (max-width: 600px) {
	.t33-page-hero {
		padding: 130px 0 70px;
	}
}

/* ---------------------------------------- */
/* Heroless-template fallback               */
/* ---------------------------------------- */

/*
 * Selector choice: the parent theme renders NO #content element.
 * Each template's main column is a <div class="wrap"> printed directly
 * inside <body> (verified in ruki/single.php, ruki/footer.php,
 * ruki/header.php — header.php closes nothing, footer.php closes
 * nothing around the template output). The .t33-page-hero partial is
 * also printed at body level (between get_header() and .wrap), so the
 * general-sibling override below cancels the fallback padding whenever
 * a hero band is present on the page.
 */
body.t33-dark-hero > .wrap {
	padding-top: 120px;
}

body.t33-dark-hero .t33-page-hero ~ .wrap {
	padding-top: 0;
}

/* ---------------------------------------- */
/* Reduced motion                           */
/* ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.t33-stars,
	.t33-mission-stars,
	.t33-page-hero .t33-hero-glow {
		animation: none;
	}

	body.t33-dark-hero.t33-scrolled .site-header {
		animation: none;
	}

	.t33-hero-back {
		transition: none;
	}
}
