/* YSIA membership theme
   Palette is taken from the official logo. Do not invent a new one. */

:root {
	--navy: #484860;
	--navy-dark: #383850;
	--navy-deep: #2c2c40;
	--green: #6BB44C;
	--gold: #F5C44C;
	--gold-deep: #e0ae2e;
	--blue: #4E9CB8;
	--dot: #3BA3C7;
	--paper: #F7F5EF;
	--paper-2: #efebe3;
	--white: #ffffff;
	--text: #383850;
	--muted: #5c5c74;
	--line: rgba(72, 72, 96, 0.14);
	--shadow: 0 16px 40px rgba(56, 56, 80, 0.08);
	--radius: 1.25rem;
	--radius-sm: 0.75rem;
	--wrap: 72rem;
	--header-h: 5.5rem;
	--font: "Noto Sans TC", "Noto Sans SC", "Sora", system-ui, sans-serif;
	--font-en: "Sora", "Noto Sans TC", "Noto Sans SC", system-ui, sans-serif;
}

.ysia-lang-zh-cn {
	--font: "Noto Sans SC", "Noto Sans TC", "Sora", system-ui, sans-serif;
}

.ysia-lang-en {
	--font: "Sora", "Noto Sans TC", "Noto Sans SC", system-ui, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

html:lang(en) {
	--font: "Sora", "Noto Sans TC", "Noto Sans SC", system-ui, sans-serif;
}

body.ysia-site {
	margin: 0;
	background: var(--paper);
	color: var(--text);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: var(--blue);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--navy-dark);
}

:focus-visible {
	outline: 3px solid var(--dot);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -100px;
	z-index: 200;
	background: var(--navy-dark);
	color: var(--white);
	padding: 0.6rem 1rem;
	border-radius: 999px;
}

.skip-link:focus {
	top: 0.75rem;
	color: var(--white);
}

.visually-hidden,
.hp-field {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.wrap {
	width: min(100% - 2rem, var(--wrap));
	margin-inline: auto;
}

.wrap.narrow {
	width: min(100% - 2rem, 46rem);
}

/* Header
   ------------------------------------------------------------------ */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--white);
	border-bottom: 1px solid var(--line);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	min-height: var(--header-h);
}

.site-logo {
	flex: 0 0 auto;
	display: block;
	line-height: 0;
}

.site-logo img {
	width: 10.5rem;
	height: auto;
}

.nav-desktop {
	flex: 1 1 auto;
}

.nav-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 1.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-desktop a,
.nav-mobile a:not(.btn) {
	color: var(--navy-dark);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.98rem;
}

.nav-desktop a:hover,
.nav-mobile a:not(.btn):hover,
.nav-desktop a[aria-current="page"],
.nav-mobile a[aria-current="page"] {
	color: var(--blue);
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-left: auto;
}

.lang-switch {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	padding: 0.15rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
}

.lang-switch a {
	color: var(--navy);
	text-decoration: none;
	font-family: var(--font-en);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	padding: 0.28rem 0.55rem;
	border-radius: 999px;
}

.lang-switch a[aria-current="true"] {
	background: var(--navy);
	color: var(--white);
}

.nav-toggle {
	display: none;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--line);
	border-radius: 0.75rem;
	background: var(--white);
	cursor: pointer;
	align-items: center;
	justify-content: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
	display: block;
	width: 1.15rem;
	height: 2px;
	background: var(--navy-dark);
	position: relative;
	border-radius: 1px;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
	background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
	top: 0;
	transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
	top: 0;
	transform: rotate(-45deg);
}

.nav-mobile {
	display: none;
	border-top: 1px solid var(--line);
	background: var(--white);
	padding: 0.5rem 0 1.25rem;
}

.nav-mobile .nav-list {
	flex-direction: column;
	align-items: stretch;
	width: min(100% - 2rem, var(--wrap));
	margin: 0 auto;
	gap: 0;
}

.nav-mobile a:not(.btn) {
	display: block;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--line);
	font-size: 1.1rem;
}

.nav-mobile .btn {
	margin-top: 1rem;
	width: 100%;
}

/* Buttons
   ------------------------------------------------------------------ */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.7rem 1.35rem;
	border-radius: 999px;
	border: 2px solid transparent;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-lg {
	padding: 0.95rem 1.7rem;
	font-size: 1.05rem;
}

.btn-gold {
	background: var(--gold);
	color: var(--navy-dark);
	box-shadow: 0 8px 20px rgba(245, 196, 76, 0.28);
}

.btn-gold:hover {
	background: var(--gold-deep);
	color: var(--navy-dark);
	transform: translateY(-1px);
}

.btn-outline {
	background: transparent;
	border-color: var(--navy);
	color: var(--navy-dark);
}

.btn-outline:hover {
	background: var(--navy);
	color: var(--white);
}

.text-link {
	font-weight: 700;
	color: var(--navy-dark);
	text-decoration: none;
	border-bottom: 2px solid var(--gold);
}

.text-link:hover {
	color: var(--blue);
	border-bottom-color: var(--blue);
}

/* Hero and typography
   ------------------------------------------------------------------ */

.kicker {
	margin: 0 0 0.6rem;
	color: var(--blue);
	font-weight: 700;
	letter-spacing: 0.08em;
	font-size: 0.82rem;
}

.ysia-lang-en .kicker,
.ysia-lang-en .badge,
.ysia-lang-en .lang-switch {
	font-family: var(--font-en);
	text-transform: uppercase;
}

h1, h2, h3 {
	color: var(--navy-dark);
	line-height: 1.25;
	letter-spacing: -0.02em;
	margin: 0 0 0.7em;
	font-weight: 700;
}

h1 {
	font-size: clamp(2.1rem, 5.4vw, 4rem);
	line-height: 1.2;
	margin-bottom: 0.55em;
	text-wrap: balance;
	line-break: strict;
}

h2 {
	font-size: clamp(1.5rem, 3vw, 2.15rem);
}

h3 {
	font-size: 1.15rem;
	margin-bottom: 0.45em;
}

.lead {
	font-size: clamp(1.05rem, 1.6vw, 1.25rem);
	color: var(--muted);
	margin: 0 0 1.25rem;
}

.hero {
	padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem);
	background:
		radial-gradient(circle at 90% 10%, rgba(245, 196, 76, 0.22), transparent 32%),
		radial-gradient(circle at 8% 85%, rgba(107, 180, 76, 0.12), transparent 30%),
		var(--paper);
}

.hero-grid {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: clamp(1.5rem, 4vw, 4rem);
	align-items: center;
}

.hero-logo {
	background: var(--white);
	border-radius: 2rem;
	padding: 1.5rem;
	box-shadow: var(--shadow);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.75rem 0 0;
}

.page-hero {
	padding: clamp(2.25rem, 5vw, 4rem) 0 1.5rem;
}

.page-hero .lead {
	margin-top: 0.75rem;
}

/* Sections
   ------------------------------------------------------------------ */

.section {
	padding: clamp(3rem, 6vw, 5.25rem) 0;
}

.section-muted {
	background: var(--paper-2);
}

.section-head {
	margin-bottom: 2rem;
	max-width: 44rem;
}

.section-head h2 {
	margin-bottom: 0.4em;
}

.section-head p,
.section-purpose .purpose-body {
	margin: 0;
	color: var(--muted);
	font-size: 1.05rem;
}

.section-purpose .purpose-body {
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	line-height: 1.7;
	color: var(--navy-dark);
	margin-bottom: 1.25rem;
}

.section-more {
	margin: 2rem 0 0;
}

.section-cta {
	background: var(--navy-deep);
	color: var(--white);
}

.cta-band {
	text-align: center;
	padding: 0.5rem 0;
}

.cta-band h2,
.cta-band p {
	color: var(--white);
}

.cta-band h2 {
	margin-bottom: 0.5em;
}

.cta-band p {
	margin: 0 0 1.25rem;
}

.cta-band .btn-gold {
	margin-top: 0.25rem;
}

/* Cards and grids
   ------------------------------------------------------------------ */

.card-grid,
.member-grid {
	display: grid;
	gap: 1.15rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

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

.benefit-grid.compact {
	grid-template-columns: repeat(4, 1fr);
}

.card,
.event-card,
.upcoming-card,
.recap-card,
.member-card,
.founder-card,
.service-item {
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.card,
.event-card,
.upcoming-card,
.recap-card {
	padding: 1.4rem 1.45rem 1.5rem;
}

.card h3,
.event-card h2,
.upcoming-card h3 {
	margin-top: 0;
}

.card p,
.upcoming-card p:not(.badge) {
	margin: 0;
	color: var(--muted);
}

.tagline {
	margin: 0;
	color: var(--navy);
	font-weight: 600;
	font-size: 1.02rem;
}

.member-grid {
	grid-template-columns: repeat(3, 1fr);
}

.member-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 0.85rem;
	min-height: 11.5rem;
	padding: 1.25rem 1rem 1.1rem;
	text-decoration: none;
	color: var(--navy-dark);
	border: 1px solid transparent;
	transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.member-card:hover {
	transform: translateY(-3px);
	border-color: rgba(78, 156, 184, 0.35);
	color: var(--navy-dark);
	box-shadow: 0 18px 40px rgba(56, 56, 80, 0.12);
}

.member-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 5.5rem;
}

.member-logo img {
	max-width: 9.5rem;
	max-height: 5.25rem;
	width: auto;
	height: auto;
	object-fit: contain;
}

.member-name {
	text-align: center;
	font-weight: 600;
	font-size: 0.92rem;
	line-height: 1.4;
}

/* Founders
   ------------------------------------------------------------------ */

.founder-list {
	display: grid;
	gap: 1.5rem;
}

.founder-card {
	display: grid;
	grid-template-columns: 11rem 1fr;
	gap: 1.5rem;
	padding: 1.5rem;
	align-items: start;
}

.founder-portrait {
	aspect-ratio: 1 / 1;
	border-radius: 1.1rem;
	background:
		linear-gradient(160deg, rgba(78, 156, 184, 0.16), transparent 42%),
		linear-gradient(20deg, rgba(245, 196, 76, 0.22), var(--paper-2));
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--line);
	overflow: hidden;
}

.founder-portrait.has-photo {
	background: var(--paper-2);
}

.founder-portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

.founder-mono {
	font-family: var(--font-en);
	font-weight: 700;
	font-size: 2rem;
	letter-spacing: 0.06em;
	color: var(--navy);
}

.founder-role {
	margin: 0 0 0.55rem;
	color: var(--blue);
	font-weight: 700;
	font-size: 0.9rem;
}

.founder-titles {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	color: var(--navy);
	font-weight: 600;
	font-size: 0.98rem;
}

.founder-titles li + li {
	margin-top: 0.2rem;
}

.founder-bio {
	color: var(--muted);
}

.founder-bio a {
	font-weight: 700;
}

/* Services and events
   ------------------------------------------------------------------ */

.service-list,
.event-list,
.upcoming-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.15rem;
}

.service-item {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1.1rem 1.5rem;
	padding: 1.5rem 1.6rem;
}

.service-index {
	margin: 0;
	font-family: var(--font-en);
	font-weight: 700;
	font-size: 1.6rem;
	color: var(--gold-deep);
	line-height: 1;
}

.service-body h3 {
	margin-top: 0;
}

.service-body p {
	margin: 0 0 0.75rem;
}

.service-body ul {
	margin: 0;
	padding-left: 1.2rem;
	color: var(--muted);
}

.event-facts p {
	margin: 0 0 0.75rem;
	color: var(--muted);
}

.event-facts p:last-child {
	margin-bottom: 0;
}

.upcoming-card .badge {
	display: inline-block;
	margin: 0 0 0.7rem;
	padding: 0.2rem 0.65rem;
	border-radius: 999px;
	background: rgba(107, 180, 76, 0.16);
	color: #2f6a22;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.recap-layout {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: 2rem;
	align-items: start;
}

.recap-coming {
	margin: 0.75rem 0 0;
	color: var(--muted);
}

.event-photos {
	display: grid;
	gap: 1.5rem;
}

.event-photo {
	margin: 0;
}

.event-photo img {
	width: 100%;
	border-radius: var(--radius);
	object-fit: cover;
	aspect-ratio: 4 / 3;
}

.event-photo figcaption {
	margin-top: 0.65rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.event-photo.event-photo--natural img {
	aspect-ratio: auto;
	object-fit: contain;
	height: auto;
}

/* Forms
   ------------------------------------------------------------------ */

.join-form,
.form-success,
.form-alert,
.prose-block,
.stack-page {
	padding-bottom: 2rem;
}

.join-form,
.form-success {
	background: var(--white);
	border-radius: 1.5rem;
	padding: clamp(1.4rem, 3vw, 2.25rem);
	box-shadow: var(--shadow);
}

.join-form h2,
.form-success h2 {
	margin-top: 0;
}

.form-alert {
	background: #fdecea;
	color: #8a1f16;
	border-radius: var(--radius-sm);
	padding: 0.9rem 1.1rem;
	margin-bottom: 1.25rem;
}

.form-alert p,
.form-success p {
	margin: 0;
}

.form-success {
	text-align: center;
	padding: 3rem 1.5rem;
}

.field {
	margin: 0 0 1.15rem;
}

.field label,
.fieldset-interests legend {
	display: block;
	font-weight: 700;
	margin-bottom: 0.4rem;
	color: var(--navy-dark);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
	width: 100%;
	padding: 0.75rem 0.85rem;
	border: 1px solid var(--line);
	border-radius: 0.7rem;
	background: var(--paper);
	color: var(--text);
	font: inherit;
}

.field textarea {
	resize: vertical;
	min-height: 8rem;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
	background: var(--white);
	border-color: var(--dot);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
	border-color: #c0392b;
}

.field-error {
	margin: 0.4rem 0 0;
	color: #8a1f16;
	font-size: 0.92rem;
}

.req {
	color: #b3261e;
	font-weight: 600;
	font-size: 0.82em;
}

.hint {
	font-weight: 500;
	color: var(--muted);
	font-size: 0.86em;
}

.check-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.check-list label,
.consent-label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-weight: 500;
	cursor: pointer;
}

.check-list input,
.consent-label input {
	margin-top: 0.35rem;
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--navy);
	flex: 0 0 auto;
}

.field-submit {
	margin-top: 1.6rem;
	margin-bottom: 0;
}

/* Footer
   ------------------------------------------------------------------ */

.site-footer {
	background: var(--navy-deep);
	color: #e7e4dc;
	padding-top: 3rem;
}

.footer-inner {
	display: grid;
	grid-template-columns: 1.1fr 1fr auto;
	gap: 2rem;
	align-items: start;
	padding-bottom: 2.25rem;
}

.footer-name {
	margin: 0.85rem 0 0.15rem;
	color: var(--white);
	font-weight: 700;
}

.footer-short {
	margin: 0;
	color: #c8c4d6;
	font-size: 0.95rem;
}

.site-logo-footer {
	display: inline-block;
	background: var(--white);
	border-radius: 1rem;
	padding: 0.55rem 0.7rem;
}

.site-logo-footer img {
	width: 9rem;
}

.footer-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.footer-nav a {
	color: #e7e4dc;
	text-decoration: none;
}

.footer-nav a:hover {
	color: var(--gold);
}

.footer-tools {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1rem;
}

.lang-switch-footer {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.14);
}

.lang-switch-footer a {
	color: #e7e4dc;
}

.lang-switch-footer a[aria-current="true"] {
	background: var(--gold);
	color: var(--navy-dark);
}

.footer-base {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 1rem 0 1.2rem;
}

.copyright {
	margin: 0;
	font-size: 0.88rem;
	color: #b7b3c3;
}

.entry-content p:first-child {
	margin-top: 0;
}

/* Responsive
   ------------------------------------------------------------------ */

@media (max-width: 900px) {
	.nav-desktop,
	.header-join {
		display: none;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.nav-mobile:not([hidden]) {
		display: block;
	}

	.hero-grid,
	.founder-card,
	.recap-layout,
	.footer-inner,
	.benefit-grid.compact {
		grid-template-columns: 1fr;
	}

	.footer-tools {
		align-items: flex-start;
	}

	.member-grid,
	.card-grid {
		grid-template-columns: 1fr 1fr;
	}

	.site-logo img {
		width: 8.6rem;
	}
}

@media (max-width: 640px) {
	body.ysia-site {
		font-size: 1rem;
	}

	.member-grid,
	.card-grid,
	.event-teaser-grid {
		grid-template-columns: 1fr;
	}

	.header-inner {
		min-height: 4.5rem;
	}

	.hero-logo {
		padding: 1rem;
		border-radius: 1.35rem;
	}

	.founder-card,
	.service-item {
		grid-template-columns: 1fr;
		padding: 1.15rem;
	}

	.founder-portrait {
		max-width: 11rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.btn,
	.member-card {
		transition: none;
	}
	.btn-gold:hover,
	.member-card:hover {
		transform: none;
	}
}
