* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	/* Light theme - comfy warm palette */
	--bg-primary: #faf8f5;
	--bg-secondary: #f5f1eb;
	--bg-tertiary: #ede8e0;
	--text-primary: #2d2d2d;
	--text-secondary: #5a5a5a;
	--text-tertiary: #8a8a8a;
	--accent-primary: #d4a574;
	/* Warm Gold/Brown */
	--accent-secondary: #c89f6d;
	--accent-tertiary: #b89366;
	--border-color: #e0d9ce;
	--card-bg: #ffffff;
	--shadow-sm: rgba(45, 45, 45, 0.05);
	--shadow-md: rgba(45, 45, 45, 0.1);
	--shadow-lg: rgba(45, 45, 45, 0.15);
}

[data-theme="dark"] {
	/* Dark theme - comfy cool palette */
	--bg-primary: #1a1a1f;
	--bg-secondary: #222228;
	--bg-tertiary: #2a2a32;
	--text-primary: #e8e8e8;
	--text-secondary: #b8b8b8;
	--text-tertiary: #888888;
	--accent-primary: #7a9cc6;
	/* Cool Blue */
	--accent-secondary: #6a8cb6;
	--accent-tertiary: #5a7ca6;
	--border-color: #333339;
	--card-bg: #25252d;
	--shadow-sm: rgba(0, 0, 0, 0.3);
	--shadow-md: rgba(0, 0, 0, 0.4);
	--shadow-lg: rgba(0, 0, 0, 0.5);
}

html {
	scroll-behavior: smooth;
}

body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
		"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	background-color: var(--bg-primary);
	color: var(--text-primary);
	transition:
		background-color 0.4s ease,
		color 0.4s ease;
	line-height: 1.6;
}

.app {
	min-height: 100vh;
	width: 100%;
	position: relative;
	overflow-x: hidden;
}

/* --- Scroll Animations --- */
.scroll-animate {
	opacity: 0;
	transform: translateY(50px);
	transition:
		opacity 0.8s ease-out,
		transform 0.8s ease-out;
}

.scroll-animate.visible {
	opacity: 1;
	transform: translateY(0);
}

/* --- Theme Toggle --- */
.theme-toggle {
	position: fixed;
	top: 2rem;
	right: 2rem;
	z-index: 1000;
	background: var(--card-bg);
	border: 2px solid var(--border-color);
	border-radius: 50%;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 12px var(--shadow-md);
	color: var(--text-primary);
}

.theme-toggle:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 16px var(--shadow-lg);
	border-color: var(--accent-primary);
	color: var(--accent-primary);
}

/* --- Hero Section --- */
.hero-section {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg,
			var(--bg-secondary) 0%,
			var(--bg-primary) 100%);
	position: relative;
	overflow: hidden;
	z-index: 1;
}

.hero-section::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: radial-gradient(circle at 50% 50%,
			var(--accent-primary) 0%,
			transparent 60%);
	opacity: 0.1;
	animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 0.1;
		transform: scale(1);
	}

	50% {
		opacity: 0.15;
		transform: scale(1.1);
	}
}

.hero-content {
	text-align: center;
	z-index: 1;
	padding: 2rem;
	max-width: 1000px;
	animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.hero-title {
	font-family: "Yu Gothic", "Hiragino Sans", sans-serif;
	font-size: clamp(3.5rem, 10vw, 7rem);
	font-weight: 800;
	margin-bottom: 1.5rem;
	line-height: 1.2;
	letter-spacing: 0.05em;
}

.title-line.highlight {
	transition: color 0.3s ease;
}

.title-line.highlight:hover {
	color: var(--accent-primary);
	text-shadow: 0 0 30px var(--shadow-lg);
}

.hero-subtitle {
	font-size: clamp(1.2rem, 3vw, 2rem);
	font-weight: 600;
	color: var(--accent-primary);
	margin-bottom: 1.5rem;
	font-family: "Courier New", monospace;
	letter-spacing: 0.15em;
}

.hero-description {
	font-size: clamp(1.1rem, 2vw, 1.5rem);
	color: var(--text-secondary);
	margin-bottom: 3rem;
	font-style: italic;
}

.scroll-indicator {
	position: absolute;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	color: var(--accent-primary);
	font-size: 2rem;
	animation: bounce 2s infinite;
}

@keyframes bounce {

	0%,
	100% {
		transform: translateX(-50%) translateY(0);
	}

	50% {
		transform: translateX(-50%) translateY(10px);
	}
}

/* --- Content Layout --- */
.content-section {
	padding: 4rem 2rem;
	display: flex;
	justify-content: center;
	align-items: center;
}

.section-content {
	max-width: 1200px;
	width: 100%;
}

.section-content h2 {
	font-size: clamp(2rem, 5vw, 3.5rem);
	margin-bottom: 3rem;
	text-align: center;
	color: var(--text-primary);
	position: relative;
	padding-bottom: 1rem;
}

.section-content h2::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 80px;
	height: 4px;
	background: var(--accent-primary);
	border-radius: 2px;
}

.section-intro {
	text-align: center;
	font-size: 1.2rem;
	color: var(--text-secondary);
	margin-bottom: 3rem;
	font-family: "Courier New", monospace;
}

/* --- Definition Card (Translation/Meaning) --- */
.definition-card {
	background: var(--card-bg);
	border-radius: 20px;
	padding: 3rem;
	box-shadow: 0 8px 32px var(--shadow-md);
	border: 1px solid var(--border-color);
	border-left: 6px solid var(--accent-primary);
	transition: all 0.3s ease;
}

.definition-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 40px var(--shadow-lg);
}

.formula-large {
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 700;
	text-align: center;
	color: var(--accent-primary);
	font-family: "Courier New", monospace;
	margin-bottom: 2rem;
	letter-spacing: -0.05em;
}

.formula-breakdown {
	background: var(--bg-secondary);
	border-radius: 12px;
	padding: 2rem;
	margin-bottom: 2rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.breakdown-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	background: var(--card-bg);
	border-radius: 8px;
	transition: transform 0.3s ease;
}

.breakdown-item:hover {
	transform: translateX(10px);
}

.breakdown-symbol {
	font-family: "Courier New", monospace;
	font-weight: 700;
	color: var(--accent-primary);
	font-size: 1.2rem;
}

.definition-text {
	font-size: 1.2rem;
	line-height: 1.8;
	color: var(--text-secondary);
	text-align: justify;
}

/* --- Example Card --- */
.example-card {
	background: var(--card-bg);
	border-radius: 20px;
	padding: 2.5rem;
	box-shadow: 0 4px 20px var(--shadow-md);
	border: 1px solid var(--border-color);
	position: relative;
	overflow: hidden;
	transition: all 0.4s ease;
}

.example-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 12px 30px var(--shadow-lg);
	border-color: var(--accent-primary);
}

.example-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg,
			transparent,
			rgba(212, 165, 116, 0.1),
			transparent);
	transition: left 0.5s ease;
}

.example-card:hover::before {
	left: 100%;
}

.example-card h3 {
	color: var(--accent-primary);
	margin-bottom: 1rem;
	font-size: 1.5rem;
}

.formula-text {
	font-family: "Courier New", monospace;
	background: var(--bg-secondary);
	padding: 1rem;
	border-radius: 8px;
}

/* --- Grid System (Research) --- */
.applications-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 2rem;
}

.app-card {
	background: var(--card-bg);
	border-radius: 20px;
	padding: 2.5rem 2rem;
	box-shadow: 0 4px 20px var(--shadow-md);
	border: 1px solid var(--border-color);
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-card:hover {
	transform: translateY(-12px) scale(1.03);
	box-shadow: 0 16px 48px var(--shadow-lg);
	border-color: var(--accent-primary);
}

.app-card h3 {
	font-size: 1.4rem;
	margin-bottom: 1rem;
	color: var(--accent-primary);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.app-card p {
	color: var(--text-secondary);
	line-height: 1.7;
}

/* --- Cultural Formula Visual --- */
.formula-visual {
	display: flex;
	justify-content: center;
}

.formula-part {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-size: clamp(1.5rem, 4vw, 2.5rem);
	font-weight: 700;
	font-family: "Courier New", monospace;
	padding: 1.5rem;
	background: var(--bg-secondary);
	border-radius: 12px;
	width: 100%;
	justify-content: center;
}

.formula-symbol {
	color: var(--accent-primary);
}

.formula-equals {
	color: var(--text-primary);
}

.cultural-list li {
	list-style: none;
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
	color: var(--text-secondary);
	font-size: 1.1rem;
}

.cultural-list li:last-child {
	border-bottom: none;
}

/* --- Footer --- */
.footer {
	background: var(--bg-secondary);
	padding: 3rem 2rem;
	text-align: center;
	border-top: 1px solid var(--border-color);
	margin-top: 4rem;
}

.footer-name {
	color: var(--accent-primary);
	font-family: "Courier New", monospace;
	font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 768px) {
	.hero-content {
		padding: 1rem;
	}

	.definition-card,
	.example-card {
		padding: 1.5rem;
	}

	.formula-part {
		font-size: 1.2rem;
		flex-direction: column;
		gap: 0.5rem;
	}
}
