/* Reset and base styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Roboto', 'Noto Sans JP', Arial, sans-serif;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center; /* Keep centered - no layout changes! */
	color: white;
}

.main-section {
	text-align: center;
	max-width: 1280px;
	margin: 0 auto;
	padding: 10px 20px;
	position: relative;
	z-index: 1;
	transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.main-section.shift-up {
	transform: translateY(calc(-30vh + 50px)); /* Move from center to near top with spacing */
}

.header-container {
	text-align: center;
	max-width: 1280px;
	margin: 0 auto;
	padding: 5px 20px;
	position: relative;
	z-index: 1;
}

.container {
	text-align: center;
	max-width: 1280px;
	padding: 10px 20px;
	position: relative;
	margin-top: 0; /* No margin needed since it's inside top-section */
}

h1 {
	font-size: 3rem;
	margin-bottom: 0.2rem;
	text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
	position: relative;
	z-index: 1;
}

.header-translations {
	margin-bottom: 0.3rem;
	display: flex;
	gap: 2rem;
	justify-content: center;
	align-items: center;
}

.header-translations h2 {
	font-size: 1.5rem;
	margin: 0;
	opacity: 0.9;
	text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
	position: relative;
	z-index: 1;
}

.header-en {
	font-family: 'Roboto', Arial, sans-serif;
}

.header-fr {
	font-family: 'Roboto', Arial, sans-serif;
}

.header-ja {
	font-family: 'Noto Sans JP', 'Roboto', Arial, sans-serif;
}

.header-separator {
	font-size: 1.5rem;
	opacity: 0.7;
	text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
	position: relative;
	z-index: 1;
}

.subtitle {
	font-size: 1.5rem;
	opacity: 0.95;
	line-height: 1.5;
}

.subtitle-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 25px;
	margin-bottom: 32px;
	text-align: left;
}

.lang-ja {
	font-family: 'Noto Sans JP', 'Roboto', Arial, sans-serif;
}

/* Buttons */
.btn {
	background: linear-gradient(45deg, #6be9ff, #0c93dc);
	/* Animateable gradient setup */
	background-size: 200% 200%;
	background-position: 0% 50%;
	border: none;
	color: white;
	padding: 15px 30px;
	font-size: 1.1rem;
	border-radius: 50px;
	cursor: pointer;
	transition: background-position 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
	margin: 10px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:hover {
	/* Shift gradient to animate */
	background-position: 100% 50%;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.btn.secondary {
	background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.btn.success {
	background: linear-gradient(45deg, #56ab2f, #a8e6cf);
}

/* Containers */
#artwork-container {
	margin: 0;
	background: transparent;
	border-radius: 15px;
	padding: 0; /* Remove padding to align with sketch */
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
	display: none;
	width: fit-content;
	max-width: 90vw;
	overflow: hidden;
	align-self: flex-start;
	position: relative;
}

#artwork-sketch {
	text-align: center; /* Center the canvas */
	display: block;
	width: 100%; /* Match container width */
	margin: 0;
	padding: 10px; /* Padding inside sketch */
	box-sizing: border-box;
}

#artwork-sketch canvas {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	outline: none !important;
	box-sizing: border-box !important;
	vertical-align: top !important;
}

/* Override any p5.js default styles */
canvas {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	outline: none !important;
	box-sizing: border-box !important;
	vertical-align: top !important;
}

.artwork-section {
	display: flex;
	gap: 20px;
	margin: 0.5rem 0;
	align-items: flex-start;
	position: absolute; /* Changed from relative to absolute */
	top: 0;
	left: 0;
	right: 0;
	z-index: 0;
	opacity: 0; /* Initially hidden */
	transition: opacity 0.5s ease; /* Smooth fade-in */
}

.artwork-section.visible {
	opacity: 1; /* Show when visible */
}


.loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	border-radius: 15px;
}

.loading-content {
	text-align: center;
	color: white;
}

.loading-content .spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top: 4px solid #6be9ff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 16px auto;
}

.loading-content p {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
}

.weather-sidebar {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 280px;
	flex-shrink: 0;
	align-self: flex-start;
}

.action-buttons {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 16px;
}

.weather-card {
	background: rgba(255,255,255,0.1);
	padding: 15px;
	border-radius: 10px;
	margin: 10px;
	min-width: 200px;
}

.weather-card h3 {
	margin-bottom: 10px;
	color: #ffd700;
}

.weather-card p {
	margin: 8px 0;
	font-size: 0.9rem;
	line-height: 1.4;
}

.weather-card p:last-child {
	text-transform: capitalize;
}


.email-form h2 {
	font-size: 1.9rem;
	margin: 0 0 14px 0;
	line-height: 1.35;
}

.email-form h3 {
	font-size: 1.4rem;
	margin: 0 0 16px 0;
	line-height: 1.4;
}

.email-form p {
	margin: 0 0 18px 0;
	line-height: 1.5;
	font-size: 1.05rem;
}

.email-form input {
	width: 100%;
	padding: 15px;
	border: none;
	border-radius: 10px;
	font-size: 1rem;
	margin: 10px 0;
	background: rgba(255,255,255,0.9);
}


@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.message {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 30; /* Same z-index as email-form to appear above everything */
	margin: 0;
	padding: 20px 40px;
	border-radius: 10px;
	display: none;
	max-width: 90%;
	text-align: center;
	color: white;
	font-weight: 500;
	font-size: 1.5rem; /* Bigger text */
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.5s ease; /* Fade transition */
	pointer-events: none; /* Don't block clicks when fading */
}

.message.visible {
	opacity: 1;
	display: block;
}

.message.success {
	background: rgba(76, 175, 80, 0.9);
}

.message.error {
	background: rgba(244, 67, 54, 0.9);
}

/* Full-screen dim overlay behind email dialog */
.email-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75); /* Dark overlay */
	z-index: 25; /* Above all content, but below email dialog (z-index: 30) */
	pointer-events: auto; /* Make overlay clickable to close dialog */
	cursor: pointer; /* Show pointer cursor on overlay */
	opacity: 0;
	transition: opacity 0.3s ease;
}

.email-overlay.visible {
	opacity: 1;
}

.email-form {
	background: rgba(255,255,255,0.85);
	padding: 32px 40px;
	border-radius: 18px;
	margin: 0;
	display: none;
	position: fixed; /* Float above overlay and center in viewport */
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 30;
	max-width: 850px; /* Slightly larger dialog */
	width: calc(100% - 72px);
	color: black;
	text-align: center; /* Center heading, copy, and button */
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: auto; /* Make form clickable */
	cursor: default; /* Default cursor on form */
}

.email-form.visible {
	opacity: 1;
}

/* Logo */
.site-logo {
	/* 50px padding on both sides */
	padding-left: 50px;
	padding-right: 50px;
	width: 100%;
	max-width: 100vw;
	box-sizing: border-box;
	
	/* background image */
	background: url('img/eepmon-logo.svg') no-repeat center/contain;
	
	/* maintain responsive height based on intrinsic SVG aspect ratio */
	height: 6vh;
	min-height: 32px;
	max-height: 80px;
	
	display: block;
	margin: 16px 0 8px 0;
	position: relative;
	z-index: 1;
	cursor: pointer;
	transition: opacity 0.3s ease;
}

.site-logo:hover {
	opacity: 0.8;
}

/* Background video */
.bg-video {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	object-fit: cover;
	z-index: -1;
	filter: brightness(0.55);
	background: #000; /* fallback */
}

/* Sponsor logos */
.sponsor-logos {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 50px; /* Position above marquee (44px height) */
	height: auto;
	z-index: 10;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 60px;
	padding: 20px;
	pointer-events: none;
}

.sponsor-logo {
	max-height: 90px;
	max-width: 280px;
	width: auto;
	height: auto;
	object-fit: contain;
	opacity: 0.9;
	filter: brightness(1.1);
	transition: opacity 0.3s ease;
}

.sponsor-logo:hover {
	opacity: 1;
}

/* Marquee footer */
.marquee {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	height: 44px;
	z-index: 10;
	pointer-events: none;
	background: transparent;
	overflow: hidden;
}

/* Marquee header */
.marquee-header {
	top: 0;
	bottom: auto;
}

.marquee__track {
	position: absolute;
	display: flex;
	width: max-content;
}

.marquee__content {
	display: inline-block;
	white-space: nowrap;
	animation: marquee-loop 18s linear infinite;
}

.marquee__content span {
	display: inline-flex;
	align-items: center;
	gap: 16px; /* equal space around the bullet */
	padding: 0 8px; /* minor inner pad */
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.9);
	line-height: 44px;
	font-size: 0.95rem;
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.marquee__content span::after {
	content: '❁';
	opacity: 0.9;
	transform: translateY(-1px); /* optically center */
}

.marquee__content span:last-child::after {
	content: '';
}

@keyframes marquee-loop {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

/* Responsive */
@media (max-width: 900px) {
	.subtitle-grid {
		grid-template-columns: 1fr;
		text-align: center;
	}
}

@media (max-width: 600px) {
	h1 {
		font-size: 2rem;
	}
	
	.weather-info {
		flex-direction: column;
		align-items: center;
	}
	
	.site-logo {
		padding-left: 24px;
		padding-right: 24px;
	}
	
	.sponsor-logos {
		gap: 20px;
		padding: 15px;
		bottom: 44px;
	}
	
	.sponsor-logo {
		max-height: 60px;
		max-width: 180px;
	}
}

/* Intro fade behavior */
.subtitle-grid,
#generateBtn {
	transition: opacity 1.0s ease;
}

.container.intro-fade .subtitle-grid,
.container.intro-fade #generateBtn {
	opacity: 0;
	pointer-events: none;
	transform: none !important;
	transition: opacity 1.0s ease !important;
}

/* Keep header elements completely fixed during fade-out */
.container.intro-fade h1,
.container.intro-fade .header-translations {
	position: relative;
	transform: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

