/* ==========================================================================
   Variables
   ========================================================================== */
:root {
	--color-primary: #667eea;
	--color-secondary: #764ba2;
	--gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
	--color-text: #333;
	--color-muted: #666;
	--color-border: #e0e0e0;
	--color-bg: #f5f5f5;
	--color-surface: #fff;
	--color-soft: #f8f8f8;
	--color-pink: linear-gradient(135deg, #ff6b9d, #ff8fab);
	--color-online: #4ade80;
	--font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	--container: 1200px;
	--radius: 15px;
	--header-height: 64px;
	--shadow: 0 4px 15px rgba(0, 0, 0, .1);
	--shadow-hover: 0 12px 30px rgba(0, 0, 0, .2);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }

body {
	margin: 0;
	font-family: var(--font-base);
	font-size: 16px;
	line-height: 1.6;
	color: var(--color-text);
	background: var(--color-bg);
	-webkit-font-smoothing: antialiased;
}
body.home { padding-bottom: 80px; }

img,
video { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; }

h1, h2, h3, h4, h5, h6 { line-height: 1.3; margin: 0 0 .6em; }

.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 20px;
}
.container--narrow { max-width: 860px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ==========================================================================
   Buttons & badges
   ========================================================================== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 28px;
	border: 0;
	border-radius: 25px;
	background: var(--gradient);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: transform .3s, box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102, 126, 234, .4); }
.btn--sm { padding: 10px 24px; font-size: 14px; }
.btn--outline {
	background: var(--color-surface);
	color: var(--color-primary);
	box-shadow: inset 0 0 0 2px var(--color-primary);
}
.btn--outline:hover { background: var(--gradient); color: #fff; box-shadow: 0 6px 20px rgba(102, 126, 234, .4); }
.btn--ghost { background: var(--color-soft); color: var(--color-text); box-shadow: inset 0 0 0 2px var(--color-border); }
.btn--ghost:hover { box-shadow: inset 0 0 0 2px #ccc; }

.badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 15px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	color: #fff;
}
.badge--note { background: var(--color-pink); }
.badge--main { background: var(--color-online); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	background: rgba(255, 255, 255, .95);
	backdrop-filter: blur(10px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}
.admin-bar .site-header { top: 32px; }

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: var(--header-height);
	padding-top: 10px;
	padding-bottom: 10px;
}

.site-title {
	font-size: 24px;
	font-weight: 700;
	background: var(--gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.custom-logo { max-height: 44px; width: auto; }

.site-header__actions { display: flex; align-items: center; gap: 12px; }

.lang-switcher {
	display: flex;
	gap: 2px;
	margin: 0;
	padding: 3px;
	list-style: none;
	border-radius: 20px;
	background: #f0f0f5;
}
.lang-switcher a {
	display: block;
	padding: 5px 9px;
	border-radius: 16px;
	color: #555;
	font-size: 12px;
	white-space: nowrap;
}
.lang-switcher a.is-active {
	background: #fff;
	color: var(--color-secondary);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .13);
	font-weight: 700;
}

.site-main { min-height: 60vh; padding-top: var(--header-height); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
	position: relative;
	height: 600px;
	overflow: hidden;
	background: var(--gradient);
}

.hero__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	transition: background-image 1s ease-in-out;
}
.hero__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 40%, transparent), color-mix(in srgb, var(--color-secondary) 40%, transparent));
}

.hero__overlay {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 20px;
	color: #fff;
	text-align: center;
}

.hero__title {
	max-width: 900px;
	margin-bottom: 20px;
	font-size: 48px;
	font-weight: 700;
	text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.hero__desc {
	max-width: 760px;
	margin: 0 0 30px;
	font-size: 20px;
	opacity: .95;
}

.hero__tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.tag {
	padding: 8px 20px;
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 20px;
	background: rgba(255, 255, 255, .2);
	backdrop-filter: blur(10px);
	font-size: 14px;
}

/* ==========================================================================
   Sections & cards
   ========================================================================== */
.section { padding: 30px 0; }
.hero + .section { padding-top: 50px; }

.section__header { margin-bottom: 40px; text-align: center; }
.section__title { margin-bottom: 10px; font-size: 36px; color: var(--color-text); }
.section__desc { margin: 0; color: var(--color-muted); font-size: 16px; }
.section__more { margin-top: 50px; text-align: center; }
.section__more .btn { border: 0; font-family: inherit; cursor: pointer; }

.card[hidden] { display: none; }
.card.is-new { animation: gauapp-fade-up .5s ease backwards; }
@keyframes gauapp-fade-up { from { opacity: 0; transform: translateY(20px); } }

.card-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

.card {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	border-radius: var(--radius);
	background: #ddd;
	box-shadow: var(--shadow);
	cursor: pointer;
	transition: transform .3s ease, box-shadow .3s ease;
}
.card:nth-child(even) { margin-top: 40px; }
.card:hover,
.card:active { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-hover); }
.card:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }

.card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform .3s ease;
}
.card:hover .card__img,
.card:active .card__img { transform: scale(1.05); }
.card__placeholder { background: var(--gradient); }

.card__link { color: inherit; }
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 3; }

.card__info {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding: 20px;
	background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
	color: #fff;
}
.card__title { margin: 0; font-size: 18px; font-weight: 700; }
.card__desc {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	max-width: 55%;
	font-size: 14px;
	text-align: right;
	opacity: .9;
}

.card--project .badge { position: absolute; z-index: 2; }
.card--project .badge--note { top: 15px; right: 15px; }
.card--project .badge--main { bottom: 15px; left: 15px; }

/* ==========================================================================
   Fixed CTA bar & footer
   ========================================================================== */
.fixed-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99;
	display: flex;
	justify-content: center;
	padding: 15px 20px;
	pointer-events: none;
}
.fixed-bar__btn {
	padding: 12px 50px;
	border-radius: 25px;
	background: var(--gradient);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	box-shadow: 0 4px 15px rgba(102, 126, 234, .4);
	animation: gauapp-pulse 2s ease-in-out infinite;
	pointer-events: auto;
}

@keyframes gauapp-pulse {
	0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(102, 126, 234, .4); }
	50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(102, 126, 234, .6); }
}

.site-footer {
	padding: 20px 0;
	color: #999;
	font-size: 13px;
	text-align: center;
}
.site-footer p { margin: 0; }

/* ==========================================================================
   Detail & archive
   ========================================================================== */
.item-detail { padding: 48px 0 80px; }
.item-detail .container--narrow {
	padding: 32px 40px;
	border-radius: 20px;
	background: var(--color-surface);
	box-shadow: var(--shadow);
}
.back-link { display: inline-block; margin-bottom: 24px; color: var(--color-muted); }
.back-link:hover { color: var(--color-primary); }
.item-detail__title { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 700; }
.item-detail__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.item-detail__media { margin: 32px 0; }
.item-detail__media img { width: 100%; border-radius: var(--radius); }
.entry-content > * { margin-top: 0; margin-bottom: 1.2em; }

.pagination .nav-links {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 60px;
}
.pagination .page-numbers {
	min-width: 40px;
	padding: 8px 12px;
	border-radius: 20px;
	background: var(--color-surface);
	text-align: center;
	box-shadow: var(--shadow);
}
.pagination .page-numbers.current { background: var(--gradient); color: #fff; }

/* ==========================================================================
   Popup
   ========================================================================== */
.popup-open,
.popup-open body { overflow: hidden; }

.popup {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.popup[hidden] { display: none; }

.popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .7);
	opacity: 0;
	transition: opacity .3s;
}

.popup__dialog {
	position: relative;
	width: 100%;
	max-width: 500px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 40px;
	border-radius: 20px;
	background: #fff;
	opacity: 0;
	transform: scale(.96);
	transition: opacity .3s, transform .3s;
}
.popup.is-open .popup__overlay { opacity: 1; }
.popup.is-open .popup__dialog { opacity: 1; transform: none; }

.popup__close {
	position: absolute;
	top: 15px;
	right: 15px;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 35px;
	border: 0;
	border-radius: 50%;
	background: #f0f0f0;
	font-family: Arial, sans-serif;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background .3s;
}
.popup__close:hover { background: #e0e0e0; }

.popup__progress { margin-bottom: 30px; padding: 0 30px; }
.popup__bar {
	height: 8px;
	margin-bottom: 10px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--color-border);
}
.popup__bar span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--gradient);
	transition: width .3s;
}
.popup__count { color: var(--color-muted); font-size: 14px; text-align: center; }

.popup__item {
	margin: -14px 0 20px;
	color: var(--color-muted);
	font-size: 14px;
	text-align: center;
}
.popup__item strong { color: var(--color-secondary); }

.popup__question { margin-bottom: 30px; font-size: 22px; color: var(--color-text); text-align: center; }

.popup__options { display: flex; flex-direction: column; gap: 15px; }
.quiz-option {
	padding: 15px;
	border: 2px solid var(--color-border);
	border-radius: 10px;
	background: var(--color-soft);
	color: var(--color-text);
	font: inherit;
	font-size: 16px;
	cursor: pointer;
	transition: all .3s;
}
.quiz-option:hover,
.quiz-option:focus-visible {
	outline: none;
	border-color: var(--color-primary);
	background: var(--color-primary);
	color: #fff;
}

.popup__error { margin: 12px 0 0; color: #dc2626; font-size: 14px; text-align: center; }
.popup__error:empty { display: none; }

.popup__result { text-align: center; }
.popup__result-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: var(--gradient);
	color: #fff;
	font-size: 48px;
}
.popup__result-title { margin-bottom: 15px; font-size: 28px; color: var(--color-text); }
.popup__result-desc { margin: 0 0 30px; color: var(--color-muted); font-size: 16px; }

.popup__rules {
	margin-bottom: 30px;
	padding: 20px;
	border-radius: 10px;
	background: var(--color-soft);
	text-align: left;
}
.popup__rules h4 { margin-bottom: 10px; font-size: 16px; color: var(--color-text); }
.popup__rules ul { margin: 0; padding: 0; list-style: none; }
.popup__rules li {
	position: relative;
	padding: 8px 0 8px 20px;
	color: var(--color-muted);
	font-size: 14px;
}
.popup__rules li::before {
	content: "•";
	position: absolute;
	left: 0;
	color: var(--color-primary);
	font-weight: 700;
}

.popup__result-btn,
.popup__submit {
	display: block;
	width: 100%;
	padding: 15px;
	border: 0;
	border-radius: 10px;
	background: var(--gradient);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	text-align: center;
	cursor: pointer;
	transition: transform .3s;
}
.popup__result-btn:hover,
.popup__submit:hover { transform: scale(1.02); }

.popup__contact { margin-top: 24px; text-align: left; }
.popup__sent {
	margin: 0;
	padding: 16px;
	border-radius: 10px;
	background: #dcfce7;
	color: #166534;
	text-align: center;
}

.popup__divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 22px 0;
	color: #999;
	font-size: 13px;
}
.popup__divider::before,
.popup__divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }

.popup__form label { display: block; margin-bottom: 12px; }
.popup__form label span { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.popup__form input,
.popup__form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid var(--color-border);
	border-radius: 10px;
	background: var(--color-soft);
	font: inherit;
	transition: border-color .3s, background .3s;
}
.popup__form input:focus,
.popup__form textarea:focus { outline: none; border-color: var(--color-primary); background: #fff; }
.popup__form .popup__submit { margin-top: 8px; }
.form-row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.popup__hp { position: absolute !important; left: -9999px; }
.popup__form.is-loading { opacity: .6; pointer-events: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}

@media (max-width: 768px) {
	.hero { height: 400px; }
	.hero__title { font-size: 32px; }
	.hero__desc { font-size: 16px; }
	.section__title { font-size: 28px; }
	.card-grid { gap: 15px; }
	.card:nth-child(even) { margin-top: 20px; }
	.card__info { flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; }
	.card__desc { max-width: none; text-align: left; font-size: 12px; }
	.card__title { font-size: 16px; }
	.popup__dialog { padding: 30px 20px; }
	.item-detail .container--narrow { padding: 24px 20px; border-radius: 0; }
}

@media (max-width: 600px) {
	.admin-bar .site-header { top: 0; }
	.form-row--2,
}

@media (max-width: 480px) {
	.site-title { font-size: 19px; }
	.site-header__actions { gap: 6px; }
	.site-header__actions .btn { padding: 9px 12px; }
	.lang-switcher a { padding: 5px 7px; }
}

@media (prefers-reduced-motion: reduce) {
	.fixed-bar__btn { animation: none; }
}
